|
|
Siegfried
Famous Hero
|
posted December 08, 2012 03:36 PM |
|
|
The problem with the !#... and !!... is: Both are correct. But both do different things.
The !#... instructions are executed whenever a map is loaded. They are executed once. I think, those instructions may be found somewhere within a function, but they are no part of that function. Just think of the erm interpreter first collecting all !#... instructions, then executing them. Regardless where they where found.
The !!... instructions only execute within some trigger (if you see a function as a trigger too). Probably you do not have a !?FU... shortly before that code snippet. But probably you have some function somewhere before. And since it is technically unnecessary to end a function with !!FU:E your in-trigger instructions are probably executed as part of the script found before your code snippet. So they probably execute somewhen. It's just that you don't know when, and you don't know the contents of your Z500 at that time. This variable is filled once at the beginning with your text, but when the script containing your setting really executes, Z500 may very well have a totally different content.
As a first hint i would recommend ending every function with !!FU:E, regardless wether it's technically necessary or not. This can keep you from those errors. Next you have to decide when resp. how you want that setting to be applied. You have the option to do it with instructions, that execute right on start loading the map. I think, they are executed when the map data is loaded, but the map is not actually built. Next would be a !?PI trigger. These are executed like an anonymous function, _after_ the map has completely been loaded and built. Next you have the option to do this within some other trigger, f.ex. a timer trigger.
I think, best for altering hero settings would be the !# trigger, as they are executed before the hero is actually on the map.
If this all does not work, try using the z var directly, insead of just its index. I think i once found such a bug in the documentation. So instead of writing ".../500" write ".../z500". But then still you have to decide when these lines should be executed.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted December 08, 2012 03:49 PM |
|
|
It can not hurt, but frankly I don't see any reason to end all your functions with FU:E. Normally functions end when a new trigger or instructions.
____________
Era II mods and utilities
|
|
Siegfried
Famous Hero
|
posted December 08, 2012 04:17 PM |
|
|
It is just for avoiding errors. If you don't do it and f.ex. make a type not correctly starting the next function or trigger, then the code of that function would be executed as a part of the former function. This causes errors hard to find.
And sometimes i just comment out a function by commenting out the function starter. It works because the function before it is ended with !!FU:E. If it was not ended like this i wohld have had to comment out every single line.
It is not technically necessary, but it helps.
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted December 08, 2012 04:21 PM |
|
Edited by artu at 16:22, 08 Dec 2012.
|
Quote: Salamandre is of course correct that receivers (!!) only work under triggers (!?), whereas instructions (!#) work without triggers (once, at the start of a new game). This is explained in ERM Help, so again I must point out that in order to understand ERM, all of ERM Help must be read. Trying to learn ERM one command at a time is doing it the hard way, in my opinion. Anyway, receivers without a trigger in front of them will never work.
Secondly, did you see my previous comment on the three ways of doing setup in ERM? (It is the third comment from the top of this page, on my system.) It may be that some of your setup instructions occur before the Heroes program is done loading its data, and so they get over-written.
Thirdly, I also agree with Salamandre that ERM commands shown here for analysis should be text (copied and pasted from the ERM Script Editor). This means you will have to add the "no-smileys" HTML command (red circle with white x) before the script text (and then go back to smiley's again after the script if you must use emoticons).
Fourthly, I believe you said earlier that you did some of the setup by modding (changes to LOD files) rather than scripting, so it will be difficult for people who don't know all the changes you made to prescribe fixes for those changes.
i looked into the lod files of some mods, the locations of specialty icons etc, but i haven't made any changes in there yet.i did read about the difference between !! and !#, yet the problem is neither of them work now. i don't understand why, they did a week ago, just look at the image i posted above a week ago, it was done and now suddenly it doesn't work. i haven't activated any new mods or anything, just to be sure there are no conflicts i wrote a script consisting only of this change, yet it still doesn't work, salamandre's script also didn't work, when i use this script, specialty text description after wogification is still fortune:
ZVSE
!#HE43:X3/62;
!#HE43:M62/1;
!#VRz401:S^Starts with blind^;
!#UN:G2/43/1/331;
!#UN:G2/43/2/401;
Does it work when you use it?
|
|
JimV
Responsible
Supreme Hero
|
posted December 08, 2012 04:50 PM |
|
|
Yes, it works for me (tested under Era 2.4).
Possibilities for problems include having used (redefined) z401 elsewhere, having edited Daremyth (43) in the Map Editor such that those edits get loaded after the instructions are executed, etc., etc..
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted December 08, 2012 05:27 PM |
|
|
Quote: specialty text description after wogification is still fortune
Where did you put the script?
____________
Era II mods and utilities
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted December 08, 2012 05:39 PM |
|
Edited by artu at 17:40, 08 Dec 2012.
|
Mods/Blind/data/s/script
The icon change, hero starts with blind, so i'm sure script is where it's supposed to be. Something overwrites my specialty text then, if it works for you guys... What can it be? Active mod list:
WoG
WoG Revised
Yona
Morn Battlefields
New Objects Patch
Composed Objects and NPC
Drop War Machines
Resolve Battle
My Portraits
Blind
(My portraits is custom portraits i collected or created, folder contains only pcx stuff: My Portraits/Data/hplxxx.pcx and hpsxxx.pcx files.)
|
|
JimV
Responsible
Supreme Hero
|
posted December 08, 2012 05:43 PM |
|
Edited by JimV at 17:55, 08 Dec 2012.
|
Yes, that is the most likely problem. I signed on to update my previous comment with it, but Salamandre wins the prize. It helps in diagnosing people's problems to be a little bit psychic, since you rarely have all the relevant information.
If you keep changing a script and nothing happens ... the script has not been loaded into the map. I am used to playing and making custom maps, so I put scripts into Timed Events in the Map Editor and disable wogification. That way the scripts are always loaded - but there are disadvantages also, of course.
A way to check is to add (during development and testing):
!#IF:M^Script xyz has executed.^;
Then if you don't see that message at the start of the game the script has not been loaded.
Edit - did not see Artu's comment above as I submitted this. I still doubt the script has been loaded (the above check will tell), but of course the way to check for mod interference is not for us to guess but to disable all mods but the one with (supposedly) the script and see if the script then works. (If so, add the mods back one by one to find the interference(s).)
RE-edit: that is, disable all mods but WoG since you need it to wogify .
Another re-edit: reading Artu's comment less quickly I see the first mention that the Blind icon does work. So I retract my doubt that the script has loaded. I would check the List of the Claimed in ERM Help (you did read that section, right?) and pick a new z-number (which is not currently used by WoG scripts).
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted December 08, 2012 05:56 PM |
|
|
i figured it out, it's hero specialization boost that overwrites it. i forgot to turn it off, such a simple yet idiotic mistake. sorry to take your time.
|
|
JimV
Responsible
Supreme Hero
|
posted December 08, 2012 06:05 PM |
|
Edited by JimV at 18:06, 08 Dec 2012.
|
I'm sorry not to have guessed that in the first place. Anyway, remember what Niels Bohr said:
"An expert is someone who has made every possible mistake in a narrow field."
I also take comfort in my favorite saying by Einstein:
"All ERM scripters make mistakes; good scripters find them."
(Actually he used the occupation of mathematician, but ERM scripting is a form of mathematics.)
|
|
Siegfried
Famous Hero
|
posted December 09, 2012 10:43 AM |
|
|
Bug
Hi,
i think i found a bug. The documentation says for !!CB#1/#2/#3: - Creature Bank at x,y,l coordinates.:
"The CB receiver should also work with Dragon Utopia, Crypt, Derelict Ship, and Shipwreck."
This seems to be not true for derelict ship. The error message says that this is not a creature bank.Is there another method to check if a derelict ship is already taken?
Just if anyone wants to know: Here is the code:
** Object 24 Derelict ship
!?OB24;
!!HE-1:N?y-1;
!!VRv100:S34; ** Hero Marker
!!FU1y-1; ** Store Hero
!!IF:V2/0; ** Deactivete Post-Trigger
!!CBv998/v999/v1000:T?y-2; ** y-2 = 0 if not taken, 1 if taken
!!IF&y-2=0:V2/1; ** Activate Post-Trigger if not taken
!!FU:E;
!$OB24&2/v132>0;
!!IF:V2/0; ** Reset (deactivate)
!!HEv101?y-1; ** Get Hero Owner
!!FU&y-1<0:E; ** No Owner, hero lost, exit
!!CBv998/v999/v1000:T?y-2; ** y-2 = 0 if not taken, 1 if taken
!!FU&y-2=0:E; ** Exit if not taken
!!FU10256; ** Enhance Skeletons
!!FU10260; ** Enhance Wights
** Object 85: shipwreck
!?OB85;
!!HE-1:N?y-1;
!!VRv100:S34; ** Hero Marker
!!FU1y-1; ** Store Hero
!!IF:V2/0; ** Deactivete Post-Trigger
!!CBv998/v999/v1000:T?y-2; ** y-2 = 0 if not taken, 1 if taken
!!IF&y-2=0:V2/1; ** Activate Post-Trigger if not taken
!!FU:E;
!$OB85&2/v132>0;
!!IF:V2/0; ** Reset (deactivate)
!!HEv101?y-1; ** Get Hero Owner
!!FU&y-1<0:E; ** No Owner, hero lost, exit
!!CBv998/v999/v1000:T?y-2; ** y-2 = 0 if not taken, 1 if taken
!!FU&y-2=0:E; ** Exit if not taken
!!FU10256; ** Enhance Skeletons
!!FU10260; ** Enhance Wights
!!FU:E;
For object 85, shipwreck, it works. For object 24, derelict ship, it does not work.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted December 09, 2012 11:16 AM |
|
|
It works, at least I was able to do it in tew4, here is the code:
[timer]
!!UN:U24/-1/?y-1; derelict ships number
!!VRv1:S-1;
!!DO107/1/y-1/1:P24; run through
!?FU107; derelict ship
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!CBv1/v2/v3:T?y1; check if visited
!!FU&y1<1:E; exit if not visited
!!CBv1/v2/v3:T0; set to not visited
[...]
When using OB trigger, derelict ID should contain the subtype too (24/0). This is a bug JimV found, so don't thank me. :)
Example from tew:
!?OB24/0&-1000; derelict ship
!!CBv998/v999/v1000:G0/115/6 G1/115/6 G2/115/6 G3/115/6 G4/115/6; [Set derelict ship]
____________
Era II mods and utilities
|
|
Siegfried
Famous Hero
|
posted December 09, 2012 12:36 PM |
|
|
Quote:
When using OB trigger, derelict ID should contain the subtype too (24/0). This is a bug JimV found, so don't thank me.
Ah! Thanks. I'll try that.
Hmmm, that would mean there are other subtypes existing?
Add:
O.k., i modified the scripts and the testmap. I modified the map so now both sides are playable by humans. Just to test if it is winnable for necro, too. Well, i found it is winnable extremely easy with a 100% necromantic strategy: Go out, conquer all, amass undead and then flood invade enemy territory For castle it is not that simple, but still simple enough. So maybe the scripts are quite useful. The optimal skill development fit well to the 2 main heroes.
Add:
Yes, it works. I just played the testmap with necro, tested it, and it worked.
This is a screenshot shortly before end. As you easily can see it is quite hard to win against such a necromancer This is the maximum what could be achieved in this map by visiting all warriors tombs with necromancer or death knight, and taking all crypts, shipwrecks and derelict ships with necromancer or death knight.
Nevertheless it is possible to win this with castle without major problems, if you're fast and develop your heroes well
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted December 09, 2012 09:58 PM |
|
|
To achieve this:
i wrote this:
!?PI;
!!HE139:B2/16;
!#HE139:X1/118; [Labetha Planeswalker, Pixies]
!#HE139:A3/1000/1/1;
!#HE139:S23/1;
!#HE139:S17/0;
!#HE139:F2/1/1/1;
!#VRz739:S^Increases the Attack and Defense skills of any Pixies or Sprites
for each level attained after first level.^;
!#UN:G2/139/1/224;
!#UN:G2/139/2/z739;
Now, i listen to Sal's advice and use total commander to see if the zText conflicts with anything and the result is clean:
Yet when i click on the estates skill here's what i see:
When I change z739 to z839 problem is fixed but how do i know it doesn't mess up something somewhere else if i cant trust the Total Commander results?
|
|
djkiwi
Hired Hero
|
posted December 09, 2012 11:26 PM |
|
Edited by djkiwi at 23:40, 09 Dec 2012.
|
If i were to make a new combination artifact with ERM script, i read up on the universal commands page
ZVSE
!!UN:A19/3/63/64/65;
For Farseers Talisman? Doesnt work
Isnt it Number / number of artifacts / artifact 1 / 2 / 3 / ...?
Or for example recreate "power of the dragon father" + dragon vial for testing if ERM works and understanding it. Is sorted by artifact position (head-feet) but doesnt work either upon rightclicking the vial.
ZVSE
!!UN:A29/10/44/42/43/38/39/40/37/45/41/127;
Like this is made 15 new Combination Artifacts and none of them work..
But the empty helmet i did this to:
ZVSE
!?OB5/161; Artifact 161
!!UNv998/v999/v1000;
!!UN:Iv998/v999/v1000/5/161;
!!ARv998/v999/v1000:M^{Titanium Helmet}
When equipped, this Helmet gives +2 Defence and +3 Knowledge bonus.^;
!?AE1&v998=161; Equip Artifact 161
!!HE-1:Fd0/d2/d0/d3;
!?AE0&v998=161; Unequip Artifact 161
!!HE-1:Fd0/d-2/d0/d-3;
!#VRz430:S^{Titanium Helmet}
When equipped, this Helmet gives +2 Defence and +3 Knowledge bonus.^;
!#HT5/161:T430;
And the stats / name / description work, but for some reason it gives me scouting, Also the next one gives me scouting and i cant see a reason
ZVSE
!?OB5/162; Artifact 162
!!UNv998/v999/v1000;
!!UN:Iv998/v999/v1000/5/162;
!!ARv998/v999/v1000:M^{Titanium Sword}
When equipped, this Sword gives +5 Attack bonus.^;
!?AE1&v998=162; Equip Artifact 162
!!HE-1:Fd5/d0/d0/d0;
!?AE0&v998=162; Unequip Artifact 162
!!HE-1:Fd-5/d0/d0/d0;
!#VRz431:S^{Titanium Sword}
When equipped, this Sword gives +5 Attack bonus.^;
!#HT5/162:T431;
because the next one doesn't give me scouting
ZVSE
!?OB5/163; Artifact 163
!!UNv998/v999/v1000;
!!UN:Iv998/v999/v1000/5/163;
!!ARv998/v999/v1000:M^{Titanium Shield}
When equipped, this Shield gives +5 Defence bonus.^;
!?AE1&v998=163; Equip Artifact 163
!!HE-1:Fd0/d5/d0/d0;
!?AE0&v998=163; Unequip Artifact 163
!!HE-1:Fd0/d-5/d0/d0;
!#VRz432:S^{Titanium Shield}
When equipped, this Shield gives +5 Defence bonus.^;
!#HT5/163:T432;
What the hell am i doing wrong??? i put all my scripts seperately on day 600 no players activated i dont care much for the scouting bug, and that the empty objects cant be used for Combination is too bad
but why don't any of the other ones i made work
And how do i set up the new combination artifacts name, description, part shown of combination artifact and replacing (or bonus?) stats when you actually combine them.
In the documentation it says ERM and WoG will do the work for you with the first script i posted 1st off.
i can come up with 1 problem, WoGifying? maybe because of some script its not working.. do i have to take all the ERM scripts i want active and put them into the map events?
Are there WoG scripts that conflict with ERM Combination artifacts?
Also.. Can i put several scripts in one event?
and.. The Download url of ERM script master and scripter aren't working anymore, i can't find a working link anywhere, the only working download gives a 0,04 mb short corrupt file, can someone supply me with one?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted December 09, 2012 11:58 PM |
|
|
Artu, search for z739, not !#VRz739. Variables are used also as receivers in most of mods.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted December 10, 2012 12:10 AM |
|
|
This advice never seems to become obsolete: read ERM Help. Example (List of the Claimed):
This lists all entities used by the WoG 3.58f scripts, as well as those used by "80 wog - jv scripts.erm". It does not include new entities used by WoG Revised (pending a listing of them).
Speaking of which, see Era script 80, mentioned above, for an example of adding a combo artifact ("Buckler of Beelzebub").
The first example in the previous comment attempts to use a Catapult (AR# 3) as a combo artifact. I have never tried to use an artifact which has an existing function as a combination artifact and doubt that it will work, especially for a War Machine artifact.
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted December 10, 2012 12:44 AM |
|
Edited by artu at 00:46, 10 Dec 2012.
|
yes, i have seen this page before and it didnt cross my mind till you linked it, ive been doing this for only two weeks, not for years like you so everything doesnt connect on my mind instantly like it does on yours. thanks for the screenshot and patience. since z1000 is the limit, almost everything seems to be claimed? with so many mods for era, how come we dont see more conflicts. this also rules out my method of z658text for hero 58, z693 for hero 93, z739 for 139 etc. i thought the 600's would be empty.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted December 10, 2012 01:09 AM |
|
|
Except objects and hero names, you can use local z vars (z1-z10) for most actions. For example, when right-clicking on hero specialty (CM2), use z1 to display text. It will trigger each time you click and you can use it elsewhere as well.
For example, in what you asked
ZVSE
!#HE43:X3/62;
!#HE43:M62/1;
!#VRz401:S^Starts with blind^;
!#UN:G2/43/1/331;
!#UN:G2/43/2/401;
should be:
!#HE43:X3/62;
!#HE43:M62/1;
!?CM2; [hero screen]
!!HE-1:N?v1; [who is the hero]
!!FU&v1<>43:E; [if not Daremith, get out]
!!CM:I?y1; [where do I click]
!!FU&y1<>118:E; [if not on specialty, get out]
!!VRz2:S^
Starts with blind^; [string]
!!IF:Q1/9/62/4^%Z2^; [display icons and text]
!!CM:R0;[disable regular message]
I did not use any global variable for and I don't need to consult claimed list. Now, if you know how to use hero ID as condition, create multiple z2 strings according to the hero ID and use it for all heros you want custom specialties.
____________
Era II mods and utilities
|
|
djkiwi
Hired Hero
|
posted December 10, 2012 02:05 AM |
|
Edited by djkiwi at 04:13, 10 Dec 2012.
|
!!UN:A#/$/#1/#2 {/#3/#4/#5/#6/#7/#8/#9/#10/#11/#12/#13/#14};
EDIT Ok i got it now!
!!UN:A13/Artifact-to-combine-to/artifacts-to-combine/2/3;
Now how do i create a new artifact to combine them to, if i try putting them on 171 it doesnt work because its out of range..
Eg if i want to combine Stoic Watchmen, Bird of Perception, And Emblem of Cogniance it will combine Emblem and Bird to Stoic instead of those 3 to a 4th one.. how do i create a new artifact with its own stats, description, name, attributes and skils to use as the 1st number??
____________
|
|
|
|