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 50 100 ... 117 118 119 120 121 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted November 21, 2011 01:19 AM
Edited by JimV at 01:20, 21 Nov 2011.

Quote:
...
!!OW:C?v2299; *Get current player
!!DO28999/0/155/1:P;

!?FU28999;
!!HEx16:O?y1; *Check hero owner
!!FU&y1<>v2299:E; *Exit if current player doesn't own the hero



A comment about variables:  I recommend using the temporary variable y-1 instead of the permanent variable v2299.

!!OW:C?y-1; *Get current player
!!DO28999/0/155/1:Py-1;

!?FU28999; x1=current owner, x16=Hero number
!!HEx16:O?y1; *Check hero owner
!!FU&y1<>x1:E; *Exit if current player doesn't own the Hero

What you have will certainly work, but the MMSF (Magissia Mithril Specialty Fix) script should be made part of a standard WoG script, so that all players have it (if they wogify), so it is better not to use a permanent variable unless it is absolutely necessary, which it is not in this case.  Even if I update the List of the Claimed in the 3.58f ERM Help, all players may not get the memo - and some may have already used v2299 in their own scripts, since it is not in the List of the Claimed currently.

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


Adventuring Hero
posted November 21, 2011 03:09 AM

I have a problem with this line

!!HEx16:X?y2/?y3; Get hero's spec

It actually SET hero's spec to 2/3 (Ressource, Sulfur)

(Current state of the script

ZVSE
!?TM1; *TM1 require script 00
!!OW:C?y-1; *Get current player
!!DO28999/0/155/1:Py-1;
!!IF:M^TEST^;

!?FU28999;
!!HEx16:O?y1; *Check hero owner
!!FU&y1<>x1:E; *Exit if current player don't own the hero
!!HEx16:X?y2/?y3; Get hero's spec
!!FU&y2<>2|y3<>7:E; Exit if not mithril spec
!!OW:Rv2299/7/d1; Add 1 mithril

)

I always though "?" was for checking and not setting.

(During all the previous test i made, i forgot ZVSE ....)
____________

My works

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


Responsible
Supreme Hero
posted November 21, 2011 04:25 AM

You always thought right.  The ?y2/?y3 is not your problem.  Look at all your commands carefully and ask yourself what they will do.  Add display commands (IF:M) if you are not sure.

As an aside, your &(condition)|(condition); is acceptable syntax, but an alternate which is perhaps more commonly used for "if A or B" is |(A)/(B); - for example:

!!FU|y2<>2/y3<>7:E;

I am not suggesting you change this, I just wanted you to be aware of the alternate.


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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 09:50 AM

In last scripts done by Fnord, the macros use probably new syntax and cause errors. I would not take the risk to spoil them by my dirty hands, so maybe when you get some time and will, can you correct to work as standalone also? Would be sad to leave them out for ever.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 21, 2011 02:46 PM
Edited by JimV at 18:36, 21 Nov 2011.

I'm not sure my hands are any cleaner, but I can try.  I think my main talent is the will to keep trying one thing after another until something finally works.  Well, that, and the fact that I always have some hunch, often ridiculous, as to why things are the way they are.  As the novel "The Day of the Jackal" illustrates, even the wrong hunch can impel one in the right direction - sometimes.

My first thought would be to get rid of all the macros, because that is what I had to do to use some of the standard WoG scripts as stand-alones.  For example, in the Living Scrolls script, even though I included the Spell and Bit macro definitions from script00 (as a separate script), I got "VNCOPY" errors at the start of a game before I converted FU$bit$ to FU3333.  The macros are convenient for remembering function and variable numbers, but of course ERM will work just as well and in fact a bit more efficiently with the actual numbers instead of the macros.

Speaking of Living Scrolls, my latest version in "Friends and Foes" no longer produces any battlefield screen glitches (the kind mister_kalu described previously) when spells are cast.  The glitches occurred when BM:C was used to cast some non-damage spells, such as Haste or Hypnotize.  Applying them to the target with BM:M instead causes no glitch, but (and my hunch is because) this also removes the animation, so I added a generic animation, V74, for all non-damage Living Scrolls spells.

