adding new planet types

This is the location for all mods to collaborate. Anyone making or planning their own mod should post help requests, screen shots and news here.

Moderators: Omega, tillias, Mod Contributor

Post Reply
Andy
Merchant
Merchant
Posts: 32
Joined: Tue Dec 04, 2012 7:52 pm

adding new planet types

Post by Andy »

Hi everyone.
I'm trying to incorporate a new planet type 'commerce_center' (in Privateer Gemini Gold). What I did so far:

Added the type to the <planet> section in wcuniverse.xml (milky_way.xml).
Added a planet of this type to a system in wcuniverse.xml (milky_way.xml) and the appropriate system file. For the planet texture called by the system file I created a commerce_center.png.
Added a line to units.csv (simply copied an existing planets line and changed the first column to 'commerce_center__planets').
Created a commerce_center.py file in \bases\ directory (simply copied/renamed agricultural.py).

Ok, what happens in game:
The new planet shows up correctly and is called 'Commerce Center: ...' in the HUD. The correct texture is applied (so I assume the system file and wcuniverse.xml work correctly).
But when I land on the planet mostly the error message 'no rooms specified' appears. Strangely sometimes the correct base screens appear but the links to the guilds / bar / mission computer and commodity exchange have gone. The only link that works is the link to the landing bay, where I can launch my ship just normally.

My question is: What did I miss? Is there any other file that needs to be changed? What string in what file tells the engine what .py-file is used for creating the base screens?

One more hint: Checking the stderr.txt there are several entries with "commerce_centerdaymerchant.py" or "commerce_centerday.py". Where does this come from? What does it mean?

Any help is much appreciated.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: adding new planet types

Post by klauss »

Andy wrote: But when I land on the planet mostly the error message 'no rooms specified' appears.
That's usually a sign of a python script error somewhere. Check the console (or stdout/stderr.txt if in windows) and look for python tracebacks.
Andy wrote:Strangely sometimes the correct base screens appear but the links to the guilds / bar / mission computer and commodity exchange have gone. The only link that works is the link to the landing bay, where I can launch my ship just normally.
Well, that's weird. Any python error I've encountered are usually consistent (ie: they either happen always or don't)... but I guess we won't know until we see the traceback.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Andy
Merchant
Merchant
Posts: 32
Joined: Tue Dec 04, 2012 7:52 pm

Re: adding new planet types

Post by Andy »

Thanks for the fast answer. I found the error and it had nothing to do with my changes. So the list above could be taken as a guide how to add new planet types... ;)

The error was in units.csv. It was already in the line that I copied from agricultural planet. One of the cargo types in column106 was not defined. Since I changed all cargo types to be available for buying the error was established. The effect was just as I described it: the base rooms were created but all the links were gone... after removing this cargo type all works fine. :)
BTW: I found the error message in stderr.txt.
Post Reply