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: ERM help and discussion
Thread: ERM help and discussion This Popular Thread is 407 pages long: 1 50 100 ... 134 135 136 137 138 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Hero_of_Light
Hero_of_Light


Responsible
Supreme Hero
posted February 20, 2012 04:34 PM

Relax, I didn't want to rush you or anything

I just posted my progress so that you wouldn't have to go through the whole script. Since there are no Erm error messages and it works that only leaves the last section of the script to fix.

Again, no hurry
____________
Not idly do the leaves of Lorien fall.

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


Promising
Famous Hero
posted February 20, 2012 04:53 PM
Edited by solitaire345 at 16:55, 20 Feb 2012.

Quote:
Thanks it works. It needs !# (rather than !!) to work i didn't realize.

Huh.. I tested and it worked with !! for me.

Quote:
I would also like to know the scripts that make an artifact cast a spell on your troops or the enemy's troops at the start of the turn. I know that scripts like that already exist in original WOG but i can't find them so if anyone knows how to do it please share.

For instance i want to make an artifact (shield 163) to grand Magic Mirror to your troops.


At battle start check if hero has artifact and if so, apply a spell with BM:C (set duration to something like 999 rounds

Quote:
On the other hand i want to make artifact 164 cast the basilisk's or medusas' stone gaze to the opponent's troops.

If someone knows how to do those things, please share.



I guess you should check if hero has that artifact and then add these abilities with stack experience (I'm not sure if experience lines can be added to separate stacks though)

Quote:
It does have a small bug though. After a battle is won (with a hero wielding the artifact) and if the hero gains a level, the attack-defense-power or knowledge bonus will not apply. Hero will have the stats he had before the battle starts (as if he didn't level up). I'm guessing that the end of battle part needs to be changed a bit. I'll try and work this out but if you have an idea on how to fix it please post.


You need a !?HL trigger to check if hero has shield or sceptre, get type of skill bonus and add it to stored values.
I am almost sure I did something similar to this when I tried to script these artifacts for you (though you may need to change variables to avoid conflicts with other scripts)
____________

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


Responsible
Supreme Hero
posted February 20, 2012 05:33 PM

Yes i found the BM command in the erm help index but how can i make it work for all the creatures? I also found out the number for stone gaze (70) so it should work with the same type of script for the opponent's creatures. I don't think it can be done through creature stack experience though. I am guessing it needs a command that goes through all of your (or opponents creatures) and apply the spell. I think this is the command i need.

!!BM:M#1/#2/#3; Apply a spell to the monster
#1 = number of spell (See Format SP)
#2 = duration in turns
#3 = level of skill (0-no, 1-basic, 2-advanced, 3-expert)

But i don't know how to make it work for each creature. If someone knows how to make this work please help.

As for the !?HL trigger i am guessing you're right but your section of the script needs editing:

!?HL-1; ERM for hero levelling when hero has one of the artifacts equipped
!!HE-1:A2/162/?v2/?v1; Calculate number of sceptres.
!!if&v1>0;
 !!IF:W-1; set current hero for w vars
 !!HL-1:S?v2/-2/-2; get type of skill bonus
 !!if&v2=2;
   !!VRw3:+1;
   !!HE-1:Fd1/0/0/0;
 !!en;
 !!if&v2=3;
   !!VRw4:+1;
   !!HE-1:F0/d1/0/0;
 !!en;
!!en;
!!HE-1:A2/161/?v2/?v1; Calculate number of helms.
!!if&v1>0;
 !!IF:W-1; set current hero for w vars
 !!HL-1:S?v2/-2/-2; get type of skill bonus
 !!if&v2=0;
   !!VRw1:+1;
   !!HE-1:Fd/d/?v1/d;
   !!FU&v1=127:E;
   !!HE-1:F0/0/d1/0;
 !!en;
 !!if&v2=1;
   !!VRw2:+1;
   !!HE-1:Fd/d/d/?v1;
   !!FU&v1=127:E;
   !!HE-1:F0/0/0/d1;
 !!en;
!!en;

You see, since the sceptre interfeers ONLY in battles, when a hero gains a level in the adventure map (picks up a treasure chest etc) there is no problem. The stored variables should apply only when the battle ends. Maybe applying both BA0 and HL?

____________
Not idly do the leaves of Lorien fall.

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


Promising
Famous Hero
posted February 20, 2012 05:59 PM

Quote:
Yes i found the BM command in the erm help index but how can i make it work for all the creatures?
I also found out the number for stone gaze (70) so it should work with the same type of script for the opponent's creatures. I don't think it can be done through creature stack experience though. I am guessing it needs a command that goes through all of your (or opponents creatures) and apply the spell. I think this is the command i need.

!!BM:M#1/#2/#3; Apply a spell to the monster
#1 = number of spell (See Format SP)
#2 = duration in turns
#3 = level of skill (0-no, 1-basic, 2-advanced, 3-expert)

But i don't know how to make it work for each creature. If someone knows how to make this work please help.

Actually it is !!BM#:XXXX;
Make a function with !!BMx16 and loop through all creatures (don't forget to check the owner).

As for stone gaze, the way you said it (or the way I understood it) the script would turn all enemy's creatures to stone, not just the one attacked. I think you should create another function which loops through all stacks, stores last line of special abilities and adds a new one with EAx16:B[linenum+1]/1/97/61/70/70/70/70/70/70/70/70/70/70/70 (just don't forget that stack number for EA must be negative, so the loop must be called by something like !!DO[function number]/-42/0/1)

Quote:
You see, since the sceptre interfeers ONLY in battles, when a hero gains a level in the adventure map (picks up a treasure chest etc) there is no problem. The stored variables should apply only when the battle ends. Maybe applying both BA0 and HL?


You can set some variable to indicate that a battle started and if it's zero, exit HL trigger.
____________

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


Responsible
Supreme Hero
posted February 20, 2012 06:11 PM

I don't really know how to make it loop through owner's creatures... Anyway, i will try and find a script that already does that and use it as a guideline. As for the stone gaze i think you misunderstood. I don't want to give the creatures the stone gaze ability. I actually want to make the opponents creatures inflicted with stone gaze for one turn at the start of the battle. So all of opponent's creatures start "frozen" for the first round (same should apply for adventuring creatures).

As for the HL trigger i'll try it. Salamandre said he would help me so i guess we will find a way to fix the script. I think it is (finally) near to complete.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 06:18 PM
Edited by Salamandre at 18:22, 20 Feb 2012.

There are endless scripts in this thread showing loops through all stacks.

In BA trigger:

1) check if attacker has art
2) check if defender has art
3) set var $ to -1
4) If one or another has art, set var $ to different values (0/1)
5) use a high var for $, as other scripts may change it if low or function local (y)