Update - I have removed all the Universal Timer, Spell, and Bit macros, but there are two more macros which are not in the standard script00.erm (from allinon1_WoG.zip):  LocalPlayer and GetBasicPrim.  These refer to two new functions which were added in the post-3.58f updated set of scripts.  This poses a slight problem.  I personally do not use the updated set, having tried them, because a) while they fixed several old bugs, they also added a few new ones, and b) they use new variables, flags, and functions which are not in the ERM Help List of the Claimed - so they interfere with some of my scripts.

In my experience, the majority of the people out there do not have the updated scripts.  My evidence for this is that one of the scripts in "Ice Arrow" had an interference with one of the updated scripts, and many people downloaded the map before finally one person reported the interference.

What I intend to do is is add the updated script00.erm to the package so that the LocalPlayer and GetBasicPrim functions are available for the scripts which use them (79, 87, 97, and 119), but I don't know if the new script00 is bug-free.  That is why I wrote this long-winded explanation.

Update 2 - I have uploaded the revised scripts at my XFiles folder here:  http://www.box.com/s/1n069e3vc5vixc8l1zk5

What I have done is to edit all the macro references into actual numbers (e.g., $once$ = v2391), and add an updated script00.erm which contains two new functions which are used by some of the scripts.  There may be other bugs which I have not addressed.

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


Famous Hero
posted November 21, 2011 07:12 PM

Can someone help me with this problem?

I have this artifact giving you expert logistics and Pathfinding when you equip it.  The code works fine for the artifact, but the problem lies in the hero user screen.  what ends up happening is that none of the armies can be divided in the main hero screen when selected.  The Icon flashes quickly and then becomes dull.  The problem occurs when I input the scripts for the artifact:

!?AE1&v998=170;
!!HE-1:S0/?v7; Check if hero has Pathfinding, if yes, variable v1 will be set to 1
!!HE-1:S2/?v8; Check if hero has Logistics, if yes, variable v2 will be set to 2
!!HE-1:S0/3; Give Expert Pathfinding
!!HE-1:S2/3; Give Expert Logistics
!?AE0&v998=170;
!!HE-1:S0/v7; Remove Pathfinding, if variable v7 is 1
!!HE-1:S2/v8; Remove Logistics, if variable v8 is 2
!?CM2;
!!UN:R3/-1;

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


Responsible
Supreme Hero
posted November 21, 2011 07:49 PM
Edited by JimV at 19:51, 21 Nov 2011.

Quote:

!?AE1&v998=170;
!!HE-1:S0/?v7; Check if hero has Pathfinding, if yes, variable v1 will be set to 1
!!HE-1:S2/?v8; Check if hero has Logistics, if yes, variable v2 will be set to 2
!!HE-1:S0/3; Give Expert Pathfinding
!!HE-1:S2/3; Give Expert Logistics
!?AE0&v998=170;
!!HE-1:S0/v7; Remove Pathfinding, if variable v7 is 1
!!HE-1:S2/v8; Remove Logistics, if variable v8 is 2
!?CM2;
!!UN:R3/-1;


Problem 1:  you are using v7-v8.  Read ERM Help, List of the Claimed:

Normal Variables (v1-v10000):
(v1-v10),...

As explained there, the parentheses mean that v1-v10 are used temporarily by many of the scriptxx wogification scripts (and many user scripts as well, including almost all of mine).  So you cannot depend on v7 and v8 having the same values in another trigger as the values to which you set them.  Find unused permanent v-variables in the List of the Claimed and use them.  List all the variables, flags, timers, and function numbers you have used at the top of your script so that others (or yourself, later) can easily check for interferences with other scripts.

