Random Events

will need to look through them (its 300+ events, so it may need a bit of time ;))
I'll mainly need to know what you think is the best way to use the crime and flammability values (or any other property values that are added) in the events. I have not done any check on what does what in event processing.
Do you need certain tags or is it enough to expose the values to Python?
 
events use two functions really, the trigger/cando as governed by the triggerinfos.xml and the actual event (i.e. what is to be changed) as governed by the eventinfos xml - if things are to be altered it should probably go through an xml tag so that the game knows what is happening.
Just for triggering its easy to use a python cando function in the trigger.
So the answer is: either :p
For events that end up removing buildings semi-randomly one will need to go through python in any case I expect and I would be happy with having the whole thing exposed to python, but ideally for triggering the whole thing one would have either a python function or an xml tag that returns the cumulative value in the city - for an xml tag I'd really love a maxcounter and a mincounter tag so that one could trigger an event above or below as specific threshold.
Of course in python one could just go through all buildings as well, but if something like this was already present in the dll, it would make it much easier (and faster I expect).

So to sum the whole thing up:
whats needed:
python function for flammability (or any other counter) by building

further great would be:
python function for flammability (or any other counter) by city
xml tag for the event trigger returning true for either equal/above or equal/below the number entered
 
events use two functions really, the trigger/cando as governed by the triggerinfos.xml and the actual event (i.e. what is to be changed) as governed by the eventinfos xml - if things are to be altered it should probably go through an xml tag so that the game knows what is happening.
Just for triggering its easy to use a python cando function in the trigger.
So the answer is: either :p
For events that end up removing buildings semi-randomly one will need to go through python in any case I expect and I would be happy with having the whole thing exposed to python, but ideally for triggering the whole thing one would have either a python function or an xml tag that returns the cumulative value in the city - for an xml tag I'd really love a maxcounter and a mincounter tag so that one could trigger an event above or below as specific threshold.
Of course in python one could just go through all buildings as well, but if something like this was already present in the dll, it would make it much easier (and faster I expect).

So to sum the whole thing up:
whats needed:
python function for flammability (or any other counter) by building

further great would be:
python function for flammability (or any other counter) by city
xml tag for the event trigger returning true for either equal/above or equal/below the number entered
The cumulative value is already calculated for city and player. So I'll expose those to Python and also add threshold tags for them to the event trigger.
 
The cumulative value is already calculated for city and player. So I'll expose those to Python and also add threshold tags for them to the event trigger.

Try to stick to a pattern of only GETing the values from Python NOT chnaging them if at all possible (due to the loss of information on rebuild otherwise). Ideal pattern would be:

  • Building XML provides chnages and/or modifiers to each property
  • Accumulated values on player and city exposed to Python for read only
  • Event XML provides for changes to values using similar syntax to the building XML

That matches the additions I'm making to the event XML for the commerce and yield modifiers etc (see other event thread), and allows for clean rebuilding of the data by the existing mechanism that replays events (but doesn't rerun event Pythion since it can't tell what it's going to do that might go beyond just putting modifications to values back).
 
One question there: removing buildings via python (like burning them down :mischief:): does that cause any problems? I expect no, but there is always a good chance my expectations are quite wrong...

No, that's fine. When buildings are removed their contribution to all accumulated totals is removed, and on rebuild teh values are assembled based on the buildings present so in both cases it's fine.
 
Try to stick to a pattern of only GETing the values from Python NOT chnaging them if at all possible (due to the loss of information on rebuild otherwise). Ideal pattern would be:

  • Building XML provides chnages and/or modifiers to each property
  • Accumulated values on player and city exposed to Python for read only
  • Event XML provides for changes to values using similar syntax to the building XML

That matches the additions I'm making to the event XML for the commerce and yield modifiers etc (see other event thread), and allows for clean rebuilding of the data by the existing mechanism that replays events (but doesn't rerun event Pythion since it can't tell what it's going to do that might go beyond just putting modifications to values back).
I agree and that was also my intention.
Unless requested I won't add any changes to the properties through events for now.
 
added quicksand event, active in 100% of games, iweight 30 (quite rare), can recur.
requires unit on dunes, option 1: unit is killed, option 2 (requires cooperation tech): units is immobile for 1 turn.

AI will be unaware of the dangers of quicksand. This gives a little advantage to human players to avoid dunes. Maybe just use option 2 :)
 
The event about the dangerous number of barbarian warriors on the border never happens for me until I have archery, at which time three little clubmen materializing is not much to get worried about.
 
AI will be unaware of the dangers of quicksand. This gives a little advantage to human players to avoid dunes. Maybe just use option 2 :)

The AI is told adamantly to take option 2 though, and frankly its extremely unlikely to be unavailable since the first 20 turns no events can happen - and by then cooperation tech is likely researched :mischief:

I have no problem removing the first option though, I just implemented it as proposed...

The event about the dangerous number of barbarian warriors on the border never happens for me until I have archery, at which time three little clubmen materializing is not much to get worried about.

I didn't look at those events at all yet, but I recall that they were toned done by some modders, not sure though I want to have game stopping events kill your game early on by shear bad luck :dunno:
 
I didn't look at those events at all yet, but I recall that they were toned done by some modders, not sure though I want to have game stopping events kill your game early on by shear bad luck :dunno:

Three Warriors showing up early on is not likely to cause more than a mild panic. And a mild panic is fun every now and then.....

As it stands it is fairly laughable that these little boys with squirt guns are trying to extort us......
 
The AI is told adamantly to take option 2 though, and frankly its extremely unlikely to be unavailable since the first 20 turns no events can happen - and by then cooperation tech is likely researched :mischief:

language (5 turns) -> nomadic lifestyle (7 turns) -> gathering (11 turns) -> scavenging (11 turns) -> cooperation (9 turns) = 5+7+11+11+9 = 43 turns. I must be doing something wrong:rolleyes:
 
language (5 turns) -> nomadic lifestyle (7 turns) -> gathering (11 turns) -> scavenging (11 turns) -> cooperation (9 turns) = 5+7+11+11+9 = 43 turns. I must be doing something wrong:rolleyes:

:p - anyhow I can change that as I said, I just don't think it will be much of a problem...
 
Back
Top Bottom