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 373 pages long: 1 50 ... 98 99 100 101 102 ... 150 200 250 300 350 373 · «PREV / NEXT»
Hero_of_Light
Hero_of_Light


Responsible
Supreme Hero
posted September 15, 2011 12:17 AM

@OxFEA

Quote:

!!UN:C5906498/1/172; *** summonning fire  el. sp.
!!UN:C5906519/1/56; *** summonning earth el. sp.
!!UN:C5906540/1/12; - summonning water el. sp.
!!UN:C5906561/1/125; - summonning air el. sp.
!!UN:C5896345/4/172;
!!UN:C5896352/4/56;
!!UN:C5896366/4/12;
!!UN:C5896366/4/125;



It worked but you posted the same code number twice for the air elementals (in bold). I used the Earth ones though and it worked, thanks a bunch.

The only thing left is to configure the formula anew. Do you know a way to enhance the number of summoned creatures? For instance i know the formula is currently like this:
Basic Magic: 2x spell power creatures
Advanced Magic: 3x Power
Expert: 4x Power

Is there a way to make it like x10, x15 and x20 spell power/creature? If not that's ok, I can always make the creatures the same power as the original elementals.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 15, 2011 02:36 AM

In MF receiver, at end should be :
"show the block animation with !!BM:V84" instead of BM:Q84.
____________
Era II mods and utilities

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


Promising
Famous Hero
feanor on DF2.ru
posted September 15, 2011 09:48 PM

Quote:
@OxFEA

Quote:

!!UN:C5906498/1/172; *** summonning fire  el. sp.
!!UN:C5906519/1/56; *** summonning earth el. sp.
!!UN:C5906540/1/12; - summonning water el. sp.
!!UN:C5906561/1/125; - summonning air el. sp.
!!UN:C5896345/4/172;
!!UN:C5896352/4/56;
!!UN:C5896366/4/12;
!!UN:C5896366/4/125;



It worked but you posted the same code number twice for the air elementals (in bold). I used the Earth ones though and it worked, thanks a bunch.


Oops.
!!UN:C5896359/4/12;

Quote:

The only thing left is to configure the formula anew. Do you know a way to enhance the number of summoned creatures? For instance i know the formula is currently like this:
Basic Magic: 2x spell power creatures
Advanced Magic: 3x Power
Expert: 4x Power

Is there a way to make it like x10, x15 and x20 spell power/creature? If not that's ok, I can always make the creatures the same power as the original elementals.

SPTRAITS.TXT

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


Responsible
Supreme Hero
posted September 15, 2011 10:26 PM

Thanks

It works now but i think it has a problem with wog creatures because when i tried to summon nightmares the game crashed. I may not use this if that is the case but thanks anyway, it's nice to know how to
____________
Not idly do the leaves of Lorien fall.

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


Responsible
Supreme Hero
posted September 16, 2011 01:27 AM

Quote:
Is there a way of modifying the actual script code so that it behaves more like the rust dragon's ability and less like a spell?


Congratulations on getting the command to work.  By the way, if you want to set it for the creature for the whole game, you could use an "instruction" which starts with !# instead of !!.  No trigger is required for instructions.  As ERM Help explains, all instructions are executed once at the start of a game.

There is a "brute-force" method to make any creature act like any other creature in battle, which is to change the creature type (BM:T) of the stack (after a battle has started and a stack number has been assigned to the troop of creatures).  Changing the stack type (to a different creature number, e.g., the Rust Dragon creature number) after the battle has started will not change the appearance of the creature, but will give it the special behavior of the new creature number.  Some attributes (stats) of the creature may change also, but these can be adjusted with other BM commands (see ERM Help).

This technique is used in a map called "The Dragon Slaughter", which is discussed in another post by Salamandre which is currently on page 3  of this forum.  The leader of the Tan Flag, Orrin, has the capability to give his shooters the ability to shoot fireballs or deathclouds.  This is done by changing the creature type to Magogs or Liches.

They must be changed back before the end of the battle, otherwise they  will appear as the changed creature in the Hero's troop slots (if they survive).  So some advanced scripting is needed.

