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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Index of Erm Help and Discussion thread
Thread: Index of Erm Help and Discussion thread This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted August 03, 2012 11:02 PM

As ERM Help explains in its tutorials, all instructions (!#) in all scripts are executed, once, at the start of a game.

So according to ERM Help, you could put it anywhere in that script or in any other script which the map will use.

If I were you, I would test it in a map and see what happens.  (Fight a seige battle, and use the Creature Properties screen to see whether the Catapult's minimum damage changes to 50.) Also, I would read all of ERM Help first, rather than trying to learn ERM by asking one question at a time.  I don't know any good scripter who has not read ERM Help (and practiced what he or she read there).

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


Adventuring Hero
wandering hero
posted August 04, 2012 08:03 PM

Copying into script won't worked.
____________
Freedom comes at a price

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


Responsible
Supreme Hero
posted August 04, 2012 08:26 PM

That is not a lot of information with which to guess what is wrong.  Among the things I don't know:

Is the script you copied the instruction into used in the game in which you say it doesn't work?

Did you start a new game after adding the instruction to a script, or continue a saved game?  The latter will not work because the original version of the script is part of the saved game.  To get the revised script you must either start at new game, or hex-edit the saved game, or, in the case of Era 2, use F12 to reload all scripts.

Exactly what do you mean by not working?  Syntax error?  Seige battle in which the minimum damage of the Catapult was not 50?  Something else?

... et cetera.

Assuming that you have a saved game in which you made the change and expected to see something as a result which you do not see, upload that saved game to some site such as wikisave or box.com, and post the URL and a description of what you expected to see and I will download the saved game, and try to figure out what is wrong.


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


Adventuring Hero
wandering hero
posted August 04, 2012 09:27 PM

Of course that script is used in the game! And I started a new game. I have some minimal knowledge .
But there was nothing changed - catapult had min. 0 damage, not 50.
____________
Freedom comes at a price

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


Responsible
Supreme Hero
posted August 04, 2012 10:28 PM

Okay, but how do I know anything about you that you don't tell me?

But a better guess on my part would be that you are using some script such as one of the War Machines scripts which changes the Catapult properties.  I don't use the WM scripts myself, so I am not very familiar with them.  Checking the scripts (with a Ctrl-F Find for !!MA), I see that War Machines I contains this code:

**
!?FU917&v591=1;
!!CA0/v7&v2052=98:B3/7; check if town has fort
!!CA0/v7&v2052=98/-1:B3/8; check if town has citadel
!!CA0/v7&v2052=98/-1:B3/9; check if town has castle
!!VRv2052&v2052=98/-1:S0; town without fort
!!MA&v2052<>98:X145/132165 M145/0 E145/200 N145/8; not town or no fort
!!MA&v2052=98:X145/132197 M145/0 E145/200 N145/8; town with fort
!!FU918&v2052<>98:P0 P1;

So a !#MA:M145/50; instruction will set the minimum damage to 50 at the start of a game, but then the WM I script will reset it to 0 in the above instructions (under a !?BA0 trigger at the start of a battle).

From the ERM Help information which I have given you already, you should be able to figure out what to do.  (If my current guess is correct.)  Good luck.  I am sorry I misinterpreted your problem.

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


Adventuring Hero
wandering hero
posted August 04, 2012 11:23 PM

The last one was most helpful. Problem solved. Thank you for your time!
Another question : Can catapult always strike without no penalty(full range)? Is there any command to do it?
____________
Freedom comes at a price

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


Responsible
Supreme Hero
posted August 05, 2012 12:46 AM
Edited by JimV at 06:20, 05 Aug 2012.

The answer, as usual is in ERM Help, under the EA receiver:

EXPERIENCE ADDING (EA) RECEIVER

!!EA$:XXXX; Receiver for adding stack experience support to ERM. $ is a type of monster.  
!#EA$:XXXX;  

OPTIONS

...
B#1/$2/$3...$15;  Set/get an experience line.
Read the file "StackExperienceBonuses.txt" in the folder "Data/Text Resources Copy" for more information.
 #1 - bonus line index (0...19) (you cannot "get" it)
 $2 - Flags. For now:
    0 - ability is disabled
    1 - ability is enabled
 $3 - ability (ASCII code of a char, see Format SE1)
 $4 - modifier (this is a numeric representation of a char or a number for "#..." parameter, standards are here))
 $5 - a value for a Rank 0 (no experience)
  ...
 $15 - a value for a Rank 10 (max experience)
...

Format SE1

Stack Experience Ability Table ($3 for EA:B command)

Letter Meaning ASCII code
...
i No Range Penalty 105
l Summon Clone 108
m Minimum Damage 109
o No Obstacle Penalty 111
...

So (if no other script interferes and resets it),

!#EA145:B6/1/105/61/1/1/1/1/1/1/1/1/1/1/1;

will add experience line 6 to creature type 145, giving it no range penalty for shooting at all levels (0-10).

Note if the creature already has an experience line 6 (most do, but a Catapult does not), this line will replace the original.

See Salamandre's thread "Guide to adding Unique Abilities to Creatures" for more information.

You might also want to read the thread "Introduction to Modding and Scripting".

Or just read ERM Help.  I would much rather answer questions from someone who has taken the trouble to educate himself on the basics  than spending my time rewriting or copying stuff which is already in ERM Help.

Update:  after some testing, I found that again there is interference, due to the fact that the War Machines I script changes the Catapult stack to the Magog creature-type in battle.  If I add the NDP (No Distance Penalty) experience line to the Catapult (145), it shows in the stack's Creature Experience Screen, but does not work.  If I add it to the Magog (45), it does not show in the Catapult's Experience Screen - but it works.  On the first shot by the (WM I) Catapult, a broken arrow may be shown, but the resulting damage has no distance penalty, and on subsequent shots the arrow cursor is unbroken.

The Magog has an NDP experience line (line 7), but it only applies to experience levels 8 through 10, and the Catapult-Magog has level zero.  This complicates things.  To give WM I the NDP, it must be applied when the Catapult is shooting, but removed afterwards to restore the normal behavior of the Magog.

This can be done by adding the lines which end with "JHV" shown below, in FU906 (which has two separate triggers in the WM I script:

...
!?FU901&v591=1; catapult action * magog *
* 1
!!VRx4&x1=1:+2068;
!!VRvx4&x1=1/x3=7:-1;
!!BMx2&x1=1/x3<>7:T145;
!!VRv2059&x1=1/x3=7:S3;
!!VRv2054&x1=1/x3=7:Sx2;
!!FU906&x1=1:P145/x5/x6/x2;
* 2
!!BMv2054&x1=2:T145;
!!VRv2059&x1=2:S0;
!!UN&x1=2:G1/45/0/0 G1/45/1/0; restore magog
!!EA45&x1=2:B7/1/105/61/0/0/0/0/0/0/0/0/1/1/1; JHV
...

!?FU906&v591=1; x1 = machine , x2 = hero
!!IF:Wx2; set W var for hero
!!VRy5:Sx1 -65;
!!VRy6:Swy5 +1; y6 = level of machine
!!VRy12&x4<21:Sv2070;
!!VRy12&x4>20:Sv2071;
!!VRy13&x4<21:Sv2072;
!!VRy13&x4>20:Sv2073;
!!VRz1&x1=146:Sz154004;
!!VRz1&x1=148:Sz154005;
!!VRz1&x1=147:Sz154006;
!!VRz1&x3>1:Sz154007;
!!VRz1:Sz154008;
!!VRz1&x1=145:Sz154009;
!!VRz1&x1=145/x3>1:Sz154010;
!!VRz1&x1=145/y12=1:Sz154011;
!!VRz1&x1=145/y12=2:Sz154012;
!!VRz1&x1=145/y12=3:Sz154013;
!!VRz1&x1=145/x3>1:Sz154014;
!!UN:G1/x1/1/1 G1/x1/0/1;
* hit points
!!VRy9&x1=145/y12=0:S500;
!!VRy9&x1=145/y12>0:Sy12 *50 *y12 +550;
!!VRy10&x1=145:Sy13 *50 +y9 -50;
!!VRy10&x1=146:Sy6 *50 +200;
!!VRy10&x1=147:Sy6 *25 + 125;
!!VRy10&x1=148:Sy6 *10 +90;
!!BMx4:Hy10 I?y11;
!!MA:Px1/y10;
* calculate shots for catapult *
!!FU&v2052=98:E; exit if siege
!!VRy12:S2068 +y11;
!!VRy11:Svy12;
!!MA&x1=145:N145/y11;
!!EA45&x1=145:B7/1/105/61/1/1/1/1/1/1/1/1/1/1/1; doesn't show exp. line for Catapult, but works--JHV
...
Note also that the War Machines II script uses a different system which interferes with WM I and this change.  That is, this change will not give a shooting Catapult NDP if WM II is active.

As I said, I have not used the War Machines much myself.  This was because like most WoG scripts I think they tend to give the AI players a disadvantage - the AI was not developed with these new capabilities in mind, and will not use them as effectively as human players.  But they are interesting and must have been fun to script, and they can be useful in custom maps, such as "The Dragon Slaughter".

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


Adventuring Hero
wandering hero
posted August 05, 2012 11:41 AM
Edited by qoty at 11:41, 05 Aug 2012.

I tried it exactly as you ordered, but I've no idea if it works, because there are no evidence - no full arrow, no special abilities in catapult tab. But maybe yes .

P.S. I always use script Enhanced Warmachines 1.
____________
Freedom comes at a price

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


Responsible
Supreme Hero
posted August 05, 2012 04:14 PM

After I click on the Catapult and see its properties screen (during its turn), from then on I see the unbroken arrow.  The damage done shown in the battle scroll (after the hit) is always without distance penalty.



So the script works but has some screen glitches, which is also true of some other old WoG scripts.  These days there are better ways of doing the script, using UN:C patches, but it illustrates the valuable technique of changing the creature type of a stack during battle.

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


Adventuring Hero
wandering hero
posted August 05, 2012 07:29 PM

OK, now it works fine. I forgot to  delete this string
!#EA145:B6/1/105/61/1/1/1/1/1/1/1/1/1/1/1;
from  that script.
Thanks for your detailed support .
____________
Freedom comes at a price

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


Supreme Hero
Work at Magic Dimmension
posted August 06, 2012 08:58 PM

Could I ask how to simulate a ressurection after real commander paladin casts cure? If it could be as "enchanced commanders" script patch I would be grateful (for my custom scripts). The problem is real commanders doesn't feature Stack Experience features which could be useable in scripts, the ERM command used in the script for additional spells doesn't work for instant spells like ressurection and changing spell from cure to ressurection in erm for paladins is buggy (you could try to cast it on non-living which causes crash). I saw similair behaviour as I want in how first aid tent from default wog script works so I would be gratefull for easy implementation like this edited (but I want it only after palading casting). Could I get exactly this done by somebody another as an patched "enchanced commanders" script file (with edited copy of code from one upgraded wog first aid)?

PS: I use ERA 2.3 enviroment basically.

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


Responsible
Supreme Hero
posted August 07, 2012 04:00 AM

As an addendum to my comment on this topic at the Era WoG Scripts thread:

Changing the stack's creature type to 13 (Arch Angel) works; I have done this in "The Dragon Slaughter" and in "New Magic", among other places.  The only issue is that the little properties box which pops up when you have the mouse-pointer on the stack will show an Arch Angel instead of the creature (assuming that you have enabled this feature in the Combat Options menu).

It occurs to me that perhaps this slight display glitch could be prevented by redirecting the Arch Angel portrait that is used on the fly, under a MM0 trigger.  (Redirecting when the mouse pointer is over the stack, and un-redirecting when it is not - with flags to prevent unnecessary changes, as in the Dragon Peaks demo.)

Alternately, if your only problem is that undead are allowed to be resurrected, this can be prevented by adding a BG0 script to cancel the action when the active stack is about to cast Resurrection on an undead target stack.  (It is also possible to make the mouse pointer show a cancel/prohibited icon instead of a casting wand.)

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


Supreme Hero
Work at Magic Dimmension
posted August 07, 2012 12:58 PM

BG0 is indeed smart, but it have to check exactly which creature is not allowed to apply the cast. My problem was it allows casting but crashes on mechanical (non-living and non-undead unit) unit - it may indeed help but it is a problem if cancel is done for AI (I have bad memories of AL's impatience not working properly).
I don't remember where but one of official wog scripts simulates ressurection AFTER action of first aid tent (and doesn't  crash and properly ressurects non-living unis). I wish similair for paladin (both) units but only after cast (so first normal cure spell and then increase targer creature count as if master ressurrection used with spell power of paladin). It should be easy but I don't know what is exactly to be done step by step.
Changing creature type is fishy because I want to preserve commander specific features so creature type change have to be done temporaly and may be buggy especially for real commanders.

I wish I'll get an easy answer, else I would work on it later as a part of more complex system ( I always wanted to rebalancr commander system, but for full approach I need some of memory codes from bersy to restore EA functionality for real commanders but I already said it's complex). If you don't have easy answers it definately have to wait until I'll exit hospital.

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


Responsible
Supreme Hero
posted August 07, 2012 04:54 PM

Simulated resurrection is not difficult if the target is still living.  For example:

1) Check conditions under BG0, and if the conditions are met (correct type of acting stack, BG:A? = creature-casts-spell), save the target stack number in a variable and set a flag for BG1.

