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: Example of a simple script
Thread: Example of a simple script
CrimsonW
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.

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


Adventuring Hero
posted May 20, 2013 05:49 PM
Edited by Dr_Zomboss at 17:50, 20 May 2013.

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).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
BloodSucker
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.



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
CrimsonW
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 ?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
gnollking
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?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
CrimsonW
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0325 seconds