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


Responsible
Supreme Hero
posted September 17, 2011 03:24 PM
Edited by JimV at 15:40, 17 Sep 2011.

Here is a simplified version of my second proposed method

ZVSE

* Resurrect enemy stacks (test)
* uses flag 195 and v101-v104

!?MF1; stack about to take damage
!!MF:F?v1 N?v2; corrected damage, stack number
!!FU&v2<21:E; do enemy stacks only
!!BMv2:H?v3 L?v4; stack HP and HP lost
!!VRv4:+v1; lost + damage
!!FU&v4<v3:E; exit if stack not about to be killed
!!BMv2:Fd4194304 ; assumes stack is not already summoned (via spell)
!!BMv2:B?v101 O?v102 P?v103 T?v104; get number, slot, hex, type
!!IF:V195/1;

!?BG1&195;
!!BU:Sv104/v101/v103/1/v102/1;
!!IF:V195/0;

!?BG0&195;
!!BU:Sv104/v101/v103/1/v102/1;
!!IF:V195/0;

It works in my test map.  As I said, a !?MR trigger should also be used to check for spell damage, for completeness.  I only tested for enemy stacks, because I am not clear on what your exact test condition should be*.  An animation could be added for dramatic effect, et cetera.

* I got the impression that you wished to resurrect the cloned Vampire stacks which you mentioned earlier, but this confuses me since I thought all but one of them were invulnerable.

Update - Maybe the issue is keeping track of the stack number to use in the previous random selection?  That could still be done in combination with summoned resurrection.  Suppose the starting stack numbers have been saved in v130-v135 as discussed previously.  Then under MF (and MR if spell damage is also to be considered), search v130-v[130+v136] (with a DOnn/0/v136/1 and FUnn) for the stack number v2, and save its index (x16) in v137.  Then under the BG triggers, get the new stack number via BU:Ev103 and place it in v[130+v137]. (Replacing the old stack number of the dead stack.)

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 03:39 PM
Edited by Salamandre at 15:53, 17 Sep 2011.

Your script resurrects instantly the dead stack on BG1 and on same AI turn (as soon as he moves) again if removed BG1. The idea was to resurrect next turn. To be more explicit, this is the demand I received:

VL summon 6 images of them selves and vanish.
From those 6 images, one is real and can be damaged
When the real one is damaged, the 5 others are instantly killed
Next turn, all 5 killed are resurrected as long as the real one still has HP left and the real stack is again randomly selected among them.

After reflection, I realized that the player, by reloading the battle until he "guesses" which is the real stack on first hit, can realize a back-hole and destroy all the VL in one turn, by concentrating all his attacks on the real one.

So I proposed a version where the "images" will not vanish as soon as the real stack is hit. If the real stack is only damaged and not killed, he will not be resurrected next turn. In other words, AI can resurrect only dead stacks, not damaged ones. So the battle issue depends on finding the real stack in SAME turn and destroying it completely. Due to random vulnerability among the 6 stacks (to be done every turn), this is a luck factor and makes the battle a puzzle.

In my script all worked fine until there was another stack on the dead spot, and from there the dead ID was lost. One idea would be to create a 1 hex obstacle as soon as a stack dies and remove the obstacle + resurrect on next turn, using examples from your script. Due to the obstacle, none will be able to move on spot.

To say the truth, I am not convinced that this battle can be won, under such circumstances. I tried to imagine a better puzzle using his ideas, but I am stuck. The challenge is creating a puzzle which can't be avoided by reload, and also the battle being winnable (ie in your script we can't win).
____________
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:53 PM
Edited by JimV at 16:03, 17 Sep 2011.

Quote:
... If the real stack is only damaged and not killed, he will not be resurrected next turn. In other words, AI can resurrect only dead stacks, not damaged ones. So the battle issue depends on finding the real stack in SAME turn and destroying it completely. ...



I understand better now but am still a bit confused because the above suggests that if the real stack is destroyed it will be resurrected.  I am sure you have a workable plan, but I might have to see it in action to understand it.

Anyway, as I now see it there were two separate plans.  The first one led you to investigate resurrecting dead stacks one turn later and find that this can't be done without the possibility of errors and crashes.  The solution as I see it is to use BU:S instead of BH:C38, but not insist that the summoned creature be on the same hex as the dead stack which it replaces.

Update - as I was writing this I got a notice that you had edited your post, so I did not see your edit until after posting.  In response to the issue of winning by luck:

