Don Stone
Conscript
Posts: 10
Joined: Fri Jul 06, 2007 7:14 pm

event scripting -- question re: EvalEvent

Thu Dec 11, 2008 7:22 pm

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?

Don Stone
Conscript
Posts: 10
Joined: Fri Jul 06, 2007 7:14 pm

event scripting -- another question

Thu Dec 11, 2008 7:43 pm

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?

User avatar
bigus
General
Posts: 599
Joined: Wed Oct 24, 2007 11:43 pm

Thu Dec 11, 2008 8:22 pm

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.

User avatar
lodilefty
Posts: 7614
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Fri Dec 12, 2008 12:12 am

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
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]
[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]

[CENTER]Rules for new members[/CENTER]
[CENTER]Forum Rules[/CENTER]

[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

User avatar
bigus
General
Posts: 599
Joined: Wed Oct 24, 2007 11:43 pm

Fri Dec 12, 2008 1:16 am

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.

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Fri Dec 12, 2008 5:46 am

deleted

Don Stone
Conscript
Posts: 10
Joined: Fri Jul 06, 2007 7:14 pm

Fri Dec 12, 2008 11:45 am

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.

User avatar
Eugene Carr
Colonel
Posts: 387
Joined: Wed Jun 20, 2007 6:58 pm
Location: Dundee, Scotland

Fri Dec 12, 2008 2:38 pm

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

Return to “AACW Mods”

Who is online

Users browsing this forum: No registered users and 4 guests