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 ... 110 111 112 113 114 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
mister_kalu
mister_kalu


Known Hero
posted November 07, 2011 05:45 PM

Quote:
Did you check the current value for grass (UN:C(address)/4/?v1)?  Perhaps it is already 100 (or whatever value you set).

In fact, I just tested:

ZVSE

!#VRv1:S2; --grass
!#VRv2:S0; --no pathfinding
!#VRv3:Sv1 *4 +v2 *4 +6546704;
!#UN:Cv3/4/?v4; --100 movepoints per tile?
!#IF:M^Grass movement value = %V4.^;

Answer:  Grass movement value = 100.



yes you are right, and I know the value is 100, but if you change to 500 or a different number the hero walks the same number of steps that if you don't do the change.. and this happens only in grass tile, if you do the change !#VRv1:SX; --where X [0,9] without 2, the scripts works and hero walks few steps 2 or 3..

i want to reduce the number of steps on grass

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


Responsible
Supreme Hero
posted November 07, 2011 06:14 PM
Edited by JimV at 18:39, 07 Nov 2011.

@Magissia,

I don't know why the Garrison owner change didn't work for you under a BA1 or BA53 trigger.  I would have have to write my own script and test in a test map, and I have other work to do.  If you are running under Era, you can try the TL0 trick which I have posted about here previously:  under the BA1 trigger, instead of changing the Garrison directly, enable TL0 with Bersy's minumum delay setting (about 20 milliseconds) and set a flag to enable a TL0 trigger.  Under that TL0&flag trigger, change the Garrison ownership, then disable TL0 again and zero the flag.  (You don't want TL0 triggering continuously as it would slow down the program.)

P.S. v999 is not a good variable to use because it is set automatically by several triggers, e.g. !?OB and !?HM.  I don't think that is the source of your problem, but it could screw up other scripts which expect v999 to have the map y-value at the end of a battle.  If it were my script, I would try various things before giving up on the BA1 or BA53 triggers, such as adding a small delay, refreshing the screen, moving the view, using v1 instead of v999, and anything else I could think of.  Salamandre has a trick where he does a change, checks with ?v# to see if the change has occurred, and if not, repeats the process  two or more times.

@Mister_Kalu,

If you want to slow down or speed up Heroes on any given terrain, use the !?HM-1; trigger (which executes when any Hero takes a step), check the terrain (v998/v999/v1000) which it is stepping on with the TR:T? receiver, then add or subtract movement points with HE-1:Wd.  For example, if it takes 100 movement points to take one step on grass, HE-1:Wd-400 will convert that to 500 movement points.  I have used this successfully to give Heroes extra movement.  Probably you should first get the MP (!!HE-1:W?v1;) and insure that it won't go negative due to the subtraction, in the case of reducing movement, as I am not sure what will happen if the the Hero's MP become negative.

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


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

Magissia, the town color is updated later, after BA1 processed already. Use the way around to get your garrison:

!?BA1; * after castle was taken, flag the battle or whatever
!!HE-1:O?y1; check winner, if no winner, no active hero
!!FU&y1<0:E;
!!GRx/y/z:Oy1; [change with your GR coordinates]
!!UN:R1;

Other flags/checks may be needed, it depends of your wishes.

____________
Era II mods and utilities

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


Adventuring Hero
posted November 07, 2011 09:32 PM
Edited by Magissia at 21:49, 07 Nov 2011.

Hello again

I'm trying to add a mithril cost to script 45 grow upgrade

i found out that

"!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/5; " define the cost, and the number of increased grow, but i can't set a mithril cost with it

Since it runs the function 863 i scrolled down to !?FU863, but seem to have found strings settings only

Edit : Ty Salamandre, will try it

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


Responsible
Supreme Hero
posted November 07, 2011 11:10 PM

Quote:

!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/5; defines the cost, and the number of increased growth, but I can't set a mithril cost with it.

Since it runs the function 863 i scrolled down to !?FU863, but seem to have found strings settings only


The P-parameters to FU863 appear to be wood/mercury/ore/sulfur/crystal/gems/gold/amount of increased growth per week.  (The strings used in FU836 are of course given in script45.ert in Data/s.)  So the script is not set up to use mithril as a cost for troop growth upgrades.  You will have to add this capability to the script, perhaps as a 9th parameter.

I hope this answers your question.  I must admit my track record for understanding what questions people are asking is poor.

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


Adventuring Hero
posted November 08, 2011 12:20 AM

That's not exactly what i asked, but if there's a problem, it's probably my poor english.

I was asking how to add a 9th parameter to have it be mithril.

