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 ... 228 229 230 231 232 ... 250 300 350 400 407 · «PREV / NEXT»
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted October 03, 2014 10:43 PM
Edited by Salamandre at 22:51, 03 Oct 2014.

HoL, I don't understand much where is the problem. The script works with tactics or without. It is triggered by the first stack action. So if either you or AI has tactics, when he tries to move its creature (or you), the message appears, play animation then battle ends.

It is you who changed to Armageddon spell, so why complain? of course, one of heroes has Armageddon blade, thus creatures will be immune to it. This is why I didn't script Armageddon spell as option, but instead something neutral as earthquake (which you can change to any spell you like).


Quote:
If Armageddon's Blade and Sword of Frost is present, show text, have both Heroes retreat and the swords destroyed.


Try this then but probably will bug, as killing heroes before battle starts is going to mess then whole thing:
!?BA0&1000; battle start
!!SN:W^HoL_disaster^/0;  initialize clash
!!BA:H0/?y11 H1/?y12;    check heroes ID
!!FU&y12<0:E;
!!HEy11:A2/128/?y1/?y2 A2/162/?y3/?y4;
!!HEy12:A2/128/?y5/?y6 A2/162/?y7/?y8;  check if they have artifacts 128/162
!!VRy9|y2=1/y4=1:S99;
!!VRy10|y6=1/y8=1:S99;
!!SN&y9=99/y10=99:W^HoL_disaster^/99;  create condition
!!SN:W^HoL_disaster^/?y1;
!!FU&y1<99:E;
!!IF:M^custom message  (both artifacts are present)^;
!!HEy11:A2/128/?y1/?y2 A2/162/?y3/?y4;
!!HEy11&y2>0:A3/128/1/1;
!!HEy11&y4>0:A3/162/1/1;
!!HEy12:A2/128/?y1/?y2 A2/162/?y3/?y4;
!!HEy12&y2>0:A3/128/1/1;
!!HEy12&y4>0:A3/162/1/1;  remove artifacts
!!HEy11:K;
!!HEy12:K;


____________
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 October 03, 2014 11:06 PM
Edited by Hero_Of_Light at 23:07, 03 Oct 2014.

Runs much smoother and simpler thanks a bunch!

However, the bug I told you about persist. If the Sword of Frost (163) is present and one of the heroes has tactics then there's problem.

If neither has tactics or both have the same skill level of tactics then it works fine. However when the hero afflicted by the petrifying spell has tactics then we have a problem, since creatures have to move and they can't since they are petrified. And even the start battle button doesn't work so you have to restart game.

Can you add a Tactics check to the artifact script? Here is the revised version (from when I removed the magic mirror effect).

***New artifacts / Heroes Summoning script

;vars used: v110-v113, v444-v445, v8001-v8018, v9711-v9712, FU100, FU333-337, flags 50, 200-202, 411,
;w85-86

!#UN:P900/?v561; [Check if Stack Experience is enabled: v296]
!#UN&v561=0:P906/1; [Disable gaining of Stack Experience from battles if Stack Experience is disabled]

