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 150 200 ... 208 209 210 211 212 ... 250 300 350 400 407 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted July 17, 2013 02:36 AM

bloodsucker said:

What are P16, P55 and P84 doing there? What P stands for?


I suggest that you take some time and read carefully the scripts from wog/data/s folder. Most of them are made by Fnord and he has a very nice and friendly erm style, proposing detailed comments at the end of each code. There are also some Fnord maps online, in which he made his way through erm from basic to expert, they will be easy to read for a beginner.

Don't ask questions that are already answered in erm help, but you can ask about unclear erm explanations. P$ are parameters you pass into the function, a basic example:

ZVSE

!?HM-1;  [trigger will occur each time your hero takes a step]
!!VRv2:+1; [increase v2 by one at each step]
!!FU333333:Pv2; Call function 333333 and pass v2 as argument (a function, in order to access parameters, uses x1-x16 syntax, in our case x1 will hold v2 and for now we will not use x2-x16, just x1)


!?FU333333;
!!IF:M^This is your %X1 step^; [syntax %X1 will show the value of x1 variable and x1 is the previous v2 passed as parameter into the function]

Basically each time you make a step, you will receive a message saying how many steps you did. Test it to see.

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


Known Hero
posted July 17, 2013 02:01 PM

I doesn't know how to use a function in a network battle...
Function is: when a hero gains a level (Lv4+Lv of the spell), his allies (with Lv4+Lv of the spell)  can cast his special spell in Expert mode. But this thing works only in hotseat.
For example, Adela and the other Heroes of the same colour at Lv5 can cast MassBless without Expert Magic Water.
I'm not able to continue alone... Someone can help me to write my script? Please...

!?BG0;
!!BG:A?y98;                  [Check if Hero casts a Spell]
!!SN:W^Type.Of.Action^/y98;  [Store Type of Action]
!!FU16613&y98=1;           [EXPERT SPELL SHARED START]
****************************************

!?BG1;
!!SN:W^Type.Of.Action^/?y98;
!!FU16614&y98=1;           [EXPERT SPELL SHARED END]
****************************************
!?FU16613;                   [EXPERT SPELL SHARED START]
!!BG:S?y99;                  [Check which Spell]
!!BG:N?y97;                  [Check number of current stack (0...41)]
!!BMy97:I?y-97;              [Check side of current stack]
!!BHy-97:N?y-1;              [Check Hero at the side of the current stack]
!!SN:W^Hero.Caster^/y-1;     [Store Number of Hero that casts the Spell of the Hero Speciality]
!!FU&y-1<0:E;                [Exit if no Hero]
!!HEy-1?y7;                [Check Colour]
!!SSy99:L?y9;                [Launched Spell Level]
!!VRy3:Sy9+4;                [Hero Level (after Lv4) when starts Advanced Speciality]
!!SSy99:S?y95;               [Spell Magic School]
!!VRy5|y95=2/y95=3/y95=6/y95=10/y95=7/y95=11/y95=14/y95=15:S14;      [Fire Magic School]
!!VRy5|y95=1/y95=5/y95=9/y95=13:S15;                                 [Air Magic School]
!!VRy5|y95=4/y95=12:S16;                                             [Water Magic School]
!!VRy5|y95=8:S17;                                                    [Earth Magic School]
!!HEy-1:E?y1/?y11 X?y12/?y13/?y14/?y15/?y16/?y17/?y18;          [Current Hero: XP (y11) and Spell (y13) of his Speciality (y12)]
!!SN:W^Type.School.Magic^/y5;[Store Type of Magic School of Spell of his Speciality]
!!HEy-1:Sy5/?y-5;            [Check Lv of Magic School of the Hero that casts the spell]
!!SN:W^Lv.School.Magic^/y-5; [Store Lv of Magic School of Spell of the Hero Speciality]

!!OWy7/?y1/?y-10/?y-20/?y-30/?y-40/?y-50/?y-60/?y-70/?y-80;   [Check Hero List of the Current Colour]
!!HEy-10:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;       [Get Expert Magic School if casts a Special Spell of an Allied Hero (same Colour)]
!!HEy-20:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-30:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-40:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-50:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-60:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-70:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
!!HEy-80:E?y1/?y-11 X?y-12/?y-13/?y-14/?y-15/?y-16/?y-17/?y-18;
!!HEy-1&y11>=y3/y-11>=y3/y-12=3/y99=y-13:Sy5/3;
****************************************

!?FU16614;                   [EXPERT SPELL SHARED END]
!!SN:W^Hero.Caster^/?y-1;
!!SN:W^Type.School.Magic^/?y5;
!!SN:W^Lv.School.Magic^/?y-5;
!!HEy-1:Sy5/y-5;
****************************************

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


Honorable
Supreme Hero
posted July 17, 2013 04:34 PM

Quote:
!!SN:W^Type.Of.Action^

You don't have to separate words with dots.
^type of action^ is easier to write, IMO.

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


Admirable
Omnipresent Hero
Wog refugee
posted July 17, 2013 08:17 PM

Umm, I don't know why you complicate things so much. It would be easier to just change bless flag to mass for that faction, then restore for other side in FU77007 (as in tew4 with spells power/flags). Normally bless has this: 0x00000040(has mass version at expert level), you could play with, test and maybe give it this: 0x00000800(friendly and has mass version).

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


Known Hero
posted July 17, 2013 11:06 PM

But each spell has different flag for Expert version...
I want to send this to the network player: !!HE(Caster):S(MagicSchool)/3;
Is it impossible? Or I should work with BM reciever? Or other?
Sorry for my insistence...

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


