Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: WoG battle guide for Dummies
Thread: WoG battle guide for Dummies This thread is 3 pages long: 1 2 3 · NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 24, 2009 08:02 AM bonus applied by angelito on 25 Mar 2009.
Edited by Salamandre at 16:42, 24 Mar 2009.

WoG battle guide for Dummies

All among us had one day a memorable battle against an human or a computer opponent. Crazy stories and startling screens have circulated since, making dream all those who have not had this chance.
Of course, the battles such as those found in Heroes may be epic.

So, why WoG claims to add something useful here?

ERM explains us the bases in detail or almost. But gives no example, and without example, the road of the dummy may be long, tortuous and strewn with crashes and nasty surprises.  Since WoG in general can be
approached in-depth only by accustomed data-processing languages, those last were attracted much by other interesting details, while the hardcore players being eager of  epic battles were left on their hunger.

This was my case for a long time. But, after testing endless and seek solutions, the sky is much more enlightened now, and some things start to concretize.

Yes, WoG is splendid, because one can create stories with varied, grotesques, insane and unforgettable situations. But why inside a battle could not one also imagine a whole story, with its bounces and surprises?

With customized messages, images, creatures coming to lend a hand, creatures fleeing and being dismissed, magical created obstacles,activated and deactivated spells,
and all this being able to tangle up like a whole and create a new universe there where no one was accustomed to see it.



Triggers and receivers:(!? and !!)

Trigger:  Whenever a player activates a  trigger, it causes some actions on one or more receivers. A trigger can be an event, object or hero that a hero visits. It is usually represented by !? and until another trigger occurs, all the actions (receivers) scripted between will follow each other.

Receiver: Receivers are ERM codes that affect heroes, objects, events, timers, functions, messages or game settings. Receivers are placed in timed events on lines following after a trigger that serves as a header.

They can be represented by  !! .

WoG custom Battles guide for Dummies

Read the following only if you are curious how it works. If want only the result and start to test your self, go at the end where the examples are done.

I will explain in this guide what you can do (basic commands, as for the others, you will need to bang your head on the monitor for months) to enhance your battle experience. For this I will script and explain what can be done when two heroes meet and fight.

Battle related triggers:

!?BA#; This will be called when any battle occurs.
# = 0 Turn on at start of every battle.
# = 1 Turn on at end of every battle.

!?BF;  This will be called when a battlefield is prepared for a battle prior to the combat beginning.

!?BG; This combat trigger occurs at every action taken by any stack or by the hero  (for spell casting, retreating and surrendering).

!?BR;  This trigger occurs every turn of a battle (for the first turn it occurs twice).
Variable v997 keeps the number of the current turn:
 -1 - start turn (before Tactics phase)
  0 - start turn (after Tactics phase)
  1 - second turn
  2 - third turn

Battle related receivers:

!!BF:XXXX; Sets up a battlefield with custom placement of obstacles.

!!BG:XXXX; During combat, you may check/set/get parameters on actions taken by a monster stack. These receivers may be used/called only in the !?BG trigger section

!!BH#:XXXX;  During combat, you may check/set/get parameters on the action taken by a hero. To be used only in the !?BG and !?BR trigger section

!!BM#:XXXX;  You may check/set/get some parameters of a stack of monsters during combat (!?BR trigger)

!!BU:XXXX; During combat, you may check/set/get parameters on taken actions. These receivers may be used/called only in !?BG(!?BR) trigger section.

Starting:

-note: you will need ERM help available to be able to identify and choose your self the different obstacles, spells, creatures and actions. All have their ID.

First we need to tell WoG that Vlaad and Salamandre will fight to the death. If we don't script this, your nicely scripted battle will occur in ALL battles on your custom map. Basically, the script have to activated only when Vlaad and Salamandre fight, and stop right after Vlaad is dead. (how could he win?)

Salamandre choosed Crag Hack
Vlaad choosed Tazar

!?BA0&1000;  **when a battle starts (BA0) and flagged as real battle (flag 1000)
!!BA:H0/?y-95; store ID of the attacker (H0) in variable -y95
!!BA:H1/?y-93; store ID of the defender (H1) in variable -y93
!!IF&y-95=102:V85/1; **If Crag Hack is attacker (Crag ID =102), set flag 85 to true (1). After the battle we will reset the flag 85 to false so the customized battle will not occur elsewhere.