!?BA0&1000;
!!UN:P900/1; [Enable Stack Experience]
!!IF:V202/0; cast twice flag
!!VRv8011:C-1/-1/-1/-1/-1/-1/-1/-1;
; Sceptre of power
!!BA:H0/?v9711 H1/?v9712;
;art 163
!!HEv9711:A2/163/d/?y6;  [check for artifact]
!!HEv9712&v9712>-1:A2/163/d/?y8;  [check for artifact]
!!VRv8013&y6>0:S0;
!!VRv8014&y8>0/v9712>-1:S0;
;art 164, gives expert haste
!!HEv9711:A2/164/d/?y7;  [check for artifact]
!!HEv9712&v9712>-1:A2/164/d/?y9;  [check for artifact]
!!VRv8015&y7>0:S0;
!!VRv8016&y9>0/v9712>-1:S0;
;summon creatures
!!IF|v9711=146/v9712=146:V411/1; activate special BF if one of heroes in
;cast twice
!!HEv9711:A2/170/d/?y2;
!!HEv9712&v9712>=0:A2/170/d/?y4;
!!IF|y2>0/y4>0:V202/1;
!!VRv444&y2=1:S0;  set the side which will cast twice
!!VRv444&y4=1:S1;
!!IF:V200/1 V201/0;
!!HEv9711:A2/162/d/?y2;  [check for artifact]
!!HEv9712&v9712>-1:A2/162/d/?y4;  [check for artifact]
;art 162, use w85
!!if&y2>0:; If attacker has it
!!IF:Wv9711;
!!VRw85:S99;
!!FU333:Pv9711;
!!en:;
!!if&y4>0/v9712>-1:; if defender has it
!!IF:Wv9712;
!!VRw85:S99;
!!FU333:Pv9712;
!!en:;
;art 161, does the opposite
!!HEv9711:A2/161/d/?y3;  [check for artifact]
!!HEv9712&v9712>-1:A2/161/d/?y5;  [check for artifact]
;Art 161, use w86
!!if&y3>0:; If attacker has it
!!IF:Wv9711;
!!VRw86:S99;
!!FU338:Pv9711;
!!en:;
!!if&y5>0/v9712>-1:; if defender has it
!!IF:Wv9712;
!!VRw86:S99;
!!FU338:Pv9712;
!!en:;
;sea creatures bonus
!!BA:P?y16/?y17/?y18;
!!TRy16/y17/y18:T?y19/d/d/d/d/d/d/d;
!!IF&y19=8:V50/1;

!?BF&1000;
;art 163
!!DO336/21/28/1&v8013=0:P;
!!DO336/0/7/1&v8014=0:P;
;art 164, haste
!!DO337/0/7/1&v8015=0:P;
!!DO337/21/28/1&v8016=0:P;

*?FU334; *magic mirror 999 turns, expert level
*!BMx16:M36/999/3;

!?FU336; *stone gaze(?) 3 turn, expert level
!!BMx16:M70/3/3;

!?FU337; *expert haste 999 turns, expert level
!!BMx16:M53/999/3;

!?FU333; change SP/KN in ATT/DEF  art ID=162, w85 used
;x1=Hero ID
!!HEx1:F?v110/?v111/?v112/?v113; Get stats
!!HEx1:I?v8018;
!!VRv114:Cv110/v111/v112/v113;
!!VRv110:+v112;
!!VRv111:+v113;
!!VRv112:-v112;
!!VRv113:-v113;
!!HEx1:Fv110/v111/v112/v113;

!?FU338; change ATT/DEF in SP/KN art ID=161, w86 used
;x1=Hero ID
!!HEx1:F?v110/?v111/?v112/?v113; Get stats
!!HEx1:S24/?y1; get if intelligence
!!VRv8019:Sv111*10;
!!VRv8019&y1=1:*5:4; %25
!!VRv8019&y1=2:*3:2;  %50
!!VRv8019&y1=3:*2;   %100
!!HEx1:Idv8019;
!!VRv114:Cv110/v111/v112/v113;
!!VRv112:+v110;
!!VRv113:+v111;
!!VRv110:-v110;
!!VRv111:-v111;
!!HEx1:Fv110/v111/v112/v113;

!?BG1&1000;
!!BU:C?y1; *check if battle ended this turn
!!FU&y1=0:E;
;art 162
!!IF:Wv9711; read hero w vars
!!HEv9711&w85=99:Fv114/v115/v116/v117; reset stats as before battle
!!HEv9711&w85=99:Iv8018;
!!VRw85:S0;
!!IF&v9712>-1:Wv9712;
!!HEv9712&v9712>-1/w85=99:Fv114/v115/v116/v117; reset stats as before battle
!!HEv9712&v9712>-1/w85=99:Iv8018;
!!VRw85:S0;  *DONE

;ART 161
!!IF:Wv9711; read hero w vars
!!HEv9711&w86=99:Fv114/v115/v116/v117; reset stats as before battle
!!VRv8019&w86=99:*-1;
!!HEv9711&w86=99:Idv8019;
!!VRw86:S0;
!!IF&v9712>-1:Wv9712;
!!HEv9712&w86=99/v9712>-1:Fv114/v115/v116/v117; reset stats as before battle
!!VRv8019&w86=99:*-1;
!!HEv9712&w86=99/v9712>-1:Idv8019;
!!VRw86:S0;

