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 ... 45 46 47 48 49 ... 50 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Siegfried
Siegfried


Famous Hero
posted October 10, 2009 04:50 PM

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
posted October 10, 2009 04:50 PM
Edited by gnollking at 16: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 05:32 PM

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
posted October 10, 2009 06: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


Admirable
Omnipresent Hero
Wog refugee
posted October 10, 2009 08: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;
____________
Era II mods and utilities

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


Supreme Hero
posted October 10, 2009 08: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


Admirable
Omnipresent Hero
Wog refugee
posted October 10, 2009 08:13 PM
Edited by Salamandre at 20: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;

____________
Era II mods and utilities

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


Supreme Hero
posted October 10, 2009 08: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


Admirable
Omnipresent Hero
Wog refugee
posted October 10, 2009 08:30 PM

Me too.
____________
Era II mods and utilities

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


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

Right.
____________

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

Tavern Dweller
posted October 10, 2009 10: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 11: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 11, 2009 12:33 AM

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


Admirable
Omnipresent Hero
Wog refugee
posted October 11, 2009 12:45 AM

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.
____________
Era II mods and utilities

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

Tavern Dweller
posted October 12, 2009 01:39 AM

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
posted October 12, 2009 02:30 PM

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 03:06 PM

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
posted October 12, 2009 03:29 PM

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 03:40 PM

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 05:05 PM

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
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 ... 45 46 47 48 49 ... 50 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3290 seconds