It can not be completely avoided, but it can be reduced to pure luck, not reloading, by randomizing the battle, as mentioned in ERM Help.  We did this in SAR and SF battles.  Chose a random VR:T number, then run a DO that many times, in which the DO function chooses a random VR:R number.  Then each time a player reloads, he or she will be in a different location in the sequence of VR:R numbers for the battle, so the vulnerable stack will probably be a different stack number in round zero.  The player could still guess that stack number by luck, but cannot eliminate wrong guesses by reloading.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 03:54 PM
Edited by Salamandre at 15:56, 17 Sep 2011.

I added a few important edits while you were posting. The real stack cannot be resurrected if only damaged. So the only way to win is that the real stack (constantly changing among the 6) is enough damaged so on x turn we can destroy it and remove all others.
____________
Era II mods and utilities

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 04:10 PM

Quote:
Chose a random VR:T number, then run a DO that many times, in which the DO function chooses a random VR:R number.


This does not change anything, the mechanics of reload still remain the same:

First turn, my fastest unit attack one of VL, he blocks (image stack).
I exit the battle and redo until my fastest unit hits the real(luck). Then concentrate all attacks on this unit.
____________
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 04:36 PM
Edited by JimV at 16:45, 17 Sep 2011.

The VR:T (and subsequent DO) is done under BA0 at the start of the battle.  Reloading takes some time, so the T value will change when the battle is re-fought after reload (unless the player waits 24 hours).  This method is described in ERM Help*.  I think it was invented by Fnord.  I last tested it in early work on SAR battles to see if McKay would start a battle with different random exclamations using it, and it worked then.

As I said it does not prevent pure luck, just the elimination of bad guesses to leave only the correct guess.  The player could win by reloading over and over and always attacking the same stack until his guess was correct, but could also win by fighting additional rounds of the same battle.  Which is easier depends on how many choices (enemy stacks) there are and how difficult the vulnerable stack is to kill, which are adjustable parameters.


* It is in the notes at the end of some section, in the form of a reply to Fnord from Slava.  I can't find it quickly right now, but have seen it a couple times.  This is why I tell people to read all of ERM Help.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 04:40 PM

I am using it myself, it is a better randomizer, I know.
I think I found a way to avoid the "reload" back-hole: change the real stack at each attack/shot. We have a 1/6 chance then to damage the same one in two consecutive attacks. Reloading isn't going the help much.
____________
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 05:24 PM

Quote:
Your script resurrects instantly the dead stack  ... The challenge is creating a puzzle which can't be avoided by reload, and also the battle being winnable (ie in your script we can't win).


The last parenthetical comment seems uncalled for to me.  I said that I didn't understand clearly what you were trying to do and so I tested for enemy stacks only, leaving it to you to set the proper tests so the battle would be winnable.

Anyway, I won't offer any more suggestions.  Good luck with your script.

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


Admirable
Omnipresent Hero
Wog refugee
posted September 17, 2011 05:33 PM
Edited by Salamandre at 18:33, 17 Sep 2011.

Was only a ascertainment, not a reproach. Myself I was not sure about how the original idea can work. Thanks for the help, I will manage it one way or another without getting other people mad.
____________
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 09:25 PM

Okay, a last thought.  Reloading to re-fight a battle could be made more tedious and therefore more apt to be avoided by something like this:


!?GM1; just before Save
!!VRv138:Sc; save game day for saved game in v138

