Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Help With timers needed >.<


Nubbs
 Share

Recommended Posts

so ive read this tutorial http://www.touchofdeathforums.com/smf/index.php?topic=16378.0 ….. and i didnt learn hardly anything about timers well i did, but i dont understand how they work i.e make a sub? how do i use an existing one? or do i have to make a new sub for every timer? that tutorial didn't seem to explain it well enough so let me tell you what im trying to do

```
' Executes when a player steps onto a scripted tile.
Sub ScriptedTile(Index, Script)
Select Case Script
Case 0
Dim F
    Dim C
    Dim K
  K = GetPlayerMap(index)
  C = GetPlayerX(index)
  F = GetPlayerY(index)

If GetPlayerClass(index) = 0 Then
  Call PlayerMsg(index, "its workin", 2)
  If CanTake(Index, 20, 1) = True Then
  Call PlayerMsg(index, "you have the shovel", 2)
  Call TakeItem(index, 1, 1)
  Call SendInventory(index)
  Call PlayerMsg(index, "one seed was taken from your stash", 5)
      Call SetTile( K, C, F, 6, 1, 0, 5)
      Call SetTimer("Plant" & index & "," & "SendMap(K)", 3000)
      Call PlayerMsg(index, "this bewteen the timer", 2)
      Call RemoveTimer("Plant" & index & "," & "SendMap(K)")
      Call PlayerMsg(index, "this is after the timer", 7)
  Else
  Call PlayerMsg(index, "its not workin", 2)
```
thats all i got so far basically i want the SetTile to disappear when the timer ends…ive got more to add after that but this is what i got so far and everything works except the timer which is named by a sub i tried to make myself  >.< didnt work out for obvious reasons prolly

ive been trying to figure this out for like the past two days lol i hate timers as much as i hate ElseIf

*note im using EE 2.7
Link to comment
Share on other sites

i dont have the SendMap sub in my main.txt so i would need to make it then right?

Sub SendMap(mapper)
    Call SendMap(index)
    Call RemoveTimer("SendMap", & index)

is that how i should set it up?

Call SetTile calls the (Map , X, Y, xset, yset, tileset ,layer)
(it places a tile from the tilesheet on the map) i want it to go away when the timer ends…and SendMap made the tile go away when i added that to the Calls i made so i want to set it up on a timer to call SendMap after the 3000 (3sec) is up
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...