Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.

Map Aleas

From AGEWiki

Jump to: navigation, search

Map Aleas are used to impact effects on units on the map. Common uses can be: storms at sea, disease, sand storms, river floods, volcanoes, hostile terrains.

The definition of a Map Alea is done through an entry in a XLS database (XXX_DB_MapAleas.xls for example). Once a MA is defined, it can be positioned on the map with a scripting command.

This way of doing allows the descriptions of MA that can be rather complex (a lot of parameters) while having only 2 things to indicate in a script: what is the MA you want, and where.

You need to create a directory MapAleas in Gamedata before anything. The file extension for map aleas is 'ale'.


Contents

Defining a Map Alea in the Database

General Parameters

  • Name
  • Alias
  • Text: reserved for future use (rfu)
  • Kind: rfu
  • Attributes: rfu
  • Region_Icon: File name of the icon to display in each region that has the MA active this turn. The coordinate used to display this icon can be parametrized using Regions indicator riMapAlea, in the same way you define the position of say riHarbor.
  • Region_Tooltip: Tooltip to display when the mouse is over the region icon. Due to a current limitation of the code, all tooltips of the actives MA in the region will show over the icon (that should not be a big problem).
  • TurnProba: Probability to have the MA active this turn (rolled each turn). if not active, all icons disappear and no adverse effect can affect the troops, because of this MA.
    • If Active (rolled once per turn), then all troops in the area may suffer at the start of turn from the MA, plus each time a troop move into another region affected by the MA, during the turn, another test is done. So at the very least, a non moving unit will have the (mis) chance of suffering once per turn from an active MA, and if it moves, new possibilities exist.
  • RegionProba: Probability to have, for each region, the MA affecting the units there. There are several conditions in addition to rolling successfully RegionProba, one being that the MA is active (this means that TurnProba was also a success).
    • Said differently, there are at least 2 checks done. One, at the area level, to see if the MA is active. If yes, icons dot the area and each unit will now roll for RegionProba to see if they are affected, at the beginning of the turn. If they move, they will also roll again for another 'RegionProba' for each new region entered.
