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 200 250 300 ... 303 304 305 306 307 ... 350 400 407 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted April 28, 2016 09:21 PM
Edited by Salamandre at 21:22, 28 Apr 2016.

!!if&v9712>0:; ----> !!if&v9712>=0:;

because Orrin ID is zero, so your script will exit if orrin is defender.

____________
Era II mods and utilities

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


Promising
Supreme Hero
Researching Magic
posted April 28, 2016 09:24 PM
Edited by RerryR at 21:26, 28 Apr 2016.

Hero_Of_Light said:
@Salamandre

I think I fixed the problem but I want you to see If this is correct ERM scripting:

Instead of exiting If no hero is there, I made the script work If defending hero IS there. Is this the correct way to use this command?

!!BA:H0/?v9711 H1/?v9712;
;art 149, 150, 152, 153, 155
!!if&v9712>0:; If hero on other side <---- Here
!!HEv9711:A2/149/d/?y20;  [check for artifact]
!!HEv9712&y20>0:R0/d-1;  [morale bonus]
!!HEv9712&v9712>-1:A2/149/d/?y21;  [check for artifact]
!!HEv9711&y21>0:R0/d-1;  [morale bonus]
!!HEv9711:A2/150/d/?y22;  [check for artifact]
!!HEv9712&y22>0:R0/d-1;  [morale bonus]
!!HEv9712&v9712>-1:A2/150/d/?y23;  [check for artifact]
!!HEv9711&y23>0:R0/d-1;  [morale bonus]
!!HEv9711:A2/152/d/?y24;  [check for artifact]
!!HEv9712&y24>0:R1/d-1;  [luck bonus]
!!HEv9712&v9712>-1:A2/152/d/?y25;  [check for artifact]
!!HEv9711&y25>0:R1/d-1;  [luck bonus]
!!HEv9711:A2/153/d/?y26;  [check for artifact]
!!HEv9712&y26>0:R1/d-1;  [luck bonus]
!!HEv9712&v9712>-1:A2/153/d/?y27;  [check for artifact]
!!HEv9711&y27>0:R1/d-1;  [luck bonus]
!!HEv9711:A2/155/d/?y28;  [check for artifact]
!!HEv9711&y28>0:R0/d3;  [morale bonus]
!!HEv9711&y28>0:R1/d3;  [luck bonus]
!!HEv9712&y28>0:R0/d-3;  [morale bonus]
!!HEv9712&y28>0:R1/d-3;  [luck bonus]
!!HEv9712&v9712>-1:A2/155/d/?y29;  [check for artifact]
!!HEv9712&y29>0:R0/d3;  [morale bonus]
!!HEv9712&y29>0:R1/d3;  [luck bonus]
!!HEv9711&y29>0:R0/d-3;  [morale bonus]
!!HEv9711&y29>0:R1/d-3;  [luck bonus]
!!en:;


no its not; this:
!!if&v9712>0:; If hero on other side <---- Here
does nothing but maybe iam wrong :D
just remove the exit condition as you did. you should be fine then.

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


Supreme Hero
Work at Magic Dimmension
posted April 28, 2016 09:26 PM
Edited by majaczek at 21:27, 28 Apr 2016.

nope
hero 0 is Orrin
should be >-1

EDIT: NINJAD

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


Admirable
Omnipresent Hero
Wog refugee
posted April 28, 2016 09:27 PM

RerryR said:

does nothing but maybe iam wrong



That is the only true statement in your post

>-1 or >=0, both do same thing.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted April 28, 2016 09:40 PM

OK so other than that is it a correct use of the script's commands? It seems to work OK, I will test it of course but I would like to know If I used it correctly.
____________
Not idly do the leaves of Lorien fall.

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


Promising
Supreme Hero
Researching Magic
posted April 28, 2016 09:41 PM

This if:; command executes the code inside if condition met until !!en:; ??

if so i realy didnt know that


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


Admirable
Omnipresent Hero
Wog refugee
posted April 29, 2016 02:32 AM

Hero_Of_Light said:
OK so other than that is it a correct use of the script's commands? It seems to work OK, I will test it of course but I would like to know If I used it correctly.


Well, is written in a messy way so hard to read and see if ok. I would structure it this way:

BA:H0/H1 ask heroes ID
[ask if hero attacker has artefact 1]
[ask if hero attacker has artefact 2]
[etc for next artefacts]
;
[ask if hero defender has artefact 1]
[ask if hero defender has artefact 2]
[etc for next artefacts]
;
[open if/en and apply effects for attacker]
[open if/en and apply effects for for defender]

This way is easier to debug and read script. In my opinion.

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


Disgraceful
Undefeatable Hero
posted April 29, 2016 08:18 PM

