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: New to scripting - need help!
Thread: New to scripting - need help! This thread is 2 pages long: 1 2 · «PREV
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted March 27, 2013 03:15 PM
Edited by Salamandre at 15:19, 27 Mar 2013.

There is already mithril mine mod here., looking in it it will answer your questions. I don't think we can make the flag change, as mithril mine is unknown object in game, not a regular mine. But you can get who owns it in text, see mod.

Note:

!!VRv5036:C0/0/0; has same effect as

!!VRv5036:S0;
!!VRv5037:S0;
!!VRv5038:S0;

Quote:
I cannot use any other than these 10 z variables



False information. Check erm help to see which z vars are claimed, there are a lot more free.

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

Tavern Dweller
posted March 27, 2013 03:18 PM

Thanks Salamandre very helpful as always

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

Tavern Dweller
posted March 29, 2013 02:07 PM

I have a problem with the objects:

the AI visits the objects regardless of the power of its army.
In that way the AI literally suicides itself when visiting that object...

is there a way to make them visit an object only when they know they can win the battle?


Here's the code:

ZVSE

//

V501
z852/853
v5009 - 5016

//

!#VRz852:S^Ghost Cave (Not visited)^;
!#VRz853:S^Ghost Cave (Visited)^;
!#HT63/59:T852;

!?OB63/59;
!!PO998:N?v1;

!!HE-1:O?v5009;
!!HE-1:P?v5013/?v5014/?v5015;

!!VRv5010:Sc +6 :4;
!!VRv5011:Sc :10 +1;
!!VRv5012:Sc *6;
!!VRv5016:Sc :10 +1 *3000;

------- AI section --------

!!HE-1&-1000:Tv5013/v5014/v5015/159/v5012; ( 69/v5010 )
!?BA0&-1000/v998=v5013/v999=v5014/v1000=v5015;
***     !!BA&-1000:M1/2/156/v5011; (changed this line of code to a comment to try out the script first)
***     !!BA&-1000:M1/1/159/v5012; (changed this line of code to a comment to try out the script first)

!?BA1&-1000/v998=v5013/v999=v5014/v1000=v5015;
!!HE-1&-1000:O?y-2;
!!FU&-1000/v5009<>y-2:E;

!!HE-1&-1000/v1=0:Fd0/d2/d0/d2;
!!HE-1&-1000/v1=0:Edv5016;

------- END AI section --------

!!IF&1000/v1=1:M^{Ghost Cave}

The ghosts have abandoned this cave and nothing is left inside it.^;

!!FU&1000/v1=1:E;

!!IF&1000:Q1^{Ghost Cave}

As you approach to the cave you feel that something bad is going to happen.

Do you want to proceed or go back?^;

!!FU&-1/1000:E;

!!HE-1&1000:Tv5013/v5014/v5015/69/v5010;
!?BA0&1000/v998=v5013/v999=v5014/v1000=v5015;
!!BA&1000:M1/2/156/v5011;
!!BA&1000:M1/1/159/v5012;

!?BA1&1000/v998=v5013/v999=v5014/v1000=v5015;
!!HE-1&1000:O?y-2;
!!FU&1000/v5009<>y-2:E;

!!IF&1000/v1=0:Q501/32/2/34/2/17/v5016/1^The ghosts have now left the cave. The fear is gone and now you feel stronger than before: ^;

!!HE-1&1000/v1=0:Fd0/d2/d0/d2;
!!HE-1&1000/v1=0:Edv5016;

!!VRv5010:S0;
!!VRv5011:S0;
!!VRv5012:S0;
!!VRv5016:S0;

!!PO998:N1;
!!OB998:H853;

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

Another thing: is there a way to set the morale of a monster during a combat?
Because I tried with with !!BM:M (mirth) but it doesn't work...
maybe I did a mistake on the code?

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


Admirable
Omnipresent Hero
Wog refugee
posted March 29, 2013 02:13 PM

!!HE-1&1000:T[...] human player fights the big boss
!!HE-1&-1000:T0/0/0/1/1; ai player fights one pikeman
____________
Era II mods and utilities

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

Tavern Dweller
posted March 29, 2013 02:30 PM

So the only way to do it is by cheating?

Well fair enough

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


Admirable
Omnipresent Hero
Wog refugee
posted March 29, 2013 02:47 PM

Well, no, there is a clean way, but this requires some scripting: check AI hero army, cumulate all health of his creatures, store this number, then add the corresponding number of enemies. I would add only half if for AI, he has bad luck in equal battles.
____________
Era II mods and utilities

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

Page compiled in 0.0309 seconds