In BF trigger:

!!DO1234/0/20/1&$=0:P;run attacker stacks
!!DO1234/21/40/1&$=1:P;run defender stacks
-clean $ var (set back to -1)

!?FU1234;
!!BMx16:M36/999/3; apply magic mirror to each stack

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


Responsible
Supreme Hero
posted February 20, 2012 07:17 PM

OK so the two scripts should look something like this right?

***Mirror Shield
!?BF; [Battlefield setup trigger]
!!BH0:N?y-1; [Attacking hero: y-1]
!!BH1:N?y-2; [Defending hero: y-2]
!!HEy-1:A2/163/d/?y2;  [check for artifact attacker]
!!HEy-2&y-2>-1:A2/163/d/?y4;  [check for artifact defender]
!!FU&y2<1/y4<1:E;  [if neither exit]
!!if&y2>0:;     [when the attacker has it]
!!IF:Wy-1;
!!VRv7777:S0;
!!FU5998:Py-1;
!!en:;
!!if&y4>0:;    [when the defender has it]
!!IF:Wy-2;
!!VRv7777:S1;
!!FU5999:Py-2;
!!en:;
!!DO5999/0/20/1&v7777=0:P;run attacker stacks
!!DO5998/21/40/1&v7777=1:P;run defender stacks
!!VRv7777:S-1;
!?FU5999;
!!BMx16:M36/999/3; apply magic mirror to each stack
!?FU5998;
!!BMx16:M36/999/3; apply magic mirror to each stack