TurnProba is thus a global check, and there is no modifier to it. RegionProba is different as each region is
different (so if there is a condition on bad weather and the weather is fair in a particular region, the MA
won't do anything in this region, even if active over the area). Also, the probabilities can be altered thanks
to attributes on models.
  • MinWeather, MaxWeather: The weather value must be between these values for the RegionProba to be rolled in a particular region.


New params added June 12, 2012

  • MinSUTrigger: integer; can't trigger if less than this number of SU (Sub Units) in the region
  • RgnProbaChgPerSU: integer; Each SU in the region change the RegionProba roll by this much, in hundredth of %
  • TurnIndexes: string; list of valid turn indexes, e.g: 0|1|2|3 for the first 4 turns of a year


There are no others conditions for now.


Effects

Effects can be made to be limited or enhance via Model Attributes
The effects parameters here are included in the Map Alea definition file, 
then some of the limiting/enhancing factors can be adjusted for individual Models.
  • Effect_OnlyIfAttrib: The model can't be affected if it has not an attribute equals to *MapAleaXXX* on itself.
    • For example if you define a radioactive storm in the DB which is using UID 13, then the correct syntax of the attribute is *MapAlea13*. If you set Effect_OnlyIfAttrib = 1, then only the models with *MapAlea13* can suffer from this MA.
  • Effect_CohLossPerc: The model loses this percentage of cohesion (base is current cohesion).
  • Effect_HitLossPerc: The model loses this percentage of hits (base is maximum health).
  • Effect_SupLossPerc: The model loses this percentage of supply (base is current stockpile).
  • Effect_CanKill: If set to 1, the model can be killed because of Effect_HitLossPerc. Leader can never be killed.
  • Effect_LockDuration: A number of turns of fixing added to the parent unit, except if current fixing was already above this value.
  • Effect_AreaDesc: Text that is shown in message panel if the whole MA is active.
    • Expected parameter is area name, so add a ¤ (e.g A storm is happening in ¤.)
  • Effect_UnitDesc: Text shown if the model takes hits (there is another one if killed, from low level code).
    • Expected parameters are unit name and region name (e.g ¤ has suffered from a sandstorm in ¤ that scattered draft animals and exhausted men.)


New params added June 12, 2012

  • Effect_MaxOccurs: integer; Max number of Hit/Coh/Sup loss that can affect a single region per try


More on Attributes

  • A model can make use of 2 attributes to alter the odds or the effects of a MA in the stack it is in.
  • A model can lend a 'stack protection' to the whole stack (beware, they are all cumulated within a stack). To do so, you need to have on a (rare) model * ProtectMapAleaXXX* yyy
  • Where XXX is the UID of the MA you want to protect against, and yyy the protection bonus.
Example: A leader has 'Desert Fox' as a chrome ability. The chrome ability does nothing, but help indicates
to the player that the leader is capable of reducing the odds the stack he is in can take damages from sand
storms. Then you add in the attributes list of the model *ProtectMapAlea5* 25. Here, it means that for the
MA of UID 5 (in the Map Aleas DB), you reduce the odds of suffering from it by 25%.
Reminder: when you specify a numeric after an attribute, you use a space, not a pipe. So a list of attributes with numerics should look like that:
 *Pillager* 35|*Winterized* 50|*ProtectMapAlea5* 25
  • The second attribute a model can makes use is an attribute that will not reduce the odds to suffer from a MA, but will either render subject to it, or tone down its effect. We saw it already with Effect_OnlyIfAttrib.
  • The correct syntax being:
    • *MapAlea13* or
    • *MapAlea13* yyy
where yyy is a value.
  • If you use the attribute without a value, then it means logically that you have set Effect_OnlyIfAttrib = 1. In this case, only the models with *MapAlea13* can suffer from the MA.
For example you define a MA named rough seas, and you add up on ironclads the attribute, so that only
they can take losses from the MA.
  • The other usage is to not set Effect_OnlyIfAttrib and still use the attribute, to reduce the effect of the MA. So you would have *MapAlea13* 75 for example. As Effect_OnlyIfAttrib is not set, all units in the area of the MA can suffer from it, but some will suffer less. 75 means 75% reduction in effects. As you guess, a value of 100 renders the model immune to the MA...
An example would be desert raider, for a MA representing a sandstorm. Or troops with NBC suits if we are
back to some radioactivity. 

Scripting commands

AddMapAlea
RemMapAlea


Samples

Example 1

UID = 1
Name = Test Storm
Alias = aleTestStorm
Text = TestStorm_Text
Region_Icon = Icon_Alea_SeaStorm
Region_Tooltip = A sea storm is occuring in this region. Fleets caught in it can suffer very large losses in ships.
TurnProba = 50
RegionProba = 35
MinWeather = 2
MaxWeather = 5
Effect_CohLossPerc = 50
Effect_HitLossPerc = 50
Effect_SupLossPerc = 50
Effect_CanKill = 1
Effect_AreaDesc = A storm is happening in ¤.
Effect_UnitDesc = ¤ has suffered from a storm in ¤ and several ships were sunk.

Example 2

UID = 2
Name = Test Sandstorm
Alias = aleTestSandstorm
Text = TestSandstorm_Text
Region_Icon = Icon_Alea_Sandstorm
Region_Tooltip = A sand storm is occuring in this region. If caught in it, units may suffer delay while they regroup and recover.
TurnProba = 10
RegionProba = 100
MinWeather = 0
MaxWeather = 5
Effect_CohLossPerc = 90
Effect_HitLossPerc = 10
Effect_SupLossPerc = 50
Effect_LockDuration = 1
Effect_CanKill = 0
Effect_AreaDesc = A sandstorm is happening in ¤.
Effect_UnitDesc = ¤ has suffered from a sandstorm that scattered draft animals and exhausted men.
Forums