Now the battle prepare to start. For instance we will customize the battle field with a few obstacles. (!!BF receiver)
!?BF&85;  The flag 85 was assigned to this battle and will be reset once the battle ends
!!BF:C; **since we want to customize OUR battlefield, this command will remove any random obstacles Heroes come with when starting any battle.



The battlefield is now clean and you can see the some numbers which will help you to figure out where to place your obstacle.

For now I will place several obstacles and create 2 battlefields in one.

You can find the number of the obstacles available in ERM.
This is done by the command:
!!BF:O#/$; where # is the type of the obstacle and $ is the position (figure yourself where to place using the numbers I placed)

As we are on grass, I will choose lucid rocks (ID=75) and add 2 crosses to impress you:
!!BF:O75/5 O75/10 O75/23 O75/27 O75/40 O75/43;
!!BF:O75/58 O75/60 O75/75 O75/76 O75/109 O75/110;
!!BF:O75/126 O75/128 O75/142 O75/145 O75/159 O75/163;
!!BF:O75/175 O75/180 O63/25 O63/161;

You notice that you can script several objects on the same line before ending with ";". Don't try more than you see here.



I tested this battle in hotseat and I suggest you do same, because it is better to control the AI opponent while testing.

Now that the battlefield is customized, we can add a message to popup on first turn or later.

Adding customized messages:

This is done by the command:

!?BR&85/v997=1; **flag 85 has to be again set to true, flag 997 shows that we have a local battle, 1 means turn 1.
!!IF:M^Type here the message you want to display on first turn^;

This message can be customized regardless your ERM skills. As it is here it will only display text. But you can add full pics, animations, whatever you want.

The same is valable for turns 2 and later, just change =1 to =X where X=the turn when you want your message to be displayed.

Adding creatures on the battlefield:

This is done by the command

!!BU&v997:S#1/#2/#3/#4/#5/#6;

and it must follow a !?BR=x trigger

S#1/#2/#3/#4/#5/#6;   Summon a stack of monster on a battle field.
  #1 - Type of monster (See Format C)
  #2 - Number of monsters
  #3 - Position
  #4 - Side (0=left or 1=right) of owner **be careful with this, 0 for left player, 1 for right player
  #5 - Hero's slot number (-1 -no slot)
  #6 - Redraw (1) or not (0)
Restrictions:
1. It must be correct position number
2. It must be free of other monsters and obstacles position.
3. There may be no more than 20 stacks on each side.

I will add some creatures on both sides with a customized message (better for a realistic story)

!?BR&85/v997=2; **on turn 2
!!IF:M^Angelito sent archers to help Vlaad^;
!!BU&v997=2:S170/400/61/1/-1/1; **on right side, they will fight for Vlaad
!!BU&v997=2:S170/400/78/1/-1/1;
!!BU&v997=2:S170/400/96/1/-1/1;
!!BU&v997=2:S170/400/112/1/-1/1;
!!BU&v997=2:S170/400/129/1/-1/1;
!!IF:M^Pacifist send even more^;
!!BU&v997=2:S170/400/61/1/-1/1;  **on left side, they will fight for Salamandre
!!BU&v997=2:S171/600/125/0/-1/1;
!!BU&v997=2:S171/600/107/0/-1/1;
!!BU&v997=2:S171/600/90/0/-1/1;
!!BU&v997=2:S171/600/73/0/-1/1;
!!BU&v997=2:S171/600/57/0/-1/1;




Removing obstacles:

This is done by

!!BM#:XXXX;

C#1/#2/#3/#4/#5;   Cast a spell
  #1 - spell number (Format SP)
  #2 - position to cast
  #3 - Monster skill level (0...3)
  #4 - Hero (???) Spell power (0...3)
  #5 - Check 4 Target Monster existing (alive)

In my example "remove obstacle" will be cast on turn 3:

!?BR&85/v997=3; **on turn 3
!!BM&v997=3:C64/24/3/3/0;  **remove obstacle ID=64, position will be 24 and 160 because we need to remove those awful looking cross
!!BM&v997=3:C64/160/3/3/0;

