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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info 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 338 pages long: 1 40 80 ... 118 119 120 121 122 ... 160 200 240 280 320 338 · «PREV / NEXT»
fanofheroes
fanofheroes


Known Hero
posted November 23, 2011 11:31 PM

Great! It's looking awesome.  Just one more artifact to go!

I was reading in a tutorial that integers must be whole numbers, and not decimals.  So I'm struggling with an Exlir of life artifact that gives 50% health bonus, plus regeneration to living, non-living and undead creatures.  How can I tell the system to round up to the nearest integer?

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


Admirable
Omnipresent Hero
Wog refugee
posted November 23, 2011 11:43 PM

It will round it automatically, can't do it other way. For increase HP by 50%, check the stack health and add bonus. For regeneration, you don't need to worry, just give back the lost HP points.
____________
All my Era II mods

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


Known Hero
posted November 23, 2011 11:47 PM

That's cool.  Am I on the right track with this? If so, will it be applied to all monsters automatically?

!#DO407/0/155/1;

!?FU407;
!!IF:Wx16;
!!VRw1:S0;
!?AE0&v998=168; equip
!!IF:W-1;
!!VRw407:S1;
!!BM:H*1.5; monster hit points are increased by 50%.  Shown before battle while on adventure map


!?AE1&v998=168; unequip
!!IF:W-1;
!!VRw407:S0;
!!BM:H/1.5; monster hit points are decreased by 50% when artifact is removed.  Shown before battle while on adventure map



[Start of battle trigger]
!#TM76:S1/999/1/255; sets timer for round 1
!?TM76;
!!DO407/0/155/1;
!?FU407;
!?BG0; start battle ground sequence
!!IF:W-1;
!!VRv574:S1; sets variable v574  
!!BM:Lv8; receives damage
!!BM:H+v8; restores health from total damaged received v8, like regeneration

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


Admirable
Omnipresent Hero
Wog refugee
posted November 23, 2011 11:53 PM
Edited by Salamandre at 23:54, 23 Nov 2011.

Man... I think you need to open some wog maps and look closely to scripts and also read the Help (I feel like parroting someone else here, do I?)

1) A trigger (!?) can't trigger another trigger. So !?FU407 followed by !?BG means nothing.
2) BM means stack. Which stack, then you need BM#
3) It seems you don't understand W vars yet, just leave them, you don't need here.
4) Battle commands cannot be placed in other than battle triggers. !?AE followed by !!BM will give you an interesting error message.

But first, start by using "disable smileys" icon on your left, so one can read your codes without thinking you are drunk.
____________
All my Era II mods

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


Admirable
Omnipresent Hero
Wog refugee
posted November 24, 2011 01:08 AM
Edited by Salamandre at 01:30, 24 Nov 2011.

I am trying to give free movement on water, but I am stuck on diagonals, as they require >100, compared to vertical/horizontal. I tried also OxFea code but on water the pathfinding becomes chaotic with this script, while movement point are kept safe, no matter diagonals or not. Weird...seems like I will have to give 140 points/tile then reset to previous value on anchor point, to prevent exploits.
____________
All my Era II mods

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


Known Hero
posted November 24, 2011 01:35 AM

Quote:
ZVSE
!?BG1;
!!VRy1:S0 R6;
!!UN&y1=0:C4453008/4/63488;
!!UN&y1=1:C4453008/4/64512;
!!UN&y1=2:C4453008/4/65504;
!!UN&y1=3:C4453008/4/02016;
!!UN&y1=4:C4453008/4/02047;
!!UN&y1=5:C4453008/4/00031;
!!UN&y1=6:C4453008/4/32784;

Beholders and evil eyes shoot rays of all rainbow's colors (=


can you do this for archmage and any other creature that have the 2048 monster flag?

"Monster 35,74,75"

thanks

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


Known Hero
posted November 24, 2011 05:44 AM



Quote:
Man... I think you need to open some wog maps and look closely to scripts and also read the Help (I feel like parroting someone else here, do I?)