It is possible there is a simpler method using UN:C pokes to change the program code, but I don't know it if so.  Anyway, the method above has been used successfully in several maps.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 16, 2011 04:45 AM
Edited by Salamandre at 06:33, 16 Sep 2011.

Somebody asked me for a tricky script and I have some problems with it.
The idea is:

We have a battle siege vs a necro. He has a stack of vampires lords in his army. On first turn, those vampires clones themselves 6 times and initial stack vanishes. Including towers those stacks will have ID 30-35. 5 of those clones are invulnerable, only 1 can take damage. The vulnerable one is randomly selected at every battle turn. If any stack is dead, the hero on right side raises it from dead. The vampires are in middle stacks, so there is no need to check if clones go outside battlefield.

My problem with it is:

If one of our units on top of the dead vampire stack, sometimes the game crashes, probably because 2 ID on same cell when necro tries resurrect. I tried to block him if our units on top, but then he doesn't cast it anymore.

Can anyone help me to see where is wrong please?

ZVSE


; vampires are BM30-BM35
!?BR&v997=0;  first round
!!VRv3456:S30 R5;
!!SS39:P1000; set animate dead power
!!DO3333/21/26/1:P63/30; check vampire lords position
!!VRv2990:Sv2888*v2889; multiply HP with number of units
!!BMv2333:Kv2990; Kill original stack

!?BR&v997>0;  get v3456 random value
!!VRv3456:S30 R5;
!!DO3334/30/35/1:P; loop through clones
!!DO3335/30/35/1:P; check how many stacks alive (30-35)

!?BG0;
!!BG:A?y1;  action
!!FU|y1<6/y1>7:E; exit if not attack or shoot
!!BG:D?v28 E?v29; get destination
!!FU&v29<0:E; exit if no target alive at destination
!!BU:Ev28/?v30; get stack at position
!!IF:V200/1;

!?BG1;
!!IF:V200/0; reset flag here because of double attack/shot (gran elves etc)

!?MF1&200;
!!VRv3457:S0;
!!DO3336/30/35/1:P; check how many VL stacks are dead and set the last to real, so battle can end
!!MF:N?y1;
!!FU&y1<21:E; exit if our troops (necessary for retaliation)
!!FU|v30<30/v30>35/v3457>4:E;  if not vampire lords clones or last stack, exit (BM30-35)
!!MF&v30<>v3456:E; disable damage if not real stack
!!VRz22&v30<>v3456:S^The clone cannot be damaged!^;
!!BMv30&v30<>v3456:V84;   show block animation
!!MM&v30<>v3456:Sz22; add battle log
**IF:V200/0; ignore invulnerability if double attack/shot unit


!?FU3333; x1 = unit type, x2 = stack number
!!BMx16:T?y1; type of unit
!!VRy2:Sy1;
!!if&y2=63:;
!!BMx16:P?y1; position
!!BMx16:N?v2888 H?v2889; get number of initial stack
!!VRv2333:Sx16; get squares around initial stack and summon 6 clones
!!VRv22:Sy1-1;
!!BU:Sx1/v2888/v22/1/-1/1;
!!BMx2:V74;
!!VRx2:+1;
!!VRv23:Sy1-17;
!!BU:Sx1/v2888/v23/1/-1/1;
!!BMx2:V74;
!!VRx2:+1;
!!VRv24:Sy1+17;
!!BU:Sx1/v2888/v24/1/-1/1;
!!BMx2:V74;
!!VRx2:+1;
!!VRv25:Sy1-2;
!!BU:Sx1/v2888/v25/1/-1/1;
!!BMx2:V74;
!!VRx2:+1;
!!VRv26:Sv23-1;
!!BU:Sx1/v2888/v26/1/-1/1;
!!BMx2:V74;
!!VRx2:+1;
!!VRv27:Sv24-1;
!!BU:Sx1/v2888/v27/1/-1/1;
!!BMx2:V74;
!!en:;

