Page 1 of 1

event scripting -- question re: EvalEvent

Posted: Thu Dec 11, 2008 7:22 pm
by Don Stone
I'm trying to understand the event scripting language, by 1) reading examples, and 2) using the documentation on the wiki -- http://ageod.nsen.ch/aacwwiki/Modding_events

I've been looking at the Union's General War Order 2 events.

Code: Select all

SelectFaction = $USA
StartEvent = evt_nam_ArmyaroundWashington|1|0|NULL|NULL|NULL|NULL

Conditions
  CountUnits = $Around_Washington;1;$USA;-1;>=;12

Actions

EndEvent

SelectFaction = $USA
SelectRegion = $Prince George's, MD
StartEvent = evt_nam_USA_GeneralWarOrderTwo1862|4|1|NULL|NULL|$Prince George's, MD|NULL

Conditions
  MinDate = 1862/04/01
  MaxDate = 1863/06/01
  EvalEvent = evt_nam_ArmyaroundWashington;=;0

Actions
  DescEvent = evt_desc_USA_GeneralWarOrderTwo1862
  ChgVPCount = -50

  ChgEvtOccurs = evt_nam_ArmyaroundWashington;MaxOccurs;0

EndEvent


Do these work as intended? I *think* that the ArmyaroundWashington event occurs on the first turn during the game where there are 12 units near Washington. With maxOccurs=1, it never occurs again. Then, on 1862/04/01, EvalEvent evt_nam_ArmyaroundWashington=1, so the WarOrder2 event does not happen -- and can never happen -- as long as at some point in the past, there were 12 units near Washington.

A couple of possibilities:

1) these events are buggy

2) EvalEvent actually causes the event to be reevaluated at that point.

3) some other bit of confusion on my part that I've missed

Which is it?

event scripting -- another question

Posted: Thu Dec 11, 2008 7:43 pm
by Don Stone
Many events have a MinDate and a MaxDate, but no other condition. E.g.,

Code: Select all

SelectFaction = $USA
SelectRegion = $Prince George's, MD
StartEvent = evt_nam_USA_Free Land1862|1|2|evt_txt_USA_Free Land1862|Event-img_USA_Free Land1862|$Prince George's, MD|119

Conditions
  MinDate = 1862/05/20
  MaxDate = 1863/01/01

Actions
  DescEvent = evt_desc_USA_Free Land1862
  ChangeFacMorale = 5
  ChangeConscriptPool = -20

EndEvent


Does MaxDate have any effect here? I *think* that this event will fire on the first turn on/after 1862/05/20, no matter what the setting of MaxDate. Is that right?

Posted: Thu Dec 11, 2008 8:22 pm
by bigus
Don Stone wrote:Many events have a MinDate and a MaxDate, but no other condition. E.g.,

Code: Select all

SelectFaction = $USA
SelectRegion = $Prince George's, MD
StartEvent = evt_nam_USA_Free Land1862|1|2|evt_txt_USA_Free Land1862|Event-img_USA_Free Land1862|$Prince George's, MD|119

Conditions
  MinDate = 1862/05/20
  MaxDate = 1863/01/01

Actions
  DescEvent = evt_desc_USA_Free Land1862
  ChangeFacMorale = 5
  ChangeConscriptPool = -20

EndEvent


Does MaxDate have any effect here? I *think* that this event will fire on the first turn on/after 1862/05/20, no matter what the setting of MaxDate. Is that right?


I believe your right. Unless it has a probability then it should fire on the Mindate.

Posted: Fri Dec 12, 2008 12:12 am
by lodilefty
bigus wrote:I believe your right. Unless it has a probability then it should fire on the Mindate.


It is often done this way so an event set [file] can be used in several scenarios.
The MaxDate prevents triggering if this event set is used in, say, 1863 or later scenarios...

This avoids having multiple instances of same code, for easy debug or change

Posted: Fri Dec 12, 2008 1:16 am
by bigus
lodilefty wrote:It is often done this way so an event set [file] can be used in several scenarios.
The MaxDate prevents triggering if this event set is used in, say, 1863 or later scenarios...

This avoids having multiple instances of same code, for easy debug or change


Thanks Lodilefty. I often wondered why the probability was not added.

Posted: Fri Dec 12, 2008 5:46 am
by Gray_Lensman
deleted

Posted: Fri Dec 12, 2008 11:45 am
by Don Stone
Thanks for the responses -- understood and much appreciated.

re: the War Order 2 events. So the conclusion is that they probably don't do what is intended. The intent (I think) is that the Union must maintain 12 units around Washington for the specified time -- if it ever drops below 12, the event should fire. I'd guess that the proper way to code this would be to put a "< 12" test directly in the second event, rather than relying on the other ("ArmyaroundWashington") event.

Posted: Fri Dec 12, 2008 2:38 pm
by Eugene Carr
Lincolns War Orders

http://www.presidency.ucsb.edu/ws/index.php?pid=69800
http://www.presidency.ucsb.edu/ws/index.php?pid=69801&st=&st1=

Then the in game events.

evt_desc_USA_GeneralWarOrderTwo1862Warning Keep 12 units adjacent to Washington DC for 2 months or lose 50 VP.

evt_desc_USA_GeneralWarOrderTwo1862 -50 Victory Points


Possibly the event should be order number 3?

Anyways the 1st event is a warning so it has to have happened for the 2nd to take place.

S! EC