Game Development Community

Timered Trigger (server side -> clients )

by Pawel Stochlinski · in Torque Game Engine · 01/07/2005 (1:14 am) · 1 replies

Hi,
today i woke up with an idea to implement for my project.
I would like to implement random based timer that will execute a script generating the rain.

I see it like this:


---[cut here]---

int x=random();
SetTimer(1,x);


...


case WM_TIMER:


Rain(x,y,z);


break;


...

-----[/cut here]----

The above script is running on the server side - so the server gives player an information when they should launch their
rain script.


Is it possible ?

#1
01/08/2005 (11:09 pm)
Yes, use the console method schedule(). Paramters are explained in its declaration. You will have to send a command to all clients telling them to start the rain effect in Rain(x,y,z) (which is the function you should schedule. You have to write that function)