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 ... 187 188 189 190 191 ... 200 250 300 350 400 407 · «PREV / NEXT»
Sguazz
Sguazz


Known Hero
posted February 26, 2013 04:03 PM

I'm trying to make a mod that requires a lot of z-strings to describe my new heroes-specialities that change by specific levels. I don't want that these z-strings are in conflict with other mods, so I ask: it's possible to set a path for 1 or more HeroSpec.txt with a simple erm command and call it when I need?

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


Honorable
Supreme Hero
posted February 26, 2013 05:30 PM

There is no ideal solution in ERM for proposed idea.

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


Responsible
Supreme Hero
posted February 26, 2013 06:33 PM
Edited by JimV at 18:34, 26 Feb 2013.

It sounds like such a mod would conflict (under Era 2) with wogification script "39 wog - heroes specialization boost.erm" which assumes it knows what specialization each Hero has (i.e., as given in the Heroes 3 manual). Therefore if I were writing such a mod I would start by trying to disable the HSB script by resetting the UN:P numbers it uses. Then I could reuse all its Claimed (i.e., List of the Claimed, ERM Help) variables, which should not interfere with any other mod which allows wogification. (However I could not use its Claimed FU-numbers.)

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


Honorable
Supreme Hero
posted February 26, 2013 07:13 PM

We did the same way in Phoenix. Actually we changed ert files, but it's not a must.

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


Known Hero
posted February 26, 2013 11:48 PM

Quote:
It sounds like such a mod would conflict (under Era 2) with wogification script "39 wog - heroes specialization boost.erm" which assumes it knows what specialization each Hero has (i.e., as given in the Heroes 3 manual). Therefore if I were writing such a mod I would start by trying to disable the HSB script by resetting the UN:P numbers it uses. Then I could reuse all its Claimed (i.e., List of the Claimed, ERM Help) variables, which should not interfere with any other mod which allows wogification. (However I could not use its Claimed FU-numbers.)


I don't like to use HSB and at the moment I try to test my mod without this WoG Option.
However I have found a solution to not use a lot of z-strings: I work with the functions !!CM2 and !!CM3. But there is only a little problem: when there is the meeting screen, I'm not able to check the number of the right hero and so appears the standard description.
Is it possible found a solution?

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


Admirable
Omnipresent Hero
Wog refugee
posted February 26, 2013 11:58 PM

!?CM3; [Hero Visiting screen mouse-click is trigger]
!!CM:H?y-6/?y-7; [Left hero: y-6, Right hero: y-7]

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


Responsible
Supreme Hero
posted February 27, 2013 01:34 AM

And if your aim is to be thorough, don't forget the Kingdom Overview screen.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 27, 2013 03:10 PM
Edited by Salamandre at 15:11, 27 Feb 2013.

I found a problem with the market of time. In any mod using external scripts (custom wogification) the UN:P193 will be set to 1 from thin air, therefore market of time will delete all three warfare skills instead of only one, when warfare is NOT activated.

The strange thing is that P193 is reported to be 1, but there is no hint about warfare in those skills infos. I have no idea from where it comes.

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


Responsible
Supreme Hero
posted February 27, 2013 06:27 PM

I can't find P193/1 in any WoG script, so I must guess that a settings file is responsible. It would also be possible to set P193 with a UN:C command or a .bin addon, but those seem unlikely.

A patch could be made to ask the player if the Warfare skills should be deleted, if the script does not already ask.

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


Admirable
Omnipresent Hero
Wog refugee
posted February 27, 2013 07:09 PM
Edited by Salamandre at 19:31, 27 Feb 2013.

I was testing tew4 which use custom scripts and got P193=1 without being set anywhere. Then I test it in Time of prophecy and got same issue. Both maps don't use warfare.

HERE is a testing mod:

1) With all options enabled map has P193=1, but all other scripts will not be read.
2) With warfare disabled in menu, map runs ok, but is supposed to not read regular options because in "load these scripts.txt" there is market of time only.

@Edit: forgot to add test.erm with map does not wogify code in txt file. But this does not change anything, P193=1 still.

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


Responsible
Supreme Hero
posted February 27, 2013 07:53 PM

Quote:
With warfare disabled in menu, map runs ok, but is supposed to not read regular options because in "load these scripts.txt" there is market of time only.


My assumption about the "load only these scripts" option was that it meant just that, with no implication that it would also adjust WoG Menu options - because if I were programming such an option I would be too lazy to program all the different possible combinations of UN:P options that the presence or absence of different scripts would imply. After all, one of the loaded custom scripts could include all the !#UN:P settings that the modder wanted.

