Page 1 of 1

Spawn specific ship using core role

Posted: Mon Jan 11, 2016 5:08 pm
by spara
It would be handy to be able to spawn a ship using it's datakey to a specific role. The idea is that I could get the exact ship I want and the core would set it up as if spawning it through a role, setting AI, armaments and such.

For example

Code: Select all

system.addShipWithKeyAndRole("[adder]", "trader-smuggler");
would give a trader-smuggler version of an Adder.

Re: Spawn specific ship using core role

Posted: Mon Jan 11, 2016 7:11 pm
by Smivs
Very good idea.

Re: Spawn specific ship using core role

Posted: Tue Jan 12, 2016 7:46 am
by cim
Most of that set up is done by the populator script - the only bit which is not is the auto AI mapping (and even that is re-done in the populator script). You wouldn't really gain anything over setting the primary role yourself after spawning the ship.

Refactoring the populator script a bit so that it had a lot of setUpShipAs functions would be possible, though quite a bit of work.

Re: Spawn specific ship using core role

Posted: Tue Jan 12, 2016 8:23 am
by spara
I kind of expected so. I'll see if I manage to replicate the population rules and create a helper oxp.