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 150 200 250 ... 276 277 278 279 280 ... 300 350 400 407 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted November 26, 2015 03:40 PM

Try this

!?LEx/y/z;
!!HE-1:A2/128/?y1/?y2; check the number of ABs hero has (y1 = equipped, y2 in backpack)
!!FU|y1<1/y2<1:E;
!!HE-1:N?y1;
!!FU338357:Py1/3;
!!IF:Q1/8/128/1^Message^; message IF artifact was found

!?FU338357;
; x1 - hero
; x2 - slot
!!UN:C6919480/4/?y1; [y1 - BASE]
!!VRy2:Sx1*1170+y1+136736; [y2 - pointer to hero structure]
!!SN:E5123648/2/y2/x2;

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


Responsible
Supreme Hero
posted November 26, 2015 03:50 PM

Thanks, it seems to work OK

One last question though. If I want this to be triggered by two separate events, do I copy the script twice (one with the coordinates of the first event and two for the second)? Or is there a way to include the coordinates of the two events on this same script?
____________
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 November 26, 2015 03:51 PM
Edited by Salamandre at 15:52, 26 Nov 2015.

No, separate events need again the code. Just paste it again with only coordinates changed but ignore this:

!?FU338357;
; x1 - hero
; x2 - slot
!!UN:C6919480/4/?y1; [y1 - BASE]
!!VRy2:Sx1*1170+y1+136736; [y2 - pointer to hero structure]
!!SN:E5123648/2/y2/x2;

It will trigger for both events.

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


Responsible
Supreme Hero
posted November 26, 2015 04:20 PM

It works on both events, thanks but I found a small bug.

It doesn't work when Armageddon's Blade is on backpack.
____________
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 November 26, 2015 04:26 PM

!?LEx/y/z;
!!HE-1:A2/128/?y1/?y2; check the number of ABs hero has (y1 = equipped, y2 in backpack)
!!FU|y1<1/y2<1:E;
!!if&y1>0/y2<1:; if artifact not equipped but in backpack
!!HE-1:A3/128/1/1; remove
!!en:;
!!if&y2>0:; if artifact equipped
!!HE-1:N?y1;
!!FU338357:Py1/3;
!!en:;
!!IF:Q1/8/128/1^Message^; message IF artifact was found

Replace first part with this.
____________
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 November 26, 2015 04:35 PM
Edited by Hero_Of_Light at 16:36, 26 Nov 2015.

Still doesn't work.

I mean, it works when equipped, it doesn't when unequipped.
____________
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 November 26, 2015 04:49 PM
Edited by Salamandre at 16:51, 26 Nov 2015.

My bad. Replace | with &  or the entire line:

!!FU|y1<1/y2<1:E;

with

!!FU&y1<1/y2<1:E;  

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


Responsible
Supreme Hero
posted November 26, 2015 05:07 PM
Edited by Hero_Of_Light at 17:11, 26 Nov 2015.

Thanks it seems to work now!

I don't know If you remember, but a long time ago I asked you for a script that instantly kills attacker and defender If one of them has sword of Frost and other Armageddon's Blade. I needed this script for the Tarnum campaigns where it was said that if these two swords collide the end of days would come (and the start of H4 as well).

I revisited the issue and I thought that another way around it is to add an event (right before the final battle) that checks for Armageddon's Blade and discards it (by adding also a text that clarifies the reasons). It works OK now and the storyline is kept clean thanks to you.

Here is the script that you gave me a long while ago:

Try this then but probably will bug, as killing heroes before battle starts is going to mess then whole thing:
!?BA0&1000; battle start
!!SN:W^HoL_disaster^/0;  initialize clash
!!BA:H0/?y11 H1/?y12;    check heroes ID
!!FU&y12<0:E;
!!HEy11:A2/128/?y1/?y2 A2/163/?y3/?y4;
!!HEy12:A2/128/?y5/?y6 A2/163/?y7/?y8;  check if they have artifacts 128/163
!!VRy9|y2=1/y4=1:S99;
!!VRy10|y6=1/y8=1:S99;
!!SN&y9=99/y10=99:W^HoL_disaster^/99;  create condition
!!SN:W^HoL_disaster^/?y1;
!!FU&y1<99:E;
!!IF:M^custom message  (both artifacts are present)^;
!!HEy11:A2/128/?y1/?y2 A2/163/?y3/?y4;
!!HEy11&y2>0:A3/128/1/1;
!!HEy11&y4>0:A3/163/1/1;
!!HEy12:A2/128/?y1/?y2 A2/163/?y3/?y4;
!!HEy12&y2>0:A3/128/1/1;
!!HEy12&y4>0:A3/163/1/1;  remove artifacts
!!HEy11:K;
!!HEy12:K;


The way I remember it it should make both heroes retreat and then removed the artifacts.

Now that I have a small experience on adding scripts on single scenarios (the idea didn't occur to me back then I guess) do you think you can modify this and make it work? Since it is only for a single scenario all I need is for the heroes to retreat or be defeated, because If Tarnum (in this campaign) loses a battle then the scenario is lost anyway so there is no need to make a big fuss about it.

To make it simpler, the script would:
1) check for both artifacts before battle (and occur ONLY IF both are equipped
2) Give a message to clarify what happened
3) Both heroes are either defeated or retreat (would prefer defeated)

If it's too much to ask then it's OK, I appreciate the effort anyway.
____________
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 November 27, 2015 04:05 PM

I don't understand, what you ask is exactly what the script you quoted does. Why need another one?

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


Responsible
Supreme Hero
posted November 29, 2015 10:36 AM
Edited by Hero_Of_Light at 10:38, 29 Nov 2015.

Yes it works OK my bad.

