Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile

<a href='http://www.game-advertising-online.com/' target='_blank'>Game Advertising Online</a><br> banner requires iframes

Age of Heroes Headlines:  
16 Dec 2014: Introducing Shapers of Lore, Academy Line-Up Detailed - read more
10 Dec 2014: Heroes III HD Remake Announced for January 29th! - read more
5 Dec 2014: Website Update delayed, Community Q&A, new Vote on the way! - read more
24 Nov 2014: The Wizardsí Armies Have Arrived! - read more
14 Nov 2014: Dungeon Line-up Vote #2 Results! - read more
11 Nov 2014: HC Icon Contest, Sylvan Townscreen Vote #2 - read more
7 Nov 2014: Dungeon Line-up Vote Round 2, Sylvan Townscreen Part 1! - read more
2 Nov 2014: Dungeon wins, line-up vote starts! - read more
18 Oct 2014: Tidbits of Information from Twitch.tv Stream! - read more
9 Oct 2014: Heroes 7 Wiki is Open, HC Design & Games - read more
16 Dec 2014: Introducing Shapers of Lore, Academy Line-Up Detailed - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info 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 thread is 251 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 (129) 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 ]
Salamandre
Salamandre


Honorable
Undefeatable Hero
posted January 08, 2012 09:23 PM
Edited by Salamandre at 21:53, 08 Jan 2012.

Thanks, it works perfect when we move the big stack when in hero screen. The bug remains when:

-we split the stack, the destination stack goes into negative if the split destination > a certain number, trying to find which
-when in town screen and move stack, stack vanish (should use the slider bar)
- the button "split creatures" is no more operational, but works through TAB+LMB ok (not a big issue for me)
-when another hero is adding to this stack another stack with ACE level (via exchanging screen), the experience of destination stack is lowered.

For the first situation, combining with JimV script should fix the problem. For the town screen, I don't know how.


@Edit: In my case, source stack is 52657 and the experience for split  is lost when the destination stack is between 21900 and 22000. Below this, ok.
Probably the best fix would be directly in data code, the guys from TE never looked into?

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


Responsible
Supreme Hero
posted January 08, 2012 10:04 PM
Edited by JimV at 02:48, 09 Jan 2012.

Thanks for an excellent script with some useful UN:C information, Bersy.

I have been considering what to do in TDS, which is a WoG 3.58f map.  I think I could convert Bersy's script for 3.58f use with a bit of address-searching, but the method I was thinking of was to use reduced numbers for the creature experience levels.  ERM gives access to the level 10 value with EA:L, and to some experience factors with EA:M and EA:U, but it does not give access to the "level 11 bonus" = the amount of extra experience which a stack is allowed to accumulate, above level 10.

For example, a Storm Elemental (127) can accumulate up to 56,000 experience, but level 10 is at 35,000 experience, so the extra amount is 21,000.  So far I have found the following addresses for the Storm Elemental's bonus:

WoG 3.58f:  85E2F0
Era 1.8:    85F548