But i'm not even sure how mithril works, i first thought it would be the ressource 7 (since 6 is gold ?) but when i tried to add a mithril reward on a creature bank it failled and did nothing.

Thanks you very much for your time JimV

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


Responsible
Supreme Hero
posted November 08, 2011 01:52 AM

From ERM Help, the OW:R command:

R#1/#2/$3; Set/check/get a resource
  #1 - Owner (See Format E1) [-1 for current owner (color)]
  #2 - Resource type (See Format R)
  $3 - Resource value

Format R is:

List of Resources
(Type 79)
0 Wood  
1 Mercury  
2 Ore  
3 Sulfur  
4 Crystal  
5 Gems  
6 Gold  
7 Mithril

So to get the amount of mithril that Red has:

!!OW:R0/7/?v1;

To subtract 5 mithril from Blue (if Blue has it):

!!OW:R1/7/d-5;

(Probably still not what you wanted to know, but maybe I'm getting closer?)

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


Adventuring Hero
posted November 08, 2011 02:55 PM
Edited by Magissia at 14:55, 08 Nov 2011.

Thanks JimV

From script 45

line 151

!!VRv434: S0;                          ;if v434=7 then player can build upgrade
!!OW:Rv428/0/?v433;                    ;v433=amount of resource
!!VRv434&v433>=x1: Sd1;
!!OW:Rv428/1/?v433;
!!VRv434&v433>=x2: Sd1;
!!OW:Rv428/2/?v433;
!!VRv434&v433>=x3: Sd1;
!!OW:Rv428/3/?v433;
!!VRv434&v433>=x4: Sd1;
!!OW:Rv428/4/?v433;
!!VRv434&v433>=x5: Sd1;
!!OW:Rv428/5/?v433;
!!VRv434&v433>=x6: Sd1;
!!OW:Rv428/6/?v433;
!!VRv434&v433>=x7: Sd1;

means i have to add

!!OW:Rv428/7/?v433;
!!VRv434&v433>=x8: Sd1;



Now i need to add the mithril cost line 52

!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/5; //pikeman

But whereever i place it, the mithril cost isn't added, i have to change the script somewhere else for it, so i need now to add, after the creature grow, a mithril cost.

I need to add the parameter mithril at the end of FU863, but i don't understand how the actual parameter are set to add the mithril one

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


Known Hero
posted November 08, 2011 03:05 PM

Quote:
@Magissia,

@Mister_Kalu,
If you want to slow down or speed up Heroes on any given terrain, use the !?HM-1; trigger (which executes when any Hero takes a step), check the terrain (v998/v999/v1000) which it is stepping on with the TR:T? receiver, then add or subtract movement points with HE-1:Wd.  For example, if it takes 100 movement points to take one step on grass, HE-1:Wd-400 will convert that to 500 movement points.  I have used this successfully to give Heroes extra movement.  Probably you should first get the MP (!!HE-1:W?v1;) and insure that it won't go negative due to the subtraction, in the case of reducing movement, as I am not sure what will happen if the the Hero's MP become negative.


yes you are right, and i did the same experiment, but this method have one mistake and is that if you change the move points !!HE-1:W, the hero walk and next, he loss the extra move points. so if you have a map with the virtual travel ( the green X icon that mark the possible way ) for 15 steps when the hero arrives to the 6-7 green X, with a lack of 7 or more steps) unexpectedly the hero stops his journey. and this may cause a serie of  troubles to a player, specially on grass ( maybe the most common terrain)

the UN receiver doesn't have this problem,

!?PI;
!!VRy1:S2; --Grass
!!VRy2:S0; --none pathfinding
!!VRy3:Sy1 *4 +y2 *4 +6546704;
!!UN:Cy3/4/400; --400 movepoints per tile

but i don't know why this doesn't work on grass and yes for all the rest of terrains

thanks

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


Responsible
Supreme Hero
posted November 08, 2011 03:37 PM

Quote:
... i have to add

!!OW:Rv428/7/?v433;
!!VRv434&v433>=x8: Sd1;

Now i need to add the mithril cost line 52

!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/5; //pikeman

But whereever i place it, the mithril cost isn't added ...


As explained in the ERM Help, the values or variables given after the P in a FU:P command are transferred into the corresponding variables x1, x2, etc. when the !?FU trigger is executed.  So in your example, x8 is the amount of growth (5).  If you added the mithril cost to your function call before the growth, that is,

!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/2/5; //pikeman

