Boogie's Moding Class #2: Random Events
from
Stardock Forums
// ********************************************
// CREATING YOUR OWN RANDOM EVENTS
// ********************************************
Originally created to be as edit-friendly as possible, the Random Event files can be daunting to someone that wants to create their own. There’re a lot of numbers, with not a lot of feedback as to what those numbers actually do. What I’ll try and do today is step through the EVENT file type and explain each field as painlessly as possible.
//------------------------------------------------------------------------
EVENT UniqueEventName01
//------------------------------------------------------------------------
-this is the header for the event. Give it any name you’d like…as long as it dosent conflict with another event’s name.
Title “Name of Event” //this is another place to name your event, but as of right now it’s unused
Description “A paragraph describing the situation.” // this will be the large paragraph above the options
Image “gfx//your_events.pcx” // file name (from the galciv root) of the image you want to use. Image should be 640x360, 8bit Indexed (256 colors).
EventType 0 // is the event a colonization event or a random event? 0 = colonize, 1 = random
GoodOption, NeutralOption, and EvilOption
// ok, this is where things get…well…messy. The random event that you make will always have random #’s generated for the user. In order to display this, and other information, these entries reference the values “GoodOptStr01”, “GoodOptStr02”, “NeutralOptStr01”, ect. These values tell the game what data to enter in place of the %s placeholders within the text you enter. There are several values that the game will accept….
0 = Display nothing. Use this by default.
1 = Player’s name..uses the value the player typed in at the start of the game. (ex> Alan Bradly)
2 = Player’s empire name. Name of the human race (ex. Terrans)
3 = Name of Player’s ships that triggered the event. Right now only works with colonization events…will display the name of the colony ship.
7 = Name of the planet.
8 = Name of the star system.
9 = Random value of the EVIL option.
10 = Random value of the NEUTRAL option.
11 = Random value of the GOOD option.
Example…
GoodOption "%s is here for all forms of life to share. Let us all live in harmony, no matter what the cost. (%s%% Planet Quality bonus)"
GoodOptStr01 7
GoodOptStr02 11
Using the “GoodOptStr” values, GalCiv will display the name of the planet in place of the first %s, and display the percentage value of the good option in place of the second %s. Also, you’ll see two consecutive %%’s. That’s to indicate where you want a % symbol to appear. Just a small quirk
The above method of inserting game-specific text into paragraphs is as well used with the Description field. Values for “DescStr01” through “DescStr04” indicate any text you want to appear in the description in place of %s.
GoodAttribute, NeutralAttribute, and EvilAttribute
Indicates what aspect of the game you want to change, based on whether it’s a random event or a colonize event. Colonization Event’s will alter aspects of that planet. Random Events alter player abilities (global change). The following list will explain the different options:
// Colonization Options – bonuses on a per-planet basis
0 – changes nothing
1 – max population growth bonus
2 – morale bonus
3 – social production bonus
4 – planet quality bonus
5 – economic bonus
6 – not used
7 – star influence bonus
8 – defense bonus
9 – research bonus
10 – starship quality bonus
// Random Event Options – these up the players ability
100 – economic
101 – ship weapons
102 - ship defense
103 – ship speed
104 - morale
105 – population growth
106 – social production
107 – military production
108 - research
109 - incluence
110 – trace
111 - diplomacy
112 – ship hit points
113 – ship repair
114 - sensors
115 - espionage
116 - soldiering
117 – interest rates
118 – planet quality
119 – number of trade routes
122 – ship range
123 – luck
124 - courage
125 - creativity
126 - government
127 – loyalty
GoodValue, NeutralValue, EvilValue
This is that value that is applied to the corresponding attribute. It will be randomized so it’s not the same number all the time.
MoralityWeight 1 through 5 // where 1 is a less morally defining situation, and 5 is a major issue that will easily change the way others perceive the player
Probability 1-100 // likelihood of the event occurring
DescStr01 through EvilOptStr02 were all discussed in the above area dealing with the Description and Option text fields.
ENDEVENT // used to indicate the end of the event.
Well, that’s about it. There’s a lot going on within these files, but finely crafted random events can add fun and variety to GalCiv. As always, I’ll be happy to answer any questions on the above documentation.
ScottT
GC Development Team