!?(event which triggers puzzle battle--assumed to be prior to BA0);
!!IF:M^This battle can only be fought after five days have passed since the last save!^; (player could also be warned at game start)
!!VRv1:Sc0-v138;
!!FU&v1<5:E; (don't allow battle) (may require more than this depending on trigger)

The player could reload to try again, but would then have to End Turn five times - or ten times, if five still seems too easy.  This would give an incentive to fight each battle more than a few rounds before retrying - especially if there were other work to re-do during the turns such as building in towns or visiting windmills.

Still, it would be better to give the player a fixed number of tries, say three, to win the battle.  This could be done by writing to and reading from an external file (not a saved game) which would contain a counter for the battle.  I am sure Berserker could provide this capability in ERA, if he has not done so already.  (WoG 3.58f can read an external file of WoG settings, and can write the WOGERMLOG file, but cannot write and read the same file, as far as I know.)

The ability to assign a random filename for this external file, create it at the start of a game, and delete it at the end of a game would be necessary.  That way, more than one game could be played with the same map at the same time.  If the file must exist with a fixed name prior to the start of the game, then starting a new game with the map would set the counters back to zero so that a previously-saved game could be retried more times.

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


Famous Hero
posted September 18, 2011 05:21 AM

Just wanted to say thank you to all!! I figured out how to mod and erm Heroes.  Considering I had literally zero knowledge at the start of how to do this, with all your help I've been able to edit the creatures around and give them all unique level abilities.  Now I can find more ways to enjoy the game.  You guys should be the ones behind making heroes 7!!

thank you ,

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


Admirable
Omnipresent Hero
Wog refugee
posted September 18, 2011 10:30 PM
Edited by Salamandre at 00:14, 19 Sep 2011.

@Oxfea and solitaire345

Quote:
!!MR:N is a WoG command that works correctly only in ERA


Seems not. I never get a valid stack, only 7 digits numbers.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 19, 2011 02:04 AM

There is a similar problem with the BG:S command.  Getting the spell number (BG:S?__) only works for a Hero cast (BG:A=1).  For a creature cast (BG:A=10), the value returned is always -1.

I have tested this for Master Genies, Arch Angels, Fairie Dragons, and Santa Gremlins, in both WoG 3.58f and ERA 1.8.

The WoG 3.58f ERM Help has been updated to note this at http://www.box.net/shared/nv038pb3shsgnsuuum5a

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


Admirable
Omnipresent Hero
Wog refugee
posted September 19, 2011 03:24 AM

I needed a table with the values MR:N comes with. They are always same, and using those values to identify stacks works okay.

!!BM0  1279814426
!!BM1  -892451011
!!BM2  92086932
!!BM3  294
!!BM4  809588289
!!BM5  -895556259
!!BM6  2200050
!!BM7  373
!!BM9  809588289
!!BM10 -900037783
!!BM11 -856693037
!!BM12 40450
!!BM13 1128486465
!!BM14 1378878633
!!BM15 83410647
!!BM16 535336
!!BM17 1396921921
!!BM18 -878537482
!!BM19 65892902
!!BM20 373
!!BM21 -845570755
!!BM22 3500066
!!BM23 884734
!!BM24 1129117764
!!BM25 994531203
!!BM26 92091216
!!BM27 294
!!BM28 1665947201
!!BM29 1642086850
!!BM30 3890354
!!BM31 373
!!BM32 1716278849
!!BM33 1517526282
!!BM34 125126544
!!BM35 391276
!!BM36 1280162562
!!BM37 1041329346
!!BM38 92093582
!!BM39 294
!!BM40 1296848449

From what I see 294 and 373 are coming 3 times. But in regular battles using 7-8 stacks on each side, they won't, so still can help except for mass damage spells.

____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted September 19, 2011 03:05 PM
Edited by JimV at 15:12, 19 Sep 2011.

That is interesting and useful, and will probably also be useful to someone who can fix the code.

Another way to get the stack number for an MR trigger is to use a BG0 trigger in series with the MR.  Here is an example which I have used:

!?BG0; get stack # for MR1
!!BG:A?v1 E?v2 Q?v3 S?v4; action, target stack, side, spell number
!!FU&v1<>1/v1<>10|v2<21/v3=1:E; exit if not actions 1 or 10, plus other conditions specific to the script
*!IF:M^BG0: A=%V1, E=%V2, S=%V4^; Santa Gremlin: A=10, E=22, S= ... -1?
!!VRv101:Cv2/v4; save stack and spell in v101 and v102
!!IF:V196/1; set flag to enable MR1

!?MR1&196; stack about to take magical damage
!!IF:V196/0;
!!MR:F?v1 S?v2; corrected damage, spell number
*!IF:M^MR1: v2=%V2, v102=%V102, stk=%V101^; SG: v2=16, v102=-1, stk=22
**FU&v2<>v102:E; removed after IF:M showed BG:S? invalid.
...

I wanted to use the spell number to verify the transaction, but this can't be done since BG:S? doesn't give the spell number for action 10.  However, the stack number from BG0 has always been correct in MR1 in my tests so far.  This method only applies to cast spells, though.

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


Honorable
Supreme Hero
posted September 19, 2011 03:16 PM

Valery, MR:N contains garbage, dont rely on it.

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


Responsible
Supreme Hero
posted September 19, 2011 05:39 PM
Edited by JimV at 00:36, 20 Sep 2011.

So far (five different program starts - but more tests are needed), the address 0x255B29C = 39170716 (decimal) contains the target stack number during !?MR1, under WoG 3.58f.  That is,

!!UN:C39170716/1/?v1; WoG 3.58f MR:N target stack

gives the (actual) target stack in v1.  However, the address does not work for ERA 1.8, but probably a different address can be found that works for ERA.

I noticed something strange during the tests.  When Fire Shield is cast on a stack by an AI Succubus (i.e., cast as a beneficial spell, like Bless), the MR1 trigger is activated for the target of the cast.  Not only that, but after the cast, every time another stack on the AI side moves, during the remainder of the round, MR1 triggers multiple times.  The UN:C value is -1 during these multiple triggers.  This process stops after every stack except for the original target stack has moved.  (I guess the process might occur regardless of what actions the stacks take, but in my tests they were AI stacks, and always moved.  More testing will be done.)

In all of these triggers, the MR:S? spell number was 29 (Fire Shield), and the final damage (MR:F?) was either 1 or 2, but the stacks did not take any actual damage.

So when using !?MR1 to assess magical damage on a stack, be aware that your script must screen for Fire Shield casts so as not to count their damage.

Once I have tested enough to feel certain of the facts, I will add the information to the WoG 3.58f ERM Help.

Update - There is another address, 8873348, which usually contains the target stack number under !?MR1, but it does not when Fire Shield is cast.  However, when EA:B is used to cast a Magic Arrow before an attack, 39170716 contains -1, and 8873348 contains the correct (target) stack number.  I have also learned that damage done by a Fire Shield does not show up under !?MR1, but as physical damage under !?MF1.  So it appears that !?MR1 should be ignored whenever the spell is 29, in which case, so far, 8873348 will give the correct target stack.  (This is for WoG 3.58f only, a different address will be needed for ERA, which I haven't studied yet.)  However, checking 39170716 may give some additional information (= target stack for a Hero or creature cast of a damage spell, =-1 for an EA:B spell?).

Incidentally, I will start checking MR:N values again in my tests.  When I started this project yesterday, I did check it for a while and remember the value 373 but I think it was for one of stacks 21-24.  There is lots more testing to do, but I need to take a break and do some real-world chores.

Update 2 - Just got MR:N = 889022380 for a Magic Arrow attack on stack zero.  The Magic Arrow came from an EA:B "before attack" creature ability.  Then I got MR:N = 373 for an Ice Bolt cast by Santa Gremlins on stack 22.  8873348 had the correct stack number in both cases (under WoG 3.58f), and 39179716 had -1 and 22, respectively.

Update 3 (then I'm done for a while) - My candidate for the ERA 1.8 address is 0x847F04.  0x88E50C usually works (in my two test starts - more are needed), but contains -1 when a creature experience-based ability casts a spell.  I mention these in case someone wants to test them under the current version of ERA.

Update 4 - So far, these numbers still work for me, for Hero casts, Santa Gremlin casts, creature experience ability casts (but I haven't tried all the damage spells), and the Thunderbird's natural Lightning Bolt:

* get address for valid MR:N
!#UN:V?v1/?v2;
!#VRv30&v1=358:S8873348; address for actual MR:N under MR1 for WoG 3.58f
!#VRv30&v1=359:S8683268; address for actual MR:N under MR1 for Wog/ERA 1.8 (h3wog.exe)

!?MR1; stack about to take magical damage
!!MR:F?v1 S?v2 N?v3; corrected damage, spell number, bogus stack #
!!FU&v2=29:E; skip Fire Shield
!!UN:Cv30/1/?v6; v6 = target stack number


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


Honorable
Supreme Hero
posted September 19, 2011 07:23 PM

From phoenix:

!?FU29999; Get mon ID
;vx1 - stack (init=-1)
!!UN:C42231940/4/?y1;
!!VRy1:+56;
!!UN:Cy1/4/?y2;
!!FU|y2<0/y2>186:E;
!!BU:Ey2/?y3;
!!FU&y3=-1:E;
!!VRvx1:Sy3;

Afair, Diakon helped a lot a long ago.

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


Responsible
Supreme Hero
posted September 20, 2011 04:22 AM

The WoG 3.58f ERM Help Update has been updated at http://www.box.net/shared/nv038pb3shsgnsuuum5a

The UN:C command has been added (copied from Solitaire345's work), and the MR:N comments have been expanded with a sample script to read the actual target stack number using UN:C.

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


Honorable
Supreme Hero
posted September 20, 2011 10:03 AM
Edited by Bersy at 11:40, 20 Sep 2011.

For 3.58:

!?FU29999; Get mon ID
;vx1 - stack (init=-1)
!!UN:C42147184/4/?y1;
!!VRy1:+56;
!!UN:Cy1/4/?y2;
!!FU|y2<0/y2>186:E;
!!BU:Ey2/?y3;
!!FU&y3=-1:E;
!!VRvx1:Sy3;

Example:
!?MR1;
!!VRv2:S-1;
!!FU29999: P2;
!!FU&v2=-1:E;

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 390 pages long: 1 50 ... 99 100 101 102 103 ... 150 200 250 300 350 390 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1315 seconds