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

<a href='http://www.game-advertising-online.com/' target='_blank'>Game Advertising Online</a><br> banner requires iframes

[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
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 thread is 248 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 (116) 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 ]
solitaire345
solitaire345


Promising
Famous Hero
posted November 14, 2011 07:54 PM

Quote:
If I use !# and I load a saved file will it run again?


No offense, but You could have tested this a dozen times since you asked.

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


Honorable
Undefeatable Hero
posted November 14, 2011 08:00 PM

Instructions (!#) are explained in Receivers section, as they do not need much space. Other that, it is hard to keep ERM only as a hobby because it takes a lot of time, errors and trials to be comfortable with.

The easiest way to get through is to read universal scripts (DATA/s), as they use friendly comments which explain every step. And have open Help nearby. Trying to read first the Help, if you never used variables is a bit useless, I think. But once you understand the logic behind, you cannot make your own scripts without exhaustive Help read.
____________

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


Responsible
Supreme Hero
posted November 14, 2011 08:59 PM
Edited by JimV at 04:20, 15 Nov 2011.

I know it is difficult to read in a foreign language, but when you load a saved game you are not at the beginning of a map, just as when you pick up a book and open it to a bookmark you are not at the beginning of a book.  Also "only one time" means one time only, not every time a map is loaded.

See the GM0 trigger in ERM Help for a way to perform commands every time a saved game is re-loaded.

I actually started to write a very similar sentence to what is in ERM Help for a reply, then decided to use the ERM Help words and looked it up (in a minute's time).

Variables are also explained in ERM Help, as well as I could explain them myself in English (or in Russian, in the Russian version).  I don't see much point in saying things here which are already in ERM Help, as though I am a look-up service.  What I will gladly do is try to explain things in different words or with examples if someone asks, "ERM Help says this ... what does it mean?"

You are just a youngster at 43, so I will make allowances for you.  I was excitable at that age also.


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


Honorable
Undefeatable Hero
posted November 14, 2011 09:24 PM

I had a strange issue when making some noobie script in another thread:

Consider you have a time trigger daily, all players.
You loop through all heroes and if one has artefact 170 (for example), you give him +10k movement points and +1000 gold to that player.

The strange issue:

The DO loop will run for each existing player. If HEx16:Wd10000 is ran 7 times, the hero will have only basic movement + 10000. With similar command, OW:R$/6/d1000; he will get number of players x 1000 gold, which is normal. I did not know that adding movement is checking basic movement and not already done bonus.
____________

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


Responsible
Supreme Hero
posted November 14, 2011 09:56 PM
Edited by JimV at 00:53, 15 Nov 2011.

That seems reasonable to me (what I would have expected - not that I am infallible).  At some point the Heroes program must look at the speeds of the creatures in a Hero's troop slots and what artifacts and secondary skills the Hero has, in order to assign the Hero's movement points for the day.  The logical time to do this is not on every color's turn, which would be mostly wasted effort, but only on the turn of the color which that Hero belongs to (or as the Hero is first recruited from a Tavern).

In simliar scripts which give or take speed bonuses, such as in "Friends and Foes" in which Scouting gives a Hero 30% extra movement per skill level, I do this (check that the Hero's owner is the current color):


ZVSE

* FAF_Scouting, JHV, Oct. 20, 2011
* Give +30%, +60%, +90% movement to Heroes w/Scouting

* uses z319, z273-z275, universal Timer 1, FU99

!#VRz319:S^{Scouting}^;     [Set yellow skill name]

!#VRz273:S^{Basic} {Scouting}

Basic Scouting allows your hero to see 1 square further into the shroud and gain +30% movement.^;
!#VRz274:S^{Advanced} {Scouting}

Advanced Scouting allows your hero to see 2 squares further into the shroud and gain +60% movement.^;
!#VRz275:S^{Expert} {Scouting}

Expert Scouting allows your hero to see 3 squares further into the shroud and gain +90% movement.^;
!#UN:G0/3/0/319;     [Set yellow skill name for Scouting]
!#UN:G0/3/1/273 G0/3/2/274 G0/3/3/275;     [Set skill texts for Scouting]

!?TM1; use daily universal timer from script00
!!OW:C?v3; (Get current player)
!!DO99/0/155/1:P;

!?FU99;
!!HEx16:O?y2; (Check hero owner)
!!FU&y2<>v3:E; (exit if not the same)
!!HEx16:S3/?y4; get scouting level
!!FU&y4<1:E;
!!VRy4:*30+100;
!!HEx16:W?y1;
!!VRy1:*y4 :100;
!!HEx16:Wy1 Gy1;

Note that one must set G at the same time as W in order to be able to dig for the Grail.  (I learned this by reading the HE:W command in ERM Help, of course.)

The map is not wogified, but I borrowed "Tobyn's Universal Timer" as a separate script from script00.erm.  With this script, only Timers 1 and 2 are needed for every use of the Timer trigger.

Edit - another way to look at it is to imagine how you would write the program.  I would write a function to set up a general player at the start of its turn, with the player number (0-7) as an input.  I would have to set the Resource Bar with the player's resources, put the players Heroes in the Hero Scroll list and Towns in the Town List, and so on.  That would be the logical time to calculate the player's Hero's movement points (to show the blue lines).  Then the same function could be used for each player, on its turn.

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


Known Hero
posted November 15, 2011 04:07 PM

hello people..to do my most useful trick, i want to change the flag of the monsters in combat.. but this doesn't work. can anyone helpme to check if this script is well?

Zvse

**dummy

!?FU815;
!?BA0;
!!BA:H0/?v700; [get defending hero's number]
!!BA:H1/?v701; [get defending hero's number]

!?BG0;
!!BG:Q?v1 A?v2 S?v3 D?v4;  get side, action, spell, target hex
!!FU|v2<>1/v3<>43:E; exit Hero don't cast and don't cast bloodlust
!!BG:E?v6;
!!BMv615; only to test if the stack is ok.. and is ok the stack gain more defens/ce
!!BMv6:F?v7; check flag
!!VRv7:&16466;  add to stack (fly,alive,siege weapon, immune fire spell)
!!BMv6:Fv7; give flags to stack


the monster have more defense but not the flags.

really i want to remove for a moment doble-wide flag for monster before hero cast a spell and obviously next to that, return to original situation.

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


Responsible
Supreme Hero
posted November 15, 2011 04:40 PM
Edited by JimV at 17:15, 15 Nov 2011.

I don't see any syntax errors (although you could add more checks).  Previously I have posted scripts which change the fly flag successfully at the BR trigger and the undead and alive flags between BG0 triggers, so I suspect the problem is due to the siege weapon flag.  Seige weapons have a speed of zero, so maybe you need to reset the speed (BM:S) also - just a guess, not tested.

Edit - it seems to me your choice of flags is contradictory - fly on a seige weapon which cannot move, alive on a seige weapon which cannot be resurrected.  These may cancel each other in some fashion.

Re-Edit - Sorry, my brain was asleep.  When you "and" (&) two sets of bits, the result is a zero bit if the bit was zero in either of the two sets, and a one only if both sets have the bit already.  So your & operation zeroed all the flag bits unless the creature already had fly, alive, seige weapon, or fire immunity.  To set those bits you need to use the "or" (|) operation.  Also read the ERM Help about the & and | VR operations.

3rd edit - Here is a re-posting of my fly script, as an example:

* Hint Test map, Orrin, Santa Gremlins=3, Master Genies=4
!?BR&1000/v997>0;
!!VRv1:Sv997%2; odd or even
!!BM3:F?v2; SG
!!BM4:F?v3; MG
!!VRv2&v1=0:&-3; even:  SG no Fly
!!VRv3&v1=0:|2;  even:  MG Fly
!!VRv2&v1=1:|2;   odd:  SG Fly
!!VRv3&v1=1:&-3;  odd:  MG no Fly
!!BM3:Fv2; SG
!!BM4:Fv3; MG

With this script, on even battle rounds (where the first round is round zero = even), the Santa Gremlins can't fly and the Master Genies can; on odd rounds, the SG can fly and the MG can't.

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


Known Hero
posted November 15, 2011 05:18 PM

thanks you the | was the correct answer

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


Known Hero
posted November 16, 2011 12:56 AM

when you use HE:I to change the hero spell points there are no problem in adventure map, but when you use to decrease or increase in combat, the game display the minimap (hero face- monsters, spell points) in the down-right corner or is a bug on my wog? thanks

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


Responsible
Supreme Hero
posted November 16, 2011 01:29 AM

Did you try using the /1 syntax which is supposed to prevent redraw?

From ERM Help, HE Receiver:

I$;  Set/check/get spell points.
Be sure to use d for relative change if you wish to add or subtract rather than set.
Example:
!!HE-1:Id-1; This will reduce the hero's current spell points by 1.
 
I$/1;   Additional Syntax
The same as HE:I$ but without redrawing
For standard syntax some of them called redrawing always even if you check only.

That is, redrawing would include updating the spell points in the current Hero display in the lower right corner of the Adventure Screen, and the same program function might do other parts of the Adventure Screen also - none of which we want to see in combat.  (Although personally I do not recall seeing the minimap.)

There are some other commands which glitch the combat screen with pieces of the Adventure Screen also.  The Living Scrolls script, which I use in "Friends and Foes" does that when it casts spells with BM:C, and there is no /1 syntax for that command.

I have noticed that the screen glitches for BM:C spell-casts last as long as the musical flourish at the start of a battle (in the first round), or as long as the sound effect for the spell, so I turn the sound off before the cast and turn it back on afterwards, so the glitch only lasts for the blink of an eye.  I noticed that Bersy eliminated  the start-of-battle music and some sound effects in the Phoenix Mod, and wonder if screen glitches were part of the reason.

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


Known Hero
posted November 16, 2011 02:11 AM

yes i used but in all the cases, appears the resource bar and sometimes the hero miniscreen.. so is a glitch :/ i used after BH:C command  thanks anyway.

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


Responsible
Supreme Hero
posted November 16, 2011 02:38 AM

I suspect the BH:C causes the glitch rather than the HE:I$/1, for the same reason as BM:C, that the function used internally to cast the spell includes redrawing as the default condition, unless an extra parameter is included in the command to prevent it, and neither the BH:C nor the BM:C have that parameter as an option.

Someone who is familiar with WoG source code could probably figure out a way to disable the redraw with UN:C pokes, but such people are very busy on more important projects.

Cutting off the sound might make the glitches take place over a shorter time.  You can turn the music and sound effects off manually to test this.  A BU:R after the cast in the same trigger does not seem to work for me, but might possibly work under a separate TL0 trigger in Era.  I don't have time to test this right now, though.  I am not half-way through checking the Phoenix Mod Manual, and there is a lot more text besides the manual.

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


Known Hero
posted November 16, 2011 02:51 AM

hey some time ago, OxFea post in the forum a script to changes the coordinates of building/dwelling into castle screen is something like these

!?PI;
!!VRy1:S0; //city (e.g. Castle)
!!VRy2:S30; //building ID (hut1)

!!VRy6:S2; //frames num in new def
!!VRy3:S280; //new x
!!VRy4:S230; //new y

!!VRy5:Sy1 *44 +y2 *6 +6859276;

!!UN:Cy5/2/y6;
!!VRy5:+2;
!!UN:Cy5/2/y3;
!!VRy5:+2;
!!UN:Cy5/2/y4;

with un:C, can you change, too, the coordinates of spells inside mage guild??

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


Known Hero
posted November 16, 2011 02:21 PM

hello check my script.

**Artificial Curse

!#SS52:F266269;  Dummy spell

!?FU808;
!?BA0;
!!BA:H0/?v700; [get defending hero's number]
!!BA:H1/?v701; [get defending hero's number]

!?BG0;
!!BG:Q?v120 A?v121 S?v122 D?v123;  get side, action, spell, target hex
!!FU|v121<>1/v122<>52:E; exit if not Hero casting Curse( dummy)
!!HE-10&v120=0:S14/?v124;
!!HE-20&v120=1:S14/?v125;
!!VRv126:Sv127-1;
!!BG:E?v129;
!!BMv129:T?v128;
!!IF|v128=56/v128=57/v128=58/v128=59/v128=141/v128=28/v128=62/v128=63/v128=64/v128=65/v128=68/v128=69:M^Undead can not be blessed^;
!!BG|v128=56/v128=57/v128=58/v128=59/v128=141/v128=28/v128=62/v128=63/v128=64/v128=65/v128=68/v128=69:A0;
!!FU|v128=56/v128=57/v128=58/v128=59/v128=141/v128=28/v128=62/v128=63/v128=64/v128=65/v128=68/v128=69:E;
!!BMv129:U1/?v127;
!!VRv126:Sv127-1;
!!BMv129:U2/?v130;
!!BMv129&v124<3/v120=0:U1/v127;
!!BMv129&v124<3/v120=0:U2/v127;
!!BMv129&v124=3/v120=0:U1/v126;
!!BMv129&v124=3/v120=0:U2/v126;
!!BMv129&v125<3/v120=1:U1/v127;
!!BMv129&v125<3/v120=1:U2/v127;
!!BMv129&v125=3/v120=1:U1/v126;
!!BMv129&v125=3/v120=1:U2/v126;
!!IF:V120/1;
!!IF:V121/1;


!?BR997&120/121;
!!BMv129:G52/?v131/d;
!!FU&v131>1:E;
!!BMv129&121:U1/v127;
!!BMv129&121:U2/v130;
!!IF:V121/0;


!?BA1;
!!IF:V120/0;
!!IF:V121/0;

Problem 1: if you cast a spell on a monster in round 1 is ok. the spell expires and the monster recovers his normal damage, but when you cast in the same monster in other round, the monster never have again the same damage

problem 2: similar to one but in other monster.. the first monster will have always minimum damage

the v129 is the problem, but i don't know how to do store different monster( or the same monster) in the same variable, to cast. thanks for everything

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


Responsible
Supreme Hero
posted November 16, 2011 04:52 PM
Edited by JimV at 20:16, 16 Nov 2011.

I will probably be editing this response several times as I think of more or better things.
Quote:

!!BMv129&v124<3/v120=0:U1/v127;
!!BMv129&v124<3/v120=0:U2/v130;
...
!!IF:V120/1;
!!IF:V121/1;


Those work but could be simplified:

!!BMv129&v124<3/v120=0:U1/v127 U2/130;  
...
!!IF:V120/1 V121/1;

Quote:

!?BR997&120/121;



Is BR997 some new 3.59 trigger, or did you mean BR&v997(condition)?
Quote:

Problem 1: if you cast a spell on a monster in round 1 is ok. the spell expires and the monster recovers his normal damage, but when you cast in the same monster in other round, the monster never have again the same damage

problem 2: similar to one but in other monster.. the first monster will have always minimum damage

The v129 is the problem, but i don't know how to do store different monster( or the same monster) in the same variable, to cast. thanks for everything


You will need to use indexed variables to store the pre-Curse values (see ERM Help, Flags and Variables, indexed variables) and then you must check each stack under BR, not just the last stack which was Cursed.  Something like this (I haven't tested it, there may be typos):

First, increase the duration of the dummy Curse spell by 1.  If you want it to last three rounds, set it to 4.

Second, you will need 84 permanent variables to store the pre-Curse minimum and maximum damage values, say v1000-v1083.  This assumes both attacker and defender might be able to Curse (42 stacks).  These variables could be re-used by other scripts outside of combat, but can not be used by other battle scripts.

!?BR&v997>1; assuming Curse lasts for three rounds, so skip the first two
!!DO199/0/41/1; this assumes both sides can Curse

!?FU199; x16=stack number, check for Curse
!!BMx16:G52/?y1/d;
!!FU&y1<>1:E;
* eliminate Curse on its last turn
!!VRy2:Sx16+1000; stack number+1000 = index to min damage
!!VRy3:Sy2+42; stack number +1042 = index to max damage
!!BMx16:U1/vy2 U2/vy3;
!!BMx16:G52/0/d;

Previously, under BG0, you will have stored the min and max damages in the v1000-v1083 table:

Instead of:
!!BMv129:U1/?v127 U2/?v130;

Use indexed variables:

!!VRv1:S1000+v129;
!!VRv2:Sv1+42;
!!BMv129:U1/?vv1 U2/?vv2;

Flags 120 and 121 are no longer necessary.  The testable condition is that the stack has had the dummy spell applied to it.  (So the test must be used before the spell duration is over, hence the need to add one to the spell duration and remove the spell when the duration is down to 1 turn).

Edit - It occurs to me that I don't know whether BM:G52/? counts down each round until the spell's duration has elapsed, or retains the original spell duration until the spell lapses.  If if does not count down automatically, maybe it could be counted down via ERM:

!?FU199; x16=stack number, check for Curse
!!BMx16:G52/?y1/d;
!!FU&y1<1:E;
!!VRy1:-1;
!!BMx16:G52/y1/d;
!!FU&y1>0:E;

Or maybe that would reduce the duration relative to when it was cast.  If neither method works (I hope the first one does), then another 42 variables will be needed, to save a duration value which can be counted down without affecting the spell.

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


Known Hero
posted November 17, 2011 03:14 AM

I gave up to the possibility of new powers because became cumbersome, and BG: A0 cause errors when you use it to dummy powers in general. the monster end his turn in many ocasions.

P.S. do you know how to change the coordinates of scrolls of mage guild?

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


Responsible
Supreme Hero
posted November 17, 2011 04:08 AM

No, I don't know much about the the internal coding of Heroes, just ERM.  The people who do are busy creating new versions of Heroes, like VCMI and the Phoenix Mod.

I was thinking my previous method of Cursing Undead could be made less kludgy by setting one undead stack to alive (temporarily) instead of creating an extra alive stack.  I would try that if I had more time - and interest.  Cursing undead doesn't really interest me, though.  I haven't come close to exhausting the possibilities of standard Heroes3/WoG yet, so I'm not ready to give up on the basic structure.  If there is some way a special artifact or other change can add to a specific map, such as the Surcoat of the Magic Elemental King in "Ice Arrow", or the Swords of Night and Day in the map of that name, it seems worthwhile to me, but general changes just for the sake of being different from Heroes don't appeal to me.  Any such changes would require a lot of testing, similar to those the Heroes design team did, for balance and playability.  Or maybe I just dislike change.  I refused to play Heroes 4 after I saw they had systematically eliminated all the game tactics I had figured out for Heroes 3.  Of course, many people loved Heroes 4.  To each his or her own.  

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


Known Hero
posted November 17, 2011 11:07 AM

what I wanted was not to create a new power to curse, if not make different spells for some powers like ; curse, haste, slow, air shield, cure and dispel magic, that can be casted for separated way in single stack and mass form( 2 spells). With them you dont requires expert magic school to have those useful spells. but when i tried to make the single spells on dummy spells and write the scripts.. well many errors, mistakes and others, that was my idea. thanks

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


Responsible
Supreme Hero
posted November 17, 2011 01:14 PM

In Era, using the new (3.59) DL receiver and trigger, you can create your own Mage Guild dialog with your own spell icons.  I'll try to show an example, from Shining Force:




If that worked you'll see examples of Magic Arrow and Mass Magic Arrow, Curse and Mass Curse, etc..  All the spells were applied to creatures directly with ERM code.  There were no Magic Schools (no Air, Earth, etc.), but certain Mages could only learn certain spells.

The graphics are a bit crude because I did some of them myself.

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


Adventuring Hero
posted November 17, 2011 01:25 PM
Edited by Magissia at 14:00, 17 Nov 2011.

Quote:




Awesome !*drools*


I have a simple script that doesn't work.

!#HE142:X2/7;

It is suposed to set Gelare's speciality to mithril (1 mithril per day)
but it doesn't work.

The icon is properly displayed but no effect
____________

My works

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 248 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 (116) 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 ] < Prev Thread . . . Next Thread >
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3522 seconds