User avatar
Captain_Orso
Posts: 5766
Joined: Tue Sep 01, 2009 5:02 pm
Location: Stuttgart, Germany

Leader Appearance Events Depending On Other Leaders

Mon Jun 04, 2012 12:05 am

In my current PBEM game Grant was killed in his second battle :crying: and then Sherman didn't appear in the spring of '62. If I remember my history correctly, Grant played a role in keeping Sherman in the army, so this may be realistic. But is it actually WAD?

I looked into the event in 'USA Leaders.sct' and it runs SelUnqUnit (Select Unique Unit) on 'Ulysses S. Grant', which will fail, because there is no 'Ulysses S. Grant' unit -- already killed and removed from the game --. However the event then runs 'SelMostNumGroup = NoSelGroup' which will then select the the 'Group' using the most command points, unless there is already a 'Group' selected. Therefore, IIUC, if Grant is in play, he is selected and Sherman spawns on him; if Grant is not in play, the largest 'Group' is selected and Sherman is spawned on it.

But Sherman didn't spawn, at all, so is this broken? If Sherman were not to spawn at all if Grant is not in play, there would be nor reason for the 'SelMostNumGroup' command, therefore I have to assume that it is intended that Sherman is not dependent on Grant to spawn.

I know that there are other leaders that spawn per event on other leaders, such as Fitzjohn Porter spawning on McClellan. These events also work the same way and if the Sherman event is broken then so are these.

Code: Select all

StartEvent = evt_nam_USA_Sherman|1|1|NULL|NULL|NULL|NULL

Conditions
  MinDate = 1862/02/01
  MaxDate = 1862/03/15
  EvalUnqUnit = William T. Sherman;NOT

SelectFaction = $USA
  SelUnqUnit = Ulysses S. Grant
SelectFaction = $USA
  SelMostNumGroup = NoSelGroup
  GenMsg
  EvalRegionSel = NULL

Actions
  GenMsg

SelectFaction = $USA
  CreateGroup
  Posture = $Defensive
  SetKind = $Land
  Entranch = 0
  InCS = 0
  FixType = 0
  SetName = W. Sherman
  Apply
  CreateUnit
  SetType = $uni_USA_Sherman
  SetName = William T. Sherman
  Apply

EndEvent

User avatar
PhilThib
Posts: 13705
Joined: Tue Oct 18, 2005 5:21 pm
Location: Meylan (France)

Mon Jun 04, 2012 7:23 am

Good point...I believe there should be indeed some checks for alternate conditions, to avoid these 'blocking points'
Image

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

Mon Jun 04, 2012 11:54 am

Ach, so...

I see the issue: when the game engine fails to find Grant, it creates a "FALSE" result in conditions, and stops any further processing of the event!

This kind of "NoGroupSel" works ok in actions, but not in Conditions!
Easy fix: move the Grant/Nogroup lines to the beginning of Conditions! Then event only fails if somehow Sherman has already appeared.

or, declare it WAD that Grant's death precludes Sherman's arrival!
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
Captain_Orso
Posts: 5766
Joined: Tue Sep 01, 2009 5:02 pm
Location: Stuttgart, Germany

Mon Jun 04, 2012 12:43 pm

I built such an event into my test-scenario using Sherman to spawn on and George Thomas to spawn.

Code: Select all

SelectFaction = $USA
StartEvent = evt_nam_USA_Thomas|1|1|NULL|NULL|NULL|NULL

Conditions
  MinDate = 1863/06/01
  MaxDate = 1865/12/15
  EvalUnqUnit = George H. Thomas;NOT

SelectFaction = $USA
  SelUnqUnit = William T. Sherman
SelectFaction = $USA
  SelMostNumGroup = NoSelGroup
  GenMsg
  EvalRegionSel = NULL

Actions
  GenMsg

SelectFaction = $USA
  CreateGroup
  Posture = $Defensive
  SetKind = $Land
  Entranch = 0
  InCS = 0
  FixType = 0
  SetName = G. Thomas
  Apply
  CreateUnit
  SetType = $uni_USA_Thomas
  SetName = George H. Thomas
  Apply

EndEvent


This event works as long as Sherman can be found in the game. If I edit the event to 'SelectFaction = $USA; SelUnqUnit = Not William T. Sherman' it stops working:

ScriptReport2724.txt
>>>
Line 32: ------------------------------
Line 34: SelectFaction, selected: Union
Line 36: SelectFaction, selected: Union
Line 37: Started processing event: evt_nam_USA_Thomas
Line 37: This event is not yet referenced, base number of allowed occurences 1
Line 40: Min date evaluated: 1863/06/01 converted to turn 2723 current turn 2724 True
Line 41: Max date evaluated: 1865/12/15 converted to turn 2784 current turn 2724 True
Line 42: Unique unit: George H. Thomas NOT found / FixType differs
Line 44: SelectFaction, selected: Union
Line 45: Select Unique unit: Not William T. Sherman not found
Line 45: We were in Conditions block, Conditions are now False.
Line 46: SelectFaction, selected: Union
Line 54: SelectFaction, selected: Union
Line 68: Finished processing event: evt_nam_USA_Thomas
Line 68: ------------------------------
<<<

As you noted Lodi, when the 'Condition' section gets a 'False' the first time, it apparently cancels the rest of the 'Condition' block and the event fails.

I tried moving the 'SelectFaction = $USA; SelUnqUnit = William T. Sherman' instruction to before the 'Condition' section, but apparently when the script enters the 'Condition' section it forgets the 'SelUnqUnit = William T. Sherman' instruction and then spawns Thomas on the largest -- in command points -- group, which renders the 'SelUnqUnit = William T. Sherman' useless.

Aside from the fact that losing Grant AND Sherman in one fell stroke in one of the full-campaign scenarios is almost unbearable, this type of event is also used for other leader too, though none as important as Sherman, at least on the Union side. I haven't checked the CSA side.

FelixZ
Major
Posts: 212
Joined: Mon Dec 12, 2011 10:43 pm
Location: Florida, USA

Mon Jun 04, 2012 2:45 pm

How about losing Jackson and E K Smith in an early 61 turn. Would there be any subsequent consequences?

User avatar
Captain_Orso
Posts: 5766
Joined: Tue Sep 01, 2009 5:02 pm
Location: Stuttgart, Germany

Mon Jun 04, 2012 5:54 pm

Eureka!!!

If the 'SelUnqUnit' and 'SelMostNumGroup' instructions are moved into the 'Actions' section, IT WORKS!! :w00t:

Code: Select all

Actions
  GenMsg

SelectFaction = $USA
  SelUnqUnit = William T. Sherman
SelectFaction = $USA
  SelMostNumGroup = NoSelGroup
  GenMsg
  EvalRegionSel = NULL


BTW this type of spawning leaders is used only for four Union leaders:

SelUnqUnit = George B. McClellan
SetName = Fitzjohn Porter

SelUnqUnit = Don Carlos Buell
SetName = A. McCook

SelUnqUnit = Don Carlos Buell
SetName = L. Rousseau

SelUnqUnit = Ulysses S. Grant
SetName = W. Sherman

Return to “AGEod's American Civil War”

Who is online

Users browsing this forum: No registered users and 10 guests