The MunchKING
Chieftain
- Joined
- Jul 8, 2008
- Messages
- 17
In order to build Quests (such as the game's "Build X Buildings" quests) does one HAVE to use Python? Or can such be done with XML?
Higher weight = more likely to pop up. A weight of -1 will cause the event in question to pop up as soon as its requirements are met.how do I increase the rate of events from poping up?
I'm trying to make an events that causes a relations change with ALL other players. Is this possible through the XML, or would I have to write a python code for that?
iWeight- is a number that affects the probability of this trigger triggering. Applies to events that are active in this game only (as does everything else). Set to -1 if the trigger needs to always occur if the other conditions are met (for example, triggers that determine quest completion should be with -1).
The game does a random check to see if you get an event for this turn.
If that check passes, then it cycles through all the events to find which ones you are allowed to have (meet all prereqs, and hasn't been done yet, or is repeatable).
The game will add up all of the iWeight values for events you are allowed to have during this cycle.
Once it is done, a random number is generated using the sum of all the iWeight values. Then the game cycles through the promotions again, subtracting the iWeight of an event you are allowed to have from the randomly generated number. When the difference becomes negative, then it assigns that event to happen.
So summary is: The larger the weight, the more likely the event is to happen once it becomes a legal event. If I have 9 events possible, with weights 12, 4, 6, 7, 3, 15, 13, 35, 5 each, then it just HAPPENS that they add up to 100, so the weight of each winds up being the percent chance of each being the event I get this turn. Let's say that I get the 35 iWeight event, but it is a non-repeatable event. Next turn I miraculously get another event, and haven't made any more leagel for myself. Now the iWeight values only add up to a total of 65, so figuring out the precise percent chance for each event is a bit trickier, but I can still say that I am most likely to get the 15, and almost as likely to get the 12.
Whatever the largest INT value that C++ will handle, I think somewhere in the 2 Billion range.