!?FU3334;
!!BMx16:N?v31;  check vampires number
!!FU&v31=v2888:E; exit if stack at full health
!!BMx16:P?v32; get position
!!BU:Ev32/?y1; get stack at position
!!FU&y1<21:E; exit if our stack is on dead corpse
**BH1:C39/v32/3/0; cast animate dead (don't check for alive - 0)

!?FU3335;
!!BMx16:N?y1; check number in stack
!!VRv3456&y1<1/v3456=x16:+1; increment v3456 if v3456 = already dead stack
!!VRv3456&y1<1/v3456=x16/x16=35:S30;
!!FU3335&v3456=30:P;redo function if BM30 dead

!?FU3336;
!!BMx16:N?y1;
!!VRv3457&y1<1:+1; count how many VL stacks are already dead



____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 16, 2011 05:58 AM
Edited by JimV at 06:19, 16 Sep 2011.

I have revised the WoG 3.58f ERM Help for the MF/BM:V84 correction and uploaded the revision to http://www.box.net/shared/nv038pb3shsgnsuuum5a

I also uploaded a complete, updated set of files for that ERM Help (3.5 MB), in case some people don't have the original version to update.

You have probably already noticed this, but if the randomly selected vunerable stack is 30, and it is alive as well as at least one other stack among 31-35, then I don't see how you will ever get out of FU3335.  This case should eventually cause a crash with a long error message ending in "Thread stack limit exceeded", or something like that.

Of course the way to verify this or other problems is to add IF:M displays of the variables for debugging information.

There are many ways of doing this.  I would start by transferring the stack numbers to a set of v-variables, say v130-v135 (v130=30, etc.) at round zero.  I would start a count of the stacks at 5 (counting from 0 to 5) in another variable, say v136.  At the start of each subsequent round I would check the stack numbers in v130-v[130+v136] in a function called by a DO (with x16 varying from 0 to v136).  Only one stack should be able to be killed per round, so as soon as I found a dead stack, I would replace its number in v[130+x16] with the last current stack number, v[130+v136], subtract 1 from v136, and end the DO. (All stacks are dead when v136<0.)

Say stack 32 is killed in round zero.  Then v130-v135 will change from

!!VRv130:C30/31/32/33/34/35; (v136=5)

in round zero to

!!VRv130:C30/31/35/33/34;  (v136=4)

in round one.

I would select the vulnerable stack with

!!VRv1:S130 Rv136; (130-135 at round 0, 130-134 after 1 stack killed)
!!VRv3456:Svv1; v3456=v[v1], e.g. if v1=133, v3456=v133

I don't know if this would be acceptable, but you could eliminate the possiblity of dead stacks on top of each other using the trick 0xFEA suggested earlier (BM:F).  (This would also prevent resurrection or reanimation of dead stacks.)

Update - I noticed after posting this that the script I was referring to has been changed from the way it was when I analyzed it.  There was no FU3336, among other changes.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 16, 2011 06:01 AM
Edited by Salamandre at 06:23, 16 Sep 2011.

Thanks, will do the homework. About resurrect, I need the necro to cast it if our unit moves later, so I don't want to set flag.

@Edit: when looking at those flags, I noticed that under BM:F, the example is related to BR:F receiver. Typo?

@Edit II: yes, I moved the dead stacks counter to MF, to get it properly. (FU3336) But I will try the suggested way.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 16, 2011 06:27 AM

Quote:
I noticed that under BM:F, the example is related to BR:F receiver. Typo?


I agree and will change the 3.58f ERM Help accordingly within the next half-hour.  Maybe there was a BR receiver instead of a BM receiver in an earlier version of WoG - or just a typo.

The next best thing I can think of would be to use the BM:F trick only if a stack is about to die on top of a previously-killed stack (maybe also depending on what the two stack numbers are).

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


Admirable
Omnipresent Hero
Wog refugee
posted September 16, 2011 06:30 AM

So this means that BH:C does not use the same mechanics as Heroes? Because we can always raise a stack of our own, even if other units died on spot.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 16, 2011 04:44 PM
Edited by JimV at 16:44, 16 Sep 2011.

Quote:
So this means that BH:C does not use the same mechanics as Heroes?


Without seeing your test map I am not sure I understand completely what is happening in it (what the two armies consist of, where the battle takes place, etc.), but I would not be very surprised if this was the case.  There are similar examples with some other ERM commands.  Just above it is reported that the EA:B command which adds Acid Breath does not produce the same mechanics as a Heroes 3 Rust Dragon.

It might be worthwhile to add notes about this sort of thing to the ERM Help, as I have in a few cases, but they can only be found by lots of testing, so probably they will never be all written down before the world turns to dust.  The lesson is to test commands and scripts under lots of conditions, and always be prepared to make revisions.  (Most such quirks can be patched, one way or another.)  (For example, a Summon (BU:S) could be used instead of a Resurrect - plus using BM:O to assign the summoned creature to the original troop slot.)

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


Admirable
Omnipresent Hero
Wog refugee
posted September 16, 2011 04:52 PM
Edited by Salamandre at 17:14, 16 Sep 2011.

My thoughts on it are that when the program search for the dead unit ID and finds another alive unit on the cell, it stores this ID and at next search,  if this unit moved from the spot, it returns no ID at all, while we clearly see there is a dead corpse there. I don't know if there is a way to test this. (BU:E will only give a stack ID if alive)
____________
Era II mods and utilities

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


Promising
Famous Hero
posted September 16, 2011 09:48 PM
Edited by solitaire345 at 21:52, 16 Sep 2011.

I fixed that typo in BF receiver in my help too. Also, corrected CB:A2 documentation from A2/$ - get/set/check an artifact $ at position # (0...) in the bonus list. to   A2/$/# - get/set/check an artifact $ at position # (0...) in the bonus list.

However the command seems to work in wrong way, as well as MR:N.


Here's the code I used for testing.

ZVSE
!?PI;
!!CB2/3/0:A3/10; Append Ogre's Club of Havoc to artifact list
!!CB2/3/0:A2/?v2/0;
!!CB2/3/0:A2/1/?v3;
!!IF:M^2 %V2^; returns 2267160
!!IF:M^3 %V3^; returns -1


Edit: actually !!CB2/3/0:A2/?v2/0; returns 2267160 no matter what artifact is set as bonus

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


Admirable
Omnipresent Hero
Wog refugee
posted September 16, 2011 10:08 PM
Edited by Salamandre at 22:24, 16 Sep 2011.

Try this:

A2/#/$ - get/set/check an artifact $ at position # (0...)
!!CB2/3/0:A2/0/?v2;

If you give a second artefact,  #=1 and so on.
____________
Era II mods and utilities

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


Promising
Famous Hero
posted September 16, 2011 10:26 PM

Oh.. I didn't notice that I wrote 1 instead of 0.

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


Known Hero
posted September 17, 2011 12:42 AM

Cool thanks for your support JimV.  I also thought of just changing the creature graphics of the two creatures so that the Azure would basically have the better of the two forms of acid breath.  I've been able to change the animated creatures, both on battle and on the map, the dwellings and sounds, but I'm having trouble changing the image you'd see of the creatures in the army's troop slots.  So far I've just renamed the corresponding files to generate the effect, but the troop pics i found in H3sprite.lod under the file name 'TWCRPORT.DEF'
I can't access the troop image cause this file seems to scroll through many other creatures.  Is there another file somewhere that I seem to not find that I can incorporate the same principles and just change the names to get the last graphics changed with it?

Cheers

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


Responsible
Supreme Hero
posted September 17, 2011 01:47 AM
Edited by JimV at 01:54, 17 Sep 2011.

Quote:
... the image you'd see of the creatures in the army's troop slots.  ...


I think creature images used in the Hero Screen troop slots are in TWCRPORT and the smaller ones shown in the lower right corner of the Adventure Screen are in CRPRSMALL - but these are "modding" questions, not ERM questions.  You should read Gnollking's Introduction to Modding post and ask such questions there and/or the Possible Creatures post.  I am pretty sure your current question is already answered in GK's post.

@Salamandre  
Quote:
... dead corpse there. I don't know if there is a way to test this. (BU:E will only give a stack ID if alive)


BU:D can be used to check for a dead stack.  With two or more dead stacks on the same hex I don't know what it will return, though.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 02:54 AM
Edited by Salamandre at 03:12, 17 Sep 2011.

I tried it simple just to check if AI hero can cast resurrect or animate undead without problems. If there is no check for our units being on top, everything goes ok.

ZVSE

!?BR&v997>0;
!!DO1/21/27/1:P;

!?FU1;
!!BMx16:N?y1;
!!FU&y1>0:E; exit if alive
!!BMx16:P?y2;
!!BH1:C38/y2/3/0; cast resurrect *THIS OK

Now if I add any check with

!!BU:Ey2/?y3; and exit if there is one of our stack on y2 position (y3<21), AI never cast the spell, even if later we moved on. Moreover, an additional problem is created if another stack of AI is on same spot. It looks like the dead AI stack ID gets screwed if other unit was on spot.

Results:
a) our alive unit is on top, cast is interrupted, but ID is forgotten later by AI
b) AI another unit is on top and alive, game crashes
c) Our unit is dead on same spot, game crashes
d) AI another dead unit is on spot, script will raise the one with the lowest stack ID
e) Should I mention the mess when several units, both from right and left side are dead on spot?

