Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » Item.Type now an Enum
Item.Type now an Enum Sun, 10 July 2011 18:53 Go to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I've changed this to an Enum <ItemType> instead of a string to further reduce typo errors and have stronger defined types.

I also added a small reflection extension method ToDescription() to ItemType so that types like 'PlanetaryInstallations' can be converted to 'Planetary Installations' for use in the GUI when needed or in some specific component matching schemes already there. The serializations still need to use ToString() though as deserializing enums with whitespaces would be an overkill implementation.
(You can use this with a simple Component.Type.ToDescription(), for example).

I also edited the components.xml file so that Item types match the Enum's ToString (PlanetaryInstallations, BeamWeapons, etc). I don't know how this affects the component editor, since It seems it is not accesible anymore from within the game or as an external app.

As always, please let me know of any bugs I may have missed with this.

Report message to a moderator

Re: Item.Type now an Enum Mon, 11 July 2011 03:21 Go to previous messageGo to next message
Daniel is currently offline Daniel

 
Chief Warrant Officer 3
Stars! Nova developer
Stars! Nova developer

Messages: 179
Registered: April 2006
Location: Nowra, Australia
Sounds reasonable but you should check that the component editor at least loads your changes. You can run it by supplying the --components option to Nova. You can do this at a command line or by setting it as a parameter in your debug options. You should become familiar with running Nova up in the debugger with different starting options as it helps a lot with debugging. For a full list of command line options see command-line.txt in the Documentation directory (stars-nova\Documentation). It looks like this:
          Start Launcher
            Nova --launch
          Start New Game wizard
            Nova --new
          Start Race Designer
            Nova --race
          Start Component Editor
            Nova --components
          Start Console
            Nova --console
          Start GUI
            Nova --gui -r <race> -t <turn> -i <intel file> -s <state file>
          Run AI
            Nova --ai -r <race> -t <turn> -i <intel file>
          Display the help screen
            Nova --help

Some example command lines:

To open the GUI with the Googly race on Dan's computer:
Nova --gui -r rabbitoid -t 2114 -i "C:\Users\daniel\Desktop\IdTest\rabbitoid.intel"

To open the Nova Console on Dan's computer:
Nova --console

To run the Nova AI on Dan's computer:
Nova --ai -r Insectoid -t 2101 -i "C:\Users\daniel\Desktop\TestGame\insectoid.intel"



Have fun.

Report message to a moderator

Re: Item.Type now an Enum Mon, 11 July 2011 03:49 Go to previous message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Ah yes, I know about the commands. It was my lazy fault; I did a "search for references" on the component designer object and got nothing that indicated it was being directly created or run from anywhere. Forgot it is still run in a non in process switch.

Seems to load everything fine here, both components and their properties.

Report message to a moderator

Previous Topic: Priorities
Next Topic: Merge/Split fleet dialog
Goto Forum:
  


Current Time: Fri Mar 29 06:16:59 EDT 2024