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


Admirable
Omnipresent Hero
Wog refugee
posted October 07, 2009 03:32 PM
Edited by Salamandre at 15:44, 07 Oct 2009.

Is that you are looking for?

!?OBx/y/z etc...set PO998:N1; if visited
!!PO998:N?v1; **optional
!!OB#&v1=1:M-1/1/0; (or !$OB, post trigger) **disable standard message if object was visited

or more simple, add+1 to variable if object was visited. If variable not +1, script any action you like, disabling original message

But first you have to disable the tower, so it does not give +1 defense. And script it to give +1 defense every time you visit until v$=20.
____________
Era II mods and utilities

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


Famous Hero
posted October 07, 2009 04:02 PM

Quote:
Is that you are looking for?

!?OBx/y/z etc...set PO998:N1; if visited
!!PO998:N?v1; **optional
!!OB#&v1=1:M-1/1/0; (or !$OB, post trigger) **disable standard message if object was visited


Interesting idea. But that stores just a number independent of any object, just related to ccordinates. Well, and i do not want to check if this object was visited by any hero, but visited by the currently visiting hero.

Quote:

or more simple, add+1 to variable if object was visited. If variable not +1, script any action you like, disabling original message

But first you have to disable the tower, so it does not give +1 defense. And script it to give +1 defense every time you visit until v$=20.


What i want is just normal standard behavior if the object was not visited by this specific hero, and extended behavior if it was already visited.

So for marletto tower: If a hero visits the marletto tower the first time, just do normal action (add 1 to DF and show a message). If the marletto tower is then afterwards visited by another hero, again the first time, just do the same. But if any hero revisits the object, offer to further enhance DF for a fee (a quite significant fee, increasing fast with DF to improve).

It mainly works. I just get this nasty "we can't help you further" message before my own scripts run. Standard behavior is fine for any hero visiting the first time, but should be switched off for any hero visiting any subsequent time.

So i think such a nuber handled with !!PO would not really help.


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


Admirable
Omnipresent Hero
Wog refugee
posted October 07, 2009 04:04 PM
Edited by Salamandre at 16:06, 07 Oct 2009.

Look at the end of PO section:

Q: Hmm... and then you're storing the object type and subtype in variables...that part makes sense at least.
!!PO998:Hy2Oy1Ty3Sy4; set owner, last visited hero, type and subtype of object. Still not sure what 998 refers to. So...you're setting all these? For what purpose? (See, I told you I'm confused by this!)
A: This way you may calculate all objects of particular type.
!!PO0/0/0:C63/3/0/-1/-1;
Now v1 has a number of objects type 63 and subtype 3 that was last visited by Orin (0) no matter what is his owner.


Hope it helps. Other that I can't see why it is so difficult to script an object doing different action only if visited by a specific hero. We have w variables for that.
____________
Era II mods and utilities

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


Famous Hero
posted October 07, 2009 04:22 PM
Edited by Siegfried at 16:23, 07 Oct 2009.

Interesting. I'll read it more thorough.

But it won't really help, i think. If Orrin visits the object, i could store something that Orrin has visited it (last). So far, so good. But then Valeska visits the object. Now i store that Valseka was the last visitor. Now Orrin revisits the object. But i have no information that he has already visited the object. i only have the information that the last visiting hero was Valeska.

There is an idea. What if calculating all objects with !!UN:U, then compare all the coordinates with v998/v999/v1000. And if equal i've found the number. Is that number the same number as needed for !!HE-1:V...? And are the coordinates the same as those set up by the trigger?


P.S.: What does !!PO:C do?

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


Famous Hero
posted October 07, 2009 04:37 PM

Hmmm, interesting. I think this !!PO stuff solves another problem for another tast. I thought of rewriting the "passable terrain" script to allow only heroes with pathfinding to pass some terrains. This would mean to daily add some minor changes to passability around the positin of such a hero and restore all these sqares after the hero has left. I'll think that over.

But still it does not solve the current problem. For marletto tower and most of the like i could simulate the standard behaviour in a post-visit trigger. But that's not possible with objects where you have to do a decision (arena f.ex.).

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


Admirable
Omnipresent Hero
Wog refugee
posted October 07, 2009 04:56 PM
Edited by Salamandre at 17:31, 07 Oct 2009.

As far as I can understand you, I don't see problems with limiting an object action to a specific hero. Check who is the current hero, and if it is orrin, enable a function. As disabling standard messages is a receiver (!!OB) not a trigger, it will work within the function.

Quote:
But that's not possible with objects where you have to do a decision (arena f.ex.).


Disable the object and script it as you wish. So it is still an arena but the dialog and bonuses are scripted by you.