As now there is more space available, we can return to previous commands and summon even more creatures:
!!BU&v997=3:S146/1/30/1/-1/1; **summon 2 artileries for Vlaad
!!BU&v997=3:S146/1/166/1/-1/1;
!!BU&v997=3:S145/1/98/1/-1/1;
!!BU&v997=3:S132/777/25/1/-1/1; **summon azures
!!BU&v997=3:S153/55/64/1/-1/1; **summon antichrists
!!BU&v997=3:S153/55/132/1/-1/1; **summon antichrist
!!BU&v997=3:S158/1000/12/1/-1/1;  **summon phoenix
!!BU&v997=3:S158/1000/182/1/-1/1;

!!BU&v997=3:S146/1/20/0/-1/1;** same for Salamandre
!!BU&v997=3:S146/1/156/0/-1/1;
!!BU&v997=3:S132/777/160/0/-1/1; **summon azures
!!BU&v997=3:S145/1/88/0/-1/1;
!!BU&v997=3:S150/77/54/0/-1/1;
!!BU&v997=3:S150/77/122/0/-1/1;
!!BU&v997=3:S158/1000/3/0/-1/1;
!!BU&v997=3:S158/1000/173/0/-1/1;

Casting various spells with creatures

The same command as for "removing obstacle" but one difference: you must say WHICH creature is casting the spell.

Attacker creatures are numbered from 0 to 20.
Defender from 21 to 41.


I will cast force field by the second creature from each side, means 1 and 22. Of course you have to specify the position to cast:

!!BM1&v997=3:C12/111/3/3/0; **cast force field expert on turn 3 for Salamandre
!!BM22&v997=3:C12/108/3/3/0; **cast force field expert on turn 3 for Vlaad
Having 20 possible stacks on the battle field, you can cast up to 20 spells each rounds using this command.



Enchant creatures with spells:

It is done with receiver !!BM after !?BR trigger and has to include in the command the NUMBER of the creature, for identifying if it is on attacker side or defender side:

!!BM21&v997>=1:M41/999/3;  **21= first defender creature, use starting with 0 for attacker
!!BM22&v997>=1:M41/999/3; **Bless ID=41, 999 rounds, expert =3, round 1.
!!BM23&v997>=1:M41/999/3;
!!BM24&v997>=1:M41/999/3;
!!BM25&v997>=1:M41/999/3;
!!BM26&v997>=1:M41/999/3;
!!BM27&v997>=1:M41/999/3;

Here is an example of enchanting defender first 6 slots  with Bless for 999 rounds.

This can be done easier with !!DO command but requires more advanced ERM skill. If not comfortable with DO, just use as above.


If you know some basic commands, you can change anything, at any time:

1) Creature stats
2) Heroes stats and morale/luck
3) Heroes spells (also give magic book and remove it as well)
4) Force the creatures to move to a specified location or take a specified action
5) Inflict magical damage to any creature


And much more...

Ending the battle:

A simple command:

!?BA1&85/1000; **was BA0 at start, it is BA1 at the end
!!IF:V85/0;  **reset the flag 85 to false (means it worked ONLY for this battle and will not occur anymore)

The script: custom battle between Crag Hack(attacker) and Tazar (defender)



ZVSE

!?BA0&1000;  **when a battle starts (BA0) and flagged as real battle (flag 1000)
!!BA:H0/?y-95; store ID of the attacker (H0) in variable -y95
!!BA:H1/?y-93; store ID of the defender (H1) in variable -y93
!!IF&y-95=102:V85/1;**If Crag Hack is attacker (Crag ID =102)

!?BF&85;
!!BF:C;  **clear battle field
!!BF:O75/5 O75/10 O75/23 O75/27 O75/40 O75/43; **place obstacles
!!BF:O75/58 O75/60 O75/75 O75/76 O75/109 O75/110;
!!BF:O75/126 O75/128 O75/142 O75/145 O75/159 O75/163;
!!BF:O75/175 O75/180 O63/24 O63/160;

