function Plus()
res=GetPlayerResource(1,6);
if (res>[amount of money needed to hire]) then
AddObjectCreatures([script name of the town],[creature ID],[number of creatures]);
SetPlayerResource(1,6,res-[amount of money needed to hire]);
end else
MessageBox(GetMapDataPath()..[file name where it is written that there is not enough money, with extension and in quotes]);
end;
end;
Trigger(NEW_DAY_TRIGGER,"Plus");It should work.
Posts from Current questions and answers regarding the map editor.
I'll answer the second question right away: this mod will help. http://all4heroes.net/node/435
The first one is a bit more complicated. You can do it like this: ChangeHeroStat([hero name],7,10). This gives the hero 10 movement points (I'm not sure how much that is, to be honest). And to give everyone 15% permanently... You can use a tricky loop that iterates through all the heroes. But I'll think about it and get back to you.
So, you can't reduce intelligence, which is a shame:( A mod for such a small map probably won't help, although it does help prevent fleeing, if I understand correctly? That's good, because sometimes they run away without a fight. And regarding the first question (need to reduce), if you can, please answer a little more precisely, where and how to enter the values. And also, do the names need to be in English?
h={'Ving','Straker','','','','','','','','','','','','','','','','','','','',''}--for 20 heroes on the map (and two starting ones), if you need to allow more, you need to add more
--write ,''. If there are more starting heroes, you need to add them at the beginning.
hq=0;
i=0;
nh=0;
k=-800;--the turn will be reduced by 800 points
function NewHero(hero)
hq=hq+1;
h[hq]=hero;
ChangeHeroStat(hero,7,k);
end;
function NewDay()
i=1;
while i<=hq do
ChangeHeroStat(h,7,k);
i=i+1;
end;
end;
function MinusHero(hero)
while (i<=hq) do
if(h==hero) then
while(i
h=h[i+1];
end;
i=hq;
end;
i=i+1;
end;
hq=hq-1;
end;
ChangeHeroStat(h[1],7,k);
ChangeHeroStat(h[2],7,k);
hq=2;--if there are 2 heroes on the map at the beginning, otherwise, you need the same functions and hq=3
Trigger(PLAYER_ADD_HERO_TRIGGER,1,'NewHero');--if player 1 hires a hero
Trigger(PLAYER_ADD_HERO_TRIGGER,2,'NewHero');--for player 2. If there is player 3, then the same function is needed for him, but replace 2 with 3
Trigger(NEW_DAY_TRIGGER,'NewDay');
Trigger(PLAYER_REMOVE_HERO_TRIGGER,1,'MinusHero');--one of player 1's heroes is defeated
Trigger(PLAYER_REMOVE_HERO_TRIGGER,2,'MinusHero');
This is how it works for me. But this is not a 15% reduction, but a reduction of 800 points (set by the parameter k). And it should work for all other parameters.
Added 1 minute ago
The names should be in English, yes.
ChangeHeroStat(h[1],7,k);
ChangeHeroStat(h[2],7,k);` Here, I also added the same thing, but with (h[3],7,k); and (h[4],7,k);. I have 4 players, and if I understand correctly, this also needs to be done, right? `
hq=2;` I changed it to `hq=4;` because there are four players with starting heroes. And I also added the following to `Trigger(PLAYER_REMOVE_HERO_TRIGGER,1,'MinusHero');` and `Trigger(PLAYER_REMOVE_HERO_TRIGGER,2,'MinusHero');`: `
Trigger(PLAYER_REMOVE_HERO_TRIGGER,3,'MinusHero');
Trigger(PLAYER_REMOVE_HERO_TRIGGER,4,'MinusHero');` (I didn't touch anything else). But there's no result; I've already tried increasing the value, but it doesn't work. Today, I figured out how to click the "check" button, and it gives me the following errors: `
Function NewHero not defined, line 6
Function newDay not defined, line 11
Function MinusHero not defined, line 18
Function nh not defined, line 4` Either I'm pasting it in the wrong place, or I don't understand anything at all.
1. Script - Name
2. Script PlayObjectAnimation("soldat1", "attack01", IDLE);
3. But it still doesn't attack.
4. What should I do?
Ment...Either I'm entering it in the wrong place or I don't understand anything:(
I'm trying to create animations for creatures here, but it doesn't work! I write everything:
1. Script-Name
2. Script PlayObjectAnimation("soldat1", "attack01", IDLE);
3. But it still doesn't attack
4. What should I do?
2. Not all creatures have an "attck01" animation, but the "attack00" animation usually exists. Even that isn't available for units of the Forest Pact, but this mod fixes it.
Did you fix the hero names in the array?
Oops, could you please provide more details, if possible, as I don't understand any of this.
Is everything else I did correct?
Added 1 minute later
Is everything else correct?
1. Are you entering the name in the Map Properties Tree?
2. Not all creatures have the "attck01" animation, but the "attack00" animation is usually present. Even if the latter is missing for Sylvan units, this mod fixes it.
Yes, yes, it's exactly as you said, changing the attack animation didn't help either.
Ment, well, basically, it just doesn't work:( I'm attaching a text document, please take a look and see what's wrong. I think I followed all the instructions:(
Try this code (at the end of the message).
Yes, yes, it's exactly like that, changing the attack also didn't help.
How many starting heroes do you have? 16? Then you need 16 lines, but it will be easier to loop. Otherwise, I looked, and it seems that some kind of nonsense happened during copying (when I copied the code).
Try this code.