Mirage Engine
How to handle gathering. - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: How to handle gathering. (/showthread.php?tid=1856)



Re: How to handle gathering. - Robin - 23-06-2008

Do you want it set per tile or per player?


Re: How to handle gathering. - Robin - 23-06-2008

Just make it so when the player stands on the tile, GetTickCount is saved to any empty Data* that is there, then whenever someone else stands on it do something like this:

Code:
If Tile.Data3 + 10000 > GetTickCount then
CAN HARVEST
else
ALREADY HARVESTED
end if



Re: How to handle gathering. - Robin - 23-06-2008

Server. The entire thing should be serverside.


Re: How to handle gathering. - deathknight - 21-08-2008

I have a question (sorry, I'm trying to learn a little bit of coding) would this bit of code activate only when you walk onto the tile, as long as you are standing on the tile, or would it depend on where you placed the code? Any explanation to a response would be appreciated.

Quote:
Code:
If Tile.Data3 + 10000 > GetTickCount then
CAN HARVEST
else
ALREADY HARVESTED
end if



Re: How to handle gathering. - Rian - 21-08-2008

Depends on where you place the code. This bit is probably activated by player action, such as standing on the tile and hitting enter, or using an item, such as a scythe or hoe, in front of or next to the tile.

What it definitely does do though, is make a player wait a certain amount of time (tile.Data3 + 10000) before someone can perform the action (harvesting) again. In this case, it looks like gettickcount is being stored in the tile's .Data3