1) A trigger (!?) can't trigger another trigger. So !?FU407 followed by !?BG means nothing.
2) BM means stack. Which stack, then you need BM#
3) It seems you don't understand W vars yet, just leave them, you don't need here.
4) Battle commands cannot be placed in other than battle triggers. !?AE followed by !!BM will give you an interesting error message.

But first, start by using "disable smileys" icon on your left, so one can read your codes without thinking you are drunk.



Sorry, there are just so many different help sections that I can't find ones that are in-depth with specific tutorial examples for me to learn. I trust your advice.  Have you written a tutorial section that I can learn from? I have found with other help sections, they just give an example or two and I learn the pattern, but not the method.  I just have this one script to try and figure out and my scripting troubles will come to an end.  But on the plus side, I did learn how to disable smileys just now lol.  

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


Admirable
Omnipresent Hero
Wog refugee
posted November 24, 2011 11:01 AM

It is explicit. When you use a receiver (!!) as BM, check BM column. A trigger as !?BG, check BG. If you can't find something in the columns, click on Triggers or Receivers boxes in the upper right corner, you will get a detailed list. I wish we could mix them as we like, but there are restrictions. Try easier scripts first, you want to use everything after 1 months in, wanna beat some record?
____________
All my Era II mods

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


Promising
Famous Hero
posted November 24, 2011 03:34 PM
Edited by solitaire345 at 15:51, 24 Nov 2011.

Quote:


can you do this for archmage and any other creature that have the 2048 monster flag?

"Monster 35,74,75"

thanks


This code works for any creature that has 2048 flag

Quote:
I am trying to give free movement on water, but I am stuck on diagonals, as they require >100, compared to vertical/horizontal. I tried also OxFea code but on water the pathfinding becomes chaotic with this script, while movement point are kept safe, no matter diagonals or not. Weird...seems like I will have to give 140 points/tile then reset to previous value on anchor point, to prevent exploits.


I am not sure if I understood you correctly, but I think you need to store the value of movement points while the hero is in boat and then restore it with each step the hero takes.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 24, 2011 04:14 PM
Edited by Salamandre at 18:00, 24 Nov 2011.

Yes it is a possibility, I will store when hero jumps in boat, restore on anchor point type. 10 years later I learn that diagonals take more points, heh.

@fanofheroes

For your script there are two choices. One uses EA-# commands to give regeneration (used in Alexander map), but I noticed bugs if AI has it, high chances that stack will freeze.

The other use a special ERA function, which I never used so I am not sure I did it right, however the script works correctly (tested it on archangels, trolls and wraiths).

ZVSE

;artefact 168 gives 50% more HP and regeneration ability (full= elixir of life)
!?BF;
!!BA:H0/?v5678 H1/?v5679; [check for artefact 168]
!!HEv5678:A2/168/?y1/?v5680;
!!HEv5679&v5679>-1:A2/168/?y1/?v5681;
!!DO2300/0/20/1&v5680>0:P;
!!DO2300/21/40/1&v5681>0:P;

!?FU2300; [increase HP by 50%]
!!BMx16:H?y1;
!!VRy1:*3:2;
!!BMx16:Hy1;

!?FU77007; [give regeneration]
!!SN:X?y1/?y2/1;
!!if&y1<21/v5680>0:; *if artefact left side
!!BMy1:L?y4;
!!FU&y4=0:E;
!!VRz1:S^Regener.wav^;
!!SN:Pz1;
!!BMy1:L0 V79;
!!en:;
!!if&y1>20/v5681>0:;  *if artefact right side
!!BMy1:L?y4;
!!FU&y4=0:E;
!!VRz1:S^Regener.wav^;
!!SN:Pz1;
!!BMy1:L0 V79;
!!en:;
____________
All my Era II mods

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


Known Hero
posted November 24, 2011 06:58 PM



Quote:
Yes it is a possibility, I will store when hero jumps in boat, restore on anchor point type. 10 years later I learn that diagonals take more points, heh.

@fanofheroes

For your script there are two choices. One uses EA-# commands to give regeneration (used in Alexander map), but I noticed bugs if AI has it, high chances that stack will freeze.

The other use a special ERA function, which I never used so I am not sure I did it right, however the script works correctly (tested it on archangels, trolls and wraiths).

ZVSE

