Creating mounted laser subents

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

Moderators: winston, another_commander

Post Reply
Mundane Soul
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Tue Aug 31, 2010 1:07 am

Creating mounted laser subents

Post by Mundane Soul »

Now, I have been a fan of Oolite for about year now, and now I'm starting to mod myself. Now, looking at the wiki and I can't find anything on this. What I wanted to do is make something make something like the Rattle Cutter. I made the model myself and everything else already, I just need to figure this out. When I look at the Rattle Cutter, I can't find the roles or anything. Any help on this?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

You need to set up the shipdata.plist, specifically the subentities key. They are separate entities which are joined to the main ship and which have their own forward and/or aft weaponry to enable multiple lasers in a given direction.

These can be either destructable or not independently of the main body of the ship by whatever setting you give the frangible key of the main body.

I'd suggest you have a good look at the shipdata.plist of the rattle cutter, and also the one for the main trunk itself to see how it all hangs together. Oh, and such weapon-equipped sub-entities don't work for player ships, currently those are single-weapon per view only.

<insert standard first post greeting here>
Mundane Soul
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Tue Aug 31, 2010 1:07 am

Post by Mundane Soul »

I want to know how to script the subents themselves; I do know how to put it on my ship, like how to make it fire by itself. I look in the shipdata in both the ship and the subents and just all over the file. I don't know where to find the roles the subents use.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

You don't. All of the NPC ship's firing is controlled by it's AI - specifically the performAttack command therein.

All of that is solely under the AI's command, and cannot be scripted. The trunk code chooses when to fire its weapons and missiles, although missiles can be forced with the fireMissile command.

fireMissile has a javascript equivalent, but there isn't anything like that to script a laser fire (either on a main entity or a sub-ent).
Post Reply