Heroes of Might and Magic Community
please log in.! Register | Today's Posts | Search! | FAQ/Rules | AvatarList | MemberList | Profile

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

Heroes 1 (Heroes 2 (Heroes 3 (Heroes 4 (Heroes 5 (Heroes 6 ()

Login:     Username:     Password:    
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: ERM help and discussion
Thread: ERM help and discussion [ This thread is 228 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 ]
Siegfried
Siegfried


Famous Hero
posted October 10, 2009 10:50 AM

Nice

I don't think it's possible to just set up an artifact to automatically do something regularly. So the normal way to do anything on a daily base would be to daily loop through any heroes, check, if this hero has the artifact equipped, and if so, do something. In your example, just add 5 mana up to the maximum.

You still have to check the maximum. Basically this is knowledge*10. But may be modified by intelligence. I'm currently not aware of other modifiers.

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


Supreme Hero
Supreme Hero
posted October 10, 2009 10:50 AM
Edited by gnollking at 10:56, 10 Oct 2009.

The /400/:

!!HE-1:Y7/5/400/1;

means that the blessing stays for 400 days.

@EDIT, i used this one from ERM help:


____________

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


Famous Hero
posted October 10, 2009 11:32 AM

It would be a nice idea to set up a general framework for hero checking. something like that:



!?TM1&@once@;    

not sure about the @once@, should be a macro set up in script00.erm. The timer is set up so that it is called each day for each player. But for a general hero checking you would do it only once and ignore other calls. Just assume the format is right. So:

!?TM1&@once@
!!UN:U34/-1/?y-1;  get number of heroes on map.
!!VRv997:S-1;      multiplexer
!!DOXXXX/1/y-1/1:P; loop through all heroes (replace XXXX with a free number)
!!FU:E;

Now set up a function for a hero check

** part 1: Done for all heroes
!?FUXXXX&v997=-1;
!!UN:U34/-1/x16/998;  reuse v998/v999/v1000 for coordinates
!!HEv998/v999/v1000:N?v997; get id of hero at coordinates
!!VRv997&v997<0:S-1;
!!FU&v997<0:E;
!!DOXXXX/7/170/1:P; do for all heroes
!!VRv997:S-1; restore multiplexer
!!FU:E;

** part 2: done for all artifacts
!?FUXXXX&v997>=0/v997<=155;
!!FU&x16<>[your artifact number]:E; exit if not handled here
!!HEv997:A2/x16/d/?y1;  calculate number of artifacts equipped
!!FU&y1<=0:E;
** now here do what you want for this hero
!!FU:E;

Part 2 could be the general artifact checker. Artifact number comes in x16. Just exit if it is not the artifact you want to handle. Then check if hero has it, then handle. Could be repeated for any artifact. Hero ID is in v997 (which during a battle holds the round number, and so is free during the timer action).

Now a second loop would be needed to check for heroes in towns. So loop through all towns, check for hero, and if found, manually set up a single call to part 2, after storing the hero id in v997.

Not tested, just a conceptional preview.

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


Supreme Hero
Supreme Hero
posted October 10, 2009 12:42 PM

How to change the hero class during a game? I am making a map where Drakon will turn to Death Knight, only his portrait, his name, and his biography will stay what at they are.
____________

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


Honorable
Undefeatable Hero
posted October 10, 2009 02:01 PM

You can't do that, unless you do some tricky things (read 3 pages earlier)

For your artefact don't bother with too much scripting, just use a time trigger and it is ok:

ZVSE

!#TM99:S1/999/1/255;

!?TM99;
!!DO99/0/155/1:P;

!?FU99;
!!HEx16:O?y2; (Check hero owner)
!!OW:C?y3; (Check current player)
!!FU&y2<>y3:E; (Abort if not the same)
!!HEx16:A2/166//?y4; **check artefact
!!FU&y4<>1:E;
!!HEx16:Id5;
____________

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


Supreme Hero
Supreme Hero
posted October 10, 2009 02:08 PM

So, i know almost nothing about ERM.. Do i have to put that to the beginning of my script?


____________

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


Honorable
Undefeatable Hero
posted October 10, 2009 02:13 PM
Edited by Salamandre at 14:15, 10 Oct 2009.

Whole script (name and what it does when weared):

ZVSE

!#VRz426:S^{Necklace of Mana}^;
!#VRz427:S^{Necklace of Mana}

When weared, this powerful Necklace gives +5 Spell Points each day^;
!#UN:A166/9/426;
!#UN:A166/10/427;

!#TM99:S1/999/1/255;

!?TM99;
!!DO99/0/155/1:P;

!?FU99;
!!HEx16:O?y2; (Check hero owner)
!!OW:C?y3; (Check current player)
!!FU&y2<>y3:E; (Abort if not the same)
!!HEx16:A2/166//?y4; **check artefact
!!FU&y4<>1:E;
!!HEx16:Id5;

____________

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


Supreme Hero
Supreme Hero
posted October 10, 2009 02:21 PM

Thank you very much .

You know, I'm just starting to learn ERM.
It will propably take months to learn something.
I can do only basic things..
____________

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


Honorable
Undefeatable Hero
posted October 10, 2009 02:30 PM

Me too.
____________

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


Supreme Hero
Supreme Hero
posted October 10, 2009 02:51 PM
Edited by gnollking at 04:07, 11 Oct 2009.

Right.
____________

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

Tavern Dweller
posted October 10, 2009 04:41 PM

Quote:
Hi,

i've rarely scripted artifacts, but i think you always can script those things at the beginning of a battle. Check for the !?BR trigger in the erm help. Variable v997 keeps the number of the current turn. So you could just set ab a trigger like:

!?BR&v997=0;
** Script anything you want to occure in first round,
** Cast spells, adjust stats, whatever

So first to do is to check the hero for the artifact. If he has it, apply spells, change stats, show animatins, whatever. If it is much to check, i prefere a construct with several trigger, one for every artifact. Could then start like this:

!?BR&v997=0;
!!BH0:N?y-1;     left hero id
!!FU&y-1<0:E;    safety exit
!!HEy-1:A2/[number of artifact]/d/?y-2;
!!FU&y-2<=0:E;   Artifact not equipped, exit
** Now do things for that artifact.

!?BR&v997=0;
!!BH0:N?y-1;     left hero id
!!FU&y-1<0:E;    safety exit
!!HEy-1:A2/[number of next artifact]/d/?y-2;
!!FU&y-2<=0:E;   Artifact not equipped, exit
** Now do things for that artifact.

... and so on...

Then continue with right hero. Just similar:

!?BR&v997=0;
!!BH1:N?y-1;     right hero id
!!FU&y-1<0:E;    safety exit
!!HEy-1:A2/[number of artifact]/d/?y-2;
!!FU&y-2<=0:E;   Artifact not equipped, exit
** Now do things for that artifact.

and so on.

Another idea might be to set up a new combo artifact with !#UN:A... but i've never tried that.

P.S.:The standard combo artifacts do not need erm. They are coded in zhe original H3.


Ok i understand what you said so far... what is the command for  having an artifact cast a spell  ( like armor of the Dammed does )
i have looked  at the help files and must be missing it ?

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


Famous Hero
posted October 10, 2009 05:20 PM

As far as i know there is no such command. You can't even set the spell. You can just check if it gives a spell (but not, which one), and you can set it to give no spell. Nothing more.

So in fact you have to simulate it.

So let's assume a trigger firing somewhen in battle. May be every round (may be then check for first round only), then check if the hero has the artifact, then use erm to cast those spells. So the artifact itself does nothing. It is just a key (or authorization) for some erm code to do it. It is simply a simulation. But for the gamer it makes no difference.

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

Tavern Dweller
posted October 10, 2009 06:33 PM

Quote:
There are surely more ways to skin the cat, but I would change all medusas aggressiveness on the map using !?HM0 (zero=Orin ID)

HM command survey each step an hero takes. Just try to loop through all monsters on the map using !!UN and type/subtype of medusas (54/77) then set their aggressiveness level to 0. First they have to be set to savage via editor.

But it is not so easy, because you would need a TM trigger to change their level to aggressive each start of turn then.

As for artifact, check Alexander the Great map, where the red player is scripted to be cursed when he gets attacked by AI (slow/weakness). Just do the same thing triggered by an artifact (!?AE0-put on, !?AE1-remove), applying the spells using !?BA0.

It is not so easy if you never scripted. The problems is not getting the effects running, but removing them after each battle or actions.

There may be other solutions, maybe someone else has a better idea.



You mentioned Alex the great map. i down loaded it and was looking for  that event. But you have a ton of timed event , can you tell me the name of the event.. i see them all just long to open each and  look thru it ..

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


Honorable
Undefeatable Hero
posted October 10, 2009 06:45 PM

The event is the last on the list, "invaders boost". I scripted it to prevent human player to block the monoliths. If human player blocks the liths, he will be penalized with mass slow while all AI heros will get boosted with mass haste, thus making impossible to win without loses.
____________

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

Tavern Dweller
posted October 11, 2009 07:39 PM

Quote:
I've been experiencing some connection problems but everything is fine now.

@Wogifier: I'll finish the script as soon as I can. School just started, you know...

@Demonpheonix: This script contains some animation bugs, but it should work fine.



ZVSE

[Part 4: Blank Horn Implementation]

!#UN:A170/3/16; [artifact is relic]
!#VRz90:S^Horn of Courage^;
!#UN:A170/9/90; [name the artifact 'Horn of Courage']
!#VRz91:S^{Horn of Courage}

Wearing this item all your troops' moral boosts formidably.^;
!#UN:A170/10/91; [set description]
!#UN:A170/8/0; [does not give a spell]

!?BA0; [when any battle occurs]
!!HE-10:A2/170/0/?v93; [check if the artifact is equiped (attacker)]
!!BH1:N?v95; [check if there is a defendering hero]
!!HE-20&v95<>-1:A2/170/0/?v94; [check if the artifact is equiped (defender)]

!?BR&v93>0; [expert mirth (attacker)]
!!BM0:M49/50/3;
!!BM0:V20;
!!BM1:Bv401; [get number of monsters in stack 1]
!!BM1&v401>0:M49/50/3;
!!BM1&v401>0:V20;
!!BM2:Bv401; [get number of monsters in stack 2]
!!BM2&v401>0:M49/50/3;
!!BM2&v401>0:V20;
!!BM3:Bv401; [get number of monsters in stack 3]
!!BM3&v401>0:M49/50/3;
!!BM3&v401>0:V20;
!!BM4:Bv401; [get number of monsters in stack 4]
!!BM4&v401>0:M49/50/3;
!!BM4&v401>0:V20;
!!BM5:Bv401; [get number of monsters in stack 5]
!!BM5&v401>0:M49/50/3;
!!BM5&v401>0:V20;
!!BM6:Bv401; [get number of monsters in stack 6]
!!BM6&v401>0:M49/50/3;
!!BM6&v401>0:V20;
!!BM7:Bv401; [get number of monsters in stack 7]
!!BM7&v401>0:M49/50/3;
!!BM7&v401>0:V20;
!!BM8:Bv401; [get number of monsters in stack 8]
!!BM8&v401>0:M49/50/3;
!!BM8&v401>0:V20;
!!BM9:Bv401; [get number of monsters in stack 9]
!!BM9&v401>0:M49/50/3;
!!BM9&v401>0:V20;

!?BR&v95<>-1/v94>0; [expert mirth (defender)]
!!BM20:M49/50/3;
!!BM20:V20;
!!BM21:Bv401; [get number of monsters in stack 21]
!!BM21&v401>0:M49/50/3;
!!BM21&v401>0:V20;
!!BM22:Bv401; [get number of monsters in stack 22]
!!BM22&v401>0:M49/50/3;
!!BM22&v401>0:V20;
!!BM23:Bv401; [get number of monsters in stack 23]
!!BM23&v401>0:M49/50/3;
!!BM23&v401>0:V20;
!!BM24:Bv401; [get number of monsters in stack 24]
!!BM24&v401>0:M49/50/3;
!!BM24&v401>0:V20;
!!BM25:Bv401; [get number of monsters in stack 25]
!!BM25&v401>0:M49/50/3;
!!BM25&v401>0:V20;
!!BM26:Bv401; [get number of monsters in stack 26]
!!BM26&v401>0:M49/50/3;
!!BM26&v401>0:V20;
!!BM27:Bv401; [get number of monsters in stack 27]
!!BM27&v401>0:M49/50/3;
!!BM27&v401>0:V20;
!!BM28:Bv401; [get number of monsters in stack 28]
!!BM28&v401>0:M49/50/3;
!!BM28&v401>0:V20;
!!BM29:Bv401; [get number of monsters in stack 29]
!!BM29&v401>0:M49/50/3;
!!BM29&v401>0:V20;

@supersonic: I've written an Adventure Map Creation Tutorial you can find at 'games.groups.yahoo.com/groups/tnth3group' in Files section. I'm also working on a project called ERM Box that contains a dozen wizards that can do some useful things for you. Wait till I complete it.

TNT, Supreme Master Arcomage of WR.


This did not work for me, it cast Mirth on the first stack only ?



And this is the Script for the Ambassadors Sash from  the WoG site

it did nothing. I copied it... put it in the scripter .. copied it from the scripter  to the timed events. sat the timer for 500 days and made it so human players not checked and no color player checked

ZVSE

Used:
flag300 = show dialog or add automatically
v1,v2
library function 20010

!?BA0;
!!FU20500:P;

!?FU20500;
!!BA:H0/?y1; !!HEy1&y1<>-1:A2/68/?y2/?y2;
!!FU20501&y2>0:Py1;

!?FU20501;
!!HEx1:O?y2; !!OW:Iy2/?y3; !!VRy3&300:S1;
!!VRy1:S0;
!!BA:M1/0/?y10/?y20M1/1/?y11/?y21M1/2/?y12/?y22M1/3/?y13/?y23M1/4/?y14/?y24M1/5/?y15/?y25M1/6/?y16/?y26;
!!FU20010:Px1/y10; !!VRy30:S-1; !!VRy30&v1>0/y20>10:Sy20:10; !!VRy1&y30>0:+y30; !!VRy20&y30>0:-y30;
!!FU20502&y3=1:Py30/v2;
!!FU20010:Px1/y11; !!VRy31:S-1; !!VRy31&v1>0/y21>10:Sy21:10; !!VRy1&y31>0:+y31; !!VRy21&y31>0:-y31;
!!FU20502&y3=1:Py31/v2;
!!FU20010:Px1/y12; !!VRy32:S-1; !!VRy32&v1>0/y22>10:Sy22:10; !!VRy1&y32>0:+y32; !!VRy22&y32>0:-y32;
!!FU20502&y3=1:Py32/v2;
!!FU20010:Px1/y13; !!VRy33:S-1; !!VRy33&v1>0/y23>10:Sy23:10; !!VRy1&y33>0:+y33; !!VRy23&y33>0:-y33;
!!FU20502&y3=1:Py33/v2;
!!FU20010:Px1/y14; !!VRy34:S-1; !!VRy34&v1>0/y24>10:Sy24:10; !!VRy1&y34>0:+y34; !!VRy24&y34>0:-y34;
!!FU20502&y3=1:Py34/v2;
!!FU20010:Px1/y15; !!VRy35:S-1; !!VRy35&v1>0/y25>10:Sy25:10; !!VRy1&y35>0:+y35; !!VRy25&y35>0:-y35;
!!FU20502&y3=1:Py35/v2;
!!FU20010:Px1/y16; !!VRy36:S-1; !!VRy36&v1>0/y26>10:Sy26:10; !!VRy1&y36>0:+y36; !!VRy26&y36>0:-y36;
!!FU20502&y3=1:Py36/v2;
!!IF&y1>0/y3=0:Q1/8/68/1^The aura of the Ambassador's Sash is having a magical effect on the enemy's army, causing some of them to join up with their own kind under your hero's command!^;
!!HEx1&y1>0/y3=0:Cy10/y30/y11/y31/y12/y32/y13/y33/y14/y34/y15/y35/y16/y36;
!!BA:M1/0/d/y20M1/1/d/y21M1/2/d/y22M1/3/d/y23M1/4/d/y24M1/5/d/y25M1/6/d/y26;

!?FU20502; !!BA:M0/x2/d/?y1;  !!VRy1&x1>0:+x1; !!BA:M0/x2/d/y1;

!?FU20010;
!!VRv1:S0; !!VRv2:S-1;
!!HEx1:C0/0/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S0;
!!HEx1:C0/1/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S1;
!!HEx1:C0/2/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S2;
!!HEx1:C0/3/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S3;
!!HEx1:C0/4/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S4;
!!HEx1:C0/5/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S5;
!!HEx1:C0/6/?y2/?y3; !!VRv1&y2=x2:+y3; !!VRv2&y2=x2:S6;

Ambassador's Shashs were unchanged in the test game ..I must be doing something wrong ?

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


Supreme Hero
Supreme Hero
posted October 12, 2009 08:30 AM

Is there anyway to 'disable' the normal function of an artefact?
____________

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


Famous Hero
posted October 12, 2009 09:06 AM

At least partially. If the artifact has the flag "gives magic spell" set, you can set it to 0.

Others i don't know.

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


Supreme Hero
Supreme Hero
posted October 12, 2009 09:29 AM

How about if the artefact gives resources?
____________

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


Famous Hero
posted October 12, 2009 09:40 AM

Nothing known.

I think if you want to "disable" it, you have to simulate that. This is: Get Artifact, and if hero has it, subtract resources from owner.

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

Tavern Dweller
posted October 13, 2009 11:05 AM

I'm making some progress ..

Question ...
so far i can add spells or stats to artifacts  but i cannot find how to add abilities ..Things like ,Double attack .. +** to speed in combat...
no retaliation..... immune to fire ( like Armageddon blade ).. i have looked at other scripts  but if they don't have a " hint line " i can't figure out what each line does.. i have also looked for them  in erm help and can find a list of about everything  except  them.



Second question can  Adventure map abilities be scripted ?  Things like  " Fly " from the angle wings... " map movement " like from boots of speed and Equestrian Gloves    

TY in advance...

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 228 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 ] < Prev Thread . . . Next Thread >
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1479 seconds