Off topic, but fun (sorry, gif cant handle the colors of the dimensional tunnel but it looks perfect in game)
Wraith passing the star gate (whole animation is only 1 MO, extracted frames from movie):

____________
Era II mods and utilities

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


Famous Hero
posted October 08, 2009 08:54 AM

Funny stargate

Now back to the second action problem: No, i do not want the marletto tower to be limited to orin. So to avoid this misunderstanding, lets name the two example heroes X and Y. And for simplicity let's name the example object (f.ex. the Marletto Tower) O.

Let's assume the beginning of a game. There are two heroes, X and Y, and there is O. Now X visits O. Here X should see the standard action of O. Now Y visits O. Y should see the standard action of O, too. Then X revisits O. Revisiting O should then skip the standard action and instead do something different (f.ex. offer more DF+ for a fee). Works, except skipping the standard action, which is the message "sorry, we can't help you any further". Now X leaves O, and Y revisits O. O then should skip the stantard action, too, and instead do the same extra scripted action as for X before (it's always the same extra action for any hero visiting the object).

The method how to check if O was already visited by any hero i took from tobys scripts, the witch hut. The method is a nice trick. There are 2 triggers needed for that. In the pre-visit trigger store the necessary stats. I just call my standard stats store function to store any stats. Tobyns script then always disables the standard message. But that is not what i want here, since the first visit this standard action should indeed take place. Now second step is a post-visit trigger. Here i check if the standard action took place. That is, if (in this example) the DF value is one more that the one stored previously. If this is so, then it was the heroes first visit and he received the standard bonus. If not, it is a heroes revisit, and i can run my own script. Unfortunately the standard action takes place between the pre-visit and the post-visit trigger.

For any object that just unconditionally gives a single bonus i could always disable the standard message and in case the standard action took place simulate it in the post-visit trigger. For a marletto tower that would be possible. But it is not possible for f.ex. the arena, where you have to decide wether you want +2AT or +2DF. Here i would need a method in the pre-visit trigger to tell if this hero already visited this object.

Now clear?

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


Admirable
Omnipresent Hero
Wog refugee
posted October 08, 2009 10:24 AM
Edited by Salamandre at 10:44, 08 Oct 2009.

Nope :P
Maybe because I don't understand why you are torturing yourself by choosing at any price a standard object. I would choose a custom one then do something like this:

ZVSE
!#VRv66:S0;
!#IF:V99/0;
!?OB10/10/0;
!!HE-1:N?v99; **who is visiting me?
!!FU998&v99=0:P; Orrin?
!!FU999&v99<>0:P; Not Orrin?

!?FU998; **Orrin
!!IF&v66=0:Q1/31/1/32/1/7^Choose your bonus, attack or defence^;
!!HE-1&1/v66=0:Fd1/d/d/d;
!!HE-1&-1/v66=0:Fd/d1/d/d;
!!IF&v66>0:M^On next visits choose a new action!^;
!!VRv66:+1; **from now you can script whatever you want further, using v66

!?FU999; **Not Orrin
!!IF&-99:Q1/31/1/32/1/7^Choose your bonus, attack or defence^;
!!HE-1&1/-99:Fd1/d/d/d;
!!HE-1&-1/-99:Fd/d1/d/d;
!!IF&99:M^You already visited this^;
!!IF:V99/1;
On FU999 you can also use a variable to script more than one possible action after flag 99 is set

____________
Era II mods and utilities

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


Famous Hero
posted October 08, 2009 01:02 PM

First this is not about Orrin or not Orrin. The object should do that for any hero.

Second: Why standard object? Well, there are many objects in the game which do have a single action (per hero). After visiting them they are wworth nothing for the hero who has already visited them. So what i want is to give any of these single-shot objects a second action only firing when a hero 8b]revisits it. So these object will have some value throughout the game.

So for the Marletto tower that would mean: For the first visit (of any hero) give a +1DF for free. This is the standard action. Now if that any hero revisits this object he may buy another +1DF, if he can afford it. The higher the current DF is, the more it costs to add another +1DF. So you may buy as many DF+ as you want as long as you can afford it. Until the limit of 20. That would then cost 20*20*1000=400.000 gold which is quite much.

So here is the sample code for the Marletto tower (works, as desired):

** Pre-visit trigger
!?OB23;                 Marletto tower
!!HE-1:N?y-1;           Hero ID
!!FU1034:Py-1/100;      Store hero to v100..v112
!!VRv200:S-1;           No second hero
!!OB998&1000:M-1/1/0;   disable next std msg
!!FU:E;

** Post-visit trigger
!$OB23&1000;
!!HE-1:F?y-1/?y-2/?y-3/?y-4; Get primary skills
!!IF&y-2<>v102:Q1/32/1/1^The veterans living here show you some defensive tricks.^;
!!FU&y-2<>v102:E;       Gained DF, standard, exit
!!FU1107:P0/1/v100;
!!FU:E;