2) Under BG1&flag, get the BM:B?, BM:H?, BM:L? and BM:N? values for the target stack, and adjust BM:N and BM:L to add the whatever amount of hit points is desired.  E.g., current total hit points for the creature = H*N-L; to add M hit points:

T' = H*N-L+M

N' = T':H (divide T' by H with an integer as the result)

H-L' = T' - N'*H, so L' = H - T' + N'*H

If L' > 0, N' --> N'+1

if N' > B, N' --> B and L' --> 0

Then set BM:N = N' and BM:L = L'.

A similar method is used to add vampiric action to any player-designated creature in "The Dragon Slaughter" when playing as Gem.  There are a lot script ideas available in custom maps.

This was not the objective I thought you had, so I am glad I did not waste my time writing sample scripts for the other methods.  Bad experiences have taught me that the script I think someone wants is rarely what they actually want.

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


Adventuring Hero
wandering hero
posted August 08, 2012 01:38 PM

Abilty to shoot with full range for ballista will look like as this - !#EA146:B6/1/105/61/1/1/1/1/1/1/1/1/1/1/1;  ?
____________
Freedom comes at a price

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


Responsible
Supreme Hero
posted August 08, 2012 03:23 PM

I think so, unless some script interferes with it, but why not test and find out?  The only way to learn something is to practice it.  Even if something doesn't work, you can learn from the attempt, and try something else - that is how science works, and how all the technology you see around you was developed.

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


Supreme Hero
Work at Magic Dimmension
posted August 08, 2012 08:56 PM

@JimV

Really thanks. Thought it is more an algorithm than ready script I get exactly which ERM battle registers (I treat ERM as Assembler derivative and in ASM there are some differences between processor registers and memory variables, and I used such weird word for it for a reason) have to be changed and under which event (Yeah ERM is an Event Based Language in opposite to assembler) - which is almost exactly all what I need (and all the rest is availble for me easily without the questions to masters like JimV, Bersy, Fnord or the popular Salamandre - has he yet to get the title of the master in WoG, ERM and similair things? Only thing I need not done yet aside from scripting an example to test and later things is easy elaborate through ERM help to code the algorithm I almost know now and check the formula of ressurection spell to get similairly balanced effects, and Commander Spell Power points is really easy to get especially under Enchanced Commanders Script which is place where I wanted to place it.)

@next person (sorry to forgrt the nickname)
The easy thing to get the answer for specific question that I also too frequently forget to do is really elaborate it itself with easily attainable sources of knowledge (which commonly are wikipedia and google searcher and speciffically for Heroes3 it is ERM Help which is really helpful despite beeing outdated and not fully correct). You don't have to remember everything if you know where knowledge lays as long as you have access to the source of knowledge (I wouldn't be able to write most easy ERM scripts without some help of ERM Help but it is anyway with each copy of my Heroes3 game and I always want to test my script a bit so I rarely write ERM script from devices without at least one copy of the game).


