-
Notifications
You must be signed in to change notification settings - Fork 36
Testing Tutorial
When you make changes or additions to the mod's code, it is good to test what you've done. Or perhaps you are looking to help out by testing events that are already in the mod. While you can just play the mod and see what events happen (and that testing does have its place), for most purposes it is much more efficient to use console commands to force the feature you want to test to occur.
#Using the console First you need to open the console. The command to do this varies by keyboard layout; on a Canada/US keyboard under English localization, it is the ` key. Other possibilities are listed on the Stellaris wiki.
There are many possible console commands. The two most useful ones for testing are
-
event [event name]
causes the named event to fire -
add_anomaly [anomaly name]
places an anomaly from the named category on the currently selected planet. Note that for events other than country events, you will need to select an appropriate entity (such as a planet or ship).
If you are working with something that follows our naming convention, events will be in a file named mem_[event_name].txt
in the events
folder, and anomaly categories will be in a file named mem_[anomaly_name]_category.txt
in the common/anomalies
folder.
To figure out what an event is named, you can look at the id =
line of the code defining the event (somewhere in the events folder). If you're just looking at a localization file, you can generally make a good guess by looking at the text of the event you want and removing whichever of .name
or .desc
is listed for the key. For example, if you wanted to find the event name for an event with a localization line
mem_science_convention.1.name:0 "Science Convention"
you would guess (correctly) that the name is mem_science_convention.1
.
To figure out what an anomaly category is named, you can look at the key =
line of the code defining the anomaly category (in the file common/anomalies/mem_[event_name]_category.txt). If you're just looking at a localization file, look for something with the name "[something]_category"; for example,
mem_asteroid_structure_category:0 "Asteroid Structure Network"
is the line telling you to use mem_asteroid_structure_category
as the anomaly name to place this anomaly category.