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

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 242 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 ]
Hero_Of_Light
Hero_Of_Light


Promising
Supreme Hero
posted February 03, 2012 01:50 PM
Edited by Hero_of_Light at 13:57, 03 Feb 2012.

@ Salamandre

Interesting... How do i add this message?

Quote:
Another problem I see in the script is that once artefact unequipped, it will restore previous stats, no matter how many levels you gathered between. Should store those levels and add them, a bit complicate.


You're right at that too. It needs further consideration. For instance you can have the artifact and gain knowledge and Power and this will not be calculated. Maybe if the trigger was the entering of the hero screen? The trigger would be entering the hero screen and then it will only CHECK if the artifact is equiped. I think that might work since it will calculate the new total every time.

@Solitaire

In what case are you refering to? The spell book disapearing or the spell points removed? I don't understand what you're suggesting.
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted February 03, 2012 02:02 PM

He means storing primary stats gained in hero w vars. If I understand the concept, the hero should be able to gain only attack and defense if artefact on. So, get what he gained (att or def) and store them to w1-w2, then add those values when artefact unequipped, then set w vars to zero again. heh, you asked for...
____________

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


Promising
Famous Hero
posted February 03, 2012 02:05 PM
Edited by solitaire345 at 14:07, 03 Feb 2012.

the pseudo code snippet is workaround for losing skill points at hero's level up.

For example your hero has these skill levels:
1 2 3 4
He equips the sceptre and now has
4 6 0 0
He levels up and gets +1 attk
5 6 0 0
He removes sceptre and once again has
1 2 3 4
where he should have
2 2 3 4

And the use of w variables is to avoid mess when there are two heroes equipped with scepters
66 66 66 66      1 2 3 4

second one equips one sceptre, first one takes another. Their stats are now
132 132 0 0      4 6 0 0

The second one unequips sceptre and now we have such skills:
132 132 0 0      66 66 66 66


Everything applies to sorcerer's helms too.
I can write a script in a while if needed.

____________
My signature contains 33
symbols.

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


Honorable
Undefeatable Hero
posted February 03, 2012 02:11 PM
Edited by Salamandre at 14:31, 03 Feb 2012.

Don't forget that there is a 127 cap for stats. If you equip this artefact late game, and the result is >127, you will end with 0 stats. Should add a check, and if more than 100, set to 100.

@Edit: 127 cap, thx Bers.
____________

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


Promising
Supreme Hero
posted February 03, 2012 02:23 PM

Damn... As always it will be more difficult than i thought. Anyway, I will try and make it work tomorrow.
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted February 03, 2012 02:29 PM
Edited by Salamandre at 14:30, 03 Feb 2012.

Is not difficult, just a bit longer than the generic I gave in a hurry. Will make it soon if really need, or Solitaire said he will do.
____________

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


Promising
Famous Hero
posted February 03, 2012 02:34 PM

Quote:
@Edit: 127 cap, thx Bers.


That's more like it. 114 seemed a bit strange. I believe that by byte manipulation in exe this limit could be lifted to 255 (having negative levels make no sense anyway)

In the meanwhile, I remembered that I held last update of ERM help for quite a while without sharing it, so here it is now: Download.
Added ERM tips page (a small one yet), direct link to ERA triggers, moved few data tables from receiver pages to separate formats and deleted some duplicate pages. If some link leads you to white screen, please tell me.
Also the icon for ERA-related stuff finally has transparency
____________
My signature contains 33
symbols.

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


Honorable
Undefeatable Hero
posted February 03, 2012 02:36 PM

Is it on  the base of the one Berserker fixed? (he took yours, fixed strings)
____________

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


Promising
Famous Hero
posted February 03, 2012 02:38 PM

W-What? I definitely missed something.
____________
My signature contains 33
symbols.

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


Honorable
Undefeatable Hero
posted February 03, 2012 02:40 PM
Edited by Salamandre at 14:47, 03 Feb 2012.

he fixed your latest ERM help and included in ERA II release, I have it, nice work from both

Download
____________

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


Promising
Famous Hero
posted February 03, 2012 02:57 PM

Thanks. Maybe you know what was altered in it? I'll try to merge these two during the weekend.
____________
My signature contains 33
symbols.

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


Honorable
Undefeatable Hero
posted February 03, 2012 03:04 PM

Strings, wrong spaces, background colors, as I see.
____________

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


Promising
Supreme Hero
posted February 03, 2012 06:15 PM

I've been testing the artifacts script and i found out that it won't work unless you get a trigger for every time there is a click on the hero screen. I think that's !?CM2; but i'm not sure how to use it anyways. I realized that in addition to the hero leveling up or visiting a marleto tower or something you'll get problems when you equip and unequip other skill bonus artifacts as well. So the trigger can't be the artifact equipment thing.

