Where have all the ship roles gone

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Where have all the ship roles gone

Post by Lestradae »

There really should be a "learning scripting questions" forum here, you know. I hereby attempt to request one. No one learns this over night or without asking a lot of questions. Perhaps that would be interesting for other people relatively new at that like me, too - and it would stop me from spamming the Expansion Forum with such questions. And it could be pointed to more easily if a specific question has already been answered.

But alas, here it comes.

Yes, I have read the wiki and looked at diverse example oxps. I can`t get my head around the way how subentities are assigned roles. For example, the Constitution ship from NavyStarships has the following subentities defined:

Code: Select all

         <string>s-dock -0.1 -72.7 -237.6 0 1 0 0</string>
                        <string>s-doors 0.0 0.0 0.0 1 0 0 0 </string>

                        <string>DummyNI -16 -80 0.0 1 0 0 0</string>
                        <string>DummyNI -16 -80 -80 1 0 0 0</string>
                        <string>DummyNI -16 -80 -160 1 0 0 0</string>
                        <string>DummyOrb 16 -70 0.0 1 0 0 0</string>
                        <string>DummyMer 16 -80 -80 1 0 0 0</string>
                        <string>DummyKes 16 -80 -160 1 0 0 0</string>

                        <string>bridge 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>nacelles 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>neck 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>phaser 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>pylons 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>rearphot 0.0 0.0 0.0 1 0 0 0 </string>
                        <string>saucer 0.0 0.0 0.0 1 0 0 0 </string>
... so, and all of those subentities then have their listing and have a role assigned (which in that case happens to be of the same designation as the ship subentity part, like "s-dock" having the role "s-dock" assigned and so on.

So, now the question. If I read the wiki allright, some unique role like:

Code: Select all

<key>roles</key>
<string>uniquely_named_role</string>
... should be defined as a role in an accompanying script.plist.

But I don`t find one in the abovementioned example, yet the subentities seem to work (well, most of the time) in the game.

Which ways are there to define a unique role? Only in a script.plist? Or somewhere else? Or will the game "fall back on" a standard role if none is defined?

Please, can someone who knows either explain or drop me an url or such where I can read about this?

Thanks @any meaningful answer in advance :?

L
Last edited by Lestradae on Fri Apr 25, 2008 10:16 pm, edited 1 time in total.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

.

Post by Lestradae »

Hm, I thought this was only for scripting request not beginner questions? :oops:

Note: Should start training to read soon :(

The question is still standing, by the way.

And: Could someone please move this to the Scripter`s Cove :idea:
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Describing the attributes of ships is not scripting.

The roles entry for a subentity does not belong in script.plist but in shipdata.plist. A subentity is a type of ship intended to be glued onto another ship (just as asteroids and cargo pods are “types of ship”).
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

.

Post by Lestradae »

Describing the attributes of ships is not scripting.

The roles entry for a subentity does not belong in script.plist but in shipdata.plist. A subentity is a type of ship intended to be glued onto another ship (just as asteroids and cargo pods are “types of ship”).
I am really not good in making understandable what I mean :(

I know all of the above; what I am asking is, if I have a "unique_ship_role", where is it defined what the role DOES? In the wiki it says it would be defined in a script-plist. The shipdata.plist, as far as I understand, makes scripts which place ships, be they standard (pirate trader hunter etc) or unique (dredger cobraclipper etc.) choose from the ships which have those roles defined in their shipdata.plist.

But again, where (in which plist or plists) is it or could it be defined what a role attributed in the shipdata.plist actually DOES?

Hope that was more understandable :oops:

L
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Oolite (itself - without running any scripts) adds ships with the roles "Pirate" "hunter" "trader" etc automaticaly. More pirates are added (and fewer police) in dangerous systems for example. If you call a ship "pirate" then it will be on the list of pirate ships and can appear whenever Oolite adds pirates. If you give it a special role like "victim1" for example, the ship will NEVER be added by Oolite itself. It will only appear when your script calls it into existance. This allows you to have special ships appear at special times (eg: In Assassins the fighting Dictatorship and Rebel ships only appear when the Civil War breaks out and only in this particular system). You decide when and how many to add. Eg:-

Code: Select all

{ 
					conditions = ( 
						"mission_assassins equal assassins_STAGE1",
 						"galaxy_number equal 6",
						"planet_number equal 73", 
						"status_string equal STATUS_EXITING_WITCHSPACE" 
					); 
					do = ( "checkForShips: victim1", 
						{ conditions = ( "shipsFound_number equal 0" ); 
						do = ( "addShipsAtPrecisely: victim1 1 pwm -3721 2780 361753"); 
						}, 
					); 
				},
victim1 is a custom role given to the Wire Frame Adder flown by the OXP Character Be Soin. By having these conditions in the script adding him, Be Soin won't pop up willy nilly. He only appears in a particular system if you are there and have accepted the mission to assassinate him. And once dead he stays dead! The ship's death actions advance the mission_stage variable, so the conditions to add him will never again be met.

YOU as the scripter decide when and where a ship with a custom role will appear.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

@Little Bear

Post by Lestradae »

@Little Bear:

Thanks for the explanation! 8)

So, did I get that alright that any custom role will have to be defined in a script.plist?

:?:

L
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

You'd define it in Shipdata. But a ship with a custom role will never appear in game unless you specifically call it with a script command.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

.

Post by Lestradae »

You'd define it in Shipdata. But a ship with a custom role will never appear in game unless you specifically call it with a script command.
Thank you: now we`re there: That`s what I wanted to know all along! :D

*back to plisting*

L
Post Reply