!?BF&1000/411;
!!VRv8001:C-1/-1/-1/-1/-1/-1/-1/-1/-1;
;Catherine: quantity of summoned creatures = to her level
!!if|v9711=146/v9712=146:;
!!VRy1:S164 R3; [Random War Machine]
!!HE146:Ed/?y2;
!!VRy2&y1=164:Sy2:2; If Cannon/2
!!VRy2&y1=167:Sy2:2; If Craneq/2
!!VRv8001&v9711=146:S0; Attacker
!!VRv8001&v9712=146:S1;  Defender
!!BU&v8001=0:Sy1/y2/38/v8001/-1/1; [Summon creatures]
!!BU&v8001=1:Sy1/y2/46/v8001/-1/1; [Summon creatures]
!!en:;
!!IF:V411/0; disable

;sea bonus
!?BR&50/1000;
!!DO100/0/41/1:P;
!!IF:V50/0;

!?FU100;
!!BMx16:T?y1;
!!FU&y1<>123/y1<>129/y1<>170/y1<>171:E; exit if not water creatures
!!BMx16:Sd1; increase speed by 1

;cast twice
!?BG0&1000/202;
!!BG:A?v445;
!!FU&v445<>1:E;
!!BG:Q?v445; **added check for side
!!FU&v445<>v444:E;
!!IF&200:V201/1;
!!IF:V200/0;

!?BR&1000/202;
!!IF:V200/1;

!?BG1&1000/201/202;
!!BHv444:M0;  side=v444
!!IF:V201/0;

;artefacts giving skills
;165, gives expert luck
!?AE1&v998=165;
!!HE-1:S9/?y1;
!!IF:W-1;
!!VRw5:Sy1;
!!HE-1:S9/3;

!?AE0&v998=165; shield unequip
!!IF:W-1;
!!HE-1:S9/w5;

;166, gives expert Logistics
!?AE1&v998=166;
!!HE-1:S0/?y1;
!!IF:W-1;
!!VRw9:Sy1;
!!HE-1:S0/3;
!!HE-1:S2/?y2;
!!IF:W-1;
!!VRw8:Sy2;
!!HE-1:S2/3;

!?AE0&v998=166; unequip
!!IF:W-1;
!!HE-1:S0/w9;
!!IF:W-1;
!!HE-1:S2/w8;

;167, gives  expert leadership
!?AE1&v998=167;
!!HE-1:S6/?y1;
!!IF:W-1;
!!VRw6:Sy1;
!!HE-1:S6/3;

!?AE0&v998=167;
!!IF:W-1;
!!HE-1:S6/w6;

;168, gives  expert estates
!?AE1&v998=168;
!!HE-1:S13/?y1;
!!IF:W-1;
!!VRw7:Sy1;
!!HE-1:S13/3;

!?AE0&v998=168;
!!IF:W-1;
!!HE-1:S13/w7;

;169, gives to beastmasters and witches +6 to all primary skills
;class 14-15
!?AE1&v998=169;
!!HE-1:B2/?y1;
!!HE-1|y1=14/y1=15:Fd10/d10/d10/d10;

!?AE0&v998=169;
!!HE-1:B2/?y1;
!!HE-1|y1=14/y1=15:Fd-10/d-10/d-10/d-10;

;163, gives +3 to all primary skills
!?AE1&v998=163;
!!HE-1:Fd3/d3/d3/d3;

!?AE0&v998=163;
!!HE-1:Fd-3/d-3/d-3/d-3;

!?CM2;
!!CM:I?y1;
!!FU&y1>67/y1<75:E;
!!UN:R3/-1; Redraw Hero Screen

[End of Battle]
!?BA1;
!!UN:P900/v561; [Restore Stack Experience status]
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 03, 2014 11:27 PM
Edited by Salamandre at 23:27, 03 Oct 2014.

bloodsucker said:
gives all 6 basic skills at basic level and six commander artifacts...


Your syntax, hum...S0/+1 does not exists in erm. Things are a bit more complex when receiving some bonus from one object. You must also flag the hero so he does not get the bonus again and again.