And what Solitaire said about variables is right, i tested a map with two artifatcs and the total sum came all wrong as he predicted.

If you can help and give me something to work with i would really appreciate it. I would really like to add these artifacts in the upcoming update.
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted February 03, 2012 06:25 PM

After reflection, seems this feature will be very tricky to add and requires long tests. As you say, hero may visit bonus places and where to store them, he may equip other artefacts along with 162, so what's going when remove/enable again, he must also store the stats in w vars. In all, a lot of work.
____________

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


Promising
Supreme Hero
posted February 04, 2012 07:03 AM

@Salamandre

I've been trying to edit the creature bank changing script you gave me in order to edit the WOG creature banks as well. However, i wasn't able to work it through. I wanted to make the Home of the Bat be guarded by Storm Elementals and to give all kinds of Elementals as reward. However, the lines are skiped and nothing happens. Can you show me what went wrong? I also would like a way to edit the original stack numbers and set them to random (let's say 4 - 8) and edit the bonus accordingly. If you could help me with that i would really appreciate it.

**Griffin Conservatory
!#TM2:S1/1/1/255; Once
!?TM2;
!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO102/1/y-1/1:P16; [run through]
!!DO103/1/y-1/1:P16; [run through]

!?FU102;
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!OBv1/v2/v3:U?y1; [subtype]
!!FU&y1<>2:E; exit if not conservatory
!!CBv1/v2/v3:G0/7/d G1/8/d G2/8/d G3/8/d G4/8/d; [Set guards]

**Home of the Bat
!?FU103;
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!OBv1/v2/v3:U?y2; [subtype]
!!FU&y2<>17:E; exit if not Home of the bat
!!CBv1/v2/v3:G0/127/d G1/127/d G2/127/d G3/127/d G4/127/d; [Set guards]
!!CBv1/v2/v3:M0/112/d M1/113/d M2/114/d M3/115/d;  [ creature reward]
____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted February 04, 2012 10:28 AM

Home of the bat is subtype 18, not 17. Here is it, change the monster reward as you wish:

**Griffin Conservatory
!#TM2:S1/1/1/255; Once
!?TM2;
!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO102/1/y-1/1:P16; [run through]

!?FU102;
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!OBv1/v2/v3:U?y2; [subtype]
!!if&y2=2:; If conservatory
!!CBv1/v2/v3:G0/7/d G1/8/d G2/8/d G3/8/d G4/8/d; [Set guards]
!!en:;
!!if&y2=18:; if home of the bat
!!CBv1/v2/v3:G0/127/d G1/127/d G2/127/d G3/127/d G4/127/d; [Set guards]
!!CBv1/v2/v3:M1/100;  [ creature reward]**gives 100 halberds
!!en:;

The monster reward was wrong scripted, ERM says:

M$1/$2 - set/get/check a bonus creature type $1 and number $2

To add any creature bank you wish to this list, just use again after the last line:

!!if&y2=[CB subtype]:;
[Guards, reward]
!!en:;
etc.
____________

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


Promising
Supreme Hero
posted February 04, 2012 11:06 AM

Thanks! It worked  

And i found a way to randomize the number of guardians and the elemental that is given as a bonus as well. Thanks again!
____________
Not idly do the leaves of Lorien fall.

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


Promising
Famous Hero
posted February 04, 2012 04:33 PM

I think I'm done with this script. It's 276 lines, so I uploaded it to my 4shared instead of pasting it here: Download

I merged all suggestions that were posted yesterday, though I'm not sure if all cases are covered. Feel free to modify.
____________
My signature contains 33
symbols.

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


Promising
Supreme Hero
posted February 04, 2012 05:57 PM

Thanks for the effort! However, it doesn't really work. When i try to equip it there are lots of ERM errors messages and (i don't know why) all of a sudden it starts the tavern card game script.

I'm beggining to think that it isn't really worth all that fuss. I mean checking all the time if the hero has leveled up, or visited a wizard's Tower or anything...

Maybe if we returned back to the basic script... If the trigger was any click on the hero screen then i guess it would work. Maybe it can be triggered by the equipment or unequipment of ANY artifact. This way it will be right most of the times. Then there would be only the problem of having two same artifacts on the map (which i think you solved).


____________
Not idly do the leaves of Lorien fall.

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


Honorable
Undefeatable Hero
posted February 04, 2012 06:46 PM

All custom scripts are for not wogified maps/mods. If your map is wogified, then you must change Solitaire functions/variables to not used ones, he can't read your mind.

Probably variables overlap.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 242 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 ] < Prev Thread . . . Next Thread >
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3475 seconds