Promising
Famous Hero
feanor on DF2.ru
posted July 17, 2013 11:50 PM

You need sjmethng like this?


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


Known Hero
posted July 18, 2013 12:28 AM


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


Admirable
Omnipresent Hero
Wog refugee
posted July 18, 2013 05:10 AM
Edited by Salamandre at 05:34, 18 Jul 2013.

It looks unclear to me what you are trying to do. What about network battle, I don't see anything in your script about network. Does your script work in single player game and not in lan or what?

Also, it is only about Adela or who else? What I mean was this:

On your player turn, check if Adela is alive and her level. If conditions are fulfilled, first remove bless flag then add new flag:

!!SS41:F?y1; check bless flag
!!VRy1:&-65; remove "has mass version at expert level"
!!VRy1:|2048; add flag "friendly and has mass version" ALWAYS
!!SS41:Fy1; Set, now bless will always be mass, no matter you have the skill

Then use special era function FU77007, which will occur before a player's turn (regeneration phase) to switch bless forth and back. On your turn it will be mass version for everyone, on AI turn it returns to regular flag.

Sguazz said:
But each spell has different flag for Expert version...



No. Many spells share same flag, for example bless has same flag as prayer and has nothing to do with expert version, it's just that spell flag.

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


Known Hero
posted July 19, 2013 10:07 PM

But I would like a script that works for all spells... Meteor Shower hasn't same flag of Bless.
I don't understand when and what data must be trasferred to the other network player (and if is it possible to do it).
My (probably horrible) script works perfectly in a Human vs Human hotseat battle...
I'm so sad...
Thanks anyway for the help and for your patience.

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


Admirable
Omnipresent Hero
Wog refugee
posted July 19, 2013 10:53 PM

Such scripts which should work for both sides and all spells are very complicated. As I see your script, it has two serious flaws, first you check the 8 active heroes specialty/level but what about those in garrisons, they don't count? Another thing is that you store the caster hero ID in SN:W but if both attacker and defender fulfill the conditions the var will be messed after battle, how do you restore for each of both heroes the original magic skill, if their ID is stored in same SN:W var?

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


Known Hero
posted July 20, 2013 01:06 AM
Edited by Sguazz at 02:14, 20 Jul 2013.

Yes, garrison heroes can't be checked with this script...

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


Hired Hero
posted July 22, 2013 02:29 AM

Is there a problem with the MR:N$ receiver or is it just me? It seems it assigns random integers.

http://www.wogcn.net/erm_help/receivers/receiver_mr.htm

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


Admirable
Omnipresent Hero
Wog refugee
posted July 22, 2013 03:03 AM

yes it returns invalid values. Get Era because all those bugs are specified in the attached erm help, thus you don't lose your time.

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


Hired Hero
posted July 22, 2013 05:18 AM

Salamandre said:
yes it returns invalid values. Get Era because all those bugs are specified in the attached erm help, thus you don't lose your time.


Meh, can't run it on Linux.

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


Admirable
Omnipresent Hero
Wog refugee
posted July 22, 2013 05:40 AM

You don't need to run era, just open erm help.

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


Hired Hero
posted July 23, 2013 05:18 PM
Edited by LakeQueen at 17:39, 23 Jul 2013.

Is there a way to check the current stack's luck/morale in battle?

EDIT: Nevermind that. What's the flag for Halflings' good luck passive?

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


Known Hero
Editing Heroes Without Limits
posted July 23, 2013 09:35 PM
Edited by Felipe at 22:07, 23 Jul 2013.

What is the commander slot number?

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


Admirable
Omnipresent Hero
Wog refugee
posted July 23, 2013 10:32 PM

ZVSE

!?BG0;
!!BG:N?y1;
!!BMy1:T?y2;
!!FU|y2<174/y2>191:E;
!!IF:M^%Y1^; [y1 = commander stack number]

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


Promising
Famous Hero
feanor on DF2.ru
posted July 24, 2013 05:04 AM
Edited by OxFEA at 17:49, 24 Jul 2013.

Quote:
I hope he finds a way to eliminate the immunities and vulnerabilities for all of the upgraded elementals.



Vulnerabilities:

degrades
!!UN:C4502224/1/8;
!!UN:C4502225/1/8;
!!UN:C4502226/1/8;
!!UN:C4502227/1/8;

upgrades
!!UN:C4502235/1/8;
!!UN:C4502237/1/8;
!!UN:C4502239/1/8;
!!UN:C4502241/1/8;

Immunities:

degrades
!!UN:C4499128/1/8;
!!UN:C4499129/1/8;
!!UN:C4499131/1/8;

upgrades
!!UN:C4499139/1/8;
!!UN:C4499141/1/8;
!!UN:C4499143/1/8;
!!UN:C4499145/1/8;

and fire/energy elemental immunity changeable via flags.
Quote:
EDIT: Nevermind that. What's the flag for Halflings' good luck passive?

It's not a flag ability

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


Hired Hero
posted July 24, 2013 01:13 PM
Edited by LakeQueen at 16:19, 24 Jul 2013.

OxFEA said:
Quote:
EDIT: Nevermind that. What's the flag for Halflings' good luck passive?

It's not a flag ability



Oh... is there any way I can add that to another unit? With EA receiver perhaps or something?

Also, how can I make a hero cast a spell once at the beginning of the combat? (much like with Armour of the Damned)

 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 150 200 ... 208 209 210 211 212 ... 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.4347 seconds