Problem 2:  here is how ERM Help explains the !!HE:S command:
--------------------------------
S#1/$2;  Set/check/get secondary skill
  #1 - Skill number (see Format SS)
  $2 - Skill level (0=none, 1=basic, 2 =advanced, 3 =expert).
Comments:
You can even set all(!) secondary skills (28 altogether) but only the first eight will show on the hero screen.
----------------------------------
So if you want to remove a skill, you must set the second parameter to zero, not whatever-the-heck is in v7 and v8.

Problem 3:  Here is what ERM Help says about !!UN:R3
-----------------------------------
R3/#; Redraw the hero Screen inside CM2 Trigger
-------------------------------------
You are redrawing the Hero screen with every mouse-click, including those used to shift troops.  As a doctor would say, after you told him, "Doc, it hurts my elbow when I do this, what should I do?":  don't do that.  I would get rid of the the whole !?CM2 section.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 08:00 PM
Edited by Salamandre at 20:10, 21 Nov 2011.

Thank you for Fnord script, I will update the thread.

CM2: I think fanofheroes is right. If he does not add this command, the hero screen is not updated when remove/put artefact, we need to close and open again. Probably he thought that CM will be triggered by artefact, but I don't see another solution, is it one?

On my system the script works ok.
____________
Era II mods and utilities

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


Famous Hero
posted November 21, 2011 08:15 PM

Quote:
Quote:

!?AE1&v998=170;
!!HE-1:S0/?v7; Check if hero has Pathfinding, if yes, variable v1 will be set to 1
!!HE-1:S2/?v8; Check if hero has Logistics, if yes, variable v2 will be set to 2
!!HE-1:S0/3; Give Expert Pathfinding
!!HE-1:S2/3; Give Expert Logistics
!?AE0&v998=170;
!!HE-1:S0/v7; Remove Pathfinding, if variable v7 is 1
!!HE-1:S2/v8; Remove Logistics, if variable v8 is 2
!?CM2;
!!UN:R3/-1;


Problem 1:  you are using v7-v8.  Read ERM Help, List of the Claimed:

Normal Variables (v1-v10000):
(v1-v10),...

As explained there, the parentheses mean that v1-v10 are used temporarily by many of the scriptxx wogification scripts (and many user scripts as well, including almost all of mine).  So you cannot depend on v7 and v8 having the same values in another trigger as the values to which you set them.  Find unused permanent v-variables in the List of the Claimed and use them.  List all the variables, flags, timers, and function numbers you have used at the top of your script so that others (or yourself, later) can easily check for interferences with other scripts.

Problem 2:  here is how ERM Help explains the !!HE:S command:
--------------------------------
S#1/$2;  Set/check/get secondary skill
  #1 - Skill number (see Format SS)
  $2 - Skill level (0=none, 1=basic, 2 =advanced, 3 =expert).
Comments:
You can even set all(!) secondary skills (28 altogether) but only the first eight will show on the hero screen.
----------------------------------
So if you want to remove a skill, you must set the second parameter to zero, not whatever-the-heck is in v7 and v8.

Problem 3:  Here is what ERM Help says about !!UN:R3
-----------------------------------
R3/#; Redraw the hero Screen inside CM2 Trigger
-------------------------------------
You are redrawing the Hero screen with every mouse-click, including those used to shift troops.  As a doctor would say, after you told him, "Doc, it hurts my elbow when I do this, what should I do?":  don't do that.  I would get rid of the the whole !?CM2 section.


Problems 1 and 3 I follow.  2 I'm having a little trouble figuring out the format. I know a '1' adds and a '0' removes, however it's the the format I'm having trouble with.  So far it works when you add the artifact, except when you remove the artifact the hero is left with basic logistics

!?AE1&v998=170;
!!HE-1:S0/3; Give Expert Pathfinding
!!HE-1:S2/3; Give Expert Logistics
!?AE0&v998=170;
!!HE-1:S0/v100; Remove Pathfinding, if variable v100 is 1
!!HE-1:S2/v1000; Remove Logistics, if variable v1000 is 2

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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 08:21 PM

