Name based commodities plist

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

The primary – generic role is also being used by the script of youradhere for checking if a constore already exists in the system before adding one. The real problem is that I will have to fundamentally change the script and I do not want to.

Moreover the current structure of this oxp with all the sets working as addons of the basic set in combination with the dynamic nature of the oxp (new sets with potentially new constores every 6 to 8 months) means that I will have to change the rather monolithic structure of youradhere into something far more complex with a script that will need an update for every new set (hence with the creation of a new set the basic set will have to be changed). I do not want to do this because this structure gives the players the ability to chose how many and what sets will have in their installation according to their tastes and the power of their machine. Low end machines with 512mb of ram maybe can cope with only 2 sets but not with all of them. Also I do not want to alienate Dr Nil from his oxp

Thank you again for all your help and your advises
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

What you can do is give the stores roles of "tescoos constore" (for example) and spawn them using the individual one (tescoos in this case). Then if you want to find them, check for shipWithRole("constore") rather than shipWithPrimaryRole("constore"). Then it should work, although the scripting may need to be adjusted.

That's how I do it with Planetfall, the location entities are spawned (and commodity.plist'd) with individual roles, but removed again using their generic secondary role.

Have a look over the script in Planetfall.oxp, it's not too complex (if you need any help give me a shout). It also allows for expandability and bolt-on working, again look in the script for an example.
Post Reply