|
Thread: Example of a simple script | |
|
CrimsonW

 

Hired Hero
|
posted May 20, 2013 05:40 PM |
|
|
Example of a simple script
I dont have too much time to work and learn scripting but I`ve tried few times in the past without succes. Can someone help me by making a simple script and explain the lines and explain how can I use it ?
What I want is a building that give +3 to all primary skills for 15000 gold but only for heroes lower than lvl 10. Im sorry if Im asking too much and thanks for any help.
|
|
Dr_Zomboss

 
 
Adventuring Hero
|
posted May 20, 2013 05:49 PM |
|
|
You dont know how to script?And i think im only in the world and dont know scripting.Sorry i dont know nothing for scripting(and for that i cant make towns or mods,if i know scripting,in this forum can be least 2 mods from me).
|
|
BloodSucker

 
     
Legendary Hero
|
posted May 21, 2013 09:37 AM |
|
|
You are asking to much!!!
Quote: I dont have too much time to work and learn scripting but I`ve tried few times in the past without succes. Can someone help me by making a simple script and explain the lines and explain how can I use it ?
What I want is a building that give +3 to all primary skills for 15000 gold but only for heroes lower than lvl 10. Im sorry if Im asking too much and thanks for any help.
Ok, I think nobody can teach a programming language trough email but there is an help file and examples are every where so look for something similar to what you need.
In this particular case I think you should look for the code of the Alms House and maybe 'School of Wizardry' or 'Battle Academy' (for setting a prize). Be carefull about the use of global variables.
|
|
CrimsonW

 

Hired Hero
|
posted May 25, 2013 01:25 AM |
|
|
I took this script from ERM help files :
ZVSE
!#VRv1:S0; [set variable v1 to 0]
!?LE0/0/0; [when event at NW corner of surface is visited]
!!VRv1:+1; [add 1 to v1]
!!IF:M^You are visitor number %V1 to the Northwest corner of the surface!^; [show message]
I added it to the map timed events and its not working , what am I doing wrong ?
|
|
gnollking

 
    
Supreme Hero
|
posted May 25, 2013 01:30 AM |
|
|
Quote: I added it to the map timed events and its not working , what am I doing wrong ?
What day did you set the event to trigger at?
Did you actually place a visitable event at 0,0, and walked over it?
____________
|
|
CrimsonW

 

Hired Hero
|
posted May 25, 2013 01:41 AM |
|
|
I added now a visitable event and its working , I didnt know I had to do that. So if I want to turn this in to a mod and to be able to use it in all the maps its not possibile because a visitable event must be placed on the map ? Thanks for info.
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted May 25, 2013 05:57 AM |
|
|
Any erm receiver depends on a trigger. Erm help examples are based on common triggers to help you understand, but you can use a lot of triggers to achiever same result. For instance to give stats to one hero almost any trigger will do it, OB, LE, BA, AE, etc.
You don't need an event at 0.0.0 to make the script run, just adapt it. You can also place an event with erm, so in fact you need nothing in editor. I will give you the pattern of your dwelling, you complete it because otherwise there is no fun.
ZVSE
!?OB143&1000; [we suppose your object is type 143, can be anything else]
!!HE-1:E[...] * check for hero experience/level
!!FU&[...] exit if already level 10 or more
!!OW:R-1/6/[...] check for player gold
!!FU&[...] exit if < than 15000
!!IF:Q1/31/3/32/3/33/3/34/3/1^[...]^; message about +3 skills
!!HE-1:Fd3[...] give the bonus
!!OW:R-1/6[...] remove 15000 gold from treasury
____________
Era II mods and utilities
|
|
|