Bersy is not as lazy as I am, so maybe he did things differently. However, so far the data I have seen seems to match my assumption.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 02, 2013 07:10 AM

Does anyone know how the game reads if one hero visited an one visit object (format OV), like learning stone or library of enlightenment? Is possible to have same result by using OB:C control word? I wanted to create a loop through libraries and stop on the one not visited by the active hero but no idea where to start.

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 02, 2013 08:54 AM

I want to make Cartographers reset each week (or month, haven't decided yet) so when you open a map but then later someone visits a Cover of Darkness you can use them again. Erm help TM section says:

!#TM1:S1/999/7/player; timer will be called on every Day 1.
!?TM1;
!!...; Here you can reset the flag for the object so that it can be visited once again.


But I don't get where I'm supposed to enter object number (cartographer is 13). It's my first experience with timers, am I looking in the wrong section?



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


Admirable
Omnipresent Hero
Wog refugee
posted March 02, 2013 09:33 AM

I think you should customize all cartographers when map loads, disable them and create script which opens the map on every visit. Just get map size then open.

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


Responsible
Supreme Hero
posted March 02, 2013 02:48 PM
Edited by JimV at 14:49, 02 Mar 2013.

Format OV seems to refer to the HE:V command. ERM Help:
-------------------------------------------
V#1/$2;
V#1/#2/$3;  V#1/$2 - set/check/get if hero visited (1) or not (0) $2 all objects of type #1 ($2 is used as a bit mask)

V#1/#2/$3
   #1 = Object type
   #2 = Object number (0..31)
   $3 = Hero visited (1) or not (0)

Types of objects (#1):
(Number in parenthesis is object type number)
0 - Learning Stone (100)
1 - Marletto Tower (23)
2 - Garden of Revelation (32)
3 - Mercenary Camp (51)
4 - Star Axis (61)
5 - Tree of Knowledge (102)
6 - Library of Enlightenment (41)
7 - Arena (4)
8 - School of Magic (47)
9 - School of War (107)

Examples:
V0/0/0 - set the Learning stone number 0 to be "not visited" by the hero.
V6/2/0 - set the Library of Enlightenment number 2 to be "not visited" by the hero.
V5/2 - set all Trees of Knowledge except second to be "not visited" (second one is visited).
-----------------------------------------------
So yes, one could use the UN:U command to search for all Libraries on a map and see whether Hero n has visited one with HEn:V6/m/?, where m is the number of the Library which is given by OB:C?. (The Object Control word, described under the OB receiver is equal to the number of the object on the map for all the objects listed above, but not for all map objects. For example,OB:C? is not the number of a Magic Spring. Simple tests will determine this for a particular object type - sometimes one has to read ERM Help and then experiment a little.)

Further explanation of:
---------------------------------------------
Example
We want to create a new object with ERM code. This object can only be visited once each week. How do we proceed?

In the object's code you can set a flag so that once it has been visited, it can't be visited again.

!#TM1:S1/999/7/player; timer will be called on every Day 1.
!?TM1;
!!... Here you can reset the flag for the object so that it can be visited once again.
----------------------------------------------
This example assumes one has read at least the basic tutorials of how to script objects, and has learned what a flag is. Flags are described in detail in the "Flags and Variables" section of ERM Help.

"create a new object" means write a script for a new object which is not already hard-coded. The Emerald Tower script is an example. That script uses Timer 2 (Tobyn's Universal Timer) as follows:
----------------------------------------------
[Timer resets the Emerald Towers' non-visited status each week]

!?TM2&$day$>7/$weekday$=$monday$/$once$=1; requires Universal Timer from script00
!!UN:P44/?y-1; [Check if script is enabled: y-1]
!!FU&y-1<>1:E; [Exit if script isn't enabled]

!!UN:U63/65/?v1; [Number of Emerald Towers: v1]
!!VRv2:S-1; [Initialize v2 to -1 to work with new faster UN:U syntax][corr. v1->v2 JHV]
!!DO10910/1/v1/1&v1>0:P; [Loop through all Emerald Towers]

[Reset non-visited status for each Emerald Tower]

!?FU10910;

!!UN:U63/65/-1/2; [Coordinates of next tower in v2/v3/v4]
!!PO2:N0; [Set PO:N to 0 to reset hint text]
---------------------------------------------------------------------
This example did not use a "flag", except in the general sense that a flag is a signal which gives a piece of information. It used PO:N to record the information (visit status) rather than an ERM "flag".

I find myself writing down ERM Help in my own words for the umpteenth time on this thread, so I will summarize and leave ERM Help itself, where I learned all these things, to provide the details:

To script a new object (or an existing object, as Salamandre says), you need to read and understand the !?OB trigger. If the object is to have limits on how often it can be visited you could use the !?TM trigger together with the UN:U object-search receiver, which requires an understanding of the !?FU trigger and the !!DO receiver, and to record information such as visit status you will need to understand the use of flags and variables, and to check for unused numbers of them in the List of the Claimed so that you do not overwrite information used by WoG scripts.

Then, depending on what you want the object to do, you will need to understand various other commands, such as the UN:S command to show (remove the Fog of Darkness from) a circular region.

Eventually, to learn all that can be done with ERM, you will have read ERM Help. I firmly believe that it is easier to learn ERM by doing the tutorials and then reading through all the commands and asking yourself "how could I use this command?", rather than waiting until you have a specific project in mind and then trying to find just those commands which will accomplish it, but to each his or her own.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 02, 2013 03:06 PM
Edited by Salamandre at 15:17, 02 Mar 2013.

Thanks a lot, there is zero information about OB:C, now I know a bit more about.

Here is loop through libraries:

!?FU251115;
!!UN:Ux1/-1/-1/1; [library at coordinates in v1/v2/v3]
!!TRv1/v2/v3:V?i; check visibility for purple player
!!VRi:&32;
!!if&i=32:;
!!OW:A-1/?y1; Get active hero
!!IF&y1<0:M^There is no active hero, select one!^;
!!VRx16&y1<0:S999;
!!FU&y1<0:E; Exit if no hero
!!OBv1/v2/v3:C?y2; Get number
!!HEy1:V6/y2/?y3; Visited?
!!FU&y3=1:E;
!!UN:Lv1/v2/v3/100;  stop view on for one second
!!IF:Q1^Next one?^;
!!VRx16&-1:S999;
!!en:;

Thanks again.


@Artu

There is no way to "reset" a regular cartographer, you must disable all the cartographers before map loads, then create script occurring when you visit them. If you keep original text, player will not know something was changed, they will act like regular cartographers but will be visitable once a month.

1) On visit (!?OB), set PO value to x, would be ok to set to player number
a) get map size, divide by 2 and from this value show map with UN:S with right coordinates

2)
TIMER (TM)
a) loop through them (DO)
b) reset PO value to zero every 28 days (!?FU)