i'm having an issue trying to find how to have a creature give friendly creatures a luck boost during battle(and not the enemy, obviously). i've looked in EA:B and MA:X, and am not finding what i need. or maybe it's in neither of them? what syntax should i be looking under?

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


Supreme Hero
Work at Magic Dimmension
posted April 29, 2016 11:14 PM
Edited by majaczek at 17:11, 30 Apr 2016.

Sorry for repeating but I've been flooded

I need code for blanking Aurora Borealis (it have to be able to build but not giving ALLSPELLS bonus, income and growth should stay like in original WoG)

lately I've been playing with creature banks, I succeed by doing some tricks. One of prizes in them is possibly a grail, so it's why I rush for a code. I already prepared scripted replacements for Tower Grail and Conflux Grail.

Also please help me with preparing a script to use wogify replace, for bringing my new objects (they are 25/1 25/2 25/3 and 25/4 and use freelancers guild's blockmap but this shouldn't be a problem). objects are working properly if placed on the map.

Please help

EDIT: I found how to wogify replace objects, I found also how to prepare custom databanks with new graphics, but I can't erm-place new objects with new graphics (it crashes). It worked when I use insert-look-like command with new objct looking like old one. Probably I need help. I'll try to fix it mysel now :|

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 07:13 PM
Edited by majaczek at 19:32, 30 Apr 2016.

It doesn't correctly replace the objects (!!CB works correctly)

Quote:
ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
ERMS_ScriptDate=30.4(April).2016

!#SN:W^Temple_SunMoon Enabled^/1;

!#TM1:S1/999/1/255;    triggers every color every day
!#TM2:S1/999/1/255;    same but triggers only *after* all calculations from TM1 are done

!?TM2; Replace objects with Temples
!!UN:P195/?y21; [Check if Replace Objects is enabled: y21=1 if yes]
!!FU&y21=0:E;

!!FU55463:P16/1/25/0/63/69/100;

!_!FU55463:P16/1/25/0/63/54/100; Test
!_!FU55463:P16/1/25/0/63/69/100; Test
!_!FU55463:P16/1/25/2/-1/-1/100; Test

!?FU55464; Internal for FU55463
!!UN:Ux1/x2/-2/1; [get x/y/l of yellow square of object into v1-v3]

!_!IF:M^Try Replacing^;

!!VRy77:S0 R99; Dice
!!if&y77<x7:;
 !_!IF:M^Replacing %X1 %X2 with %X3 %X4^;
 !!UN:Ov1/v2/v3;
 !!if|x5<0/x6<0:;
   !!UN:Iv1/v2/v3/x3/x4;
 !!el:;
   !!VRy99:S99;
   !!if&x3=25:;
     !!VRy99:S25;
     !!UN:Iv1/v2/v3/x5/x6;
     !!OBv1/v2/v3:T25;
     !!OBv1/v2/v3:Ux4;
   !!en:;
   !!UN&y99=99:Iv1/v2/v3/x3/x4/x5/x6;
 !!en:;
!!en:;

!?FU55463;
x1, x2 - Type and Subtype of Replaced object
x3, x4 - Type and Subtype of New Object
x5, x6 - Apperance of New Object
x7     - Percentage chance

!!UN:Ux1/x2/?v5;  [objects number]

!!FU&v5<2:E; exit if < 2 objects
!_!VRv5:-1;

!!DO55464/1/v5/1:Px1/x2/x3/x4/x5/x6/x7;


!#TM81:S1/1/1/255; Once
!?TM81; Fix new Creature Banks


!!if&2=3:;
!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P16; [run through]
!!en:;

