|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted July 27, 2013 03:47 PM |
|
|
Not good idea, as SN:W^slot^ can't store both armies data after battle, so one of variable will be wrong. To have it work properly if both attacker and defender have dragons, you must store in BA/BG their heroes ID, battle side and slots respectively. Of course, the casualties will show dendroids, because this is what they are when they die.
Such scripts can get quite long if you want them to work in all situations. And then what happens if one of heroes surrender while script is not closed, no idea.
|
|
Felipe

 
  
Known Hero
Editing Heroes Without Limits
|
posted July 27, 2013 04:58 PM |
|
|
The trigger MF1 happens before the stack is killed and the battle end. So I used some ideas of sagamosa. I am trying to give the bind ability to my new creature the Dryad number 231.
It works. The battle result is ok.
!?BA0; adding bind ability
!!IF:V87/0; just in case
!!SN:W^dryad^/231; [store crystal dragons ID]
!?BG0;
!!BG:A?v1;
!!FU&v1<>6:E; exit if not a hit
!!BG:N?v87; (N pega numero do stack)
!!FU|v87<0/v87>41:E; just in case
!!BMv87:T?v9601; (pegar numero do monstro no v9602)
!!FU&v9601<>231:E; exit if not driade
!!BMv87:T23; change to Dendroid Solder
!!BMv87 ?y2; [Check slot]
!!SN:W^slot^/y2; [store slot]
!!IF:V87/1; (set flag v87 para 1)
!?MF1&87; before stack taking physical damage
!!IF:M^MF1^;
!!MF:F?y-1; damage dealt?
!!MF:N?y-2; stack #?
!!VRy-10&y-2<21:S0; !!VRy-10&y-2>=21:S1; current attacked side
!!MF:N?y-2; stack #?
!!BMy-2:H?y-3 N?y-14 L?y-5; HP/ number of creatures/ HP left by next monster in stack
!!VRy-50:Sy-3 -y-5; HP left in first creature in stack
!!VRy-14:-1; decrease creature count and replace its HP by y-50(representing HP left for the next moster in stack)
!!VRy-6:Sy-14 *y-3 +y-50; total HP pool of the stack
!!FU&y-1<y-6:E; end code if stack is not killed by this attack
!!VRv100:S0; clear recognition variable
!!DO327952/0/20/1&y-10=0 y-2; loop through all stacks on field and find if all dead [if there are any HP left]
!!DO327952/21/41/1&y-10=1 y-2;
!!FU&v100<>0:E; exit if not the last creature
!!BMv87:T231;
!?BG1&87; (se v87 tiver flag 1)
!!IF:M^VC ativou BG1^;
!!BMv87:T231;
!!IF:V87/0;
!?FU327952;
!!BMx16:N?y-1 T?y-2; number of creatures in this stack? [if >0, not all units are dead, guardian angel not activated
!!FU&y-1<=0:E; end code if stack is dead [living creatures =0]
!!VRy-5|y-2=145/y-2=146/y-2=147/y-2=148/y-2=149/y-2=160/y-2=161/y-2=162/y-2=163:S10;
!!FU&y-5=10:E; end code if only creature left are immovable creatures (ammo cart, ballista, emmissaries)
!!FU&x16=x1:E; end code if loop is on currently attacked creature [don't calculate]
!!VRv100:+y-1; add up all living stack units
* end
|
|
Felipe

 
  
Known Hero
Editing Heroes Without Limits
|
posted July 27, 2013 05:03 PM |
|
|
Sorry, the code was not "clean" yet.
The final form:
!?BA0; adding bind ability
!!IF:V87/0; just in case
!?BG0;
!!BG:A?v1;
!!FU&v1<>6:E; exit if not a hit
!!BG:N?v87; (N pega numero do stack)
!!FU|v87<0/v87>41:E; just in case
!!BMv87:T?y1; (pegar numero do monstro no v9602)
!!FU&y1<>231:E; exit if not driade
!!BMv87:T23; change to Dendroid Solder
!!IF:V87/1; (set flag v87 para 1)
!?MF1&87; before stack taking physical damage
!!MF:F?y-1; damage dealt?
!!MF:N?y-2; stack #?
!!VRy-10&y-2<21:S0; !!VRy-10&y-2>=21:S1; current attacked side
!!MF:N?y-2; stack #?
!!BMy-2:H?y-3 N?y-14 L?y-5; HP/ number of creatures/ HP left by next monster in stack
!!VRy-50:Sy-3 -y-5; HP left in first creature in stack
!!VRy-14:-1; decrease creature count and replace its HP by y-50(representing HP left for the next moster in stack)
!!VRy-6:Sy-14 *y-3 +y-50; total HP pool of the stack
!!FU&y-1<y-6:E; end code if stack is not killed by this attack
!!VRv100:S0; clear recognition variable
!!DO327952/0/20/1&y-10=0 y-2; loop through all stacks on field and find if all dead [if there are any HP left]
!!DO327952/21/41/1&y-10=1 y-2;
!!FU&v100<>0:E; exit if not last creature
!!BMv87:T231;
!!IF:V87/0;
!?BG1&87; (se v87 tiver flag 1)
!!BMv87:T231;
!!IF:V87/0;
----------------------------------------------------------------------
!?FU327952;
!!BMx16:N?y-1 T?y-2; number of creatures in this stack? [if >0, not all units are dead, guardian angel not activated
!!FU&y-1<=0:E; end code if stack is dead [living creatures =0]
!!VRy-5|y-2=145/y-2=146/y-2=147/y-2=148/y-2=149/y-2=160/y-2=161/y-2=162/y-2=163:S10;
!!FU&y-5=10:E; end code if only creature left are immovable creatures (ammo cart, ballista, emmissaries)
!!FU&x16=x1:E; end code if loop is on currently attacked creature [don't calculate]
!!VRv100:+y-1; add up all living stack units
* end
|
|
SteroidCro

 
Tavern Dweller
|
posted August 25, 2013 08:33 PM |
|
|
What if I disabled the Stack Exp. Option?
You said that WoG has 11 levels of exp. for creatures.
But can i still add this abilities to creatures if i disable the Stack Exp.?
|
|
Hero_Of_Light

   
    
Responsible
Supreme Hero
|
posted August 25, 2013 11:35 PM |
|
|
Is there a way to use these commands and add simple traits like attack, defense and health bonus? I am asking because when it comes to the (originally) 4 unused Heroes III creatures (122, 124, 126, 128) the stack experience doesn't work and it needs scripting. So, I was wondering If I could script these bonuses as well.
____________
Not idly do the leaves of Lorien fall.
|
|
SteroidCro

 
Tavern Dweller
|
posted August 26, 2013 12:19 PM |
|
|
Hero_Of_Light said: Is there a way to use these commands and add simple traits like attack, defense and health bonus? I am asking because when it comes to the (originally) 4 unused Heroes III creatures (122, 124, 126, 128) the stack experience doesn't work and it needs scripting. So, I was wondering If I could script these bonuses as well.
Yeah but i was wandaering how to edit creature traits such as double strike or no retal and size of the creature w/o the usage of stack exp. If you look at the scripts of WoGs creatures that are modified they are all modified to gain spells by levels so how to use those scripts in order to change creature traits and add new w/o the stack levelling up?
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted August 26, 2013 12:28 PM |
|
|
|
Hero_Of_Light

   
    
Responsible
Supreme Hero
|
posted August 26, 2013 12:56 PM |
|
|
I don't see how battle flags will help with my problem. As I said the 4 unused Conflux creatures need to have their stack experience fixed through erm (and not my the crexbon.txt). What I need is EA commands to set speed bonuses, attack bonuses etc.
____________
Not idly do the leaves of Lorien fall.
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted August 26, 2013 07:11 PM |
|
|
My answer was to Steroid. For your problem I have no clue, if they are unused, they are unused until now, you have to improvise.
|
|
bloodsucker

 
     
Legendary Hero
|
posted October 09, 2014 12:31 AM |
|
|
Is it possible to make a creature cast a spell instead of attack, like Master Genies, Archangels or Ogre Magi? If not, can we change the spell they cast?
I imagine that at least part of the habilities creatures gain with ranks are hard coded cause "Creatures Stack Experience" is Slava's work but how can I find out what is and what is not?
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted October 09, 2014 04:19 AM |
|
|
Short answer: No.
Long answer and only for experimented users: yes up to some point, use BM:E and BM:U4 to see what is possible. Don't forget that casting spell requires a specific animation too, if the creature don't have it, game will crash.
____________
Era II mods and utilities
|
|
bloodsucker

 
     
Legendary Hero
|
posted October 09, 2014 05:02 AM |
|
|
THANK YOU!!! I will became an experimented user one day...
Is it possible to give mass spell (efreets, gargoyles) or was hardcoded?
Reading things word by word is a better police then one may think...
To have the habilities replaced first clean the defitions with:
!!EA37:B5/0/////////////;
!!EA37:B6/0/////////////;
!!EA37:B7/0/////////////;
!!EA37:B8/0/////////////;
!!EA37:B9/0/////////////;
!!EA37:B10/0/////////////;
!!EA37:B11/0/////////////;
!!EA37:B12/0/////////////;

|
|
bloodsucker

 
     
Legendary Hero
|
posted October 09, 2014 05:41 PM |
|
|
bloodsucker said: Is it possible to give mass spell (efreets, gargoyles) or was hardcoded?
Yes, is just put a 4
!!EA136:B10/1/115/48/0/0/1/1/1/2/2/2/3/3/4;
Oh God!!! Poor victims 
Tell me what you think of these?
ZVSE
!?OB63/67&1000;
!!FU&v1=1:E;
!!IF:Q1^I can greatly improve your units, are u interested?^;
!!FU&-1:E;
****Enchanthers def
!!MA:A136/50;
!!MA:D136/50;
!!MA:E136/75;
!!MA:M136/75;
!!MA:P136/150;
!!MA:S136/20;
!!MA:N136/32;
!!EA136:B5/0/////////////;
!!EA136:B6/0/////////////;
!!EA136:B7/0/////////////;
!!EA136:B8/0/////////////;
!!EA136:B9/0/////////////;
!!EA136:B10/0/////////////;
!!EA136:B11/0/////////////;
!!EA136:B12/0/////////////;
!!EA136:B5/1/119/53/0/0/0/0/0/1/1/1/1/1/1; Immunity 5
!!EA136:B6/1/119/112/0/0/0/0/1/1/1/1/1/1/1; Immu Dispel
!!EA136:B7/1/85/37/10/15/20/30/40/50/60/70/90/90/100; Summon MGs
!!EA136:B8/1/75/59/0/10/15/20/25/30/40/50/60/75/100; Berserk
!!EA136:B9/1/115/53/0/1/1/2/2/3/3/4/4/4/4; Haste
!!EA136:B10/1/102/115/0/0/0/0/0/1/1/1/1/1/1; Shoot Close
!!EA136:B11/1/105/61/0/0/0/0/0/1/1/1/1/1/1; Distance
!!EA136:B12/1/115/48/0/0/1/1/1/2/2/2/3/3/4; Prayer
****Master Genies def
!!MA:A37/50;
!!MA:D37/50;
!!MA:E37/75;
!!MA:M37/75;
!!MA:P37/150;
!!MA:S37/20;
!!EA37:B5/0/////////////;
!!EA37:B6/0/////////////;
!!EA37:B7/0/////////////;
!!EA37:B8/0/////////////;
!!EA37:B9/0/////////////;
!!EA37:B10/0/////////////;
!!EA37:B11/0/////////////;
!!EA37:B12/0/////////////;
!!EA37:B5/1/119/53/0/0/0/0/0/1/1/1/1/1/1; Immunity 5
!!EA37:B6/1/119/112/0/0/0/0/1/1/1/1/1/1/1; Immu Dispel
!!EA37:B7/1/98/61/0/5/10/15/20/25/30/35/40/45/50; Red. Def
!!EA37:B8/1/102/98/0/0/0/0/0/1/1/1/1/1/1; Attack and return
!!EA37:B9/1/85/150/25/25/50/75/100/125/150/175/200/225/250; Summom SAs
!!EA37:B10/1/75/59/0/10/15/20/25/30/40/50/60/75/100; Berserk
!!EA37:B11/1/101/61/0/10/20/30/40/50/60/70/80/90/100; Death blow
!!EA37:B12/1/102/99/0/0/0/0/0/1/1/1/1/1/1; champion
**** Supreme Archangls def
!!MA:A150/75;
!!MA:D150/75;
!!MA:E150/200;
!!MA:M150/200;
!!MA:P150/1250;
!!MA:S150/23;
!!EA150:B5/0/////////////;
!!EA150:B6/0/////////////;
!!EA150:B7/0/////////////;
!!EA150:B8/0/////////////;
!!EA150:B9/0/////////////;
!!EA150:B10/0/////////////;
!!EA150:B11/0/////////////;
!!EA150:B12/0/////////////;
!!EA150:B5/1/119/53/0/0/0/0/0/1/1/1/1/1/1; Immunity 5
!!EA150:B6/1/119/112/0/0/0/0/1/1/1/1/1/1/1; Immu Dispel
!!EA150:B7/1/85/12/0/25/50/75/100/125/150/175/200/225/250; Summon Angels
!!EA150:B8/1/102/98/0/0/0/0/0/1/1/1/1/1/2; Attack & Return
!!EA150:B9/1/112/62/0/0/1/1/1/2/2/2/3/3/3; Blind
!!EA150:B10/1/98/61/0/10/15/20/25/30/40/50/60/70/80; Red. Def.
!!EA150:B11/1/74/78/0/0/0/0/0/1/1/1/1/1/1; Dispel Enemy
!!EA150:B12/1/75/59/0/10/15/20/25/30/40/50/60/75/100; Berserk
|
|
Siegfried

 
   
Famous Hero
|
posted October 21, 2014 09:41 AM |
|
|
Hi,
would it be possible to add those extra features to the war machinery? I know they do not get experience, because they are added if the proper "artifact" is equipped. That's no problem. I want to add or alter some functionality for the first aid tent per battle.
As far as i know i can access the BF stacks with !!EA-1 ... !!EA-41 to target a specific BF stack.
So first question: Do these war machines have any EA features already set? And is there a flag/option that let's any creature cast a spell after being attacked? Or at least when retaliating?
I'd like to let the tent cast animate dead instead of heal if used by a hero with necromancy, and to cast resurrection if used by a hero without necromancy but some other skills (not yet specified). Would that be possible?
For the spell after being attacked: I'd like to make living creatures under the control of the frost ring specialist to cast frost ring after being atacked (not before), or before retaliating. I tried it with manual applying damage, but that shows the damage animation one after the other, which does not look that good.
____________
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted October 21, 2014 10:44 AM |
|
|
Try to look in existing mods. For example bers.pack.erm from wog revised gives to gnolls first strike when retaliating, or gives gran elves shoot after moving. Just change the strike/move to cast spell manually. For SN receiver and its parameters, look in era manual (to not confound with SN/sound).
|
|
bloodsucker

 
     
Legendary Hero
|
posted October 21, 2014 10:48 AM |
|
|
Siegfried said:
So first question: Do these war machines have any EA features already set? And is there a flag/option that let's any creature cast a spell after being attacked? Or at least when retaliating?
... and to cast resurrection if used by a hero without necromancy but some other skills (not yet specified). Would that be possible?
I know that Woodmelon coded the catapult for Haart specialty using the EA but the "creature" doesn't gain experience so all habilities are set to work at maximum potence from level 0.
I also know someone already code the resurrection hability to the first aid tend, I even think is one of the options in the Skills page of WoG. Don't remember to see it cast animate dead but probably also.
I believe it is in this fight you can see a tend resurrecting troops but I don't have the time to rewhatch it right now.
https://www.youtube.com/watch?v=4IIS7BQcMtg
|
|
Siegfried

 
   
Famous Hero
|
posted October 25, 2014 03:58 PM |
|
|
First Aid Tent
Hi,
Edit: Git it. Wrong index inf FindStack.
i tried it now, and it does not work. So obviously there is something wrong. Here is the code:
!?BF&1000;
!!BA:H0/?y1; ** y1 = left hero ID
!!if&y1>=0:;
!!HEy1:A2/@First Aid Tent(A)@/d/?y2;
!!if&y2>0:;
!!VRy3:S-1; ** Preset to no spell
!!HEy1:S@Necromancy@/?y8;
!!VRy3&y3<0/y8>0:S@Animate Dead@;
!!HEy1:X?y4/?y5/d/d/d/d/d;
!!VRy3&y3<0/y4=@SpecCreature@/y5=@First Aid Tent@:S@Cure@;
!!VRy3&y3<0/y4=@SpecSecondarySkill@/y5=@First Aid@:S@Cure@;
!!VRy3&y3<0/y4=@SpecSpell@/y5=@Cure@:S@Cure@;
!!VRy3&y3<0/y4=@SpecSpell@/y5=@Resurrection@:S@Resurrection@;
!!HEy1:S@Water Magic@/?y6;
!!VRy3&y3<0/y5>0:S@Cure@;
!!HEy1:S@Earth Magic@/?y7;
!!VRy3&y3<0/y7>0:S@Resurrection@;
!!if&y3>=0:; ** Found something to apply
!!DO@FindStack@/0/20/1:P@First Aid Tent@;
!!if&v2>=0:; ** found tent
!!VRy9:S0-v2-1;
!!EAy9:B5/1/74/y3/1/1/1/1/1/1/1/1/1/1/1;
!!en:;
!!en;
!!en:;
!!EA-1:B5/1/74/37/1/1/1/1/1/1/1/1/1/1/1;
!!en:;
** TODO: defender
!!FU:E;
The second EA line is for debugging only, if anything above went wrong. I have a very similar script with BR trigger that shows me debug messages instead of really applying anything. This script says that first aid tent was found at index 0, and the spell was set to 37 which is cure. That would be correct. But when i try to check the tent for exp abilities there is nothing.
I thought with !!EA-1:... i'd address the first battlefield stack. Is that wrong? Or what index does the first battlefield stack have for the EA receiver?
P.S.: I tried !#EA147:B5/1/74/37/1/1/1/1/1/1/1/1/1/1/1; and that worked. So basically the syntax seems to be correct. So the question reduces to the correct index for first BF stack.
____________
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted October 25, 2014 04:12 PM |
|
|
What value you get for v2 after stacks loop? Also after loop, try debug:
!!BMv2:T?y1; is y1 tent subtype?
|
|
Siegfried

 
   
Famous Hero
|
posted October 25, 2014 04:33 PM |
|
|
Yes, i tried it. And found a bug there. I got the wrong BF index. Now the first aid tent is found, and the ability is applied.
But still it does not cast. Seems that the tent does never "attack". So healing is not an attack.
Is there another possibility to make the tent cast a spell? Like the commander f.ex.
BTW i found another bug in the code above. The line applying the ability should read:
!!EAy9:B5/1/74/y3/100/100/100/100/100/100/100/100/100/100/100;
____________
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted October 25, 2014 04:36 PM |
|
|
There is warfare script where tent casts healing/resurrect. Other than that, I have no idea how could be done differently.
|
|
|