Well, I modified the first object and made three more.
They work ok but the tips get mixed. I still don't understand that code very well, but I thought !!CM0 would exit in any case that is not the respective object...
---
Private School
ZVSE
!?OB139/1&1000;
!!HE-1:N?y1;
!!HEy1:B0/?z11;
!!HE-1:P?y2/?y3/?y4;
!!SN:W^Hero_%Y1_PrivateSchool_%Y2_%Y3_%Y4^/?y5;
!!IF:Wy1;
!!IF&y5=99:M^Thanks for your visit, is always good for business to have old students here.^;
!!FU&y5=99:E;
!!IF:M1^Here %Z11 can learn half of what he would from visiting a Library and pay 10000 gold and 5 of mithril for it.^;
!!IF:Q1^But we have no other pre-requisites, are you interested?^;
!!FU&-1:E;
!!OW:R-1/6/?y6;
!!OW:R-1/7/?y7;
!!IF&y6<10000:M^You don't have enouch money, we charge 10000 for frequency.^;
!!FU&y6<10000:E;
!!IF&y7<5:M^You don't have enouch mithril, we charge 5 for frequency.^;
!!FU&y7<5:E;
!!OW:R-1/6/d-10000;
!!OW:R-1/7/d-5;
!!IF:M^Congratulations, you are now a private school graduate.^;
!!HE-1:Fd1/d1/d1/d1;
!!SN:W^Hero_%Y1_PrivateSchool_%Y2_%Y3_%Y4^/99; set this school to visited for this hero
!?CM0;
!!CM:P?y2/?y3/?y4;
!!OBy2/y3/y4:T?y6 U?y7;
!!FU&y6<>139/y7<>1:E;
!!OW:A-1/?y1;
!!SN:W^Hero_%Y1_PrivateSchool_%Y2_%Y3_%Y4^/?y5;
!!VRz1&y1<0:S^There is no active hero^;
!!IF&y1<0:Q1/-1/-1/4^%Z1^;
!!CM&y1<0:R0;
!!FU&y1<0:E;
!!IF:Wy1;
!!VRz1&y5=99:S^Already visited^;
!!VRz1&y5<99:S^Not visited^;
!!IF:Q1/-1/-1/4^%Z1^;
!!CM:R0;
---
Shaolin Temple
ZVSE
!?OB139/2&1000;
!!HE-1:N?y1;
!!HEy1:B0/?z11;
!!HE-1:P?y2/?y3/?y4;
!!SN:W^Hero_%Y1_ShaolinTemple_%Y2_%Y3_%Y4^/?y5;
!!IF:Wy1;
!!IF&y5=99:M^The monks are pleased to see you again, they have nothing to teach you but can always tell you some jokes.^;
!!FU&y5=99:E;
!!IF:Q1^You have found a shaolin temple. You can meditate with them but will take some time, are you interested?^;
!!FU&-1:E;
!!HE-1:W?y6;
!!IF&y6<2000:M^You don't have enouch time to meditate today. Maybe another day.^;
!!FU&y6<2000:E;
!!VRv1:S0 R3;
!!VRv2:S0 R3;
!!IF&v2=0/v1=0:S1;
!!HE-1:Fd0/d0/dv1/dv2;
!!HE-1:Wd-2000;
!!IF:M1^You have learned a lot about mind blowing techniques.^;
*!IF:M1^Your power has improved by %V1 and your knowledge has improved by %V2.^;
!!IF:Q1/33/v1/34/v2/1^Your power has improved by %V1 and your knowledge has improved by %V2.^;
!!SN:W^Hero_%Y1_ShaolinTemple_%Y2_%Y3_%Y4^/99; set this school to visited for this hero
!?CM0;
!!CM:P?y2/?y3/?y4;
!!OBy2/y3/y4:T?y6 U?y7;
!!FU&y6<>139/y7<>2:E;
!!OW:A-1/?y1;
!!SN:W^Hero_%Y1_ShaolinTemple_%Y2_%Y3_%Y4^/?y5;
!!VRz1&y1<0:S^There is no active hero^;
!!IF&y1<0:Q1/-1/-1/4^%Z1^;
!!CM&y1<0:R0;
!!FU&y1<0:E;
!!IF:Wy1;
!!VRz1&y5=99:S^Already visited^;
!!VRz1&y5<99:S^Not visited^;
!!IF:Q1/-1/-1/4^%Z1^;
!!CM:R0;
----------
Buddhist Monk
ZVSE
!?OB139/3&1000;
!!HE-1:N?y1;
!!HEy1:B0/?z11;
!!HE-1:P?y2/?y3/?y4;
!!SN:W^Hero_%Y1_BuddhistMonk_%Y2_%Y3_%Y4^/?y5;
!!IF:Wy1;
!!IF&y5=99:M^The monk asks you for sake, you have none but you share a bottle of wine with him.^;
!!HE-1&y5=99:Wd-100;
!!FU&y5=99:E;
!!IF:Q1^You found a buddhist monk. You can meditate with him but will take some time, are you interested?^;
!!FU&-1:E;
!!HE-1:W?y6;
!!IF&y6<2000:M^You don't have enouch time to meditate today. Maybe another day.^;
!!FU&y6<2000:E;
!!VRv1:S1 R2;
!!VRv2:S1 R2;
!!HE-1:Fd0/d0/dv1/dv2;
!!HE-1:Wd-1500;
!!IF:M1^You have learned more mind blowing techniques.^;
!!IF:Q1/33/v1/34/v2/1^Your power has improved by %V1 and your knowledge has improved by %V2.^;
!!SN:W^Hero_%Y1_BuddhistMonk_%Y2_%Y3_%Y4^/99; set this school to visited for this hero
!?CM0;
!!CM:P?y2/?y3/?y4;
!!OBy2/y3/y4:T?y6 U?y7;
!!FU&y6<>139/y7<>3:E;
!!OW:A-1/?y1;
!!SN:W^Hero_%Y1_BuddhistMonk_%Y2_%Y3_%Y4^/?y5;
!!VRz1&y1<0:S^There is no active hero^;
!!IF&y1<0:Q1/-1/-1/4^%Z1^;
!!CM&y1<0:R0;
!!FU&y1<0:E;
!!IF:Wy1;
!!VRz1&y5=99:S^Already visited^;
!!VRz1&y5<99:S^Not visited^;
!!IF:Q1/-1/-1/4^%Z1^;
!!CM:R0;
-----------
Dream Teacher
!!IF:Wy1;
!!IF&y5=99:M^You try to meditate but you only get flashbacks from the last time you have been here.^;
!!HE-1&y5=99:W0;
!!FU&y5=99:E;
!!HE-1:W?y7;
!!IF&y7<2000:M^You don't have enouch time to meditate today. Maybe another day.^;
!!FU&y7<2000:E;
!!VRy6:Sy6+1;
!!VRv1:Sy6*500;
!!HE-1:Y9/v1/666/1;
!!IF:M^You have found a space to meditate on yourself, from this day on you will receive an extra %V1 of experience every day.^;
!!HE-1:W0;
!!SN:W^Hero_%Y1_DreamTeacher_%Y2_%Y3_%Y4^/99; set this school to visited for this hero
!!SN:W^Hero_%Y1_NumberTeachersVisited^/y6;
!?CM0;
!!CM:P?y2/?y3/?y4;
!!OBy2/y3/y4:T?y6 U?y7;
!!FU&y6<>139/y7<>4:E;
!!OW:A-1/?y1;
!!SN:W^Hero_%Y1_DreamTeacher_%Y2_%Y3_%Y4^/?y5;
!!VRz1&y1<0:S^There is no active hero^;
!!IF&y1<0:Q1/-1/-1/4^%Z1^;
!!CM&y1<0:R0;
!!FU&y1<0:E;
!!IF:Wy1;
!!VRz1&y5=99:S^Already visited^;
!!VRz1&y5<99:S^Not visited^;
!!IF:Q1/-1/-1/4^%Z1^;
!!CM:R0;
P.S. Since the CM0 is not part of each objects routine, wouln't it be better to make another file and treat them all together? I already have more then 10 objects working, except for the tips.
Is there an undocumented property of object that makes them behave like scholars and treasure chests, disappearing after use?
I was thinking to use some objects from New Objects and NPC that look like people to create super scholars that give things like: secondary skills above eight, sphinx blessings, artifacts, etc...
Could also be used as triggers for custom battles. But I wonder if I will have to delete every single one of them separatly or there is another way.
* Found a way, I make them treasure chests of an empty type, then script the type to have multiple options. That way they will have different looks and actions, you can't know if you're going to find a bunch of resources, a new secondary skill or the fight of a lifetime.
---
I went a little further on this one. I got some errors when I tested it with Second Henchmen creature present, didn't checked yet with commanders but I bet will do the same.
I have to find a way to exclude entities that are not regular creatures from the flags check and I'm not seing how to do it.
* They don't, already fought a battle and the only one who didn't had the attack and deffense bonus was the Second Henchman. Not sure what is happening to the Fire Immunity and I believe it has some problems.
1. I'm not sure but !!BA1 happens after the battlefield is closed, so I think the restore part can't work like this.
2. Even if it is possible to catch a moment after the battle is finnished and before the battlefield is closed, if some slots are dead the second scan will not catch all the monsters in the same positions.
!!IF:Wy1;
!!IF&y5=99:M^Hey, I'm done for the next millennium. Don't you know I married to Aphrodite? The girl has needs...^;
!!FU&y5=99:E;
!!IF:M^You found the mythical Forge of Vulcan. After a few hours of talking you convince the god himself to freely improve your weaponry.^;
!!IF:Q1^But he needs 20 mithril, 20.000 of gold, 50 of ore and 30 of each precious resources just to use as working materials, are you interested?^;
!!FU&-1:E;
!!IF&y6<50:M^You don't have enouch mercury, I need 30 for my work.^;
!!FU&y6<50:E;
!!IF&y7<30:M^You don't have enouch ore, I need 50 for my work.^;
!!FU&y7<30:E;
!!IF&y8<30:M^You don't have enouch sulfur, I need 30 for my work.^;
!!FU&y8<30:E;
!!IF&y9<30:M^You don't have enouch crystal, I need 30 for my work.^;
!!FU&y9<30:E;
!!IF&y10<30:M^You don't have enouch gems, I need 30 for my work.^;
!!FU&y10<30:E;
!!IF&y11<20000:M^You don't have enouch gold, I need 20000 for my work.^;
!!FU&y11<20000:E;
!!IF&y12<20:M^You don't have enouch mithril, I need 20 for my work.^;
!!FU&y12<20:E;
!!IF:N31/12/32/12;
!!IF:N^You were blessed with the god's favor. All your creatures will have 12 more of attack and deffense and Immunity to Fire when in battle.^;
!!SN:W^ForgeOfVulcan^/99; set Forge to visited
!!SN:W^Hero_%Y1_ForgeOfVulcan^/99; set this hero as the one who visit it.
Salamandre said:Fantastic code Hawaiing, thanks. Had the surprise to see 10 consecutive attacks too.
So,you may like extra_shoot too.
ZVSE
*Extra <metee attack> or <shoot> for stack.
*need <erm_hooker.era>
*<SN:W^007.AttackA.Times^> flag holds the attack times.
*<SN:W^007.ShootA.Times^> flag holds the shoot times(not for 149#Tower)(and 146# is different from other shooters)
********************PUT YOUR CODE HERE******************************
!?BG0;[example]
!!SN:W^007.AttackA.Times^/0;[reset flag](or reset it at BG1)
!!SN:W^007.ShootA.Times^/0;[reset flag](or reset it at BG1)
!!BG:A?y1 N?y2 E?y3;
!!BMy2:T?y4;
!!if&y1=6:;
!!SN&y4=132:W^007.AttackA.Times^/2;[AzureDragon has 2 extra_attack_times]
!!en:;
!!if&y1=7:;
!!SN&y4=196:W^007.ShootA.Times^/2;[Dracolich has 2 extra_shoot_times]
!!en:;
********************HOOK_CODE******************************
!?BA0&1000;
!!SN:L^EraPlugins\erm_hooker.era^/?y1 Ay1/^SetHook^/?y2;
!!SN:Ey2/1/7381311/101310; [hook at <after metee_attack>]
!!SN:Ey2/1/4456346/101311; [hook at <after shoot>]
!?BA1&1000;
!!SN:L^EraPlugins\erm_hooker.era^/?y1 Ay1/^UnsetHook^/?y2;
!!SN:Ey2/1/7381311;
!!SN:Ey2/1/4456346;
You have to be creative within the erm boundaries. So far we cannot change secondary skills descriptions with erm (only in text files) but we CAN change artifacts descriptions.
!?PI;
!!VRz1:S^Offense Specialist^;
!!VRz2:S^Logistic Specialist^;
!!UN:A12/9/z1 A12/10/z1; [change titan gladius description]
!!UN:A98/9/z2 A98/10/z2; [change boots of speed description]
!!IF:Q1/8/12/8/98/10^Start with Offense or Logistics specialist?^;
!!if&v1=1:;
!!HE132:X0/22;
!!en:;
!!if&v1=2:;
!!HE132:X0/2;
!!en:;
!!UN:A12/9/0 A12/10/0;
!!UN:A98/9/0 A98/10/0; [restore both artifacts descriptions]
Such examples can be found by thousands in erm maps, fnord, mines etc.
____________ Era II mods and utilities
Salamandre said: So far we cannot change secondary skills descriptions with erm...
Such examples can be found by thousands in erm maps, fnord, mines etc.
Thanks. It was a matter of perspective, I always assumed the limitation was from my understanding, that I was the making an error. So I tried everything to correct my mistake but never tought about work around the problem cause I suposed there should be no problem at all, I was the one creating it.
Salamandre said:I use 2, same effect.
!!HE132&v1=1:X0/22;
!!HE132&v1=2:X0/2;
I had notice it right now, too. When I wrote those lines I was completly rusty and the only thing I was thinking to code was that, to play a game without using Gundula.
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.8(August).2015
[disable one elemental type limit]
ZVSE
!?BG0;
!!BG:A?y1 Q?y2 S?y3;
!!SN:W^BG.A^/y1 W^BG.Q^/y2 W^BG.S^/y3;
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.8(August).2015
[disable one elemental type limit]
ZVSE
!?BG0;
!!BG:A?y1 Q?y2 S?y3;
!!SN:W^BG.A^/y1 W^BG.Q^/y2 W^BG.S^/y3;
[Air Magic]
!?BG0;
!!BG:Q?y1; Get Current side
!!BHy1:N?y2; Get Current Hero
!!FU&y2<0:E; Exit if no Hero
!!HEy2:S15/?y3; Air Magic Level into y3
!!UN&y3=2:C5906561/1/127; 0x70 Air Elemental -> Storm Elementals
!!UN&y3=3:C5906561/1/208; 0x70 Air Elemental -> Hurricane Elementals
it works for Storm Elementals but doesn't work for Hurricane Elementals (new creature from Amethyst) :|
EDIT: It doesn't work for any creature number > 127
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.8(August).2015
[disable one elemental type limit]
ZVSE
!?BG0;
!!BG:A?y1 Q?y2 S?y3;
!!SN:W^BG.A^/y1 W^BG.Q^/y2 W^BG.S^/y3;
[Fire Magic]
!?BG0;
!!BG:Q?y1; Get Current side
!!BHy1:N?y2; Get Current Hero
!!FU&y2<0:E; Exit if no Hero
!!HEy2:S14/?y3; Fire Magic Level into y3
!!UN&y3=2:C5906498/1/129; 0x72 Fire Elemental -> Energy Elemental
!!UN&y3=3:C5906498/1/129; 0x72 Fire Elemental -> Energy Elemental
[Water Magic]
!?BG0;
!!BG:Q?y1; Get Current side
!!BHy1:N?y2; Get Current Hero
!!FU&y2<0:E; Exit if no Hero
!!HEy2:S16/?y3; Water Magic Level into y3
!!UN&y3=2:C5906540/1/123; 0x73 Water Elemental -> Ice Elementals
!!UN&y3=3:C5906540/1/123; 0x73 Water Elemental -> Ice Elementals
Could OxFea, Salamandre, Hawaiing or anybody prepare a fix?
It seems that H3 Code threats is as Signed Char, and it would help to change that code to threat it as Unsigned Char, but code seems to be too complex for me to find adress of the commands myself
now is there enough small number of UN:C to understand?
my guess is that is code interpreting it as signed char instead of unsigned char and crashes soon on negative number
could you help me now?
EDIT: it seems there is not enough memory place in instructions to prepare unsigned push, the original contains 8bit signed constant push opcode (6A) and one byte constant. any signed constant push command is more than 1 byte opcode :(... it perhaps need a hook or some dirty workaround?
@SalamandrePlease, when you have the time look at my Forge of Vulcan script.
I believe the scan has problems and I'm starting to understand enouch of Hawaing code to make it work but not if I'm making the scan all wrong and suddenly there are creatures with their attributes changed that are not the right one's.
!!IF:Wy1;
!!IF&y5=99:M^Hey, I'm done for the next millennium. Don't you know I married to Aphrodite? The girl has needs...^;
!!FU&y5=99:E;
!!IF:M^You found the mythical Forge of Vulcan. After a few hours of talking you convince the god himself to freely improve your weaponry.^;
!!IF:Q1^But he needs 20 mithril, 20.000 of gold, 50 of ore and 30 of each precious resources just to use as working materials, are you interested?^;
!!FU&-1:E;
!!IF&y6<50:M^You don't have enouch mercury, I need 30 for my work.^;
!!FU&y6<50:E;
!!IF&y7<30:M^You don't have enouch ore, I need 50 for my work.^;
!!FU&y7<30:E;
!!IF&y8<30:M^You don't have enouch sulfur, I need 30 for my work.^;
!!FU&y8<30:E;
!!IF&y9<30:M^You don't have enouch crystal, I need 30 for my work.^;
!!FU&y9<30:E;
!!IF&y10<30:M^You don't have enouch gems, I need 30 for my work.^;
!!FU&y10<30:E;
!!IF&y11<20000:M^You don't have enouch gold, I need 20000 for my work.^;
!!FU&y11<20000:E;
!!IF&y12<20:M^You don't have enouch mithril, I need 20 for my work.^;
!!FU&y12<20:E;
Salamandre said:Henchmen is a different script, to affect it you must go in its script.
Nah, my only problem with henchmen and commander is that if I'm counting creatures in the battlefield they are included, so read his flagged habilities and add bits will provoke problems.
I asked you this first in a PM, remember?
I still don't know exactly what I want for these banks, I want them to be unique to each map and one visit only. They should make the hero who visit them really special. I was thinking of relating them to greek mythology.
I want to use the 'Change your battlefield' code if you don't mind. That would be the reward for visiting Athena.
Mercury will add three to the speed of your creatures.
For Diana I want the extra attacks routine but just for shooters.
I'm not sure if I use Ares for the extra melee and Jupiter for both or Jupiter for both and make Ares give all creatures First Strike and ignores no retaliation, instead.
For this one what I want is:
1. Is a one visit only object.
2. Flags hero
3. In battlefield loops trough this hero's army and gives 12 attack and deffense and Immunity to Fire to all creatures.
After battle all creatures are restored to normal.
I'm ok with this one as it is (presuming that it works) but I'm open to sugestions to other beneficts of god intervention. (Not the kind you find on Other Side of the Monitor, please).
1-2
!?OB[...]&1000;
!!OB998:P?y1/?y2/?y3; get coordinates
!!HE-1:N?y4; get hero ID
!!SN:W^Blood_Hero_%Y4_%Y1_%Y2_%Y3^/99; flag hero, now every time you ask this sn: w var, it will answer 99.
3:
!!DO12345/0/20/1:P; process left side battlefield (right side would be 21-41)
!?FU12345;
!!BMx16:T?y1;
!!FU&y1<0:E; exit if not valid stack
!!BMx16:Ad12 Dd12; add 12 attack/def
!!BMx16:F?k;
!!VRk:|16384;
!!BMx16:Fk; add fire immunity flag
majaczek said:
EDIT: it seems there is not enough memory place in instructions to prepare unsigned push, the original contains 8bit signed constant push opcode (6A) and one byte constant. any signed constant push command is more than 1 byte opcode :(... it perhaps need a hook or some dirty workaround?
my code for you.hope it help.(dirty maybe)
PS:HE:S level is not the true battle spell level(like Magic Clouds Land.)
They are not restored because they never changed. There is no connection between battle stacks (BM) and map monsters (MA), the codes are different. You don't need to restore.
____________ Era II mods and utilities
Didn't knew that, I tought I was affecting !!MA too. It's much simpler this way.
In this case, can I use !!BA, !!BM in !!LE to create battles against impossible creatures without restore their values after? Much interesting.