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 ... 131 132 133 134 135 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
solitaire345
solitaire345


Promising
Famous Hero
posted February 05, 2012 01:24 PM

Well, to be honest, I didn't test this script whole. Only few parts of it.
I found that the source of syntax errors was at the line which sould have exited FU1 if artifacts are -1, 161 or 162. I broke it to separate commands and now it works.
The tavern card game happened because it uses the same function numbers I used. You can change them to your liking

However I ran into another problem: even when artifacts aren't equipped, other artifacts don't give any bonus.. I'm not sure what happened, so I won't upload it yet.



By the way, did you know that AE trigger happens when map is loading and your starting bonus is random artifact?
____________

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


Responsible
Supreme Hero
posted February 05, 2012 02:35 PM

I thought that the AE trigger was called when you equiped or unequiped an artifact. I don't think you need to start with an artifact the map in order to have this trigger functional but anyways...

I have an idea on the matter that might solve the problem. What if the trigger was the start of the battle instead of the equipment of the artifact. This way, the artifact won't give anything when wielded in the adventure map (and so the hero will be able to cast spells and stuff normally) but in battle it will function and so every time it will have the new variables (whatever they may be). This way i think it will work for the AI player as well. What do you think?

I post the basic idea of the script. I don't know how the checking of the artifact being worn works, if you can help me with that.

!?PI;
!#UN:P67/?v5000;   [Check is the script is enabled, otherwise exit]
!!FU&v5000<>1:E;

!?BF; [Battlefield setup trigger]

!#UN:P67/?v5001;   [Check is the script is enabled, otherwise exit]
!!FU&v5001<>1:E;

!!BH0:N?y-1; [Attacking hero: y-1]
!!BH1:N?y-2; [Defending hero: y-2]
***Here it should check whether any on of them bears the artifact
!!HE-1:F?v110/?v111/?v112/?v113; Get stats
!!VRv114:Sv110;
!!VRv115:Sv111;
!!VRv116:Sv112;
!!VRv117:Sv113;
!!VRv110:+v112;
!!VRv111:+v113;
!!VRv112:-v112;
!!VRv113:-v113;
!!HE-1:Fv110/v111/v112/v113;

!?BA1; **end of the battle
!!HE-1:Fv114/v115/v116/v117;

I actually would like to know how to check if the hero wields an artifact for future reference. For instance, how do you make an artifact give your troops a spell and how to afflict the opponents troops with a spell? I would really like to know how to do this because i have some nice ideas for a combination artifact.

____________
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 05, 2012 03:37 PM
Edited by solitaire345 at 16:35, 05 Feb 2012.

Quote:
I thought that the AE trigger was called when you equiped or unequiped an artifact. I don't think you need to start with an artifact the map in order to have this trigger functional but anyways...


That's true. What I wanted to say was that it is also triggered when your starting bonus is random artifact. Found it when trying to debug this script. Also when a map is restarted, the script is triggered for ballista and war machines (seems like ERM scripts from previous map aren't yet unloaded at that point).



Returning to your script I found another problem: artifact bonus is applied AFTER AE1 trigger, but I think it can be solved with enabling TL trigger for a while.

EDIT: In theory I fixed some errors and it SHOULD work properly. You can download modified script here. However though HE:F returns correct values, skills displayed for hero are wrong:

I am absolutely sure that values for this part of script aren't modified between getting and displaying them.




I'm not sure if checking whether hero has artifact can be done with ERM, but it definitely can be done via SN:X. I'll recheck your script and then try to make artifact checking.


____________

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


Responsible
Supreme Hero
posted February 05, 2012 04:16 PM
Edited by Hero_of_Light at 17:34, 05 Feb 2012.

I suggested the artifact checking for the script i posted in the previous post not the original idea. I think there is a command that checks if the attacking hero or the defending one wields a certain artifact because there are many artifacts in WOG that give a bonus ONLY in the battlefield. That's what i suggested for my artifacts as well.

***EDIT***


In theory I fixed some errors and it SHOULD work properly. You can download modified script here. However though HE:F returns correct values, skills displayed for hero are wrong:

I am absolutely sure that values for this part of script aren't modified between getting and displaying them.



First of all, the picture shows nothing wrong. The Knowledge and Power are set as 1 as a default (even if you try to make them 0). Same doesn't apply for attack and Defense which can take the number 0. I am guessing that Knowledge and Power can't be 0 (and come to thing of it, even the Barbarians start with 1 Knowledge and Power). Secondly, i tried it but still has problems.