;artefact 168 gives 50% more HP and regeneration ability (full= elixir of life)
!?BF;
!!BA:H0/?v5678 H1/?v5679; [check for artefact 168]
!!HEv5678:A2/168/?y1/?v5680;
!!HEv5679&v5679>-1:A2/168/?y1/?v5681;
!!DO2300/0/20/1&v5680>0:P;
!!DO2300/21/40/1&v5681>0:P;

!?FU2300; [increase HP by 50%]
!!BMx16:H?y1;
!!VRy1:*3:2;
!!BMx16:Hy1;

!?FU77007; [give regeneration]
!!SN:X?y1/?y2/1;
!!if&y1<21/v5680>0:; *if artefact left side
!!BMy1:L?y4;
!!FU&y4=0:E;
!!VRz1:S^Regener.wav^;
!!SN:Pz1;
!!BMy1:L0 V79;
!!en:;
!!if&y1>20/v5681>0:;  *if artefact right side
!!BMy1:L?y4;
!!FU&y4=0:E;
!!VRz1:S^Regener.wav^;
!!SN:Pz1;
!!BMy1:L0 V79;
!!en:;



Thank you so much!!!  I tried getting the wheels rolling.  I understand the triggers and receivers now, but as you can obviously tell from my progress, it would've been a very long time from point A to point B.



ZVSE

!?AE1&v998=168; Equip artifact
!!BM:H

!?AE0&v998=168; Unequip Artifact
!!

!?BA0; Pre battle trigger
!!
!!

!?BA1; Post battle trigger
!!
!!

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


Known Hero
posted November 24, 2011 07:04 PM



And if I want the effects to also show on the adventure map do I take the same script used inside the battle trigger and add it outside?

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


Admirable
Omnipresent Hero
Wog refugee
posted November 24, 2011 07:05 PM

Don't do that!

What effects regeneration and HP+%50 on adventure map?
____________
All my Era II mods

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


Known Hero
posted November 24, 2011 07:44 PM

ya, just so that it also appears on the adventure map while its equipped.  just for aesthetics.  not necessary i suppose

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


Admirable
Omnipresent Hero
Wog refugee
posted November 24, 2011 07:49 PM

Forget it, too many problems. If your hero changes boosted creatures with another, or leaves them in mines or garrisons, you will need millions of codes to avoid chaos.
____________
All my Era II mods

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


Known Hero
posted November 25, 2011 02:04 AM

Quote:
Forget it, too many problems. If your hero changes boosted creatures with another, or leaves them in mines or garrisons, you will need millions of codes to avoid chaos.


Cool, good point.  I don't like chaos hahaha.  Thank you so much for helping me through this.  Now going to play the scenario that i made, or rather I made with a lot of your help more accurately.  Although I did create the map completely on my own.  It's my version of Middle Earth from lord of the rings.  The scale isn't accurate in terms of geography but it's pretty close.  With some minor add-ons and adjustments.  But the art is cool.  

Thanks again!! =)

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

Tavern Dweller
posted November 26, 2011 09:31 AM

First of all hi. I'm an long time Homm 3 - WOG player that i left the game a few years ago but not i'm back at it I forgot all my ERM but i made a few scripts and now i need help with a few things i wanna do.

I Want to make the new caves (The ones that appear in the map editor on the towns section right next to the adventure cave) to appear when i wogify any map replacing other things.

I added this to script00.erm:

**

!!VRy20:S0; [initialize object counter to 0]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/59/3/-1/0/1/0; [adventure cave2]

!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/60/3/-1/0/1/0; [adventure cave3]

!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/58/3/-1/0/1/0; [adventure cave4]

!!FU671&y20>016/1/3/y20/40; [replace 40% of dwarven treasuries]
!!FU671&y20>055/0/3/y20/40; [replace 40% of mystical gardens]
!!FU671&y20>084/0/3/y20/10; [replace 10% of crypts]


But it's not working. Any ideas why?


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


Responsible
Supreme Hero
posted November 26, 2011 08:54 PM

There's not enough information to do more than guess (TLI as opposed to TMI), but guessing is my middle name.  I'll attach the original section of script code from script00 at the end of my comments.

