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


Admirable
Omnipresent Hero
Wog refugee
posted November 18, 2011 10:25 PM

I am trying to get fire shield as mass spell with SS:F. I have no idea how.

0x00000040 - has mass version at expert level

Tried |64 but no success. Just making comparative results with BM flags, this is way over my poor head.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 18, 2011 10:40 PM
Edited by JimV at 23:05, 18 Nov 2011.

0x40 (hexadecimal, base 16) = 64 (decimal, base 10), so you did exactly the right thing.  It looks like Solitaire345 needs to update his manual again, to state that the mass effect does not work for Fire Shield**.  (I noted another glitch with Fire Shield previously).  I don't have to update the 3.58f Help because 3.58f doesn't have that command!  (The laziness of not switching completely to Era triumphs again.)

(My pocket calculator, like most ones designed for technical work, will convert hex to dec or vice-versa.  It can be useful at times.  I think the Calculator on most Windows PC's will also, but it is easier to pick up my TI-34.)(It runs on a solar cell with no battery and has lasted me at least 20 years now.  That reminds me - must add it to my will - but who deserves it?)

** Later - no, I must read all of the 3.59 Help one of these days.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 18, 2011 10:42 PM
Edited by Salamandre at 23:28, 18 Nov 2011.

I got it to work by dirty ways:

!?BR&v997>=0;
!!SS29:F?y1;
!!VRy1:&-280598; [checked previously what is original fire shield flag]
!!VRy1:|280645; [give protection from fire flag]
!!SS29:Fy1;

Fire shield is now mass spell, but probably my method has some backsides.
____________
Era II mods and utilities

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


Known Hero
posted November 18, 2011 11:05 PM
Edited by mister_kalu at 23:07, 18 Nov 2011.

Quote:
I got it to work by dirty ways:

!?BR&v997>=0;
!!SS29:F?y1;
!!VRy1:&-280598; [checked previously what is original fire shield flag]
!!VRy1:|280645; [give protection from fire flag]
!!SS29:Fy1;

Fire shield is now mass spell, but probably my method has some backsides. The question is what flag to give to go from 280597 to 280645? 64 is over the value.


!#SS29:F2097165;

mass fire shield without expert level


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


Admirable
Omnipresent Hero
Wog refugee
posted November 18, 2011 11:08 PM
Edited by Salamandre at 23:10, 18 Nov 2011.

Oh, forget all what I said, I was ignorant on how it works.

!?BR&v997>=0;
!!SS29:F?y1;
!!VRy1:&-17; [remove single target flag]
!!VRy1:|64; [add mass spell flag]
!!SS29:Fy1;

I forgot to remove first the single target flag, pure newbie issue
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 18, 2011 11:11 PM
Edited by JimV at 23:12, 18 Nov 2011.

Quote:
I got it to work by dirty ways:

!?BR&v997>=0;
!!SS29:F?y1;
!!VRy1:&-280598; [checked previously what is original fire shield flag]
!!VRy1:|280645; [give protection from fire flag]
!!SS29:Fy1;

Fire shield is now mass spell, but probably my method has some backsides. The question is what flag to give to go from 280597 to 280645? 64 is over the value.


To make a long story short, you erased the 0x10 single-target flag, and added the 0x40 mass-effect flag.  I didn't realize there was a single-target flag, but then I'm not an Era expert.

The long story:

According to my TI-34, 280597 = 0x44815, so &-280598 erases all those bits: 0x40000, 0x4000, 0x800, 0x10 (the culprit), 0x4, and 0x1.

280645 = 0x44845, so |280645 resets all those bits except 0x10, and adds 0x40.

So to make a mass effect spell, you must erase the single-target bit and add the mass-target bit.  Seems redundant, but that's the way it was coded.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 18, 2011 11:11 PM
Edited by Salamandre at 23:58, 18 Nov 2011.

We had same thoughts. So Solitaire, just ignore issue with fire shield. It works very well, when the coder has all his mind.

Quote:
!#SS29:F2097165;
mass fire shield without expert level


0x00000800 - friendly and has mass version
Right, used |2048. Thanks.

Just tried mass blind, phew...
____________
Era II mods and utilities

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


Known Hero
posted November 18, 2011 11:58 PM

Quote:
We had same thoughts. So Solitaire, just ignore issue with fire shield. It works very well, when the coder has all his mind.

Just tried mass blind, phew...


!#SS62:F2097165;

mass blind?

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


Admirable
Omnipresent Hero
Wog refugee
posted November 19, 2011 12:00 AM
Edited by Salamandre at 20:39, 19 Nov 2011.

Probably, I used same script as for fire shield. Did not give the value, just the flag.

How do we change permanently hero movement points?

!!HE-1:Gv556 Wv556; bonus is lost on next day?
____________
Era II mods and utilities

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


Admirable
Omnipresent Hero
Wog refugee
posted November 19, 2011 11:27 PM
Edited by Salamandre at 23:59, 19 Nov 2011.

I have a script which buggers me a lot. I need an object where any hero can buy permanent mvm points, the cost of each upgrade is doubling. Ok, until here no problem.

Now the tricky thing is that the player can overcome my calculations if he constantly equips/unequips boots of haste and gloves. I also tried to subtract 600 and respectively 300 points if those artefacts present, but it still can change values if cheats. If artefacts not equipped, all goes ok. When you equip them, the base movement returns to original, no matter the upgrades done. The base movement displayed is not the one I already have, that one remains correct, so one can upgrade endless times using the trick. Did I miss something, or?

ZVSE

;Royal stables
!#VRz117:S^{Royal Stables}^;
!#OB26/122/0:Hz117;
!#VRv4985:S10000; initial cost

!#TM6:S1/999/1/1;
!?TM6;     give daily bonus movement
!!DO6458/0/155/1:P;
!?FU6458;
!!IF:Wx16;
!!FU&w1=1:E; exit if hero never visited stables
!!HEx16:Gw2 Ww2; set to upgraded movement, otherwise the bonus is lost

!?PI;
!!DO6457/0/155/1:P;
!?FU6457;    set w1 to 1 for all heroes
!!IF:Wx16;
!!VRw1:S1;

!?OB15/15/0&1000;
!!IF:V1/0;
!!HE-1:A2/98/?y1/?y2;   check for boots of haste
!!HE-1:A2/70/?y1/?y3;   check for equestrian gloves
!!IF|y2>0/y3>0:M^Please remove any movement bonus artefacts before training^;
!!FU|y2>0/y3>0:E;
!!IF:W-1; call hero's variables
!!HE-1:G?v556; check initial mvm points
!!VRy5:Sv556:100;  get number of tiles
!!IF&v556>=4000:Q1/22/21/1^We are sorry, you are already so fast that no one can catch you! Take it easy, youngster...^;
!!FU&v556>=4000:E;
!!IF:Q1/22/21/2^Hello adventurer! At the {~Orange}Royal Stables{~} we can train your horse to travel up to {~Yellow}40 tiles{~} daily. Each training session will add 2 tiles and the price will double with each upgrade. Actually you can travel {~Yellow} %Y5 tiles{~}. Do you want to improve this?^;
!!IF&-1:M^We are sorry then. Come back to see us when in need!^;
!!FU&-1:E;
!!VRy2:Sw1; read w1 var
!!VRy2:*v4985; multiply with initial price (10000)
!!OW:R-1/6/?y3;
!!IF&y3<y2:M^You can certainly run faster without any gold in pockets, why would you need us?!^; if no gold
!!FU&y3<y2:E;
!!IF&w1=1:M^Your first training, noobie? Enjoy the progress!^;
!!VRy5:+2;
!!VRy1:S100000+y2*-1;
!!IF:Q1/6/y1/2^To improve your movement, I need {~White} %Y2{~} gold, deal?^;
!!IF&-1:M^Another time then...^;
!!FU&-1:E;
!!IF&w1>0:M^Okay then, now let me whisper to your horse the supersonic trot formula...

   {~Aqua}DONE!{~}

Your horse can now travel {~Yellow} %Y5 tiles{~} each day!^;
!!VRy2:*-1;
!!OW:R-1/6/dy2;  take gold
!!VRw1:*2;       multiply w1 var
!!VRv556:+200;   add movement
!!VRw2:Sv556;  store in w2 var for timer 6
!!HE-1:Gv556 Wv556;  set both so he can dig later



What happens: I remove artefacts and upgrade till 4000 points, which display correct. I equip both artefacts then remove and now it tells me I have still 26 tiles as before operation, while "check movement" is displaying 4000 still...
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 20, 2011 02:55 AM
Edited by JimV at 03:04, 20 Nov 2011.

After doing some tests, my understanding of the HE:G? value is this:

It gets recalculated every time a Hero equips or unequips the Boots of Speed or Equestrian Gloves - so probably also when a Hero equips or unequips a speed artifact, such as the Cape of Velocity, and when a Hero changes troops and has a faster or slower slowest creature.  That is, it tells you what movement points a Hero would have at the start of a day, for the Hero's current condition.

Example:  Sorsha starts the day with the Boots of Speed on, and has 2719 MP (both G and W).  If she removes her Boots before taking a step, she still has 2719 MP (W), but G changes to 2119.  At the Stables, she buys an upgrade, and her G value becomes 2319.  If she puts on her Boots again, her G becomes 2719.  If the game is End-Turned then, at the start of the next day she has G=W=2719 before the Timer does its work, but G=W=2319 (from w2) after. If she then takes off her Boots, G changes to 2119 (calculated based on her current condition, without of course including w2 which the Heroes program does not know about), but her MP's stay at 2319 - since MP only change with movement and various game bonuses - changing G does not change MP.

Anyway, knowing how G works, it becomes clear I think that you need to store an incremental movement bonus, not an absolute one, e.g., the +200, not G+200.  Then at the start of each day, get W (which will be the same as G at that point), add w2, and reset W and G to that value.

I would ignore the Boots and other factors and have a maximum bonus, maybe +2000, rather than a maximum absolute value of MP.

One could check for the Boots and Gloves with !?AE triggers and make some adjustments, but if I am correct, that would not be enough.  When I can, I put a Hero in a Town overnight, with all but its fastest troops in the Garrison, to get the maximum movement the next day (and use my Dress Code script to equip all my speed and movement bonuses).  To work with an absolute value, you would have to check for all those things as well - too much trouble.

P.S. Well, if you did want to limit maximum movement (except for Rally Flags and such), you could make that check as part of the Timer - after adding the w2 bonus, set the value to 4000 if it is greater than 4000.  Just don't try to do it with w2 alone.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 20, 2011 03:18 AM
Edited by Salamandre at 03:52, 20 Nov 2011.

Thank you, still very unclear to me, first time working with permanent change of movement. I noticed that I forgot to add boots/gloves bonus in timer, so hero starts with w2 points + bonuses, if any.

If no understandable solution for me, I could simply disable bonus artefacts, the stables feature replaces them, but, as you said, other factors can trigger the reset, as slower/faster creatures. Maybe if I check G and set it again once the boots are equipped, with !?AE?

Or another idea: since the w2 value is kept whatever the boots are equipped or not, limit the training sessions to 12, so every hero can get to 40 tiles. This eliminates the possibility that we can use the artefact trick to obtain >40 tiles. The cost being fixed by w1, there is no danger of a lower cost when G resets.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 20, 2011 03:58 AM
Edited by JimV at 04:17, 20 Nov 2011.

I think you may be confusing G and W.  G is the movement points which a Hero would be given at the start of a turn.  It does not change as a Hero moves, but it does change as the conditions used to set initial movement change:  artifacts, minimum creature speed, etc..  W is the movement points which a Hero has left during its turn.  It is set to G at the beginning of a turn, and decreases as the Hero moves, until it becomes less than one step's worth, when the Hero can no longer move.

Let me see if I can dissuade you from trying to keep track of everything which will affect G by this example:

Sorsha has an army of Arch Angels and Santa Gremlins.  With her Boots on, her initial movement points are 2719.  If I dismiss the Santa Gremlins, her initial movement points become 3200.  (Her movement points, W do not change as she dismisses the SG, but G, the starting value she would have the next day under that condition, does.)

My proposal is to save the bonus in w2:  first 200, then 400, and so on.

That way, if Shorsha ends her turn with the Boots on and Santa Gremlins she will have 2719+w2 MP at the start of the next day.  If she ends with SG and Boots off, she will have 2119+w2 MP the next day.  If she dismisses her SG and ends her turn with her Boots on, she will have 3200+w2 MP the next day.  How she ends the day is up to her player, but she will always get the w2 bonus which she paid for.

Again, you could also impose a limit on the maximum amount of movement, under the same Timer, but it seems fairer to me just to limit the maximum bonus, so as not to penalize the player for having obtained artifacts and high-speed creatures.

P.S. Actually, you don't need both w1 and w2 in my proposed system.  Just keep a count of the number of bonuses in w1 (start at zero, no need to initialize), and multiply it by 200.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 20, 2011 11:59 AM

Okay thanks. I will work on it today and post result.
____________
Era II mods and utilities

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


Adventuring Hero
posted November 20, 2011 02:57 PM
Edited by Magissia at 15:15, 20 Nov 2011.

What i did to fix the mithril spec don't work, i will look on fixing it later

for now i have that

!?TM1; *TM1 require script 00
!!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 don't own the hero
!!HEx16:X?y2/?y3; Get hero's spec
!!FU&y2<2/y2>2&y3<7:E; Exit if not mithril spec
!!OW:Rv2299/7/d1; Add 1 mithril

-
I tried to set Refuge camp monster with DW but it doesn't work, is there a command for it ?
____________

My works

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


Responsible
Supreme Hero
posted November 20, 2011 03:44 PM

Quote:

!!FU&y2<2/y2>2&y3<7:E; Exit if not mithril spec

You are very close - you did a lot of things correctly - but this statement is screwed up.  It should produce a syntax error, with the extra "&" in front of y3.  The specific condition you are looking for is y2=2 and y3=7, correct?  Then you want to exit if y2<>2 OR (not AND) y3<>7.  Read about the AND (&) and OR (|) syntax under Flags and Variables and try again.  Please.  (I forget that sometimes.)
Quote:

I tried to set Refuge camp monster with DW but it doesn't work, is there a command for it ?


A closer reading of ERM Help would have told you in advance that DW would not work, but there is no harm in experimenting.  DW says:

!!DW#1/#2/#3: Monster dwelling at x,y,l coordinates
(Monster Dwellings are Types 17 and 20, See Format CG)

So you could have checked in the Map Editor (Grayface v3.3) and found that Refuge Camps are type 78.  Also, clicking on the CG html link gives a complete list of all monster dwellings.

I don't see a receiver for type 78 objects under Other Objects in ERM Help, so if there is one, the WoG Team never documented it.  I might be able to find a UN:C poke for it if you really need it, but you could easily write a new script which disables the normal function of 78/0 objects (under !?OB78/0;) and replaces it with whatever new function which you would like that object to have.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 20, 2011 04:13 PM
Edited by Salamandre at 16:16, 20 Nov 2011.

Concerning my stables:

I changed at end
[...]
!!VRw1:*2;       multiply w1 var for price
!!VRw2:+200;
!!HE-1:Gd200 Wd200;

And time trigger:

!?TM6;     give daily bonus movement
!!DO6458/0/155/1:P;
!?FU6458;
!!IF:Wx16;
!!FU&w1=1:E; exit if hero never visited stables
!!HEx16:Gdw2 Wdw2; [will be added to current bonus]

Now the hero gets correct bonuses, and if he equips the boots/gloves, next turn their bonus is added to the training value.

Still, my problem remains. When remove boots later, the stables says I have 26 tiles, instead of 40, but I see 40 in display movement! I am lost. Should I add w2 to the v556 check when visit stables?
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted November 20, 2011 05:10 PM

Here are the things you can tell a player at your stables:

1) How much movement the Hero has remaining that day, both before and after paying the fee and getting the bonus.  These values will be based on HE:W, and the bonus (200 MP).