(where 2 is the mithril cost) then x8 becomes the mithril cost and x9 becomes the creature growth, so every where in !?FU863 there is an x8, it will have to be changed to x9.  Alternatively, you could add the mithril cost after the growth, e.g.,

!!FU863&1/x3=0/x2=164:P0/0/7/0/0/0/1000/5/2; //pikeman

and then you won't have to change x8 in !?FU863 but you will have to use x9 here:

!!VRv434&v433>=x9: Sd1;

There are always many different ways to write a script.

There may be other things which have to change in !?FU863 also - I have not studied the script.  Well, for sure there will be messages which have to change, to tell the player that the cost includes mithril.



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


Responsible
Supreme Hero
posted November 08, 2011 03:49 PM
Edited by JimV at 16:00, 08 Nov 2011.

Quote:
... i don't know why this doesn't work on grass and yes for all the rest of terrains


I don't either, and probably you would have to ask the programmers who designed the game that way.  My guess is they intended that there should never be a movement penalty for grass, so they didn't bother to program any use for the table value for grass, but they needed a table entry for grass so that they could index values from the table by terrain number.  That is, sand is 1 and snow is three, so if the table skipped grass, the index for snow would read the value for swamp.

It would not be difficult to eliminate all grass from a map at the start of the game, using the TR:T command in DO loop, if you insist on limiting movement.  You could even add eratz grass tiles to the sand def and convert the actual grass to sand-grass, so the map would look the same in the Adventure screen.

P.S. One can become accustomed to the path inconsistencies when using HM-1 to add or subtract movement, and a player can eliminate them by first clicking on a destination to see the overall path, then clicking on an intermediate destination a few steps away, but I agree this is not ideal.  Sometimes one has to make compromises in an imperfect world, however.

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


Adventuring Hero
posted November 08, 2011 04:43 PM
Edited by Magissia at 16:52, 08 Nov 2011.

Thanks JimV

So i decided to use x9 for mithril


!!VRv434: S0;                          ;if v434=7 then player can build upgrade
!!OW:Rv428/0/?v433;                    ;v433=amount of resource
!!VRv434&v433>=x1: Sd1;
!!OW:Rv428/1/?v433;
!!VRv434&v433>=x2: Sd1;
!!OW:Rv428/2/?v433;
!!VRv434&v433>=x3: Sd1;
!!OW:Rv428/3/?v433;
!!VRv434&v433>=x4: Sd1;
!!OW:Rv428/4/?v433;
!!VRv434&v433>=x5: Sd1;
!!OW:Rv428/5/?v433;
!!VRv434&v433>=x6: Sd1;
!!OW:Rv428/6/?v433;
!!VRv434&v433>=x7: Sd1;
!!OW:Rv428/7/?v433;
!!VRv434&v433>=x9: Sd1;


Doing that, when i have 2 mithril or more, i can't make the grow upgrade (nothing happen after selecting the level 1 dwelling)

i also modified