!!UN:U25/-1/?y-1;  [Dragon Utopias number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P25; [run through]

!_?OB16;
!_!FU:E;
!_!OBv998/v999/v1000:U?y1;
!_!SN:W^Last Creature Bank Subtype^/y1;
!_!OBv998/v999/v1000&y1>20:U0;

!_$OB16/0;
!_!FU:E;
!_!SN:W^Last Creature Bank Subtype^/?y1;
!_!OBv998/v999/v1000:Uy1;


!?OB25;
!!HE-1:N?y1;
!!DO55460/0/6/1:Py1;

!?FU55462; Add Prize
x1/x2/x3 - Position of Crbank
x4       - Type of prize
          1 small combo
          2 big combo
          3 grail

!!VRy1:S0 R99; Dice

!!CBx1/x2/x3&x4=3:A3/2;
!!if&x4=2:;
 !!CBx1/x2/x3&y1>=0 /y1<5 :A3/134; PotDF
 !!CBx1/x2/x3&y1>=5 /y1<12:A3/129; AA
 !!CBx1/x2/x3&y1>=12/y1<24:A3/133; Legion
 !!CBx1/x2/x3&y1>=24/y1<36:A3/126; Dragon Soul Orb
 !!CBx1/x2/x3&y1>=36/y1<55:A3/108; Fanatic Courage
 !!CBx1/x2/x3&y1>=55/y1<66:A3/162; SoDK
 !!CBx1/x2/x3&y1>=66/y1<80:A3/161; Helm of Vision
 !!CBx1/x2/x3&y1>=80/y1<90:A3/166; Broach of Wealth
 !!CBx1/x2/x3&y1>=90      :A3/169; Boots of Rincewind
!!en:;

!!if&x4=1:;
 !!FU55462&y1<10 :Px1/x2/x3/1 Px1/x2/x3/1; extra bonus
 !!FU55462&y1>=95:Px1/x2/x3/1 Px1/x2/x3/1; extra bonus

 !!CBx1/x2/x3&y1>=10/y1<15:A3/170;
 !!CBx1/x2/x3&y1>=15/y1<20:A3/168;
 !!CBx1/x2/x3&y1>=20/y1<25:A3/167;
 !!CBx1/x2/x3&y1>=25/y1<30:A3/165;
 !!CBx1/x2/x3&y1>=30/y1<35:A3/164;
 !!CBx1/x2/x3&y1>=35/y1<40:A3/163;
 !!CBx1/x2/x3&y1>=40/y1<45:A3/158;
 !!CBx1/x2/x3&y1>=45/y1<50:A3/140;
 !!CBx1/x2/x3&y1>=50/y1<55:A3/139;
 !!CBx1/x2/x3&y1>=55/y1<60:A3/138;
 !!CBx1/x2/x3&y1>=60/y1<65:A3/137;
 !!CBx1/x2/x3&y1>=65/y1<70:A3/136;
 !!CBx1/x2/x3&y1>=70/y1<75:A3/135;
 !!CBx1/x2/x3&y1>=75/y1<80:A3/132;
 !!CBx1/x2/x3&y1>=80/y1<85:A3/131;
 !!CBx1/x2/x3&y1>=85/y1<90:A3/130;
 !!CBx1/x2/x3&y1>=90/y1<95:A3/83;
!!en:;

!?FU55461; Clean
x1/x2/x3 - Position of Crbank

!!CBx1/x2/x3:A1/?y1;
!!CBx1/x2/x3&y1>0:A4/0;

!!if&x1=1:;
!!CBx1/x2/x3:G0/-1/0 G1/-1/0 G2/-1/0 G3/-1/0 G4/-1/0 G5/-1/0;
!!CBx1/x2/x3:G6/-1/0 G7/-1/0; Clean Guards Slots
!!CBx1/x2/x3:M-1/0; Clean Monster Prize
!!CBx1/x2/x3:R0/0 R1/0 R2/0 R3/0 R4/0 R5/0 R6/0;
!!en:;

!?FU55460;
x1  - Checked hero
x16 - Creature slot

!!FU&x1<0:E;
!!HEx1:C0/x16/?y1/?y2;
!!HEx1&y1>=243/y1<=251:C0/x16/-1/0;

!?FU55457;
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!OBv1/v2/v3:U?y2; [subtype]


!_!OBv1/v2/v3&y2>20:U10; If new Creature Bank set type to Dragon Utopia


!_!FU:E; Debug Exit

!!if&y2>20/x1=16/2=3:; Any new CRBANK
!!VRy3:Sy2 -20;
!!UN:Ov1/v2/v3;
!_!UN:Iv1/v2/v3/16/0/16/y2;
!_!UN:Iv1/v2/v3/16/0;
!!UN:Iv1/v2/v3/16/0/25/y3;
!!en:;

!!if&y2>0/x1=25:;
!!VRy3:Sy2;
!!el:;
!_!UN:Ov1/v2/v3;
!!FU:E;
!!en:;

!_!FU:E;


!!VRy99:S0 R99; Dice

!!if&y3=1:; Moon

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/246/9  G1/247/9 G2/248/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/153/9  G4/154/9 G5/155/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/235/9; G7/242/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=2:; Sun

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/243/9  G1/244/9 G2/245/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/150/9  G4/151/9 G5/152/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/253/9; G7/240/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=3:; Stars

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/249/9  G1/250/9 G2/251/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/156/9  G4/157/9 G5/158/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/241/9  ;G7/254/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=4:; Greed

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/134/29 G1/135/29 G2/132/29; First 3 slots of Dragons
!!CBv1/v2/v3:G0/151/29 G1/155/29 G2/154/29; Next 3 slots of Dragons
!!CBv1/v2/v3:G6/196/29; Next 1 slot of Dracoliches

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;




Help please

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


Admirable
Omnipresent Hero
Wog refugee
posted April 30, 2016 07:17 PM

More infos? What it does, what it does not work? Then why you can't place new objects if they replace old? They should work if Objects.txt is correctly coded.

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 07:26 PM
Edited by majaczek at 19:30, 30 Apr 2016.

Here is my last objects file
Quote:

9
default.def 111111111111111111111111111111111111111111111111 000000000000000000000000000000000000000000000000 000000000 000000000 0 0 0 0
sf1480.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 25 1 0 0
sf1481.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 25 2 0 0
sf1478.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 25 3 0 0
gkh2ob36.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 25 4 0 0
Z358o11.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 63 69 0 0
Z358o12.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 63 70 0 0
Z358o13.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 63 71 0 0
Z358o14.def 000111111111111111111111111111111111111111111111 010000000000000000000000000000000000000000000000 111111111 011111111 63 72 0 0




If "Custom Utopia" is placed by mapmaker it works perfectly
but I can't place it by erm. In my concept I need object 25 with additional subtypes (editing crbank.txt works only in mapmaker but crashes game, this is first approach to add more crebanks that actually works). Dependent of version of the script it either:
1) Crashes while replacing
2) Replace with 63/69 and it doesn't work like CreBank
3) other cases I don't remember

