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: Scripting Question
Thread: Scripting Question
oblivious_fool
oblivious_fool


Hired Hero
posted March 18, 2023 11:52 AM

Scripting Question

Greetings!

I have a question regarding object scripting!

In the following object scripts, is it possible to add a line presenting a certain image upon visiting said object?

Thanks!

1) !?PI;   Code below is exceuted when map loads
!!VRz977:S^The Last Outpost^;  Write Hint Text in Z-Var. Z-Var must be unique
!!OB129/140/0:Hz977;      Object reviever with coordinates, Set Hint Text

!?OB129/140/0&1000;
!!PO998:N?v1;
!!FU&v1=1:E;

!!IF:M^.^;

!!VRz977:S^The Last Outpost (visited)^;

!!PO998:N1;

2) !?PI;   Code below is exceuted when map loads
!!VRz941:S^Heatwave^;  Write Hint Text in Z-Var. Z-Var must be unique
!!OB38/72/1:Hz941;      Object reviever with coordinates, Set Hint Text

!?OB38/72/1&1000/v9150=0;      Everytime you visit this coordinates trigger the code below

!!IF:M^Here's the fire domain! Now my magic power reaches it's peak once more!^;      First Message

!!HE-1:S14/?y1;          Check current hero if he has fire magic and save in variable y1

!!IF&y1>0:M^Yes you already have it.^;       if y1>0 display this message

!!IF&y1=0:Q1^Do you wish to achieve fire mastery?^;      if y1=0 display this

!!IF&-1:M^Get out of here!^;      if you refuse set flag 1 to zero and display this text
!!VRv9150&-1:S10;               set variable v9150 to 10  so this trigger never works again

!!HE-1&1:S14/3;                   if you click yes give hero expert fire magic

!!IF&1:Q2/20/47/1^Finally!^;      ... and display this

!!VRz1&1:S^CLIMAX^;                       [Play level up sound]
!!SN&1z1;                              [Play level up sound]

!!VRz941:S^Heatwave (visited)^;

!!PO998:N1;

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

Tavern Dweller
posted March 18, 2023 09:17 PM
Edited by HeLG_TLA at 21:23, 18 Mar 2023.

oblivious_fool said:

I have a question regarding object scripting!

In the following object scripts, is it possible to add a line presenting a certain image upon visiting said object?

!!IF&1:Q2/20/47/1^Finally!^;      ... and display this



-------------
As I understand it, you would like to insert your own image, which is not included in the list of possible display for the receiver !!IF:Q; And in your version, this dialog is a simple message, equivalent to !!IF:M; just adding an image. And therefore, it is possible !!IF:M; and use it, and insert the image you need as follows: !!IF:M^{~>avwmagx0.def:0  block} text ^;
In the example, before the main text message, the zero frame from the archmage def file (the unit model on the adventure map) will be shown.
This is relevant if you are working with ERA 3.x.x.
Something similar to the dialog shown below

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


Hired Hero
posted March 20, 2023 04:39 PM

As I understand it, you would like to insert your own image, which is not included in the list of possible display for the receiver !!IF:Q; And in your version, this dialog is a simple message, equivalent to !!IF:M; just adding an image. And therefore, it is possible !!IF:M; and use it, and insert the image you need as follows: !!IF:M^{~>avwmagx0.def:0  block} text ^;
In the example, before the main text message, the zero frame from the archmage def file (the unit model on the adventure map) will be shown.
This is relevant if you are working with ERA 3.x.x.
Something similar to the dialog shown below



Is this script in erm2? In my scripts I use only erm1, is it possible to find a guide for this kinds of scripting?

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

Tavern Dweller
posted March 20, 2023 05:33 PM
Edited by HeLG_TLA at 17:39, 20 Mar 2023.

This command is available for ERA version 3.3.0 and higher. All scripts written in erm2 automatically support versions written in erm1 (I mostly write in erm1 myself).
  Specifically, this function (displaying an arbitrary frame of any def file) also works on erm1 (that is, the script header will contain ZVSE, not ZVSE2 /this header is required if the script is written in erm2/), but the ERA client version is a prerequisite (at least 3.3 .0)
------------------

http://wforum.heroes35.net/showthread.php?tid=5830&pid=121375#pid121375

a brief description of the innovations in ERA 3.3.0 from 01/24/2021 (current version 3.9.4)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0462 seconds