(I need to do more testing on different PC's to be sure these are consistent.)

My thought is to set both the EA:L value and the bonus value to lower numbers for at least certain creatures which are commonly used in TDS, and perhaps all creatures.  This should solve all stack experience problems (until people escalate the number of creatures from hundreds of thousands up into the tens of millions), and might also solve the disappearing stack problems (not tested).

I note in testing so far that when the level 10 value (EA:L) is reduced, the maximum amount of experience which a stack can gain from a battle is also reduced--which is good.  Perhaps the balance of some maps would be affected even so, but I think that would not be true for TDS.  After a few weeks of game-time, The Doctor only generates level 10 Storm Elementals after a battle anyway.

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


Responsible
Supreme Hero
posted January 08, 2012 11:30 PM
Edited by Bersy at 23:32, 08 Jan 2012.

Val, the script covers only hero screen, not town screen or hero meeting screen. Fixed problem with split button. Also I suggest to implement custom dialog for splitting, consisting only of one input field for number (IF:[dont remember command ])

http://pastebin.com/vcfU2qHn

Jim, it's much simplier to find variables of currently selected slots for heroes meeting screen and town screen. If we have custom split operation for all these screens, the problem can be considered mostly solved.

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


Responsible
Supreme Hero
posted January 09, 2012 03:15 AM
Edited by JimV at 03:17, 09 Jan 2012.

I think these are the correct addresses for the amount of experience each creature can have above level 10:

WoG 3.58f:  20*(Creature number) + 8771844

Era 1.8:    20*(Creature number) + 8776540

These work for me in multiple program starts on both a Windows 7 and a Windows XP system, although both machines had plenty of RAM (nothing special these days, but more than older machines have) and possibly older machines with less RAM might use a different memory layout.

I used this script to rescale all creature experience level values in a test version of TDS:

ZVSE

* CreatureExpRescale, JHV, Jan. 8, 2011

* uses FU480

!?FU480; x16=cr#
!!EAx16:L?y1;
!!VRy1: :100;
!!EAx16:Ly1;
!!VRy2:Sx16*20+v5; address of Level 11 - Level 10 exp for creature
!!UN:Cy2/4/?y3;
!!VRy3: :100;
!!UN:Cy2/4/y3;

!#UN:V?v1/?v2; WoG/ERM versions
!#VRv5&v1=358:S8771844; base address of Delta11 for WoG 3.58f
!#VRv5&v1=359:S8776540; base address of Delta11 for Era 1.8
!#IF&v1<358|v1>359:M^WoG version not recognized, Creature Experience Level script not activated!^;
!#DO480/0/196/1|v1=358/v1=359:P; scale back creature exp levels by 1/100

This seems to solve all creature-experience-overflow problems in TDS, but not the Town Screen problem.  That is a different problem, an overflow in the creature count, caused by using two-byte storage for creature count in the Town Screen.  The maximum positive integer in two-byte arithmetic is (2^15)-1 = 32767.  Creature counts up to that number work okay.  If you add one more creature (in the Hero Screen), 32767+1 overflows to -32768 in two-byte integer arithmetic, and negative numbers of creatures are not displayed in the Town Screen.  They can be seen in the Hero Screen, but attempts to use a negative number of creatures for anything will crash the program.

So Bersy is right (except that was easier for me to find data tables by searching memory than to find out how the program handles troop slot selection), the ERM solution will require a custom troop splitter/combiner for the Town and Hero Meeting screens - unless and until someone who knows the code makes a patch to replace the two-byte arithmetic with four-byte arithmetic (which would not apply to WoG 3.58f).

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


Responsible
Supreme Hero
posted January 09, 2012 01:26 PM

One can try finishing the job
$06775888 - Heroes Meeting, selected side (0..1) or -1
$06775890 - Heroes Meeting, selected slot or -1
$0675254C - Visiting Hero, selected slot or -2
$067525CC - Town Garrison, selected slot or -2

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


Responsible
Supreme Hero
posted January 09, 2012 07:21 PM

Here is an interesting trick which could simplify the process a little:

ZVSE

* troop slot splitter/combiner, JHV, Jan. 9, 2011

!?CM2; click on Hero screen
!!CM:F?v1 I?v2 S?v3; get flag and clicked object values
!!FU|v1<>1/v2<68/v2>74/v3<>12:E; exit if not shift-left-click push or not creature slot
!!CM:I127 S13; change click to Split Creatures Button
!!UN:R3/-1;

This converts a shift-click operation to a Split Creatures Button operation automatically, so the player always uses the Split Creatures Button.  Since the SCB operation seems to use four-byte arithmetic, the manual data transfers are not necessary in this case.


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


Honorable
Undefeatable Hero
posted January 09, 2012 07:44 PM
Edited by Salamandre at 19:45, 09 Jan 2012.

Yes it works, although the first time is "whats going", as we need to click twice on the yellowed empty slot. I take it, thanks.

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


Adventuring Hero
Outcast Fire Witch
posted January 13, 2012 01:50 PM

I have a problem, please help.
I set quest "return with artifact" for a quest guard, but some WoG artifacts (such as Dragonheart, blank artifact,...) don't appear in the list to choose. I want to require WoG artifacts in quest guard. What erm script that I can do it?
Please help. Thanks.
____________
My HoMM3 Maps
Sorry for my bad English.

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


Responsible
Supreme Hero
posted January 13, 2012 02:56 PM

Quote:
I set quest "return with artifact" for a quest guard, but some WoG artifacts (such as Dragonheart, blank artifact,...) don't appear in the list to choose.


Go to Grayface's website at https://sites.google.com/site/sergroj/wog and download and install his Map Editor Patch 3.3.

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


Honorable
Undefeatable Hero
posted January 13, 2012 04:39 PM
Edited by Salamandre at 17:16, 13 Jan 2012.

I am not sure how to solve a problem:

When clicking on spell book, a function occurs and it assign to each spell a variable, which is dynamic, may improve through research. Until here, it is simple, click and get new spells power. Now, if you are sorcerer, it must show this variable*2, but how to avoid multiplying*2 each time you open book? Is there any way to intercept when spell book is closed and restore values? In battle it is easy, multiply spells power in BA0 then apply in BF, so it does not occur twice (BA1 reset them). But in hero screen , it will increase every time we open the book.

I get I=19 either I click on spell book or close spell book. Tracking this click with a flag (set true/false on second click on) does not work.

The script is:

!?CM2;  [Hero screen]
!!CM:F?v14 I?v15;
!!FU22000&v14=0/v15=19:P; set spells

; fu22000 occurs also in battle
!?FU22000; Set spells values for human
!!SS17:Pv5015; Lightning new power
!!SS15:Pv5019; magic arrow
!!SS54:E3/v5021; slow
!!SS13:Pv5027; fire wall
!!SS19:Pv5016; chain new power
!!SS16:Pv5020; ice bolt
!!SS23:Pv5022; Meteor
!!SS22:Pv5028; inferno
!!SS25:Pv5017; destroy undead
!!SS14:E3/v5023; earth quake
!!SS29:F?y1; fire shield
!!VRy1:&-17; [remove single target flag]
!!VRy1:|64; [add mass spell flag]
!!SS29&v6006=1:Fy1; set spell to mass if upgraded
[...follows other spells]

All those vars have double value if v1975=3.

Maybe one timer which double the values every day and when click on end turn, divide by two?

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


Responsible
Supreme Hero
posted January 13, 2012 05:35 PM

Quote:
Is there any way to intercept when spell book is closed and restore values?


If I understand what you are doing (probably not), when a Hero is a Sorcerer you want his spells shown at double spell power, and if the Hero is not a Sorcerer, at one times spell power.

Then upon a left-click of the Cast Spell button (Adventure Map), or Spell Book (Hero Screen), check to see whether the Hero is a Sorcerer or not, and set the spells accordingly, before the Spell Book is displayed.  That is, for a non-Sorcerer, make sure the spells are at one times spell power.  (Also at the start of a battle, in case a Sorcerer opened a Spell Book just prior to the battle, but the battle Hero is not a Sorcerer.)  You must have a variable or flag which records the status of the spells, e.g., zero if the spells are currently set for a non-Sorcerer, and one if the spells are set for a Sorcerer.  Or perhaps it would be simpler to save two sets of spell values, with and without Sorcery, if the spell settings are changing with time.  Anyway, the key points are: 1) always know whether the spells are set for a Sorcerer or not; 2) whenever a Hero is about to have his spells displayed, change the spell settings if the current settings do not match the Hero type.

