I have been trying for the last 3 days to get a script working on a randomly generated map in Heroes 5.
I read the guide CH_H5_scripting2.01 from here and I used HOMM5_Script_Functions.pdf for the specific functions.
What I am trying to do is quite simple I want to add once a week 2 creatures to a castle or to a hero.
This is how I went about it:
1) I created a random map and defined what faction player 1 and what faction player 2 is. And gave Player 1 the hero "Nur"
2) I opend the script panel under map properties.
I added MANY different version of these scripts:
Code: Select all
Trigger(NEW_DAY_TRIGGER, "days");
function days()
if GetDate(DAY) == 2 then
AddHeroCreatures( Nur, CREATURE_ARCHANGEL, 1 );
end;
end;
Trigger (NEW_DAY_TRIGGER, "town1");
function town1()
if GetDate(2) then
GetObjectCreatures(Bahiyaa, 91, 2);
end;
end;
3. I start the heroes game select the map I created in multiplayer or single player and wait until it is day 2.
Sadly nothing ever happens no matter how I change the script. I am not even getting an error message…
I am guessing I am doing something very basic wrong or scripts don’t work with random generated maps.
Can anyone explain me what I am doing wrong or give me a step by step explanation on how to “add 2 creatures each week to a town ”
Any help would be very much appreciated !
Kind regards,
SilverMB -