***Medusa's Head Shield
!#UN:A164/2/5; wielded in the left hand
!?BF; [Battlefield setup trigger]
!!BH0:N?y-1; [Attacking hero: y-1]
!!BH1:N?y-2; [Defending hero: y-2]
!!HEy-1:A2/164/d/?y2;  [check for artifact attacker]
!!HEy-2&y-2>-1:A2/164/d/?y4;  [check for artifact defender]
!!FU&y2<1/y4<1:E;  [if neither exit]
!!if&y2>0:;     [when the attacker has it]
!!IF:Wy-1;
!!VRv7777:S0;
!!FU5996:Py-1;
!!en:;
!!if&y4>0:;
!!IF:Wy-2;
!!VRv7777:S1;
!!FU5997:Py-2;
!!en:;
!!DO5997/0/20/1&v7777=1:P;run attacker stacks
!!DO5996/21/40/1&v7777=0:P;run defender stacks
!!VRv7777:S-1;
!?FU5997;
!!BMx16:M70/1/3; apply magic mirror to each stack
!?FU5996;
!!BMx16:M70/1/3; apply magic mirror to each stack

They work when the hero wields any of the artifacts but when any other hero attacks his or her creatures are afflicted by stone gaze. Somehow the script doesn't work JUST for the heroes that wield the artifacts. What do i do wrong?
____________
Not idly do the leaves of Lorien fall.

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


Promising
Famous Hero
posted February 20, 2012 07:59 PM

No need to have two functions for applying spells. variable x16 is cycle counter, which is automatically set by DO receiver. Also I don't understand why do you call one of the functions that apply spells before knowing which side has the artifact and why do you call it with parameters (hero ID) if they do not use them. And why are there IF:W command if you don't use w vars?

By the way: did you consider a case when both sides have artifact that turns enemy creatures to stone?
____________

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 08:04 PM
Edited by Salamandre at 20:28, 20 Feb 2012.

I would still use checks for artefacts in BA trigger, then do battle stacks changes in BF. And of course, unite both artefacts in same BF trigger.

I think that's all it needs, now it checks if both have artefact in same battle:

***Mirror Shield and Stone hell
!?BA0&1000; [Battlefield setup trigger]
!!BA:H0/?y-1 H1/?y-2;
!!HEy-1:A2/163/d/?y2;  [check for artifact attacker]
!!HEy-2&y-2>-1:A2/163/d/?y4;  [check for artifact defender]
!!HEy-1:A2/164/d/?y3;  [check for artifact attacker]
!!HEy-2&y-2>-1:A2/164/d/?y5;  [check for artifact defender]
!!VRv7777:C-1/-1/-1/-1;
!!VRv7777&y2>0:S1;
!!VRv7778&y4>0:S1;
!!VRv7779&y3>0:S1;
!!VRv7780&y5>0:S1;

!?BF&1000;
!!DO5998/0/20/1&v7777=1:P;
!!DO5998/21/41/1&v7778=1:P;
!!DO5999/21/41/1&v7779=1:P;
!!DO5999/0/20/1&v7780=1:P;

!?FU5998;
!!BMx16:M36/999/3; apply magic mirror to each stack

!?FU5999;
!!BMx16:M70/1/3; apply stone


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


Promising
Famous Hero
posted February 20, 2012 08:09 PM

Is ok, he checks for artefacts and set v7777 to 0/1, then calls loop.

I see. But what would happen if creatures of both attacker and defender are stoned for the first round? Would the game handle it or would it crash?


____________

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 08:15 PM
Edited by Salamandre at 20:27, 20 Feb 2012.

Player will be unhappy, but it is his wish...

Edited post above, tested.

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


Responsible
Supreme Hero
posted February 20, 2012 08:46 PM
Edited by Hero_of_Light at 21:08, 20 Feb 2012.