v102 holds the DF value of the current hero (the one who activated the trigger) stored by FU1034 in the pre-visit trigger. So if there is any difference, the standard action has taken place. If there is no difference, then obviously the hero has visited that object somewhen in the past. So then do something (FU1107).

The system for the mercenary camp is very similar. Now other objects like arena, magic school or school of war: They do offer a choice of what to gain. So i cannot simply deactivate the message in the pre-visit trigger.

So the code for the arena would be:
** Pre-visit trigger
!?OB4;                  Arena
!!HE-1:N?y-1;           Hero ID
!!FU1034:Py-1/100;      Store hero
!!VRv200:S-1;           No second hero
** Now here i can not disable the message because the player has do
** choose between attack and defense (what to learn). So i need
** a check if this current hero (the one who has activated
** the trigger) has already visited this arena in the past.
!!FU:E;

** Post-visit trigger
!$OB4&1000;             Post-visiting arena, human version
!!HE-1:F?y-1/?y-2/?y-3/?y-4; Get primary skills
!!FU&y-1<>v101:E;       Gained AT? Nothing to do.
!!FU&y-2<>v102:E;       Gained DF? Nothing to do
!!FU1107:P2/2/v100;     Gained nothing? Then do something.
!!FU:E;

Now clear?



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


Admirable
Omnipresent Hero
Wog refugee
posted October 08, 2009 01:34 PM

Quote:

** Now here i can not disable the message because the player has do
** choose between attack and defense (what to learn). So i need
** a check if this current hero (the one who has activated
** the trigger) has already visited this arena in the past.


Ok I get the idea. Have you tried to activate w variables for the hero visiting (IF:W-y1)? Then set one of them to something, and for future visits check its value and trigger new function if the hero has already visited. w variables are unique for each hero so the script will make the difference.
____________
Era II mods and utilities

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


Famous Hero
posted October 08, 2009 02:13 PM
Edited by Siegfried at 14:40, 08 Oct 2009.

Yes, that sounds promising. But still i need to store in that w variable which of n Marletto Towers the hero already visited. You see, there may be many (up to 32, i think) of them on a map.

There is a way to check if any hero with given ID has visited f.ex. Marletto Tower #5. But how to tell if that Marletto Tower the Hero is currently visiting is #5?

So the problem seems (for me at least) to remain the same. I still somehow need the number of the object to check if the hero has visited it in the past.

So f.ex. i thought of some function initially looping through all those objects and maybe use PO to store the objects number in that user defined place in the objects coordinates. When visiting an object i get those coordinates in v998/v999/v1000. So i might then just read the variable stored at that location. The big question is: Is this the same number as the one needed by checking if a hero has visited object number x? I don't think so. Looping through the objects numbers them beginning in the upper left corner, left to right, top to bottom, surface to unterground. The numbers for checking are stored when you place the object in the editor. So the first object placed gets number 1, the second object number 2, and so on. Obviously the numbering scheme is different.

Maybe something is stored in that control word. But i don't have any information about it.

Edit: For now i'll limit functionality to Marletto Tower and Mercenary Camp. I'd like to get an idea of how to handle Stax Axix and Garden of Revelation. I think it makes no sense to pay gold to them to gain additional knowledge or power.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 08, 2009 02:24 PM

Well, there is a problem in your script. If marleto tower gives def for 5000 gold the first time and for 10k gold the second time, the player will simply visit another marleto to get def for the first price and so on. It seems to me a better idea that once a marletto was visited, all marlettos on the map are reseted to increase price for that hero. This was already done in 16.erm script (battle academy)using both PO and W variables.

It will simplify your script too.
____________
Era II mods and utilities

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


Famous Hero
posted October 08, 2009 02:48 PM

No

The price does not depend on the Marletto Tower, but on the heroes current DF. So on revisiting any Marletto Tower you get the same price.

But of course cou can at any time visit any Marletto Tower not yet visited to get 1DF for free. But the next +1DF buyable will cost the same at all Towers.

But indeed it has a strategic aspect. So in the beginning of a game it might be advisable to buy additional 1 or 2 DF for low money. But then this money will be missing when building up your towns. So it is a gamers decision.

Later in game when the hero already has some decent DF additional DF will be quite costly. So it depends on wether you actually have that money to spend or need it urgently to buy troops. Again that's gamers decision.

There is 1 Problem still to handle: How to cope with AI. The AI will never revisit a visited one-shot object. So i thought resetting the visited flag for all those objects once a month, but for AI only. Similar to an existing script, but much more interesting for human players.

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


