ubi.com    Forums  Hop To Forum Categories  Might and Magic  Hop To Forums  Heroes of Might and Magic V Cartographers Guild    I need some help for scripting.
Go
New
Find
Notify
Tools
Reply
  
  Login/Join 
Posted
There are no forum or anything to find related information in Korea about HOMAM5's script system.
I've tried to find out, but couldn't.
So I get this to straight.

I've designed one map and I want it to add a certain amount of resources in weekly basis.
ex) 100 increase of wood and ore, 100000 increase of gold, 50 increase of other resources per every monday.

could you please make a script for this so that I can add the function on script tab, script tab shows up when map property in map editor clicked.

I put dozens of hours on studying it so that I was able to make one exllent map including some modification of data, but I kinda got stuck at this part, script.

Hopefully there would be someone who can help me out.
And It would be greatly appreciated if the script you make works properly as I intended.
 
Posts: 1 | Registered: Sun May 25 2008Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
Try this --

Trigger(NEW_DAY_TRIGGER,"newday");
function newday()
if GetDate(DAY_OF_WEEK)==1 then
SetPlayerResource(PLAYER_1, GOLD, (GetPlayerResource(PLAYER_1, GOLD) + 100000));
SetPlayerResource(.....do the same for each resource you want replacing GOLD with the resource name and the number with how much)
end;
end;


Basically the trigger is called at the start of every day. It calls the functions newday()
Then we check the day of the week, if it is 1 (the first day) we do the script in between the 'if' and the first 'end;'.
In this case we use SetPlayerResource(playername,recourcename,amount) to set the resource. You can use this once for each resource type.
The reason you use GetPlayerResource is because we want to ADD 100000 to what the player already has. So what happenes if the player has 50 gold, we get that, add it to 100000 to get 100050, then set the players resource to 100050
 
Posts: 2 | Registered: Wed December 03 2008Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

ubi.com    Forums  Hop To Forum Categories  Might and Magic  Hop To Forums  Heroes of Might and Magic V Cartographers Guild    I need some help for scripting.

Terms of Use