It still doesn't work when a hero that doesn't wield the artifact attacks a random creature in the adventure map. It works when a hero wields the artifacts but when a hero doesn't have them either his or the enemies creatures start with stone gaze or magic mirror.

And as for the case where both heroes have the stone gaze artifact i guess there could be a check that exits when that's the case.

EDIT
I think I found the problem. You didn't add any exit function if noone has the artifacts. I also think each of them must have its own script and trigger so that it doesn't exit if a hero has one of them and not the other.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 09:08 PM

Does not need exit. Here it works, probably conflicts with something else in your script.

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


Responsible
Supreme Hero
posted February 20, 2012 10:02 PM

I don't know... I changed the variables and still... Note that it works when a hero wields the artifact (even if he or she wields the sceptre as well). Note also that if the attacking or defending hero is one of the ones that summon creatures the script also works ok. However, when a random hero attacks an adventuring creature the defenders have Magic Mirror. I can't see why. I'll leave it for now. I'll try again tomorrow.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 10:08 PM

Where you changed variables? probably you forgot this, which is very important:

!!VRv7777:C-1/-1/-1/-1;

This will reset vars between battles. If you changed vars in BF but did not change this line, then that's why you get them in every battle.

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


Responsible
Supreme Hero
posted February 20, 2012 11:22 PM

No i changed the heroes variables y-1, y-2 in case they interacted with the ones of the two previous artifacts.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 20, 2012 11:55 PM
Edited by Salamandre at 23:56, 20 Feb 2012.

From what I've seen, the error was to create several BF triggers, thus everything is messed. One must hold all the scripts. I will look into once I am done with my update. Also would be a good idea to convert to MOD and use ERA II because it allows testing and updating in real time, takes much less time and easier install. As it is now, I have to test, close map, modify script, restart and do this several times.

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


Hired Hero
posted February 24, 2012 07:45 AM

hello
Sory, i speak English not well
help me, pleas
I need script change damge of spell
Who you know?
____________

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


Responsible
Supreme Hero
posted February 24, 2012 05:57 PM

Spell damage can be changed 1) as a mod, by changing the "effect" parameters in the file SPTRAITS.TXT in H3Bitmap.lod, or 2) using the !!SS receiver described in the WoG 3.59 ERM Help document, or 3) various WoG 3.58f commands, such as the !?MR triggers and associated receivers.

The sticky post on "Introduction to Modding and ERM scripting" might contain more information on this topic.

Unfortunately, the Heroes 3 text files such as SPTRAITS and the WoG 3.58f and WoG 3.59 ERM Help documents are written in either English or Russian - at least the versions which I know of.  Perhaps some people have translated or will translate them into other languages.  You could start a new topic asking for translated versions, to find out.

A WoG 3.58f map available at this site which includes increased spell damage is "The Dragon Slaughter v2.07Dr".  The Era 2 map "The Empire of the World IV" (also available here), provides another example.  The first uses WoG 3.58f commands, and I think the second uses the !!SS receiver.  Editing the SPTRAITS file (preferably with the TxtEdit utility) would probably be the easiest method to use.


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


Admirable
Omnipresent Hero
Wog refugee
posted February 24, 2012 06:05 PM
Edited by Salamandre at 18:06, 24 Feb 2012.

The solution to "scepter of power" was easy, stats can be reverted before the leveling takes up:

In BG1, check if battle ended then revert stats. This will take place before !?BA1, thus additional skills gathered through leveling will display correctly.

!?BG1&1000;
!!BU:C?y1; check if battle ended this turn
!!FU&y1=0:E;
**HEv555:O?y1; **for the sake of test, even if one of heroes died, it will still display as belong to one faction, removed
**HEv777:O?y3;
!!IF:Wv555; read hero w vars
!!FU&w3<>99:E; if scepter on/off
!!HEv555:Fv114/v115/v116/v117; reset stats as before battle
!!VRw3:S0;

I added it in 67.erm.



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 50 100 ... 134 135 136 137 138 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.4681 seconds