Famous Hero
posted October 08, 2009 05:25 PM

In case there are still open questions, here is the function called by the Marletto Tower and the Mercenary Camp. There is some code unnecessary for both, this is meant for Arena or School of War, where you have a choice. But this is disabled for now.


** Adding primary skills for a fee.
** Might version
** Fee is calculated by current * current * 1000
** x1 = AT+
** x2 = DF+
** x3 = Hero ID
!?FU1107&1000;
!!FU&x1=0/x2=0:E;
!!FU&x3<0:E;
!!FU&x3>155:E;
!!HEx3:F?y1/?y2/?y3/?y4; Primary skills
!!HEx3:O?y5;
!!FU&y5<0:E;            No owner?
** Choose what to improve
!!VRv1:S0;
!!VRv1&x1=0:S2;
!!VRv1&x2=0:S1;
!!IF&x1>0/x2>0:Q1/34/0/35/0/10^Hi again. You want to learn more? Right. Please choose.^;
!!FU&v1=0:E;            Escape
!!VRz1:S^Oh my, that is beyond our knowledge. You already topped the best.^;
!!IF&v1=1/y1>20:M1/1;
!!FU&v1=1/y1>20:E;      Limit
!!IF&v1=2/y2>20:M1/1;
!!FU&v1=2/y2>20:E;      Limit
!!VRy10&v1=1:Sy1*y1*1000*x1; Cost
!!VRy10&v1=2:Sy2*y2*1000*x2;
!!OW:Ry5/6/?y11;        Owner current gold
!!IF&y11<y10:M^That would cost %Y10. Unfortunately you don't have enough.^;
!!FU&y11<y10:E;
!!IF:Q1/6/y10/2^Well, that costs %Y10. Do you want to visit our school?^;
!!FU&-1:E;
!!VRy11:-y10;           Subtract cost
!!OW:Ry5/6/y11;
!!HEx3&v1=1:Fdx1/d/d/d; Add AT
!!HEx3&v1=2:Fd/dx2/d/d; Add DF
!!IF:M^Thanks for visiting our school.^;
!!FU:E;

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

Tavern Dweller
posted October 09, 2009 11:34 PM

Thank you all for the fine work , i have learned a lot from this thread.
I am just starting to look into changing things. i have some questions.

I would like to put the effects of some of the combine artifacts on the blank ones , the cloak of the undead king effects ,on the blank sword.
Effects of Armor of the Dammed on a blank one . can this be done ?

Second question i could not find the files for the combo artifacts. i found all the upgrade ones , but not Angelic Alliance , Armor of the Dammed, or Cloak of the Undead King. what erm file # are they stored in ???

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


Famous Hero
posted October 10, 2009 10:03 AM
Edited by Siegfried at 10:05, 10 Oct 2009.

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.

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


Supreme Hero
posted October 10, 2009 04:35 PM

I just finished my first ERM artefact .
The script uses this one:



I call it "Necklace of Mana".
It gives +5 spell points when equipped .
Here's the script:

ZVSE
ERMS_ScriptDate=10.10(October).2009
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
!?OB5/166;

!!UN: Ov998/v999/v1000;
!!UN:Iv998/v999/v1000/5/166;

!!ARv998/v999/v1000:M^{Necklace of Mana}

When weared, this powerful Necklace gives +5 Spell Points each day.^;

!?AE1&v998=166;
!!HE-1:Y7/5/400/1;
!?AE0&v998=166;
!!HE-1:Y7/5/400/0;

!#VRz427:S^{Necklace of Mana}

When weared, this powerful Necklace gives +5 Spell Points each day.^;
!#HT5/166:T427;


Well, it doesn't actually give +5 spell points, it
gives a blessing that gives you +5 spell points
each day . I didn't know how to make it give spell
points, so i used a blessing .
I am not so good in this, but i think this is a good artefact for a map im just working with .
____________

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


Admirable
Omnipresent Hero
Wog refugee
posted October 10, 2009 04:40 PM

hehe, you need a time trigger if wanna do something each day.
____________
Era II mods and utilities

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


Supreme Hero
posted October 10, 2009 04:45 PM

You mean that only by giving this blessing wont give spell points daily?:


____________

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


Admirable
Omnipresent Hero
Wog refugee
posted October 10, 2009 04:49 PM
Edited by Salamandre at 16:49, 10 Oct 2009.

I never tested this, but I guess it is when you equip the artefact (?AE1) that the blessing is given. Your blessing is one day long and you did not specified to the game to look if artefact is still equipped. So every time you equip it, the blessing is given but vanish the next day. Needs test.
____________
Era II mods and utilities

 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 ... 44 45 46 47 48 ... 50 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3266 seconds