!?BR&85/v997=2; **on turn 2
!!IF:M^Angelito sent archers to help Vlaad^;
!!BU&v997=2:S170/400/61/1/-1/1; **on right side, they will fight for Vlaad
!!BU&v997=2:S170/400/78/1/-1/1;
!!BU&v997=2:S170/400/96/1/-1/1;
!!BU&v997=2:S170/400/112/1/-1/1;
!!BU&v997=2:S170/400/129/1/-1/1;
!!IF:M^Pacifist send even more^;
!!BU&v997=2:S170/400/61/1/-1/1;  **on left side, they will fight for Salamandre
!!BU&v997=2:S171/600/125/0/-1/1;
!!BU&v997=2:S171/600/107/0/-1/1;
!!BU&v997=2:S171/600/90/0/-1/1;
!!BU&v997=2:S171/600/73/0/-1/1;
!!BU&v997=2:S171/600/57/0/-1/1;

!?BR&85/v997=3; **on turn 3
!!BM&v997=3:C64/24/3/3/0;  **remove obstacle ID=64, position will be 73 and 57 because we need to remove those awful looking cross
!!BM&v997=3:C64/160/3/3/0;

!!BM1&v997=3:C12/111/3/3/0; **cast force field expert on turn 3
!!BM22&v997=3:C12/108/3/3/0; **cast force field expert on turn 3

!!BU&v997=3:S146/1/30/1/-1/1; **summon 2 artileries for Vlaad
!!BU&v997=3:S146/1/166/1/-1/1;
!!BU&v997=3:S145/1/98/1/-1/1;
!!BU&v997=3:S132/777/25/1/-1/1; **summon azures
!!BU&v997=3:S153/55/64/1/-1/1; **summon antichrists
!!BU&v997=3:S153/55/132/1/-1/1; **summon antichrist
!!BU&v997=3:S158/1000/12/1/-1/1;  **summon phoenix
!!BU&v997=3:S158/1000/182/1/-1/1;

!!BU&v997=3:S146/1/20/0/-1/1;** same for Salamandre
!!BU&v997=3:S146/1/156/0/-1/1;
!!BU&v997=3:S132/777/160/0/-1/1; **summon azures
!!BU&v997=3:S145/1/88/0/-1/1;
!!BU&v997=3:S150/77/54/0/-1/1;
!!BU&v997=3:S150/77/122/0/-1/1;
!!BU&v997=3:S158/1000/3/0/-1/1;
!!BU&v997=3:S158/1000/173/0/-1/1;

!?BA1&85/1000; **was BA0 at start, it is BA1 at the end
!!IF:V85/0;  **reset the flag 85 to false (means it worked ONLY for this battle and will not occur anymore)



____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
SAG
SAG


Promising
Supreme Hero
WCL owner
posted March 24, 2009 08:31 AM

I wish to make more easy troop arrangement during Tactics phase. I would like to give focus to creature by ALT+click on selected creature. Can you please help with code? Thanks in advance

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 24, 2009 03:21 PM

Sag, I don't understand what you want to do. Can explain more please?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
angelito
angelito


Honorable
Undefeatable Hero
proud father of a princess
posted March 24, 2009 03:33 PM

I guess he is talking about the strict order which determines the turn of each creature during the tactics phase.

It would be easier if you could just "click" on 1 creature and then click on the hex you want it to be placed.

Currently you have to click "next" every time until the creature you want to place has its "turn"
____________
Better judged by 12 than carried by 6.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Nostrazugus
Nostrazugus


Hired Hero
French guy who learn
posted March 24, 2009 03:44 PM

It is just an idea, no request to do it for me, but, I was thinking about making a script like hero moral modifier during fights. You were talking about moral/luck modifier in this thread, so I will expose you what I was thinking about it.

What about a script that made your moral grow when one of your creature kill a stack of lvl7 or any upper lvl creature ?

Do you think I can make it with ERM ? Doesn't it appear a bit imbalanced ?
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 24, 2009 04:17 PM
Edited by Salamandre at 16:19, 24 Mar 2009.

Yes, it can be done, but you have to check every turn of the battle the type of monster in each slot, check if it is alive/dead and give +1 morale if it is dead. Thats means about 3 lines of code for each stack and every turn. If the battle is long, you may end with thousand lines for not that much of boosting.

Flaws:

Inbalanced for necro
What happens if the player keep ressurecting his high level stacks and you kill them again and again?

@Sag: I will look into ERM, but may be beyond my skills. I guess you already asked for it in russian WoG forums, and if they could not do it...but deserves a search.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Nostrazugus
Nostrazugus