I told you that working the battlefield trigger would be the solution. I am really close on making it work. Read this:

***Artifacts

!?BF; [Battlefield setup trigger]

!#UN:P67/?v5979;   [Check is the script is enabled, otherwise exit]
!!FU&v5979<>1:E;

!!BH0:N?y-1; [Attacking hero: y-1]
!!BH1:N?y-2; [Defending hero: y-2]
!!HEy-1:A2/162/?y1/?y2;  [check for artifact]
!!HEy-2:A2/162/?y3/?y4;  [check for artifact]
!!FU&y2<0:E; [Exit if zero]
!!HEy-1:F?v110/?v111/?v112/?v113; Get stats
!!VRv114:Sv110;
!!VRv115:Sv111;
!!VRv116:Sv112;
!!VRv117:Sv113;
!!VRv110:+v112;
!!VRv111:+v113;
!!VRv112:-v112;
!!VRv113:-v113;
!!HEy-1:Fv110/v111/v112/v113;
!!FU&y4<0:E; [Exit if zero]
!!HEy-2:F?v120/?v121/?v122/?v123; Get stats
!!VRv114:Sv120;
!!VRv115:Sv121;
!!VRv116:Sv122;
!!VRv117:Sv123;
!!VRv110:+v122;
!!VRv111:+v123;
!!VRv112:-v122;
!!VRv113:-v123;
!!HEy-2:Fv120/v121/v122/v123;

!?BA1;
!!BH0:N?y-1; [Attacking hero: y-1]
!!BH1:N?y-2; [Defending hero: y-2]
!!HEy-1:A2/162/?y1/?y2;  [check for artifact]
!!HEy-2:A2/162/?y3/?y4;  [check for artifact]
!!FU&y2<0:E; [Exit if zero]
!!HEy-1:Fv114/v115/v116/v117;
!!FU&y4<0:E; [Exit if zero]
!!HEy-2:Fv124/v125/v126/v127;


Now, up until the red part it works. When hero equips or unequips the artifact, nothing changes. Even when equiping other artifacts and so on. When a battle starts the hero's stats are rearranged as they should be. So it works. The problem is that when the battle is over the hero still has all his or her stats on Attack and Defense. I would like to rearrange them as they were but apparently i'm using the end of the battle trigger wrong. If you can help me with that i think it would be over and done with.
____________
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 05, 2012 06:08 PM
Edited by solitaire345 at 18:08, 05 Feb 2012.

Quote:
First of all, the picture shows nothing wrong. The Knowledge and Power are set as 1 as a default (even if you try to make them 0).


Oops.. I didn't know it. Thanks.

Quote:
i tried it but still has problems.


What problems? I can try to fix them.


As for your script, i can suggest only two things.


Use !#UN:P67/?v5979; as receiver (!!UN:P67/?v5979;) not instruction




Also you should check if y-2 is -1 (no defending hero) after this line: !!BH1:N?y-2; to avoid errors.


I fail to see anything else wrong in your code.. Try to save all variables with UN:J10 before applying stats back and see what are their values.
____________

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


Responsible
Supreme Hero
posted February 05, 2012 07:08 PM

I don't know what else i can do, the end of battle trigger doesn't do anything. If anyone can help, please post.
____________
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 05, 2012 07:11 PM

Just saw it: you are checking for artifact 162 two times and zero times for 161.

And can you specify what problems you experienced with my script?
____________

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


Responsible
Supreme Hero
posted February 05, 2012 07:36 PM

No i didn't add the script for artifact 161. I check for 162 two times in case it is wielded by the attacking hero or the defending hero. That's why it checks for y2 and y4.

As for your script it's probably my fault. I copied it and pasted it in my script (because frankly i'm still too much of a roockie to use it as it is) and i had these problems:

The card game still went on (and i didn't even had that WOG option ON)

After that, when i unequiped the artifact there was a new artifact that appeared out of nowhere in the hero's neck and the stats were all made to 0 0 1 1.

Anyway, i keep trying to tell you that although i appreciate the effort, your script is way too large and there are so many asspects to consider this way.

On the other hand i think what i suggest is better, since the hero will be able to use the adventure spells normally and the stats will be changed only in battle (where it actually counts). It still needs a lot of testing but i think i am on the right track. If i configure how to use the Battle ending trigger then it will most likely be done.
____________
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 February 05, 2012 08:01 PM

I think that post battle trigger (BA1) can't determinate who was attacker and defender. I would check for artefact in BA0, set a w var to 99 if one hero has it, then after battle, check the survivor (HE-1:O?y1) w vars, and if w=99, do the modifications.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted February 05, 2012 08:33 PM

I don't understand how that would work. What trigger should i use in the end? And how do the w variiables work exactly?
____________
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 February 05, 2012 08:56 PM
Edited by Salamandre at 20:57, 05 Feb 2012.

w vars are hero identity card, unique for each. I did not follow closely what's going on, just saw your attempt to read attacker/defender ID after battle, but one is already dead and no sure it is stored somewhere.


;in battle, artefact 162 bost attack/def with spell p/knw values. After battle it returns to normal.

!?BA0;
!!BA:H0/?y-1 H1/?y-2;
!!HEy-1:A2/162/d/?y2;  [check for artifact]
!!HEy-2&y-2>-1:A2/162/d/?y4;  [check for artifact]
!!FU&y2<1/y4<1:E;
!!if&y2>0:;
!!IF:Wy-1;
!!VRw3:S99;
!!FU333:Py-1;
!!en:;
!!if&y4>0:;
!!IF:Wy-2;
!!VRw3:S99;
!!FU333:Py-2;
!!en:;

!?FU333;
;x1=Hero ID
!!HEx1:F?v110/?v111/?v112/?v113; Get stats
!!VRv114:Cv110/v111/v112/v113;
!!VRv110:+v112;
!!VRv111:+v113;
!!VRv112:-v112;
!!VRv113:-v113;
!!HEx1:Fv110/v111/v112/v113;

!?BA1;
!!HE-1:O?y1;
!!FU&y1<0:E;
!!IF:W-1;
!!FU&w3<>99:E;
!!HE-1:Fv114/v115/v116/v117;
!!VRw3:S0;

Also I did not envisioned that both heroes can have the sword in same battle, you may need to select other vars for defender if want to.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted February 05, 2012 09:05 PM

It works! Thanks a bunch

I will have to run some test of course but while attacking adventuring creatures it works perfectly.

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 05, 2012 09:08 PM

I thought I posted this message, but apparently, not.. I think Salamandre is right why your script doesn't work. It triggers when one hero is already not there and battle structure is probably wiped out.

However I can explain why my script failed.
Quote:
The card game still went on (and i didn't even had that WOG option ON)


It's because that script checks for options only before calling that function and not in the function itself. If you apply wogification, WoG autoloads every script regardless of their options and thus there was another FU1 with tavern card script.

Quote:
After that, when i unequiped the artifact there was a new artifact that appeared out of nowhere in the hero's neck and the stats were all made to 0 0 1 1.


The same applies. Some variable got changed between artifact re-equip script and tavern card dame. This is why script-local functions are great feature introduced in those released sources of WoG.

Quote:
And how do the w variables work exactly?


Imagine them as a table with 200 columns and 156 rows. you choose a row with IF:W command and then acces the column you want as any other numeric variable.

____________

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


Responsible
Supreme Hero
posted February 06, 2012 02:04 AM

@Solitaire

Well, the thing is that i can't know which variables to change and in what i should change them. So i will try my luck with the script Salamandre gave me...

@Salamandre

...speaking of which... it doesn't work that good afterall, because now whenever a hero that DOESN'T have the artifact attacks there are several script error messages writing something about "can't find hero" and "hero's number limit" or something like that.

Can you find out what went wrong?
____________
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 February 06, 2012 02:56 AM

I don't know, can you describe test conditions, and what other scripts are used in battle? Post here the error message from WOGERMLOG.TXT, from top until end of context.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted February 06, 2012 11:46 AM
Edited by Hero_of_Light at 12:03, 06 Feb 2012.

***EDIT***

@Salamandre's next post.

You were right. I changed them to y-3 and y-4 and it works. Thanks!
____________
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 February 06, 2012 11:56 AM
Edited by Salamandre at 11:59, 06 Feb 2012.

Bah, both scripts use y-2 for checking hero, that's what we get when mix same variables. Change y-2 in one of them...

You can delete common vars, only until end of context is helpful.

!?PI;
!#UN:P67/?v5991;   [Check is the script is enabled, otherwise exit]
!!FU&v5991<>1:E;

!#UN will not exit PI in this case, will run before. Use receiver.(!!)
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted February 06, 2012 12:06 PM

The halfling script works ok... What are you suggesting that i should change and why?
____________
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 February 06, 2012 12:22 PM

if I understand well, from your script you want:

!?PI;
exit now if !#UN [...]

!# is instruction
!? is trigger
!! is receiver.

This is the order the game reads them.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted February 07, 2012 05:02 PM

@Salamandre

The artifact script doesn't work afterall. It actually works on SoD, AB and RoE maps but in WOG maps (and this in random maps as well) it doesn't and there are the same error messages. I made the changes you suggested (and tested a few changes) but i couldn't get it to work. I am sure it has something to do with the Heroes checking and the artifact checking as well, because in a map that the artifact exists and is equiped there weren't any problems.


As i said before i use the creature summoning script from the halfling's mod 9 times (one for every town). Here is the script:

!?PI;
!!UN:P67/?v5999;   [Check is the script is enabled, otherwise exit]
!!FU&v5999<>1:E;

!?BF; [Battlefield setup trigger]

!!UN:P67/?v5998;   [Check is the script is enabled, otherwise exit]
!!FU&v5998<>1:E;

!!BH0:N?y-3; [Attacking hero: y-1]
!!BH1:N?y-4; [Defending hero: y-2]
!!FU&y-3<>3/y-4<>3:E; [Exit if neither is the hero **Sylvia**]
!!HE3:E?y-5/?y-6/1; [Hero Level: y-4]
!!VRy-7&y-3=122:S0; [Set y-7 to 0 if attacker is the hero]
!!VRy-7&y-4=3:S1; [Set y-7 to 1 if defender is the hero]
!!BU&y-7=0:S9/y-6/38/y-7/-1/1; [Summon creatures]
!!BU&y-7=1:S9/y-6/46/y-7/-1/1; [Summon creatures]

****I use this part 9 times i just post one again to show you how it appears in the script***********

!?PI;
!!UN:P67/?v5997;   [Check is the script is enabled, otherwise exit]
!!FU&v5997<>1:E;

!?BF; [Battlefield setup trigger]

!!UN:P67/?v5996;   [Check is the script is enabled, otherwise exit]
!!FU&v5996<>1:E;

!!BH0:N?y-3; [Attacking hero: y-1]
!!BH1:N?y-4; [Defending hero: y-2]
!!FU&y-3<>31/y-4<>31:E; [Exit if neither is the hero **Aeris**]
!!HE31:E?y-5/?y-6/1; [Hero Level: y-4]
!!VRy-6::5; [the formula: y-4]
!!FU&y-6<1:E; [Exit if zero]
!!VRy-7&y-3=122:S0; [Set y-7 to 0 if attacker is the hero]
!!VRy-7&y-4=31:S1; [Set y-7 to 1 if defender is the hero]
!!BU&y-7=0:S25/y-6/38/y-7/-1/1; [Summon creatures]
!!BU&y-7=1:S25/y-6/46/y-7/-1/1; [Summon creatures]

***Artifacts

**scepter of Power


!?BA0;
!!BA:H0/?y-1 H1/?y-2;
!!HEy-1:A2/162/d/?y2;  [check for artifact]
!!HEy-2&y-2>-1:A2/162/d/?y4;  [check for artifact]
!!FU&y2<1/y4<1:E;
!!if&y2>0:;
!!IF:Wy-1;
!!VRw3:S99;
!!FU333:Py-1;
!!en:;
!!if&y4>0:;
!!IF:Wy-2;
!!VRw3:S99;
!!FU333:Py-2;
!!en:;

!?FU333;
;x1=Hero ID
!!HEx1:F?v110/?v111/?v112/?v113; Get stats
!!VRv114:Cv110/v111/v112/v113;
!!VRv110:+v112;
!!VRv111:+v113;
!!VRv112:-v112;
!!VRv113:-v113;
!!HEx1:Fv110/v111/v112/v113;

!?BA1;
!!HE-1:O?y1;
!!FU&y1<0:E;
!!IF:W-1;
!!FU&w3<>99:E;
!!HE-1:Fv114/v115/v116/v117;
!!VRw3:S0;
____________
Not idly do the leaves of Lorien fall.

 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 ... 131 132 133 134 135 ... 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.6554 seconds