That is too simple, so I must not understand what you are doing.

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


Honorable
Undefeatable Hero
posted January 13, 2012 05:46 PM
Edited by Salamandre at 17:55, 13 Jan 2012.

No, all heroes are sorcerers, it is a faction  choice. It is only about the right info of the spell damage, outside the battle (in battle ok).

I should probably have done the spells system different, as right now, the DL's are holding real values, you upgrade them normally, then in battle they do *2 damage if player choose sorcerer. I am thinking to remove the battle *2 modifications, put them in a daily timer, and reset them when end turn. So when open book, they show properly for this faction as well.

This is how is done:

Start game: store the spell power (not primary skill) in a var.
DL: this var increase by 10 if purchase upgrade, set new power
In battle (BA0) *2 if sorcerer faction, reset in BA1

Also the spells damage is correctly displayed in battle, as I assigned this function to CM4 as well, which occurs after BA0.

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


Responsible
Supreme Hero
posted January 17, 2012 10:18 AM

solitaire, will you update the ERM help? I'm making a package and need old ERM help replacement. Jim's variant is nice, but 3.58f only. Yours is lack of formatting (especially code) and some backgrounds.

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


Responsible
Supreme Hero
posted January 17, 2012 04:06 PM

Revised sol's erm version: http://www.multiupload.com/HPJMBDOMQG
Fixed backgrounds, erm formatting, deleted garbage (thumbs.db...), few typo.

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