Hired Hero
French guy who learn
posted March 24, 2009 05:04 PM

Ok, so the idea sounds well, but what you said to me is that means too much work for the result.

I didn't know anything about the mechanics that I had to use, that's why I asked. Thanks for the answer.

About necro, I thought they have a lot of bonuses able to balance the no morale ability even with the use of this kind of script. I also thought about increasing luck, but why killing superbeast make you lucky ? So, consider it prety much dead
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pacifist
pacifist


Famous Hero
posted March 25, 2009 11:51 AM

The idea is good. It was implemented in Heroes 4 but in this version there are more levels of morale and it works differently (speed of action). The conditions of morale modifiers there were based on % of total army killed. Maybe if the WoG team is able to change the way morale and luck function (seems taken into consideration) the idea will be more interesting and worth to implement .
____________
http://www.youtube.com/user/alkoriak#g/u

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
sagamosa
sagamosa


Hired Hero
posted March 25, 2009 12:54 PM

re: adding morale to stacks
It can be done i think much more efficently in quite few lines of code using some loop functions. could be imbalanced for necro, but necro creatures/heroes could be taken out of the loop, that's not a problem. Necro isn't supposed to get morale bonuses, would make sence anyway.

re: SAG and changing battle arrangements during tactics.
I would say iyt could be done with stack flags, waiting and done acting appropriate stacks, I did something like that when preparing my anticipation script, where retaliation goes even before stack's attack action, waiting attacking stack and then bringing it to action again after opposing stack retaliation.
however it's quite complicated and for me the effect is not worth the time invested.

____________
Sagamosa
Advanced Levels

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Nostrazugus
Nostrazugus


Hired Hero
French guy who learn
posted March 25, 2009 02:44 PM

I think that if I make the script, which doesn't seems than easy for a ERM beginner, I will apply moral modifier only on heroes, necro ones too. In this case, moral modifier are applied on creature stacks, if it has to. Necro or any unaffected by moral creatures will not have moral bonuses.

I was thinking about such a script because when I play some maps, there is a lot of neutrals that may be interesting to play with. I often get an hero whom army is build from two or three factions and he doesn't always have the luck of getting moral artifacts ( even the spirit of oppression ) or the leadership skill.

I didn't know how the moral worked on H4. But here, I got a question to know if this is so imba versus necro. In fact, ghost dragons give -1 and blood ones -2 to moral modifier. Does this modifier still work until end of fight or just until they are killed ? I have never paid attention to it.
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pacifist
pacifist


Famous Hero
posted March 25, 2009 02:53 PM

The modifier is active until the end of fight, just as the bonus of archmagi or malus of pegasus for example (concerning spell points costs). Also, if you have 3 stacks of different alignments you have -1 morale but one of the stack killed doesn't do anything to rebalance the moral .
____________
http://www.youtube.com/user/alkoriak#g/u

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Nostrazugus
Nostrazugus


Hired Hero
French guy who learn
posted March 25, 2009 03:29 PM

Ok, it sounds more interesting to make this script, even if it require time to learn how to do, and do good.
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
doom3d
doom3d


Known Hero
Avatar of general Z
posted March 25, 2009 06:46 PM

Just a short remark. Yes, BR trigger comes twice for round 1.
And the game will crash, if you try to use BU:M during the first one.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 25, 2009 08:38 PM
Edited by Salamandre at 09:36, 26 Mar 2009.

Yes, many commands do not work if used on turn 0. They will make the game crash or slow a lot the beginning of the battle. Creatures should be summoned starting with !?BR=1. Also for applying damage spells with !!BM:K;

I did not tested what happens if the human has tactics and the commands are scripted in round 0.

Good that Doom and Sagamosa visit here, maybe they could help me:

I need summoned creatures (with !!BU:S) to be kept in heros army after battle (with casualties enabled)

So far, I tried with:

!!BM#