Whatever you do, you end with VERY used variables, as v100 and v1000

Use v7895 and v7896 and you will be good.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 21, 2011 09:19 PM

Quote:

CM2: I think fanofheroes is right. If he does not add this command, the hero screen is not updated when remove/put artefact, we need to close and open again. Probably he thought that CM will be triggered by artefact, but I don't see another solution, is it one?


In "The Dragon Slaughter" there is no UN:R3 and Scouting is added and removed.  At most I would do the update once for each AE trigger, setting a flag in AE and zeroing the flag in CM2.

I say to check the List of the Claimed:

Normal Variables (v1-v10000):
(v1-v10), v11-v12, (v13-v14), v15-v23, (v24-v34), v35-v36, v40-v45, (v50-v54), v70-v71, (v76), v88-v93, (v94-v95), v100, (v101-v111), v119-v142, (v143), v144-v147, v150, v157-v200, v205, v210-v250-v257, v266-v284, v295-v299, (v300-v308), v310-v312, v320-v359, (v360-v370), v372-v373, v381-v386, v388-v389, v400-v422, v424-v444, v450, (v451-v469), v487-v505, v508, v510-v559, (v564-v571), v572-v579, v587-v599, (v600-v739), v700-v775, v777, v800, v803-v844, v846-v899, (v900-v916), (v920-v934), v950-v966, v975-v976, (v991-v993), (v997-v1000), ...

and he picks two other claimed variables.  There is no point in my giving any more advice which won't be followed.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 09:23 PM
Edited by Salamandre at 21:25, 21 Nov 2011.

Well, it depends if he intends to wogify or not. If no wogify, I would avoid v1-v10, v100 (isn't used in dialogs?), v997-v1000.
____________
Era II mods and utilities

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


Famous Hero
posted November 21, 2011 09:37 PM

haha that's all it needed!

My next trouble shooting question is this:  This artifact I have increases morale and luck by +3 when you mount it, and returns it to normal levels when you remove it.  However, if you keep it equipped, it gives you +3 for that battle, and post battle, the morale and luck are reduced even while equipped.  Infact, if you remove the artifact, the morale level is reduced to -3. I tried increasing the variables to 8895 and 8896 respectively, so i wouldn't have any overlapping occuring, but for some reason it doesn't behave as I'd like it to.  What am I missing?


ZVSE

[Set new description for Neclace of Great Fortune]
!#VRz8895:S^Neclace of Great Fortune^;
!#VRz8896:S^{Neclace of Great Fortune}
When worn, this powerful neclace increases your primary skills by 5 and gives your hero +3 morale and +3 luck.^;
!#UN:A166/9/8895; [Set new description]
!#UN:A166/10/8896;

!?AE1&v998=166;
!!HE-1:Fd5/d5/d5/d5;
!!HE-1:R0/d3; Add +3 Moral
!!HE-1:R1/d3; Add +3 Luck

!?AE0&v998=166;
!!HE-1:Fd-5/d-5/d-5/d-5;
!!HE-1:R0/d-3; Remove -3 Moral
!!HE-1:R1/d-3; Remove -3 Luck

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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 09:39 PM

Question: what does +3 morale or luck on adventure map?
____________
Era II mods and utilities

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


Famous Hero
posted November 21, 2011 09:42 PM

PS.  I didn't understand which variables were claimed, and which were not before your highlighted outline.  I thought from that other message the only variables I could use were of multiples of 10

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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 09:49 PM
Edited by Salamandre at 21:53, 21 Nov 2011.

I mean you insist to use a straight way every time you script something. But it is not always possible. You claimed you can't find a command which makes creature to retal against creatures with no retal ability. There is none. Instead there IS a command to remove "no retal" ability, which is equivalent to your demand.

Now you want an artefact to give +3 morale/luck everywhere. Why would you need it? Only in battle it can make any difference.

So script the battle

!?BA0;
a) who is hero left/right
b) who has the artefact
c) Hero who has the artefact, R0/d3 R1/d3;