Bad-mannered
Adventuring Hero
young dragon,changed
posted January 23, 2012 01:04 AM

I'm new to erm, i tried to put a visit object-then receive text command, but when I run the game it doesn't activate. I'm sure I made the specs (position of the object) right, it's put on day 675 and available for player1 only to trigger. I used !?OB and below it !!IF:M^texthere^; I haven't forgotten to put the ";" at the end of both of them and also ZVSE at the front. So what could be wrong?? Please, help!!

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


Responsible
Supreme Hero
posted January 23, 2012 04:11 AM

Quote:
So what could be wrong?


It might help to copy and paste your complete script here, and describe what object you used.  It could be some typo which you haven't yet noticed, or it could be that you used !?OBx/y/L; but the x/y/L coordinates are not the coordinates of the object's yellow square, or it could be that the object does not have a yellow square (in the Map Editor when you click the button which shows red and yellow squares), or it could be that you used !?OBtype/subtype; but used the wrong type or subtype for the object which your Hero visited, or it could be you used an &-1000 condition instead of a &1000 condition, or ... many other things.

The !?OB trigger will only work for objects which have yellow squares as shown in the Map Editor.  Adding a yellow square to an oak tree with the TR:E command during a game will not create a visitable object.  There is a tutorial in ERM Help which goes through the process of creating a visitable object via ERM commands step by step.

Probably none of that has anything to do with your actual problem, but you asked what could be wrong, and those are some things which could be.

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


Honorable
Undefeatable Hero
posted January 23, 2012 05:21 AM

Quote:
Adding a yellow square to an oak tree with the TR:E command during a game will not create a visitable object.  


In Shining Force, lumber mill quest (Granseal scripts) I added oak trees, changed to yellow square and was able to chop (visit) them.
____________

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


Bad-mannered
Adventuring Hero
young dragon,changed
posted January 23, 2012 11:34 AM

Quote:
Quote:
So what could be wrong?


It might help to copy and paste your complete script here, and describe what object you used.  It could be some typo which you haven't yet noticed, or it could be that you used !?OBx/y/L; but the x/y/L coordinates are not the coordinates of the object's yellow square, or it could be that the object does not have a yellow square (in the Map Editor when you click the button which shows red and yellow squares), or it could be that you used !?OBtype/subtype; but used the wrong type or subtype for the object which your Hero visited, or it could be you used an &-1000 condition instead of a &1000 condition, or ... many other things.

The !?OB trigger will only work for objects which have yellow squares as shown in the Map Editor.  Adding a yellow square to an oak tree with the TR:E command during a game will not create a visitable object.  There is a tutorial in ERM Help which goes through the process of creating a visitable object via ERM commands step by step.

Probably none of that has anything to do with your actual problem, but you asked what could be wrong, and those are some things which could be.


The object is visitable and the coordinates should be right - horizontal: 8  and vertical: 6 yeah, the yellow square. Here is the code i used:
ZVSE
!?OB8/6/0;
!!IF:M^{You gaze upon the small cottage for one last time.}^;

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


Honorable
Undefeatable Hero
posted January 23, 2012 11:39 AM

!?OB6/8/0, try this.
____________

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


Responsible
Supreme Hero
posted January 23, 2012 01:38 PM

Quote:
Quote:
Adding a yellow square to an oak tree with the TR:E command during a game will not create a visitable object.  


In Shining Force, lumber mill quest (Granseal scripts) I added oak trees, changed to yellow square and was able to chop (visit) them.


Quibble:  oak trees are type 135, not type 199, but you're right.  The ERM Help tutorial says to place a Sign object (which has a yellow square) which looks like a tree (or some other object) with the UN:I command, but maybe that was only to save the step of adding the yellow square manually with TR:E.  I tried putting a yellow square on an empty tile to make an exit for the Labyrinth in "300" and that didn't work - I had to use an invisible Sign.  Since then I have only used objects which had yellow squares (with disguises).

I guess the actual rule is to place a yellow square on an object, not a bare tile.  I stand corrected.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 251 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 (129) 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 ] < Prev Thread . . . Next Thread >
Post New Poll †† Post New Topic †† Post New Reply

Page compiled in 0.1888 seconds