!?OB63/28&1000;
!!HE-1:N?y1;
!!IF:Wy1; check this hero w97 flag (if w97=99, he already visited)
!!IF&w97=99:M^you already visited this^;
!!FU&w97=99:E;
!!IF:N8/146/8/147/8/148/8/149/8/151/8/154; show the player what's going on
!!IF:N^Your commander receives a +1 bonus to all skills, and those artifacts^;
!!COy1:S0/d1 S1/d1 S2/d1 S3/d1 S4/d1 S5/d1;
!!COy1:A3/0/146/d A3/1/147/d A3/2/148/d A3/3/149/d A3/4/151/d A3/5/154/d;
!!VRw97:S99; set this hero w97 flag to 99, so he can't get the bonus again


____________
Era II mods and utilities

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


Legendary Hero
posted October 03, 2014 11:28 PM

I want to create an object that provides battles everytime you visit it. I tryed the code on the Adventure Caves (both Wog and TDS) but they are too confusing for my actual level. Does anyone has something similar but (A LOT) less elaborate?
Thanks

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


Admirable
Omnipresent Hero
Wog refugee
posted October 03, 2014 11:29 PM

HoL ah ok, now I understand. I forgot about the old script which petrified. I will look into tomorrow.

Also in the last script I gave you, if AI attacks us, game bugs, battle continues, then after battle it crashes. No idea why. If you are the attacker, all ok.
____________
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 October 03, 2014 11:42 PM

Yes you're right. Oh well, don't bother then after all it is not that crucial to the game. The tactics bug is however rather serious if the sword is to work.

As always thank you for your time... You help make my ideas come to life and so most of the features of my mods wouldn't even exist without your help so I am really grateful.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 12:08 AM

Hol

In your long script, delete this part:

!?BF&1000;
;art 163
!!DO336/21/28/1&v8013=0:P;
!!DO336/0/7/1&v8014=0:P;
;art 164, haste
!!DO337/0/7/1&v8015=0:P;
!!DO337/21/28/1&v8016=0:P;


Then replace with:

!?BR&v997=0; after tactics phase
;art 163
!!DO336/21/28/1&v8013=0:P;
!!DO336/0/7/1&v8014=0:P;

!?BF&1000;
;art 164, haste
!!DO337/0/7/1&v8015=0:P;
!!DO337/21/28/1&v8016=0:P;

This will solve the petrify during tactics phase.
____________
Era II mods and utilities

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


Legendary Hero
posted October 04, 2014 12:31 AM

Thanks, it works. Only object has no name and it says not visited when it already was but I'm trying to correct that, the TDS version I have still uses the old ways...

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 12:43 AM
Edited by Salamandre at 00:44, 04 Oct 2014.

Well, this is tricky, as you can have different message when clicking on the object:

Add this to the script then you will get 3 possible messages, try it now with more than one heroes:

!?CM0;
!!CM:P?y1/?y2/?y3;
!!OBy1/y2/y3:T?y4 U?y5;
!!FU&y4<>63/y5<>28:E;
!!OW:A-1/?y1;
!!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&w97=99:S^Already visited^;
!!VRz1&w97<99:S^Not visited^;
!!IF:Q1/-1/-1/4^%Z1^;
!!CM:R0;

____________
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 October 04, 2014 12:46 AM

Hmm... Seems to work OK but I encountered a strange bug which logically won't show that much (if at all) in the game.

When you start the game and IF both heroes wield Sword of Frost and have same level tactics (or none) and IF this is the FIRST battle of the game at first turn both of the creatures armies are frozen and so the battle can't start. You'll need to restart Heroes.

However, if there has been at least a battle before that which I describe above, then it works OK. Strange huh?

Anyways this is a very long shot and it is highly unlikely to actually happen so I guess we have a winner...

Thanks again
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 12:49 AM

I think it can be solved, replace this part then test please:

!?BR&v997=0; after tactics phase
;art 163
!!DO336/21/28/1&v8013=0/v8014<0:P;
!!DO336/0/7/1&v8014=0/v8013<0:P;

Now if both have frost sword, petrify will be disabled, so game will not hang.
____________
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 October 04, 2014 12:55 AM

Yep seems to have solved the problem. And it is only logical that if both have the same thing noone should be petrified.

Thanks a bunch!
____________
Not idly do the leaves of Lorien fall.

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


