Forrest appearing in Union owned Stewart, TN
Posted: Sun Dec 13, 2009 4:05 am
I recently had Forrest show up in a Union owned Fort Donelson (Stewart, TN), even though the Confederates still owned many cities in Tennessee. Why did this happen? Obviously, because that's where the computer was told to put him.
Forrest's arrival is caused by the following event, in CSA Leaders:
I do not have the manual for event codes, so have had to make do with the wiki, which is incomplete, and searching the forum for old posts.
At any rate, here is my best guess for what the critical part of this code does:
Thus, if my understanding of CondSkip is correct, Forrest appearing in Stewart, TN, under all circumstances is exactly what this code should do. My understanding of CondSkip is based on an old post by Pocus: [POST]62546[/POST] that I found by doing a search for "CondSkip" in the forums.
Correcting the code:
I submit that the following code much more accurately represents the desired intention:
Translated into English prose:
Pick Stewart, TN if not enemy owned.
If Stewart is not valid (i.e. was enemy owned) pick a random friendly-owned
Tennessee city, weighted by city size squared,
If still don't have a valid region, go back to Stewart, TN.
Associate event message with region on map.
I am not sure if multiple "GenMsg" commands are needed, or just one after all the regions are finally picked. I am also unsure if this should go before or after the "Actions" statement.
If I am correct that this event is bugged, and how it bugged, then there are at least twenty-five other instances of similar bugs just in the file "CSA Leaders". I have not yet looked at the other event files for this bug.
Forrest's arrival is caused by the following event, in CSA Leaders:
Code: Select all
SelectFaction = $CSA
StartEvent = evt_nam_CSA_Forrest|1|1|NULL|NULL|NULL|NULL
Conditions
MinDate = 1862/02/01
MaxDate = 1862/03/01
EvalUnqUnit = Nathan B. Forrest;NOT
SelectRegion = $Stewart, TN
SelectRegInArea = $TN;Squared;OwnedCities;CondSkip
GenMsg
PickFromRegList = NotEnemy
GenMsg
EvalRegionSel = NULL
Actions
GenMsg
etc, etc.
At any rate, here is my best guess for what the critical part of this code does:
Code: Select all
EvalUnqUnit = Nathan B. Forrest;NOT // If Forest is not on the map
SelectRegion = $Stewart, TN // Pick Stewart, TN as region
SelectRegInArea = $TN;Squared;OwnedCities;CondSkip
// If valid region has been picked, which it always has, skip
// this line. In other words, this line is a no-op.
GenMsg // Connect map region to event display
PickFromRegList = NotEnemy // Pick only regions that are not enemy from list. This is a guess.
GenMsg // Again, associate map region to event display.
EvalRegionSel = NULL // Accept event even if there are no valid regions.
// This is a complete guess. I have no documentation on "EvalRegionSel".
Actions
GenMsg // Again, etc.
Correcting the code:
I submit that the following code much more accurately represents the desired intention:
Code: Select all
Conditions
MinDate = 1862/02/01
MaxDate = 1862/03/01
EvalUnqUnit = Nathan B. Forrest;NOT
SelectRegion = $Stewart, TN;NotEnemy
SelectRegInArea = $TN;Squared;OwnedCities;CondSkip
SelectRegion = $Stewart, TN;CondSkip
GenMsg
Pick Stewart, TN if not enemy owned.
If Stewart is not valid (i.e. was enemy owned) pick a random friendly-owned
Tennessee city, weighted by city size squared,
If still don't have a valid region, go back to Stewart, TN.
Associate event message with region on map.
I am not sure if multiple "GenMsg" commands are needed, or just one after all the regions are finally picked. I am also unsure if this should go before or after the "Actions" statement.
If I am correct that this event is bugged, and how it bugged, then there are at least twenty-five other instances of similar bugs just in the file "CSA Leaders". I have not yet looked at the other event files for this bug.