Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Spawn specific ship using core role

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Spawn specific ship using core role

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Spawn specific ship using core role

Post by Smivs »

Very good idea.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Spawn specific ship using core role

Post 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.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Spawn specific ship using core role

Post by spara »

I kind of expected so. I'll see if I manage to replicate the population rules and create a helper oxp.
Post Reply