Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Function Execution (https://forums.graalonline.com/forums/showthread.php?t=74572)

killerogue 06-13-2007 06:25 PM

Function Execution
 
It would be nice to have a way to speed up, slow down or pause the execution of individual functions.

I was working on something where I wanted all my objects to get loaded before I send the information to the player with a "public function onPlayerLogin(pl)", but the loading of the objects is done "onCreated".

xAndrewx 06-13-2007 06:41 PM

so, why won't onCreated work?

DustyPorViva 06-13-2007 06:46 PM

Hmm, well I don't know if it helps much, but things are executed in order from top to bottom, so if you do the loading before the functions, it should load beforehand.

Gambet 06-13-2007 07:26 PM

That's why they made functions such as scheduleevent and so forth.

killerogue 06-14-2007 12:02 AM

OnCreated() is working. Lol, I just need to pause the execution of onPlayerLogin so I make sure the vars are loaded properly. I do suppose I can set an extra var and use scheduleevent and add a function Gambet.

godofwarares 06-14-2007 12:05 AM

I usually do something like

PHP Code:

while (var == null)
{
     
sleep(0.5);


It will stay in the loop while the variable is null, and when it is set, it continues. This is what I use when i'm loading something from the serverside on clientside

Gambet 06-14-2007 12:05 AM

Quote:

Originally Posted by killerogue (Post 1317784)
I do suppose I can set an extra var and use scheduleevent and add a function Gambet.




Indeed you can. :)

Inverness 06-14-2007 05:16 AM

You could use waitfor() for a non-existing event, Stefan recommended that.


All times are GMT +2. The time now is 01:47 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.