As you can see below, there is a long list of objects which will replace Dwarven Treasuries, etc., in the script.  I don't know if you actually added (appended) your code after the original code (below) or replaced the original code entirely with your code.

In either case you need to set y3 to 1 to enable the replacement of your objects.  In the original code, y3 is set by interrogating the WoG option (UN:P) for each new object, to see if the player has enabled it.  You may wish to re-define some of the P-codes to apply to your objects, or just enable them all automatically (!!VRy3:S1;).  In the latter case you could just remove all the y3=1 conditions.

I am assuming, without checking because it's not my script so I don't have to, that the objects you are replacing are a match (RYR - red, yellow, red square objects) for the objects which are being replaced, and that your terrain/back wall/edge x/edge y parameters are correct.  Otherwise the replacement may not work.

Case 1:  you added your code after the original code.  In that case, 80% of the Dwarven Treasuries, etc., have already been converted to Arcane Towers, etc., and you are telling ERM to replace 40% of the remaining 20% = 8% of the original counts.  Suppose there were only 10  Dwarven Treasuries on the map to begin with.  8% of 10 is zero, in integer arithmetic.

Case 2:  you replaced the original code.  Then maybe you forgot to set y3 to 1.

Case 3:  you did neither of the above.  I won't speculate on that.

** table fields: type/subtype/footprint/terrain/back wall/edge x/edge y
** footprint values:  0 = Y, 1 = RY, 2 = YR, 3 = RYR, 4 = other
...

** TABLE of RYR OBJECTS **

!!VRy20:S0; [initialize object counter to 0]
!!UN:P140/?y3; [check if New Creature Dwellings option is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C17/91/3/-1/0/1/0; [vast cavern] [table of RYR objects]

!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C17/99/1/-1/1/1/0; [hellfire rift]

!!UN:P138/?y3; [check if New Creature Banks option is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C16/20/3/-1/1/2/1; [grotto]

!!UN:P108/?y3; [check if Junk Merchant script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/ 8/3/-1/2/2/1; [junk merchant] [actually RRYR]

!!UN:P17/?y3; [check if Potion Fountains script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/ 2/3/-1/1/1/0; [venus's fountain]

!!UN:P15/?y3; [check if Mysterious Creature Dwelling script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/ 3/3/-1/0/2/1; [mysterious creature dwelling]

!!UN:P30/?y3; [check if Adventure Cave script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/57/3/-1/0/1/0; [adventure cave]

!!UN:P26/?y3; [check if Artificer script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/52/3/-1/0/2/0; [artificer]

!!UN:P21/?y3; [check if Freelancer's Guild script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C213/0/3/-1/0/1/0; [freelancer's guild]

!!FU671&y20>0:P16/1/3/y20/80; [replace 80% of dwarven treasuries]
!!FU671&y20>0:P55/0/3/y20/80; [replace 80% of mystical gardens]
!!FU671&y20>0:P84/0/3/y20/80; [replace 80% of crypts]

By the way, here was my addition to script00 to eliminate the Treasure Chest bug:

!?FU671;

!!UN:Ux1/x2/?v951; [count number of replaceable objects]
!!FU&v951<2:E; exit if < 2 objects [added by JHV 7/23/2008]
!!VRv951:-1; [added by JHV 7/23/2008]

!!VRx4:-1; [deal with replacements numbered 0 to x4]
!!VRv952:S-2; [Initialize v952 to last object for faster UN:U format]
!!DO672/1/v951/1:Px1/x2/x3/x4/x5; [do a loop for each object]

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


Admirable
Omnipresent Hero
Wog refugee
posted November 26, 2011 10:46 PM

Is there any UN:C code to change the pitlords ability to horned demons instead of demons?
____________
All my Era II mods

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

Tavern Dweller
posted November 27, 2011 12:43 PM

Thx for the help i finally made it work. Ill post my caves scripts just for if somebody is interested.

Is there any way to replace the prisons in wogification? I remember this could be done but a patch fixed it?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: Next Thread » This Popular Thread is 338 pages long: 1 40 80 ... 118 119 120 121 122 ... 160 200 240 280 320 338 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1842 seconds