Events and AI
Moderators: Slitherine Core, The Lordz
Events and AI
Hi people and Robotron, where is defined in which turn an avent can be played by the AI and the probabilities the AI really choose it?
Re: Events and AI
This is very complicated to explain in detail. Is this a general question or do you have a specific problem?

Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Re: Events and AI
I was thinking about modify the game number of turns... and I don't know how to adapt events to this variation 
Re: Events and AI
Changing number of turns:
Open 1914.lua
at the top you will find
Try changing that.
Also look at
function(setturndate)
This function controls how much time passes with each turn (in PotzBlitz: 2 weeks per turn in 1914, 4 weeks from 1915-18)
If you want to return to the original time per turn you can replace the function with the original one. This will restore 2 weeks per turn after turn 5:
Modifying events to match new number of turns:
Search the events.lua and diplomacy.lua scripts for occurrences of
which is the number of the game turn
which is the number of the current month (1 to 12)
which is the number of the current year (1914, 1915 etc.)
You will need to judge if your new number of turns will change the outcome of any event.
A simple example:
In Potzblitz the Christmas event triggers on turn 14 because each turn represents 2 weeks and turn 14 is late December.
If you would have changed the time per turn to 1 week you would need to trigger the event on turn 28 instead.
As you can see changing the number of turns is not easily done and will require A LOT of work to synchronize all stuff (including research times etc.).
Of course you can experiment but I guarantee you will get crazy results.
I would better not try it at all, if I were you.
Open 1914.lua
at the top you will find
Code: Select all
scenario.turnLimit = 60Also look at
function(setturndate)
This function controls how much time passes with each turn (in PotzBlitz: 2 weeks per turn in 1914, 4 weeks from 1915-18)
If you want to return to the original time per turn you can replace the function with the original one. This will restore 2 weeks per turn after turn 5:
Code: Select all
function SetTurnDate()
if game.turn > 5 then
game.date:AdvanceWeeks(2)
end
end
Modifying events to match new number of turns:
Search the events.lua and diplomacy.lua scripts for occurrences of
Code: Select all
game.turnCode: Select all
game.date.monthCode: Select all
game.date.yearYou will need to judge if your new number of turns will change the outcome of any event.
A simple example:
In Potzblitz the Christmas event triggers on turn 14 because each turn represents 2 weeks and turn 14 is late December.
If you would have changed the time per turn to 1 week you would need to trigger the event on turn 28 instead.
As you can see changing the number of turns is not easily done and will require A LOT of work to synchronize all stuff (including research times etc.).
Of course you can experiment but I guarantee you will get crazy results.
I would better not try it at all, if I were you.

Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Re: Events and AI
Wow! Thanks a lot Robotron 