Legendary Hero
posted October 04, 2014 03:06 AM
Edited by bloodsucker at 09:41, 04 Oct 2014.

Salamandre said:
Well, this is tricky, as you can have different message when clicking on the object:




Thanks.
It works. It changes correctly the tool tip on the mouse pointer but the message in "chat" bar is unaffected. Object is still called object and this code is way too complicated for me to understand without some carefull reading, so I don't know if u already considered that.

Sorry for the late awser but I'm trying to create the battle object and I only camed here much later.

P.S: Can u comment lines of "funtional" code with an * ? Every single script I made has shown problems that look to me like "computer is also compiling the lines I commented!!!"


P.P.S. Ok, what is happening with this one I can guess (wrong Sintax of !!IF...) but I have no idea how it is done and the help for randomize variables and conditional actions is Snowy...

ZVSE

** Initialization code
!#VRz488:S^Eternal Battle^;
!#VRv790:S0;
!#HT63/60:V790/0/488; [set hint to z488, whenever v790 is 0, which it always will be]
** end of Initialization code

!?OB63/60&1000;
!!PO998:N?v1;
!!FU&v1=1:E;
!!IF:Q1^You will get some extra resources from the battles you fight here.  Do you want to try your luck?^;
!!FU&-1:E;
!!HE-1?v9040/?v9041/?v9042;     [Get position]

!!VRv2:0;                [ Randomize ]
!!VRv2:R4;
!!IF:V2/0;
!!HE-1:Tv9040/v9041/v9042/116/500;     [Provoke battle]
!!IF:V2/1;
!!HE-1:Tv9040/v9041/v9042/22/500;
!!IF:V2/2;
!!HE-1:Tv9040/v9041/v9042/31/1200;
!!IF;V2/3;
!!HE-1:Tv9040/v9041/v9042/33/800;
!!IF:V2/4;
!!HE-1:Tv9040/v9041/v9042/117/400;

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


Famous Hero
posted October 04, 2014 10:05 AM
Edited by Siegfried at 11:38, 04 Oct 2014.

Hi,

regarding commenting out lines: It is as Salamandre said. I often have lines like this in my scripts:

**IF:M^DEBUG: store to %X2^;

If i want to enable these lines, i simply replace it with:

!!IF:M^DEBUG: store to %X2^;

I use this intensely for debugging purposes

A question:

Is it possible to check the native terrain for a given creature? Or do i have to check it manually by querying the alignment?

Update:
I'm currently experimenting with my synergies script. If anyone wants to play with it... i have it uploaded to http://www.rorkvell.de/h3/85.erm

The basic idea around this script is to give some kind of bonus depending on more than 1 skill (thus synergies), and this bonus being developable. So there is no static bonus, but a bonus which is low at the beginning and may become really significant for higher level heroes. And in some cases the bonus also depends on other things like the movement. Others will add extra bonus for specific classes if they have some special artifact, thus adding kind of artifact bonus only for specific classes. I want nothing static, all dynamic

What it currently does:
If the attacker has Tactics + Archery, then all shooters with same alignment get an AT bonus, depending on how far the hero moved to that point. The fare moved, the higher the bonus. The bonus depends also on the expertise in tactics and archery. Any tactics or archery specialist will double the bonus effect of that skill.

If an attacker has Tactics + Offence, then all melee troops with same alignment get an AT bonus, similar to the archer bonus.

If a defender has Tactics + Armorer, he gets a bonus depending on the remaining movement points. So the optimal bonus is, when he did not move at all. The bonus is also depending on the expertise of these 2 skills. And if defending a town, gets extra bonus. And if defending town of same alignment, +1.

There is a similar bonus for ship to ship battles, if the hero has navigation, but that has still to be worked out. The script probably has bugs. I try to eliminate them.

I have also added a small test map: http://www.rorkvell.de/h3/_Test01.h3m

____________

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 12:09 PM
Edited by Salamandre at 12:50, 04 Oct 2014.

@bloodsucker

Ok, not bad, you are going to be the next erm god and outtake  the galaxy. Just a few remarks:

Don't use global variable for local checks. Global variable: v10-v9999. Quick variables: y1-y100. They are unique for each trigger.