The reason I posted it again is that I tried it on a single scenario and nothing happened, it didn't work. But when I entered it in my mod script then it worked fine. So it's OK.

I may not use it though because I am afraid it might interact with my other part of script. !?BA0&1000; is a trigger you gave me for other functions as well, do you thing there might be a problem there?

Can something else be used? Like !?BA0&998; or something?
____________
Not idly do the leaves of Lorien fall.

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


Famous Hero
posted November 29, 2015 01:07 PM

function getGameState

Hi

I am thinking of giving a hero the ability to recall to a position that was set earlier, similar to the feature in The Dragon Slaughter.
But I do not want to use the CM mouse trigger.

I want to record the position of the hero when the player presses [ key and teleport the hero to this position when player press ].

and I found the function !?FU77003 can be the trigger in the ERM help. It also says I could use the function getGameState to determine the current window. But how to use the getGameState function?

Thanks.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 29, 2015 01:18 PM

For example, from "TEW4" mod:

!?FU77003;
!!SN:L^Era.dll^/?y1 Ay1/^GetGameState^/?y2 Ey2/1/?y98;
!!FU&y99<>6053040:E; exit if not town screen

You can find similar example all over the mods released.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 29, 2015 01:22 PM

Hero_Of_Light said:
!?BA0&1000; is a trigger you gave me for other functions as well, do you thing there might be a problem there?
Can something else be used? Like !?BA0&998; or something?


If triggers are correctly scripted and organized, there is no risk to have multiple actions for one trigger, this is what programming does. In fact, most of the time you don't have the choice and the best way is to use a single trigger. Timer 2 (in wog core scripts) is the trigger for probably more than one thousand actions and it works okay, no reason to bug.

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


Responsible
Supreme Hero
posted November 29, 2015 01:57 PM

OK then, I'll run some test and then I'll see what I will do. To be honest I don't know if I am going to use this, since the Sword of Frost is one of the unused WoG artifacts in my mod and it will only appear in a scenario If its placed in map editor. So I don't think it will come up that much.

I think the solution you gave me earlier with the trigger event is more elegant. It's good to know it works though... I may use it in the future. Thanks a lot!
____________
Not idly do the leaves of Lorien fall.

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


Famous Hero
posted November 29, 2015 02:23 PM

Salamandre said:
For example, from "TEW4" mod:

!?FU77003;
!!SN:L^Era.dll^/?y1 Ay1/^GetGameState^/?y2 Ey2/1/?y98;
!!FU&y99<>6053040:E; exit if not town screen

You can find similar example all over the mods released.


I guess y98 stores the value of game state.
and y99 is a typo, it should be y98?

and is there a list that I can refer to to find out the value for different game state?

Thanks.

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


Admirable
Omnipresent Hero
Wog refugee
posted November 29, 2015 02:55 PM

No, it is y99, try it. As for the list, there isn't any, just use the script above to get all values when pressing a key.

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


Famous Hero
posted November 29, 2015 03:37 PM

Salamandre said:
No, it is y99, try it. As for the list, there isn't any, just use the script above to get all values when pressing a key.


Ok.

but if I want to only activate the trigger when window is the adventure map (not town, not battle,not others). How can I set the condition (y99<>?)?

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


Admirable
Omnipresent Hero
Wog refugee
posted November 29, 2015 03:49 PM

Just get the game state with debug message, note down its value then use it as condition.

!?FU77003; when press a key
!!SN:L^Era.dll^/?y1 Ay1/^GetGameState^/?y2 Ey2/1/?y98;
!!IF:M^ game state is %Y99^;
!!FU&y99<>[...]:E; exit if not the window you want.  
____________
Era II mods and utilities

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


Famous Hero
posted November 29, 2015 04:36 PM

Salamandre said:
Just get the game state with debug message, note down its value then use it as condition.

!?FU77003; when press a key
!!SN:L^Era.dll^/?y1 Ay1/^GetGameState^/?y2 Ey2/1/?y98;
!!IF:M^ game state is %Y99^;
!!FU&y99<>[...]:E; exit if not the window you want.  


Great. Thanks a lot.

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


Responsible
Supreme Hero
posted December 04, 2015 03:31 PM
Edited by Hero_Of_Light at 15:32, 04 Dec 2015.

I've been modding the original Heroes III campaigns to work with my mod. So far the progress is great!

The new creatures and town lineups appear in the original campaigns. Furthermore, now the campaign's difficult can be set as you wish. I've been playing RoE campaigns in Impossible and let me tell you that they are way harder than you might think! And it is nice to be able to score Archangel in Long Live the Queen etc.

While everything worked smoothly, there are a few minor setbacks. These seem hardcoded though, as I don't know any other possible way to solve these.

1) In RoE maps, Air, Fire, Water and Earth Elementals are set to neutral and not Conflux. I am guessing that since Conflux didn't appear till Armageddon's Blade, the Elementals where set to neutral even If these commands are present.

!!MA:O112/8; [Conflux]
!!MA:O113/8; [Conflux]
!!MA:O114/8; [Conflux]
!!MA:O115/8; [Conflux]

Is there a way to fix this? I've set the campaigns' scenarios to Wake of Gods. It is weird, because since I saved them as wake of Gods maps, I could actually add Phoenixes in RoE campaigns. But still, the Elementals remain Neutral.

2) Also, I was wondering if it is possible to add the damage dealt by citadels in the RoE campaigns. I know this was added later on as a feature, but I think it would be nice to make it work in all of the campaigns (as IF it was a feature that was always there).

These bugs are no big deal. The fact that the original campaigns are playable in my mod is way more important. I was just wondering if there's a way to change these two features (either with an ERA command or a Plugin.
____________
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 150 200 250 ... 276 277 278 279 280 ... 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.6668 seconds