@JimV
Yeah Jim Vogan, you have very specific and elaborate way of implementing things (not that it is something bad, my friend). People commonly are making the mistake of judging other people in base of themselves, and you JimV while beeing our hero are still only a human (I'm too, obviously!). Sometimes it's better to ask than guess and it saved you much of unneeded (so iriting for you) work that it was exactly said what is needed. People has different ways of solving things so that honorable and experienced programist as you (since you not only script in ERM but really program since 8bit era) has definately a different concept than such novice as the person mentioned or me (I prefer to say on myself as novice eg. person which still has much to learn despite my pride for the right to making mistakes ). So misunderstanding is not really your fault as commonly matures and childs couldn't understand each other. While you have much more right to pride than me, don't bother to ask for something especially if it could save your work (which together with your time is really precious as you could statistically work while the while on another fabulous mod or on important bugfix to existing one)

@all people here
It is really wise to properly know when to ask or find himself/herself. Some may think it's obvious but the task is in reality very hard.

PS: I'd like to make a mod with unnoficial bugfixes and tiny custom changes to official WoG/ERA scripts. The question is if I am allowed to use the title "ERA ERM Unnoficial Patch" or something similair (mostly the "unnoficial patch" part)? I'm supposed to work on it in cycle with ERA updates and the changes to official one would be indeed tiny - much less than SU lite but with some small custom elements - but I wouldn't like to be rude and I am following the nomenclature of TES modding (where mod beeing a bugfix for official content rather than proper/elaborated mod used the term "Unofficial Patch")? It would be obviously less tested (so a bit less stable) than official scripts so they have no own right to be included in official ones before strong testing so I would be really fine with the "Unofficial Patch" mod, but I wonder if I am demanding too much? I'll grant automatic right for any changes from Unnofficial Patch to be included later in official ERA only if I am allowed to use the name (I mean elsewere wouldn't be any "Unofficial Patch", not that I wouldn't allow my "fixes" to be shared, obviously!).

PPS: I hope you can stand so long post but I wonder if it is really true .

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


Legendary Hero
walking to the library
posted August 08, 2012 09:24 PM

I think you should ask Bersy in the Era thread the question you finished your post with if he doesnt check your post here.
____________
"They made a Heroes V? "-OhforfSake

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


Responsible
Supreme Hero
posted August 08, 2012 09:55 PM

Quote:
It is really wise to properly know when to ask or find himself/herself. Some may think it's obvious but the task is in reality very hard.


This system has always worked for me so far:

1) First read the manual (ERM Help, in this case).  Otherwise, you are like a carpenter trying to build a house without knowing not only how to use carpentry tools, but even what the tools are.

2) Then try to figure out how to accomplish some objective.

3) Usually the first attempt will not work, but you will learn something.  Think of another way, and try again.

4) Repeat step three many times.

5) If all else fails, ask Bersy.

Probably this works for me because I enjoy using ERM.  If it were some task which I found boring or very difficult, I might be happy to let others do my work for me.  (I have been trying for years to get my sister who is an artist to do Heroes graphics for me.)

As for unofficial or official patches, my opinion, for what it is worth, is that this is the internet:  people can offer whatever Heroes mods they want (as long as they do not violate any license agreements), and it is up to other people whether they want to use them.  Mods involving replacements for WoG scripts should be easy to make, using Bersy's "load only these scripts" option.

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


Promising
Famous Hero
of infamy
posted August 09, 2012 06:45 AM

Quote:

5) If all else fails, ask Bersy.



Indeed the true recipe for success

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0594 seconds