Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle gathering.
#1
Do you want it set per tile or per player?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#2
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
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Server. The entire thing should be serverside.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#4
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
Reply
#5
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)