BATTLE
ATTRIBUTES
(BA)
RECEIVER
Used to set up the attributes of a battle. Generally it makes sense to set up only after !?BA# trigger.(BA0/BA1/BA50/BA51)
Note: v998/v999/v1000 variables will store the location of the current battle visited. Also, you can refer to it easily with an indirect reference (for example: !!BA998:...; )
!!BA:XXXX; | Set up the attributes of a battle. |
OPTIONS | |
A$; |
Get or check (NOT set) an AI only battle $ = 1 if this battle is theoretical only (complete AI battle) $ = 0 if this is a real battle or quick battle. So you can always check whether you can use battle receivers for this battle or not (see comments below). Comments. You may use set syntax, but this means nothing. If we have any battle on the map (Hero to Hero, Hero to Monsters, Hero to defended object...), the !?BA# trigger works always. Also a corresponding receiver !!BA... works fine. But. If this is a battle WITHOUT human (completely AI battle, not quick auto battle!), there is NO REAL battle simulation. AI just calculates possible losses using AI value of creatures, no more. This means that in such battles none of the next receivers may be used (corresponding triggers also will not work in this case): !!BG, !!BM, !!BH, !!BU, !!BF This is important for all of them treat a combat manager as filled by correct values, though actually, this is not. Game will most probably crash if this is the first battle since game start or a result is undetermined otherwise. Warning! Even for Human battle, the combat manager IS NOT READY in !?BA0 trigger section. So you cannot use !?BA0; !!BH0:N?v426; BH receiver should be used only in BH trigger section. I see that using BA:A may be not the easiest way to track it and made another change. We have flag1000 as a marker of HUMAN/AI owner of a hero. For the battle trigger !?BA# this flag is set to inverse "complete AI battle" flag. So you can use it to check like this: !?BA1&1000; Here you run !?BA trigger section only if this is a real battle (there is at least one human as an opponent). In many senses this flag1000 value is the same as before I think that this is enough for other battle triggers: !?BG, !?BR and !?BF must not be called in theoretical battles (complete AI battles). |
B#; | Set the background picture
for the battle. -1 = default 1. sand/shore 2. sand/mesas 3. dirt/birches 4. dirt/hills 5. dirt/pines 6. grass/hills 7. grass/pines 8. lava 9. magic plains 10. snow/mountains 11. snow/trees 12. subterranean 13. swamp/trees 14. fiery fields 15. rock lands 16. magic clouds 17. lucid pools 18. holy ground 19. clover field 20. evil fog 21. "favourable winds" text on magic plains background 22. cursed ground 23. rough 24. ship to ship 25. ship Comments: Background 21 is clearly a placeholder; I guess they were going to have a favourable winds combat screen but didn't get around to it. Background 24 has built-in obstacles - the space between the ships; I don't yet know if those hexes are obstacles or not if you don't use BF:C, but of course if you do use BF:C, they aren't. |
B^file.pcx^; | Set a custom picture for a battlefield. Comments: Path to the file.pcx is taken from DATA folder. As usual filename+extension must not be longer than 12 chars. |
Disable/Enable the battle. # = 1 to disable (battle is automatically won) # = 0 to enable the battle |
|
E$; |
$ - is a state
of the battle: =2 is an AI vs non-active Human battle (runs at distant PC) =1 is a Human vs Human battle (runs at two PCs) =0 is all other battles (runs at this PC) |
Set the Hero # that's fighting the battle. # = 0 for attacker # = 1 for defender $ = Hero number. $ = -2 for no hero (defender only). See format H |
|
Set the Monsters that are fighting the battle. #1 = Attacker's monsters (0) or defender's monsters (1) See format C #2 = Slot number (0..6) $1 = Monster type (use -1 for a slot with no monsters) $2 = Number of monsters |
|
O$1/$2; |
$1 - is an attacker owner (Hero's owner) $2 - is a defender owner (Hero's or monsters owner) Note: This may be used in !?BA0,!?BA1,!?BA50 and !?BA51 triggers section or in any other battle based triggers. Only check or get syntax is available. You can set it by this command will not change it. |
Position on the map (for background picture and
terrain bonuses only). $1 = x $2 = y $3 = Level | |
Q$ |
Quick Combat battles control: !!BA:Q$; !!BA:Q$ - set/check/get Quick Battle flag. $ = 1 if quick battle is enabled and 0 if disabled. |
S$ |
Get/check siege battle type !!BA:S$; $ - type = 0 ordinary battle = 1 a siege with a Fort = 2 a siege with a Citadel = 3 a siege with a Castle Comment. You may not set this parameter. |
Notes about the !?BA Trigger (that must precede
the BA receiver)
This Trigger is for every battle. But if you use 0 (!?BA0), this will be triggered at
the beginning of the battle and if you use 1 (!?BA1), this will be triggered
at the end of the battle.
Every time a battle takes place this trigger will work. It will work for ANY number of battles and for all battles. You can (and should) use only one trigger for all your scripts and gain access at every battle whenever it happends. If you want for example to make some help for every Sunday, just check the day and make it with receivers.
The !!BA command appears to work fine, but how do we:
a) tell who won the battle?
b) tell where the battle is occurring?
It must not be too hard. You have both (or one left) heroes when the
battle start. So check their owners before and after the battle (who has lost will have a different one after the
battle :-)
And I let you ability to set or check the battle location.
Just use P command with *get* syntax: !!BA:P?v100/?v200/?v300;
Note: checking the location after a battle won't work because the hero moves (vanishes) from the location after the end of battle check is all done. Same with monsters -- they vanish only after it has completed. So the easiest way to do it seems to be to check the current hero's owner -- if it's -1 then the hero has lost the battle.