Events and AI

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
Kossatx
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 157
Joined: Wed Nov 27, 2013 3:27 pm

Events and AI

Post by Kossatx » Sat Nov 30, 2019 10:22 am

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?

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1282
Joined: Tue Nov 23, 2010 3:35 pm

Re: Events and AI

Post by Robotron » Sat Nov 30, 2019 12:18 pm

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 on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Kossatx
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 157
Joined: Wed Nov 27, 2013 3:27 pm

Re: Events and AI

Post by Kossatx » Sat Nov 30, 2019 1:49 pm

I was thinking about modify the game number of turns... and I don't know how to adapt events to this variation :|

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1282
Joined: Tue Nov 23, 2010 3:35 pm

Re: Events and AI

Post by Robotron » Sat Nov 30, 2019 3:30 pm

Changing number of turns:

Open 1914.lua

at the top you will find

Code: Select all

scenario.turnLimit = 60
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:

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.turn
which is the number of the game turn

Code: Select all

game.date.month
which is the number of the current month (1 to 12)

Code: Select all

game.date.year
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. :wink:

I would better not try it at all, if I were you. :mrgreen:
Slitherine's Commander the Great War on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Kossatx
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 157
Joined: Wed Nov 27, 2013 3:27 pm

Re: Events and AI

Post by Kossatx » Sat Nov 30, 2019 6:18 pm

Wow! Thanks a lot Robotron :D

Post Reply

Return to “Commander the Great War : Mods & Scenario Design”