!!FU861&433:Px1/x2/x3/x4/x5/x6/x7/x9/v430/v431/v428/x8/;
to make the script correctly take 2 mithril bars (so i end with -2 mithril bars, or -1, since when i have the correct number of mithril bar it doesn't works)

Edit : Found out that i have to correct thoses lines

!!VRz405&v434=8/v435=0:Sz405 +z145009;

!!VRz405&v434<8/v435=0:Sz405 +z145010;

!!IF:V433/0;
!!IF&v434=8/v435=0:Q433/405;
!!IF&v434<8/v435=0:M1/405;
!!IF&v435>0:M1/405;

Now the script correctly takes 2 mithril bars and don't exit when you have enough bars

Thanks you very very much for your help JimV, i will now add mithril cost for every building in the script and share the script there

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


Responsible
Supreme Hero
posted November 08, 2011 05:14 PM
Edited by JimV at 17:19, 08 Nov 2011.

@Magissia,

Looking at the original script, I see:


!!VRv434: S0;                          ;if v434=7 then player can build upgrade
!!OW:Rv428/0/?v433;                    ;v433=amount of resource
!!VRv434&v433>=x1: Sd1;
!!OW:Rv428/1/?v433;
!!VRv434&v433>=x2: Sd1;
!!OW:Rv428/2/?v433;
!!VRv434&v433>=x3: Sd1;
!!OW:Rv428/3/?v433;
!!VRv434&v433>=x4: Sd1;
!!OW:Rv428/4/?v433;
!!VRv434&v433>=x5: Sd1;
!!OW:Rv428/5/?v433;
!!VRv434&v433>=x6: Sd1;
!!OW:Rv428/6/?v433;
!!VRv434&v433>=x7: Sd1;

!!VRz405&v434=7/v435=0:Sz405 +z145009; would you like to increase troop production?

!!VRz405&v434<7/v435=0:Sz405 +z145010; you can't afford another upgrade

So the code here is checking whether the player has enough of each resource, from wood to gold (0 to 6).  If the player has enough of each (and some may have a requirement of zero), then at the end v434 will contain the value 7.  By adding mithril, you will arrive at a value of 8 if each requirement is met.  So the tests following should be &v434=8 and &v434<8.

There are probably other changes necessary also.  Ideally, you should read the whole script and look up each command in the ERM Help until you understand everything which the script is doing.  Just as if you were adding an extension to a house you would need to read the blueprints and see where the support posts, plumbing lines, and electrical conduits are.

(Note to me:  I see that the command IF:Q#1/#2 is used by the WoG Team in this script, where #2 = the number of a z-variable.  This command is not in the WoG 3.48f ERM Help.  I will add it when I find time to make my next update.)

Edit - I see you already figured it out for yourself while I was typing that.  Good work.

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


Hired Hero
posted November 08, 2011 07:03 PM

HI!

I have another problem. I want to make mass resurrection but
I do not know how can check the spell is castable at a stack.
Can not cast resurrect on undead, magic immunity, golem, and some
others.
Is there a way to check a # spell is castable at # stack?

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


Known Hero
posted November 08, 2011 07:07 PM


hello, i have a question, the letters are white and yellow with black shadow, Salamandre says :

ERA allow :

Colorful dialogs with HTML-like syntax (yeah, white and yellow colors are in the past).

this mean that the letters will have another full colors?  for example the white color for the letters of the font is #FFF3DE, for the yellow is this : #EFD77B

if i wanna change the color to Green or something and maybe ERM will transform the colors into #00FF00 ( absolutly green).. but, this is a caprice, the letters can have different shades for borders, edges, for base.?.. in this case i want do a new medfont.fnt with not single, if not hybrid colors with 3 or 4 in their pixels for every letter ( grey, blue, white, yellow ) and that ERM with a receiver, load it. Like a external imagen ( this is much improbably because transform a picture in a font ,sounds weird and strange), but load a new font(external) for the game, I've never heard.

probably the comment before is too confused. sorry

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


Adventuring Hero
posted November 08, 2011 07:13 PM

Quote:
HI!

I have another problem. I want to make mass resurrection but
I do not know how can check the spell is castable at a stack.
Can not cast resurrect on undead, magic immunity, golem, and some
others.
Is there a way to check a # spell is castable at # stack?


Hi

You can check if unit died by getting how much units are on a stack at start, and compare it afterward.

I wish i could help you more
____________

My works

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


Hired Hero
posted November 08, 2011 07:25 PM

That is not enough. The archer can not be resurrected when has magic resistance or they are cloned or they are undead or ... There is too many checkable thing. Is there a receiver MR but I do not know how can I check the spell is able on the stack (the mouse changing to spellbook)

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


Adventuring Hero
posted November 08, 2011 08:32 PM

It's a bit out of topic, but i actually never got that the icon was a book...
____________

My works

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


Responsible
Supreme Hero
posted November 08, 2011 08:42 PM
Edited by JimV at 21:23, 08 Nov 2011.

[quote... Is there a way to check a #s spell is castable at #n stack?


There is a flag bit (16) which is set for creatures which are alive, i.e., not undead, not elementals, not golems, and not gargoyles.  It can be checked with BM#n:F.  That will eliminate most creatures, but not Gold, Black, Diamond, or Darkness Dragons.  Those could be checked for using creature type, BM:T.

In WoG, creatures can also have magic immunity which is experience-based (EA:B).  These could be checked for using the EA(-#n-1):F and EA(-#n-1):B? commands.  Actually, a Dragon might get Receptivity (no immunity to beneficial spells), so that could be checked for also.

Presence of the Orb of Vulnerability will eliminate natural immunities, but not experience-based immunities.

Edit - I forgot to mention that clones can be detected by a BM:F flag bit also.

Re-Edit - I also forgot about the Power of the Dragon Father, which should be checked for.  I don't think the Orb of Vulnerability overcomes it, but would have to do a test to be sure.

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


Hired Hero
posted November 08, 2011 09:40 PM

Thanx, but what about to cast magic immunity and something what I am not thinking? Is there a siple check for the spell not a many many tests? I think the program sets something to in/out to cast a spell or show able to cast a spell.
Is memory location about this set?


 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 ... 110 111 112 113 114 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1137 seconds