You can even script each cartographer to reset every 28 days, from the day it was visited. On visit set PO to 28, then timer check every PO and subtract one. When PO is zero, object can be visited again.

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 02, 2013 03:22 PM

Quote:

There is no way to "reset" a regular cartographer, you must disable all the cartographers before map loads, then create script occurring when you visit them. If you keep original text, player will not know something was changed, they will act like regular cartographers but will be visitable once a month.

1) On visit (!?OB), set PO value to x, would be ok to set to player number
a) get map size, divide by 2 and from this value show map with UN:S with right coordinates

2)
TIMER (TM)
a) loop through them (DO)
b) reset PO value to zero every 28 days (!?FU)

You can even script each cartographer to reset every 28 days, from the day it was visited. On visit set PO to 28, then timer check every PO and subtract one. When PO is zero, object can be visited again.


If by regular you mean a single cartographer, that's not what I had in mind anyway, I want all of them to be revisitable when a week passes. So I guess this tip will help, thanks.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 02, 2013 03:25 PM

No, I mean all of them, that's why you will need a loop in timer.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted March 02, 2013 05:04 PM

A note on Cartographers: there are two types, one which shows only land terrain and one which shows only water. To simulate them exactly with ERM scripts, one would have to use the TR:T? (get the type of terrain, to check for water) and TR:V commands, doing one square at a time in a DO-loop, instead of using the UN:S command, which shows everything. (I note this because some people are sticklers for exactitude.)

(Another option of course would be to delete all Covers of Darkness from a map or replace them with something else; or in the case of random maps, perhaps eliminating the object from ZAOBJTS.txt would prevent their occurance (not tested).)

This illustrates the fact that writing a complicated ERM script is analogous to building a house, in this sense: there is no single tool which a carpenter can find his toolbox with a button which is labeled "press me to build a house". The carpenter must learn what all of his tools can do, design a plan for the house, and then figure out how to use the available tools to construct the house according to the plan.

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 02, 2013 05:10 PM

Quote:
(Another option of course would be to delete all Covers of Darkness from a map or replace them with something else; or in the case of random maps, perhaps eliminating the object from ZAOBJTS.txt would prevent their occurance (not tested).)


Yes, but as a random map player, I must remind you of that nasty Necro town the AI keeps getting back.

 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 ... 187 188 189 190 191 ... 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.9002 seconds