PS: I prepared replacement def files and packed (inspired by new version of adventure pillars mod).

EDIT: I also tried adding new subtypes of object 63 and it doesn't work also

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 07:58 PM

This work better
Quote:
ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
ERMS_ScriptDate=30.4(April).2016

!#SN:W^Temple_SunMoon Enabled^/1;

!#TM1:S1/999/1/255;    triggers every color every day
!#TM2:S1/999/1/255;    same but triggers only *after* all calculations from TM1 are done

!?TM2; Replace objects with Temples
!!UN:P195/?y21; [Check if Replace Objects is enabled: y21=1 if yes]
!!FU&y21=0:E;

!_!FU55463:P16/1/25/0/63/69/100;
!!FU55463:P16/1/25/1/63/69/100;

!_!FU55463:P16/1/25/0/63/54/100; Test
!_!FU55463:P16/1/25/0/63/69/100; Test
!_!FU55463:P16/1/25/2/-1/-1/100; Test

!?FU55464; Internal for FU55463
!!UN:Ux1/x2/-2/1; [get x/y/l of yellow square of object into v1-v3]

!_!IF:M^Try Replacing^;

!!VRy77:S0 R99; Dice
!!if&y77<x7:;
 !_!IF:M^Replacing %X1 %X2 with %X3 %X4^;
 !!UN:Ov1/v2/v3;
 !!if|x5<0/x6<0:;
   !!UN:Iv1/v2/v3/x3/x4;
 !!el:;
   !!VRy99:S99;
   !!if&x3=25/x4>0:;
     !!VRy99:S25;
     !!UN:Iv1/v2/v3/25/0/x5/x6;
     !_!UN:Iv1/v2/v3/x5/x6;
     !_!OBv1/v2/v3:T25;
     !!OBv1/v2/v3:Ux4;
   !!en:;
   !!UN&y99=99:Iv1/v2/v3/x3/x4/x5/x6;
 !!en:;
!!en:;

!?FU55463;
x1, x2 - Type and Subtype of Replaced object
x3, x4 - Type and Subtype of New Object
x5, x6 - Apperance of New Object
x7     - Percentage chance

!!UN:Ux1/x2/?v5;  [objects number]

!!FU&v5<2:E; exit if < 2 objects
!_!VRv5:-1;

!!DO55464/1/v5/1:Px1/x2/x3/x4/x5/x6/x7;


!#TM81:S1/1/1/255; Once
!?TM81; Fix new Creature Banks


!!if&2=3:;
!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P16; [run through]
!!en:;

