Wake of Gods Forum | Форум Во Имя Богов
Updating the erm help, please contribute - Printable Version

+- Wake of Gods Forum | Форум Во Имя Богов (http://wforum.heroes35.net)
+-- Forum: Герои Меча и Магии 3.5 WoG/ERA (/forumdisplay.php?fid=99)
+--- Forum: Скрипты (/forumdisplay.php?fid=103)
+--- Thread: Updating the erm help, please contribute (/showthread.php?tid=4734)


Updating the erm help, please contribute - Valery - 03.05.2015 22:15

What I found so far, please add anything that could simplify scripters life and is not in erm help actually.


;If OB:T = 34 (hero). #get object under hero / erm snippet

;Fix day of, all erm help is wrong about:


; redraw town screen

;change battlefield during battle

;Mop function, find hero portrait for DL

;safe functions equip/delete artifact

;set scouting radius
;65000 objects allowed (XXL maps)
;pitlords summon horned demons


;DL addition:

Code:
A#1/#2/$/1    Change dialogue item characteristic.
#1 - item ID

#2    type    $
  3    Text    (string): new text of the item
  4    Def     (number): new cadre in Def
  11    Pcx     (string): new picture

#4  parameter should always be 1 (anyone care to explain why?)

Notes:
May be called in !?DL trigger and so may be used to customize the dialog on a fly.



RE: Updating the erm help, please contribute - Berserker - 03.05.2015 22:28

Quote:#4 parameter should always be 1 (anyone care to explain why?)
#4 Redraw dialog (1 or 0, 0 by default).


RE: Updating the erm help, please contribute - gamecreator - 03.05.2015 23:01

(03.05.2015 22:15)Valery Wrote:  What I found so far, please add anything that could simplify scripters life and is not in erm help actually.
SN:G may corrupt ERM conditions (if/el/en) if used from inside one.
And updated code for correct curse removal:



RE: Updating the erm help, please contribute - Valery - 03.05.2015 23:17

(03.05.2015 22:28)Berserker Wrote:  #4 Redraw dialog (1 or 0, 0 by default).

We never tested it with 0, and I saw nowhere that. Isn't it safer to say 1 is default?


RE: Updating the erm help, please contribute - gamecreator - 03.05.2015 23:21

Wog sources say it's redraw. For example, you want to change several elements. If you redraw only when changing the last one, it would be much faster and smoother.


RE: Updating the erm help, please contribute - Valery - 03.05.2015 23:25

Ah I see, thanks.

;find player starting town type


; show oracle map

;no ghosts will appear in town after demolishing all dwellings

;create DL dialog on holding mouse button



RE: Updating the erm help, please contribute - Berserker - 03.05.2015 23:26

Valery, if you specify nothing, 0 is assumed. gamecreator is right, if you update several elements, use 1 only for the last one.
Meaning is: redraw the whole dialog after changing control state.


RE: Updating the erm help, please contribute - Valery - 03.05.2015 23:31

yes I understood, is that the error for missing redraw popped up only in 2.55.


RE: Updating the erm help, please contribute - Berserker - 03.05.2015 23:42

Valery, we faced it in Phoenix even when Era had 1.xx versions. It comes from TE (2005). You were just lucky.


RE: Updating the erm help, please contribute - Valery - 03.05.2015 23:48

ok boss, all my DL have 4th parameter, I only forgot it once and I payed of my life and blood.

;must fix emerald tower script, right? As it is now, is big error:
v1 stores number of towers and is set to -1 next command, then next command the loop is screwed. I fix it by replacing v1 with the usual y-1, ok?


Amazing this error stayed there for 10 years.


RE: Updating the erm help, please contribute - Bes - 04.05.2015 00:26

Quote:Function to change building position:

!!VRy1:S0; //city (e.g. Castle)
!!VRy2:S5; //building ID (e.g Tavern)

!!VRy6:S2; //frames num in new def
!!VRy3:S250; //new x
!!VRy4:S200; //new y

!!VRy5:Sy1 *44 +y2 *6 +6859276;

!!UN:Cy5/2/y6;
!!VRy5:+2;
!!UN:Cy5/2/y3;
!!VRy5:+2;
!!UN:Cy5/2/y4;

For more information try to see this post (with translator)
http://forum.df2.ru/index.php?showtopic=6803&view=findpost&p=192935



RE: Updating the erm help, please contribute - Valery - 04.05.2015 14:26

Bersy, how to use in Komposer the erm format I see in some of the htm files? Like here in forum.


RE: Updating the erm help, please contribute - Berserker - 04.05.2015 15:06

I didn't include highlighting script there. Once solitaire345 did it. He also added SN commands from Era. I understood you correctly?
We could try, if you wish.


RE: Updating the erm help, please contribute - Valery - 04.05.2015 15:14

yes, solitaire used it in several receivers htm. Did this mean he had to implement it for only that file?

of course it looks better with, as all other codes examples are pure red. But if too much work, it will be enough as it is.


RE: Updating the erm help, please contribute - Berserker - 04.05.2015 17:26

Not too much, but I'm currently feeling graaaay…fog.


RE: Updating the erm help, please contribute - Valery - 04.05.2015 17:31

No problem. Should I implement the additional scripts in regular format then later you add code? Or better wait for code?


RE: Updating the erm help, please contribute - Berserker - 04.05.2015 20:29

Kompozer allows to view page source code and edit it. Add scripts in the following way:

Code:
<script type="erm" id="erm[unique number for current page]">!!UN:C6919480/4/?y20;
!!VRy20:+136736;
!!VRy21:S[hero number]*1170+y20;
!!VRy22:Sy21+12;  y22 points to object type
;  +16;  y[NN] would point to object subtype
!!VRy23:Sy21+20;  y23 points to object control word (real OB:C)
!!UN:Cy23/4/?y24; get object type under hero...</script>

You won't see the result until send me all html pages to add highlighting script to. You can send them once any time, I'll try to add fast.


RE: Updating the erm help, please contribute - Valery - 04.05.2015 21:34

This is how Solitaire coded his scripts? I do same or I use yours?

Code:
<script type="erm">ZVSE
!#TM1:S1/999/1/1; set TM1 for red
!?TM1;
!!UN:U16/-1/?v100;
!!VRv1:S-1;
!!IF:M^Found %V100 Creature Banks. Now run through all of them.^;
!!DO123/1/v100/1:P;
!!IF:M^Put Shroud.^;
!!UN:H72/72/0/1/100;Close for Red
!!UN:H72/72/1/1/100;Close for Red
!!VRv1:S-2;
!!IF:M^Now run in backward order.^;
!!DO124/1/v100/1:P;<
!?FU123;
!!UN:U16/-1/-1/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms
!?FU124;
!!UN:U16/-1/-2/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms</script>
<script>



RE: Updating the erm help, please contribute - Berserker - 05.05.2015 00:23

Ok, use solitaire's variant, I will update the script.


RE: Updating the erm help, please contribute - Valery - 05.05.2015 09:23

Day (1..n): !!VRv1:Sc;
Day (0..n): !!VRv1:Sc -1;
Day of the month (0..27): !!VRv1:Sc -1 %28;
Week of the month (0..3): !!VRv1:Sc -1 %28 :7;
Week of the month (1..4): !!VRv1:Sc -1 %28 :7 +1;

Can I ask please for "day of the week"? It is the only one missing from the list and I remember there was a quirk on day 7 with the code from help.


RE: Updating the erm help, please contribute - gamecreator - 05.05.2015 10:22

Day of the week (0..6): !!VRv1:Sc -1 %7;
Day of the week (1..7): !!VRv1:Sc -1 %7 +1;


RE: Updating the erm help, please contribute - Valery - 14.05.2015 02:03

Okay, I found the reason to that !!EA bug. Is the erm help which must be updated and fixed.

It says:

Code:
Support for stack experience on the battle field.
   You can set experience points, experience lines and experience parameters for any creature on the battle field.
   Use any !!EA command for this. To refer to a stack on a battle field you need to mention a stack index in negative range:
!!EA-1:... stack 0
!!EA-2:... stack 1
..
!!EA-42:... stack 41
As before you can use a positive value to apply the command to a type of creature. You may set experience parameters for any stack on the battlefield, right in BA0 (BA50) trigger sections or later during a battle.

Or the problem is that troops in BA are in processing of converting to battle stacks, and probably this is the reason we get strange values in their stats. The script works perfectly in BF trigger, no bug.

So I will update the help and I saved a lot of debugging time to Bersy))

