|
Thread: New to scripting - need help! | This thread is pages long: 1 2 · «PREV |
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 27, 2013 03:15 PM |
|
|
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.
|
|
brunoverde
Tavern Dweller
|
posted March 27, 2013 03:18 PM |
|
|
Thanks Salamandre very helpful as always
|
|
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?
|
|
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
|
|
brunoverde
Tavern Dweller
|
posted March 29, 2013 02:30 PM |
|
|
So the only way to do it is by cheating?
Well fair enough
|
|
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
|
|
|