Thats all.

Btw you will have a problem with !#VRz8895.
____________
Era II mods and utilities

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


Famous Hero
posted November 21, 2011 10:15 PM

There!

!?AE1&v998=166; Equip artifact
!!HE-1:Fd5/d5/d5/d5;
!!HE-1:R0/d3; Add +3 Moral
!!HE-1:R1/d3; Add +3 Luck

!?AE0&v998=166; Unequip Artifact
!!HE-1:Fd-5/d-5/d-5/d-5;
!!HE-1:R0/d-3; Remove -3 Moral
!!HE-1:R1/d-3; Remove -3 Luck

!?BA1; After any battle
!!BA:H0/?y-95; Check who the left hero was
!!BA:H1/?y-96; Check who the right hero was
!!HEy-95:A2/166/?v1/?v2; Check if the left hero still has the necklace
!!HEy-96&y-96>=0:A2/163/?v3/?v4; Do the same for the right hero, but only if it was a hero
!!HEy-95&v1>0:R0/d3; Give luck and morale bonuses
!!HEy-96&v3>0:R0/d3;
!!HEy-95&v1>0:R1/d3;
!!HEy-96&v3>0:R1/d3;


Just one thing to add:  when I click to remove/add the artifact, for a split second the hero's map stats appear in the far right side of the screen.  none of the other artifacts I have made (with you help ) demonstrate this pattern.  

I understand the logic, just articulating it in code is where i stumble.  


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


Admirable
Omnipresent Hero
Wog refugee
posted November 21, 2011 10:19 PM
Edited by Salamandre at 22:34, 21 Nov 2011.

Orrin has ID=0 (!!HEy-96&y-96>-1), and in your script, if artefact is equipped, nothing happens. Your code checks in backpack (v2-v4 stores if artefact on).
____________
Era II mods and utilities

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


Famous Hero
posted November 22, 2011 06:06 PM

Quote:
Orrin has ID=0 (!!HEy-96&y-96>-1), and in your script, if artefact is equipped, nothing happens. Your code checks in backpack (v2-v4 stores if artefact on).


I can't explain it, but for some reason the artifact works properly? I dunno, maybe I did something without realizing it, but for now I'll leave it as is until something comes from it.

I was reading back to an earlier post you sent me Salamandre, about the descriptive text used when you pick up an artifact from the adventure map.  you sent me:

ZVSE

!?OB5;
!!OB998:U?y1; [get subtype]
!!FU&y1<>166:E; [exit if not necklace #166]
!!VRz1:S^My Text^;
!!IF:M^%Z1^;
!!OB998:M-1/1/0; [disable next message]


....to add at the end of the sequence so that it reads what I'd like to specifically. I would like the image of the artifact and the name of it embedded inside the description when you pick up the artifact, very similar to when you pick up other artifacts.  Using the necklace as an example, I would require some kind of "show image and text" command more or less.  would it look something like this:  ??

!?OB5;
!!OB998:U?y1; [get subtype]
!!FU&y1<>166:E; [exit if not necklace #166]
!!VRz1:S^My Text^;
!#VRz572:S^Neclace of Great Fortune^;
!#VRz573:S^{Neclace of Great Fortune}
!!IF:M^%Z1^;
!!OB998:M-1/1/0; [disable next message]

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


Admirable
Omnipresent Hero
Wog refugee
posted November 22, 2011 07:25 PM

!#VRz572:S^Necklace of Great Fortune^;
!#VRz573:S^{Necklace of Great Fortune}^;
!#UN:A166/9/572 A166/10/573;
!?OB5;
!!OB998:U?y1; [get subtype]
!!FU&y1<>166:E; [exit if not necklace #166]
!!IF:Q1/8/166/1^custom text^;
!!OB998:M-1/1/0; [disable next message]

____________
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 50 100 ... 117 118 119 120 121 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.5818 seconds