|
Thread: Scripting Question | |
|
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;
|
|
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
|
|
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?
|
|
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)
|
|
|
|