O$;   Number of a (hero's) army slot (0...6,-1)
Comments:
If O$ sets to -1, the stack will not appear in (hero's) army after the battle (summoned creatures).

If O$ sets to -1, the stack will not appear in (hero's) army
after the battle (summoned creatures).

but did not get any result visible. Any idea?

Adding custom sound in battle:

Use always !!IF:M^message^; right after adding sound, as the custom message will end the original battle sound. If not !!IF:M  your sound will not be triggered because there is already a sound playing.

____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
sagamosa
sagamosa


Hired Hero
posted March 26, 2009 10:14 AM

you can do that with a command you use - !!BU:S.
If you set a hero slot to other than -1 in that command, the stack stays even after battle, with correct battle losses. Just don't forget to check, there's a free slot for the new army

or you can work around that and save the stack type and final number before battle ends (!!BU:C) and give it back to hero in BA1 trigger and maybe use the adding army manually dialogue in !!HE:C2.

[copied from ERM help]
!!BU:S#1/#2/#3/#4/#5/#6; Summon a stack of monster on a battle field.
  #1 - Type of monster (See Format C)
  #2 - Number of monsters
  #3 - Position
  #4 - Side (0=left or 1=right) of owner
  #5 - Hero's slot number (-1 -no slot)
  #6 - Redraw (1) or not (0)

____________
Sagamosa
Advanced Levels

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 26, 2009 10:22 AM
Edited by Salamandre at 10:26, 26 Mar 2009.

Thanks. But my problem is that I can not know if the players starts the battle with all 7 slots already occupied or not. Thats my dilemma.

My latest attempt was to store the summoned creatures into a variable before the battle, and then add the variable at the end with !!HE:C2. But it adds the initial number and ignores if any casualties occurred in the battle.

So I will try your second option and save them before the battle ends. But how to know what slot they are? It depends of the player choice to start the battle with 1-7 slots full...do a loop on 21-41 and see where they are? (hero is defender)
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
sagamosa
sagamosa


Hired Hero
posted March 26, 2009 11:43 AM
Edited by sagamosa at 11:44, 26 Mar 2009.

Quote:
Thanks. But my problem is that I can not know if the players starts the battle with all 7 slots already occupied or not. Thats my dilemma.


you can check which slots are used by using !!BA:M command.
but have you tried? may the game engine automatically uses the add army menu after battle when having more then 7 stacks, it's quite possible.

Quote:

My latest attempt was to store the summoned creatures into a variable before the battle, and then add the variable at the end with !!HE:C2. But it adds the initial number and ignores if any casualties occurred in the battle.

So I will try your second option and save them before the battle ends. But how to know what slot they are? It depends of the player choice to start the battle with 1-7 slots full...do a loop on 21-41 and see where they are? (hero is defender)


i don;t really see the problem, but let's suppose we do it this way:

you summon 13 swordsman on round 2 for defender on position =92. Those swordsman won't stay with hero after battle
!!BU:S6/92/1/-1/1;

let's set a unique summon stack recognition variable for swordsman straight after summon, e.g. v100=6 [swordsman = 6 in C format)
also set a summon stack number variable now, e.g.
!!BU:E92/?v101;

then

!?BG0; before action is taken
!!BU:C?y-1;  battle ends now?
!!FU&y-1<>1:E; continue only for battle end
!!BMv101:N?v102; current number of swordsman to v102

!?BA1; after battle trigger

check if hero is still alive?
if yes
add back creature in v100 in number v102.
end




____________
Sagamosa
Advanced Levels

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ayreon
Ayreon


Famous Hero
posted March 26, 2009 12:54 PM

I took my time in reading and using the tutorial. Thanks a lot, Salamandre. It is very helpful

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 27, 2009 04:38 AM

thanks Sagamosa, I came up with a slightly different option, as I needed the creatures to keep battle experience.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ayreon
Ayreon


Famous Hero
posted April 26, 2009 08:17 PM

Quote:
!?BA0&1000;  **when a battle starts (BA0) and flagged as real battle (flag 1000)
!!BA:H0/?y-95; store ID of the attacker (H0) in variable -y95
!!BA:H1/?y-93; store ID of the defender (H1) in variable -y93
!!IF&y-95=102:V85/1; **If Crag Hack is attacker (Crag ID =102), set flag 85 to true (1). After the battle we will reset the flag 85 to false so the customized battle will not occur elsewhere.



But how can you be sure that this occurs in the battle against this particular defender?
My battle occurs everywhere where the attacker is the same hero.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 3 pages long: 1 2 3 · NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0983 seconds