!!HE-1:P?v9040/?v9041/?v9042;     [Get position]
here you block 3 global vars and you can't use them anymore without reseting them manually
!!HE-1:P?y1/?y2/?y3;     [Get position] here I use 3 quick vars (y1-y3), they will reset automatically at next trigger, use this.


!!VRv2:0;       [ Randomize ]
!!VRv2:R4;


Wrong syntax. If you want v2 to set to zero, you use !!VRv2:S0; (set to zero) If you want to randomize v2, you use !!VRv2:S0 R4; (same command)

!!IF:V2/0;

Here you think you talk about v2, but in fact you already switched to flag 2 (V2). v2 = variable 2, V2 = flag 2. So your script stopped working at this point.

If you want to make your fights dependent of the v2 randomizer, use:

!!VRv2:S0 R4; randomize v2 to 0-4
!!HE-1&v2=0:Ty1/y2/y3/116/500; if v2=0    
!!HE-1&v2=1:Ty1/y2/y3/22/500;  if v2=1
!!HE-1&v2=2:Ty1/y2/y3/31/1200; if v2=2
!!HE-1&v2=3:Ty1/y2/y3/33/800;  and so on
!!HE-1&v2=4:Ty1/y2/y3/117/400;

Is easy once you passed the error phase.

!!PO998:N?v1;
!!FU&v1=1:E;


Here you ask for square infos, but you don't set them later. So this part is useless. The correct would be:

!?OB63/60&1000;
!!PO998:N?v1; ask for this square PO value (0-15), will be zero by default unless you change it
!!FU&v1=1:E; exit if 1
!![...do some action, battle, visit any, ...]
!!PO998:N1; set current square (v998 stores it) to 1 value, so next time when you visit, it exits.

Exercise for you, so you understand global vars vs quick vars.

!?CM0; when right click anywhere on map
!!VRv10:S50; set v10 to 50
!!VRy10:S50; set y10 to 50
!!FU5666:P; start function 5666 and display values of v10 and y10

!?FU5666;
!!IF:M^v10 is %V10, y10 is %Y10^; display the values of v10 and y10.

@Siegfried, I don't know of any way to get creatures terrain other than asking for faction first.

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


Legendary Hero
posted October 04, 2014 03:20 PM

Salamandre
Thank you for the detaled explanation.

I always wondered what a line like this one:
!!HE-1&v2=0:Ty1/y2/y3/116/500;
was all about... It is completly incompreensible without some hands-on.

I've read about the concept of global variables long time ago so I forgot that v is different then y.

!!PO998:N?v1;
!!FU&v1=1:E;


This is the result of the f...king copy/paste without knowing what your are doing. I had already removed it from script by the time you wrote this.



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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 03:26 PM

bloodsucker said:

I always wondered what a line like this one:
!!HE-1&v2=0:Ty1/y2/y3/116/500;
was all about... It is completly incompreensible without some hands-on.


not really, each of those syntax are explained in erm help and at least here, is easy to figure out.

HE-1 (current hero)
&v2=0 action will process only if variable 2 = 0
Ty1/y2/y3 battle will take place at map coordinates y1/y2/y3
116/500 type and number of creatures to fight.
____________
Era II mods and utilities

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


Legendary Hero
posted October 04, 2014 04:23 PM
Edited by bloodsucker at 16:36, 04 Oct 2014.

Salamandre said:

not really, each of those syntax are explained in erm help and at least here, is easy to figure out.


Yeah, now that I tryed it I read it with ease but you need to try every step by it self to the all line make sense. This is really a very powerfull language and has absolutly nothing to do with assembly. But is as user friendly as assembly.

BTW, can u point me a simple example of something a like but using !!BA ? I wanted to make a test for hero's level and give experience to creatures acordingly.

Thanks

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


Legendary Hero
posted October 04, 2014 07:01 PM

Salamandre
Can you please be so kind as explain to me what is w97 doing?

If I change something like the name of the mod it gets completly crazy and stops everything, even Conquistador doesn't load...

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2014 07:48 PM

Paste here what erm help says about w vars (hero vars) then ask me what section you don't understand.
____________
Era II mods and utilities

 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 ... 228 229 230 231 232 ... 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.5705 seconds