2) How much movement the Hero would have at the start of the day (under the Hero's current conditions), and how much movement the Hero would have at the start of the day with the stable's next bonus.  These values will be based on HE:G, and the bonus.

3) The amount of additional movement which the bonus will give.

Example (made up):

"Hello, traveler!  With the artifacts and team you currently have equipped, you would be able to travel 26 tiles at the start of the day (unless you found some way to extend it, such as a Rally Flag).  You currently have enough energy left to travel 8 more tiles before resting.  If you pay my fee, under the same conditions you would be able to travel 28 tiles at the start of the day, for the rest of your life!  You will also get those two additional tiles today, right now, if you act on my amazing offer."

You seem to want to quote some absolute, maximum amount of tiles, which is difficult to calculate for the reasons we have previously discussed, and would probably confuse the player (even more than my example).

I think what I would just say is something like this:

"Hello, traveler.  For a substantial fee (I don't work for a pittance), I can give you two more tiles of movement, both now, today, and every day for the rest of your life!"

(This assumes you haven't also added a limit, such as:)
!!HExx:W?v1; (for lurkers, xx means "some variable which I haven't specified")
!!VRv1&v1>4000:S4000;
!!HExx:Wv1;

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


Admirable
Omnipresent Hero
Wog refugee
posted November 20, 2011 05:27 PM

Thanks, going to work it again from scratch.
____________
Era II mods and utilities

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


Adventuring Hero
posted November 21, 2011 12:29 AM

Thanks JimV, i just forgot to put / instaed of a second & as you said, thanks pointing it.

Game didn't told me about any syntax error, that's why i didn't seen i guess.

For the refuge camp : the problem is some time, player could buy level 7  monsters at first day, i wanted to force the refuge camp to sell rogues or halfling two first weeks.
____________

My works

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

Page compiled in 0.7211 seconds