!!UN:U25/-1/?y-1;  [Dragon Utopias number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P25; [run through]

!_?OB16;
!_!FU:E;
!_!OBv998/v999/v1000:U?y1;
!_!SN:W^Last Creature Bank Subtype^/y1;
!_!OBv998/v999/v1000&y1>20:U0;

!_$OB16/0;
!_!FU:E;
!_!SN:W^Last Creature Bank Subtype^/?y1;
!_!OBv998/v999/v1000:Uy1;


!?OB25;
!!HE-1:N?y1;
!!DO55460/0/6/1:Py1;

!?FU55462; Add Prize
x1/x2/x3 - Position of Crbank
x4       - Type of prize
          1 small combo
          2 big combo
          3 grail

!!VRy1:S0 R99; Dice

!!CBx1/x2/x3&x4=3:A3/2;
!!if&x4=2:;
 !!CBx1/x2/x3&y1>=0 /y1<5 :A3/134; PotDF
 !!CBx1/x2/x3&y1>=5 /y1<12:A3/129; AA
 !!CBx1/x2/x3&y1>=12/y1<24:A3/133; Legion
 !!CBx1/x2/x3&y1>=24/y1<36:A3/126; Dragon Soul Orb
 !!CBx1/x2/x3&y1>=36/y1<55:A3/108; Fanatic Courage
 !!CBx1/x2/x3&y1>=55/y1<66:A3/162; SoDK
 !!CBx1/x2/x3&y1>=66/y1<80:A3/161; Helm of Vision
 !!CBx1/x2/x3&y1>=80/y1<90:A3/166; Broach of Wealth
 !!CBx1/x2/x3&y1>=90      :A3/169; Boots of Rincewind
!!en:;

!!if&x4=1:;
 !!FU55462&y1<10 :Px1/x2/x3/1 Px1/x2/x3/1; extra bonus
 !!FU55462&y1>=95:Px1/x2/x3/1 Px1/x2/x3/1; extra bonus

 !!CBx1/x2/x3&y1>=10/y1<15:A3/170;
 !!CBx1/x2/x3&y1>=15/y1<20:A3/168;
 !!CBx1/x2/x3&y1>=20/y1<25:A3/167;
 !!CBx1/x2/x3&y1>=25/y1<30:A3/165;
 !!CBx1/x2/x3&y1>=30/y1<35:A3/164;
 !!CBx1/x2/x3&y1>=35/y1<40:A3/163;
 !!CBx1/x2/x3&y1>=40/y1<45:A3/158;
 !!CBx1/x2/x3&y1>=45/y1<50:A3/140;
 !!CBx1/x2/x3&y1>=50/y1<55:A3/139;
 !!CBx1/x2/x3&y1>=55/y1<60:A3/138;
 !!CBx1/x2/x3&y1>=60/y1<65:A3/137;
 !!CBx1/x2/x3&y1>=65/y1<70:A3/136;
 !!CBx1/x2/x3&y1>=70/y1<75:A3/135;
 !!CBx1/x2/x3&y1>=75/y1<80:A3/132;
 !!CBx1/x2/x3&y1>=80/y1<85:A3/131;
 !!CBx1/x2/x3&y1>=85/y1<90:A3/130;
 !!CBx1/x2/x3&y1>=90/y1<95:A3/83;
!!en:;

!?FU55461; Clean
x1/x2/x3 - Position of Crbank

!!CBx1/x2/x3:A1/?y1;
!!CBx1/x2/x3&y1>0:A4/0;

!!if&x1=1:;
!!CBx1/x2/x3:G0/-1/0 G1/-1/0 G2/-1/0 G3/-1/0 G4/-1/0 G5/-1/0;
!!CBx1/x2/x3:G6/-1/0 G7/-1/0; Clean Guards Slots
!!CBx1/x2/x3:M-1/0; Clean Monster Prize
!!CBx1/x2/x3:R0/0 R1/0 R2/0 R3/0 R4/0 R5/0 R6/0;
!!en:;

!?FU55460;
x1  - Checked hero
x16 - Creature slot

!!FU&x1<0:E;
!!HEx1:C0/x16/?y1/?y2;
!!HEx1&y1>=243/y1<=251:C0/x16/-1/0;

!?FU55457;
!!UN:Ux1/-1/-1/1; [Creature Bank coordinates in v1/v2/v3]
!!OBv1/v2/v3:U?y2; [subtype]


!_!OBv1/v2/v3&y2>20:U10; If new Creature Bank set type to Dragon Utopia


!_!FU:E; Debug Exit

!!if&y2>20/x1=16/2=3:; Any new CRBANK
!!VRy3:Sy2 -20;
!!UN:Ov1/v2/v3;
!_!UN:Iv1/v2/v3/16/0/16/y2;
!_!UN:Iv1/v2/v3/16/0;
!!UN:Iv1/v2/v3/16/0/25/y3;
!!en:;

!!if&y2>0/x1=25:;
!!VRy3:Sy2;
!!el:;
!_!UN:Ov1/v2/v3;
!!FU:E;
!!en:;

!_!FU:E;


!!VRy99:S0 R99; Dice

!!if&y3=1:; Moon

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/246/9  G1/247/9 G2/248/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/153/9  G4/154/9 G5/155/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/235/9; G7/242/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=2:; Sun

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/243/9  G1/244/9 G2/245/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/150/9  G4/151/9 G5/152/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/253/9; G7/240/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=3:; Stars

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/249/9  G1/250/9 G2/251/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/156/9  G4/157/9 G5/158/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/241/9  ;G7/254/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=4:; Greed

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/134/29 G1/135/29 G2/132/29; First 3 slots of Dragons
!!CBv1/v2/v3:G0/151/29 G1/155/29 G2/154/29; Next 3 slots of Dragons
!!CBv1/v2/v3:G6/196/29; Next 1 slot of Dracoliches

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;




But the change type/subtype doeesn't seem to work by erm?

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


Admirable
Omnipresent Hero
Wog refugee
posted April 30, 2016 08:16 PM

Graphical substitutions work ok, now if you want new subtypes, I know they work when placed in editor then scripted, but placed in wogification, I never saw such thing.
____________
Era II mods and utilities

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 08:49 PM
Edited by majaczek at 20:50, 30 Apr 2016.

I almost did it but there's lacking refresh in WoG
ScreenshootI'll try harder

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


Admirable
Omnipresent Hero
Wog refugee
posted April 30, 2016 08:59 PM

But why you want them to have a creature bank subtype? Just place them as anything which works, then script to act as a creature bank when visit.
____________
Era II mods and utilities

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 09:02 PM
Edited by majaczek at 21:20, 30 Apr 2016.

For example to be used properly by AI? I don't know

When I placed "New Utopias" in Map Editor and used !!CB receiver on them it worked perfectly ... but WoGification made it harder

Edit: Ooops! My test map has a flaw. there is a problem if objects overlaps. now is better but still not perfect.

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


Supreme Hero
Work at Magic Dimmension
posted April 30, 2016 10:15 PM
Edited by majaczek at 00:07, 01 May 2016.

Quote:

!#TM81:S1/1/1/255; Once
!?TM81; Fix new Creature Banks
!!IF:M^New Creature Banks Accessible^;
!!UN:C5168326/4/2657254; turn on TL triggers
!!TL:C1;
!?TL1;
!!SN:W^Temple_SunMoon initialised^/?y1;
!!FU&y1=2:E;
!!IF&y1=1:M^TL0 trigger works^;
!!FU55465&y1=1:P; &y1
!!UN&y1=1:C5168326/4/434630; turn off TL triggers
!!SN&y1=1:W^Temple_SunMoon initialised^/d1;




Why TL1 doesn't fire?

EDIT: I have Similair Pseudo-Trigger and works at least on Custom Maps

Quote:
!?HM-1;
!!SN:W^Temple_SunMoon initialised^/?y1;
!!FU55465&y1=1:P;
!!SN&y1<9:W^Temple_SunMoon initialised^/d1;

!?FU55465;

!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P16/-1; [run through]

!!UN:U25/-1/?y-1;  [Dragon Utopias number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P25/-1; [run through]







--------------------------------------------------------

Here is my last version of script. It doesn't fire replace for newly placed objects but works well with map-planted ones
Quote:
ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
ERMS_ScriptDate=30.4(April).2016

!#SN:W^Temple_SunMoon Enabled^/1;

!#TM1:S1/999/1/255;    triggers every color every day
!#TM2:S1/999/1/255;    same but triggers only *after* all calculations from TM1 are done

!?TM2; Replace objects with Temples
!!UN:P195/?y21; [Check if Replace Objects is enabled: y21=1 if yes]
!!FU&y21=0:E;
!!VRy1:Sc;
!!IF&y1>1:E;

!_!FU55463:P16/1/25/0/63/69/100;
!!FU55463:P16/1/25/2/63/69/90;

!_!FU55463:P16/1/25/0/63/54/100; Test
!_!FU55463:P16/1/25/0/63/69/100; Test
!_!FU55463:P16/1/25/2/-1/-1/100; Test

 !_!IF:M^This Mod adds pillageable Temples^;
 !_!UN:R6/250;

!?FU55464; Internal for FU55463
!!UN:Ux1/x2/-2/1; [get x/y/l of yellow square of object into v1-v3]

!_!IF:M^Try Replacing^;

!!VRy77:S0 R99; Dice

!!if&y77<x7:;
 !_!UN:R6/50;
 !_!IF:M^Replacing %X1 %X2 with %X3 %X4^;
 !!UN:Ov1/v2/v3;
 !!if|x5<0/x6<0:;
   !!UN:Iv1/v2/v3/x3/x4;
 !!el:;
   !!VRy99:S99;
   !!if&x3=25/x4>0:;
     !!VRy99:S25;
     !!UN:Iv1/v2/v3/25/0/x5/x6;
     !_!UN:Iv1/v2/v3/x5/x6;
     !!OBv1/v2/v3:T25;
     !!OBv1/v2/v3:Ux4;

     !!UN:R6/50;

     !_!FU55457:P25/x4/v1/v2/v3;
     
     !_!OBv1/v2/v3:U?y77;
     !_!IF:M^Subtype %Y77^;

     
   !!en:;
   !!UN&y99=99:Iv1/v2/v3/x3/x4/x5/x6;
 !!en:;
 !!SN&x3=25/x4>0:W^Knightmare CreBank %V1 %V2 %V3^/x4;
 !_!IF&x3=25/x4>0:M^Replaced %X1 %X2 with new CreBank^;
!!en:;

!?FU55463;
x1, x2 - Type and Subtype of Replaced object
x3, x4 - Type and Subtype of New Object
x5, x6 - Apperance of New Object
x7     - Percentage chance

!!UN:Ux1/x2/?v5;  [objects number]

!!FU&v5<2:E; exit if < 2 objects
!_!VRv5:-1;

!!DO55464/1/v5/1:Px1/x2/x3/x4/x5/x6/x7;


!#TM81:S1/1/1/255; Once
!?TM81; Fix new Creature Banks

!?HM-1;
!!SN:W^Temple_SunMoon initialised^/?y1;
!!FU55465&y1=1:P;
!!SN&y1<9:W^Temple_SunMoon initialised^/d1;

!?FU55465;

!!UN:U16/-1/?y-1;  [creature banks number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P16/-1; [run through]

!!UN:U25/-1/?y-1;  [Dragon Utopias number]
!!VRv1:S-1;
!!DO55457/1/y-1/1:P25/-1; [run through]

!_?OB16;
!_!FU:E;
!_!OBv998/v999/v1000:U?y1;
!_!SN:W^Last Creature Bank Subtype^/y1;
!_!OBv998/v999/v1000&y1>20:U0;

!_$OB16/0;
!_!FU:E;
!_!SN:W^Last Creature Bank Subtype^/?y1;
!_!OBv998/v999/v1000:Uy1;


!?OB25;
!!FU:E;
!!HE-1:N?y1;
!!DO55460/0/6/1:Py1;

!?FU55462; Add Prize
x1/x2/x3 - Position of Crbank
x4       - Type of prize
          1 small combo
          2 big combo
          3 grail

!!VRy1:S0 R99; Dice

!!CBx1/x2/x3&x4=3:A3/2;
!!if&x4=2:;
 !!CBx1/x2/x3&y1>=0 /y1<5 :A3/134; PotDF
 !!CBx1/x2/x3&y1>=5 /y1<12:A3/129; AA
 !!CBx1/x2/x3&y1>=12/y1<24:A3/133; Legion
 !!CBx1/x2/x3&y1>=24/y1<36:A3/126; Dragon Soul Orb
 !!CBx1/x2/x3&y1>=36/y1<55:A3/108; Fanatic Courage
 !!CBx1/x2/x3&y1>=55/y1<66:A3/162; SoDK
 !!CBx1/x2/x3&y1>=66/y1<80:A3/161; Helm of Vision
 !!CBx1/x2/x3&y1>=80/y1<90:A3/166; Broach of Wealth
 !!CBx1/x2/x3&y1>=90      :A3/169; Boots of Rincewind
!!en:;

!!if&x4=1:;
 !!FU55462&y1<10 :Px1/x2/x3/1 Px1/x2/x3/1; extra bonus
 !!FU55462&y1>=95:Px1/x2/x3/1 Px1/x2/x3/1; extra bonus

 !!CBx1/x2/x3&y1>=10/y1<15:A3/170;
 !!CBx1/x2/x3&y1>=15/y1<20:A3/168;
 !!CBx1/x2/x3&y1>=20/y1<25:A3/167;
 !!CBx1/x2/x3&y1>=25/y1<30:A3/165;
 !!CBx1/x2/x3&y1>=30/y1<35:A3/164;
 !!CBx1/x2/x3&y1>=35/y1<40:A3/163;
 !!CBx1/x2/x3&y1>=40/y1<45:A3/158;
 !!CBx1/x2/x3&y1>=45/y1<50:A3/140;
 !!CBx1/x2/x3&y1>=50/y1<55:A3/139;
 !!CBx1/x2/x3&y1>=55/y1<60:A3/138;
 !!CBx1/x2/x3&y1>=60/y1<65:A3/137;
 !!CBx1/x2/x3&y1>=65/y1<70:A3/136;
 !!CBx1/x2/x3&y1>=70/y1<75:A3/135;
 !!CBx1/x2/x3&y1>=75/y1<80:A3/132;
 !!CBx1/x2/x3&y1>=80/y1<85:A3/131;
 !!CBx1/x2/x3&y1>=85/y1<90:A3/130;
 !!CBx1/x2/x3&y1>=90/y1<95:A3/83;
!!en:;

!?FU55461; Clean
x1/x2/x3 - Position of Crbank

!!CBx1/x2/x3:A1/?y1;
!!CBx1/x2/x3&y1>0:A4/0;

!!if&x1=1:;
!!CBx1/x2/x3:G0/-1/0 G1/-1/0 G2/-1/0 G3/-1/0 G4/-1/0 G5/-1/0;
!!CBx1/x2/x3:G6/-1/0 G7/-1/0; Clean Guards Slots
!!CBx1/x2/x3:M-1/0; Clean Monster Prize
!!CBx1/x2/x3:R0/0 R1/0 R2/0 R3/0 R4/0 R5/0 R6/0;
!!en:;

!?FU55460;
x1  - Checked hero
x16 - Creature slot

!!FU&x1<0:E;
!!HEx1:C0/x16/?y1/?y2;
!!HEx1&y1>=243/y1<=251:C0/x16/-1/0;

!?FU55457;
x1 - Object type
x2 < 0 Default
x2 > 0 Custom

!!VRy3:S0;

!!if&x2<0:;
 !!UN:Ux1/-1/-1/1;  [Creature Bank coordinates in v1/v2/v3]
 !!OBv1/v2/v3:U?y2; [subtype]
!!el:;
 !!VRv1:Cx3/x4/x5;  [Creature Bank coordinates in v1/v2/v3]
 !!IF:M^Custom CreBank^;
 !!VRy2:Sx2;
!!en:;


!_!OBv1/v2/v3&y2>20:U10; If new Creature Bank set type to Dragon Utopia

!!SN:W^Knightmare CreBank %V1 %V2 %V3^/?y77;
!!IF&y77>0:M^Marked new CreBank %Y77^;

!_!FU:E; Debug Exit

!!if&x1=16:; Any new type CRBANK
 !!if&y2>20:;
   !!VRy3:Sy2 -20;
 !!el:;
   !!VRy3:S0;
 !!en:;
!!en:;

!!if&y77<=0:;
 !!if&y2>0/x1=25:;
   !!VRy3:Sy2;
 !!en:;
!!el:;
 !!VRy3&y77>0:Sy77;
!!en:;

!!FU&y3<=0:E;


!!VRy99:S0 R99; Dice

!!if&y3=1:; Moon

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/246/9  G1/247/9 G2/248/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/153/9  G4/154/9 G5/155/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/235/9; G7/242/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=2:; Sun

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/243/9  G1/244/9 G2/245/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/150/9  G4/151/9 G5/152/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/253/9; G7/240/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=3:; Stars

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/249/9  G1/250/9 G2/251/9; First 3 slots of Guards
!!CBv1/v2/v3:G3/156/9  G4/157/9 G5/158/9; Next 3 slots of Lv7++
!!CBv1/v2/v3:G6/241/9  ;G7/254/9; Next 2 slots of Powerul Minions

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;
!!if&y3=4:; Greed

!!DO55461/1/99/1:Pv1/v2/v3; Clean Creature Bank

!!CBv1/v2/v3:G0/134/29 G1/135/29 G2/132/29; First 3 slots of Dragons
!!CBv1/v2/v3:G0/151/29 G1/155/29 G2/154/29; Next 3 slots of Dragons
!!CBv1/v2/v3:G6/196/29; Next 1 slot of Dracoliches

!!FU55462&y99<65:Pv1/v2/v3/1 Pv1/v2/v3/1;
!!FU55462&y99>=65/y99<90:Pv1/v2/v3/2;
!!FU55462&y99>=90:Pv1/v2/v3/2;

!!en:;




It even doesn't help if I made a mark :( (or it ommits making a mark?)

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


Legendary Hero
posted May 01, 2016 11:52 AM
Edited by bloodsucker at 12:29, 01 May 2016.

Salamandre said:
Graphical substitutions work ok, now if you want new subtypes, I know they work when placed in editor then scripted, but placed in wogification, I never saw such thing.

But it works, I've substitute several Objects by my custom boxes and I'm able to substitute resources and other stuff with the coded boxes (type 6, subtype 1) while keeping the unchanged ones (type 6, subtype 0) with tratitional rewards and they both work (one with code the other without).

Majaczek said:
doesn't fire replace for newly placed objects but works well with map-planted ones
Are you trying to place new 'normal' objects on map with code and then replacing them with the ones you created in the same script? If so make sure you close the first DO loop (place new objects) before initiate the search of objects for the second. They both have to loop all objects on map but the number of objects and their indexes have changed.

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


Supreme Hero
Work at Magic Dimmension
posted May 01, 2016 06:48 PM
Edited by majaczek at 19:06, 01 May 2016.

bloodsucker said:

Majaczek said:
doesn't fire replace for newly placed objects but works well with map-planted ones
Are you trying to place new 'normal' objects on map with code and then replacing them with the ones you created in the same script? If so make sure you close the first DO loop (place new objects) before initiate the search of objects for the second. They both have to loop all objects on map but the number of objects and their indexes have changed.


I have Script for new dragon Utopias. Any object Type 25 Subtype >0 placed on the map works Perfectly. Problem is while replacing Adventure Map Objects with them. I tried multiple aproaches and results are bad including crash on replace, "Not a CB" error, "Mon" object, object which look perfect but does nothing, a "dragon utopia" object guarded by guards and others...

EDIT: I Know What is Wrong! Blockmaps for objects doesn't match! It is Mapedit who reads Objects directory but not the game I wish I can repair it now

 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 200 250 300 ... 303 304 305 306 307 ... 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3672 seconds