Have no idea how to solve this
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 17, 2011 03:47 AM
Edited by JimV at 04:05, 17 Sep 2011.

Quote:
...
Now if I add any check with

!!BU:Ey2/?y3; and exit if there is one of our stack on y2 position (y3<21), AI never cast the spell, even if later we moved on. Moreover, an additional problem is created if another stack of AI is on same spot. It looks like the dead AI stack ID gets screwed if other unit was on spot. ...


I am not sure I follow all of your post, but I think you are saying you want to be able to resurrect a dead AI stack (assuming it is resurrectable, not a golem, gargoyle, elemental, or undead), but want to make sure there is no other live stack on top of it, but the BU:E command gives mis-information in some cases.  Also the BH:C38 command might crash or resurrect the wrong creature in some cases.

On the first issue, you could perhaps do a two-part test:

a) your !!BU:Ey2/?y3;

b) then if y3 is a valid stack number, do !!BMy3:P?y4; and only abort the resurrection if y4=y2.

(Maybe there will be a problem with that too, but my principle is, if one thing doesn't work, try something else.  As I think Einstein said, a theory should be as simple as possible - but no simpler. ) (So if something simple doesn't work, try something more complicated.)

On the second issue, I suggested using a BU:S summon instead of BH:C38.  That is, get the creature number (N or B) and number of creatures and troop slot of the dead stack (BMx16:T? N?_ O?_;) and use these in BH:S, if the hex is not occupied by a live stack - however, there is then the issue of the dead stack number.  Perhaps using the BM:F trick on the dead stack after reading its parameters would eliminate this stack completely?  Then you could add a test for valid creature number (>-1) in your BMx16 tests (exit if invalid cr# for a stack).  Or for that matter, test its BM:F parameter and exit if the "summoned" bit is set.  (Recall that BH:S does not set the summoned bit, so the new stack would not be eliminated by this test.)  I am hoping here that BM:F would "free" the old stack number so that the AI would not run out of stack numbers after many resurrections.

That may be confusing if I haven't grokked your issue correctly - or even if so.  Given a test map and and a statement of what you want the AI to do, I might be able to do better.

Update - There are some unknowns in the above procedure which would have to be tested.  I am more confident that this would work:

At the instant an AI stack (of the sort which you want to resurrect) is about to die (under !?MF physical damage or !?MR magic damage - see my previous example of using BM:F), set  its BM:F "summoned" bit flag so it will disappear without a corpse and its stack number can be reused, but first get its N (or B?), O, P, and T parameters (saved in permanent variables), and set a flag for the next BG trigger (or under ERA you could use the special rapid TL0 trigger which Berserker gave us as was done in Shining Force).

Under that next trigger summon a new stack to the hex with the same parameters.  Then unset the flag (and disable the TL0 if used).  With this method there would be no need to check all the stacks at the start of each round - a stack would be replaced immediately after it died.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 05:19 AM
Edited by Salamandre at 05:27, 17 Sep 2011.

Thanks, sounds clear but within the need of creating clones/real stacks every turn, so checking BM30-35 constantly, all those procedures order are too complex for me because they create a new ID each time. Still I have no solution if one of our stacks dies on spot, and it may cause problems under a few circumstances...was more hoping that this could have been fixed in my original script, but it looks like it needs a new way of scripting, much more complicated.
____________
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 373 pages long: 1 50 ... 98 99 100 101 102 ... 150 200 250 300 350 373 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1758 seconds