Now I know about 10 maps which need to redo the code, including those from Jim. Which shows again erm help is not God's word.)


RE: Updating the erm help, please contribute - Berserker - 14.05.2015 19:03

You're great )


RE: Updating the erm help, please contribute - Valery - 20.05.2015 20:56

All is ready, except gamecreator "curse" script, which is all in russian and I was updating the english section. Can have a translation of the comments, please?


RE: Updating the erm help, please contribute - feanor - 20.05.2015 21:52

Quote:;set scouting radius
works only without scouting as skill
shouldn't be used i think


RE: Updating the erm help, please contribute - Valery - 20.05.2015 22:14

Right, Bersy remove it from UN:C examples.

Feanor, do you have more UN:C black magic list? Erm is being updated.


RE: Updating the erm help, please contribute - gamecreator - 21.05.2015 01:22

Here you go:



RE: Updating the erm help, please contribute - Valery - 21.05.2015 02:16

Thanks. Why it needed this script, HE:Y didn't work properly? What I write as definition to it?


RE: Updating the erm help, please contribute - gamecreator - 21.05.2015 12:31

Definition? Do you mean description?
This is the correct way to remove WoG curses, should be used instead of HE:Y.


RE: Updating the erm help, please contribute - Valery - 21.05.2015 12:48

ok, done and sent to Bersy.


RE: Updating the erm help, please contribute - Valery - 28.08.2015 20:21

A script from Hawaiing, gives multiple melee attacks. Need hooker plugin.




RE: Updating the erm help, please contribute - Valery - 29.08.2015 14:33

From Hawaiing too, multiple shoot + multiple melee




RE: Updating the erm help, please contribute - Valery - 09.11.2015 22:10

Change town buildings name and description, by hawaiing


Changing buildings cost, by Hawaiing: