Mailing List
Home
Forum Home
MUD Dev - Discussion of MUD system design, development, and implementation
Mac Game - Mac game development
Rivers of MUD - a Diku and Merc based multiuser dungeon
SMAUG
Subjects
Getting UDP through NAT/firewalls/whatever for a game
Getting UDP through NAT/firewalls/whatever for a game
QuickTime errors
Python script as stand alone MUD server
Various sound problems
Fragment Shaders & GL TEXTURE RECTANGLE EXT
Timers and global variables
Re: Language and platform for Text MUD server
Apparent acquisition of Yantis (mysupersales) by IDE
HID keyboard
Getting UDP through NAT/firewalls/whatever for a game
Microsoft Sparkle
Director MX
Congratulations Horizons
Yet more problems fullscreen mode
Apple Dev Kitchen Them 's tasty vittles, Maw!
NSOpenGLContext, Pbuffers, and drawables
More DCR "theft " naughtiness
dynamic sprite creation and imaging lingo
Re: Find stuff in Flash array?
Effects of skill imbalances?
QuickTime errors
Rom 2 4/Quickmud Enhancement/Bug fix
Working with XML files/CFURL
smooth scrolling/subpixel tweening
RE: (Ron help me?) Flash text
Flash Racing
MudDev FAQ 2
Browser based games
Installing GLUT
Special character in Flash XML
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Question About Timeout Objects

Question About Timeout Objects

2003-12-17       - By Pranav Negandhi

 Back
Reply:     1     2     3  

>From personal experience, I'd say timeouts are great. Especially for the
kind of work that you deploy them for. I've had some problems with using
persistent variable references with timeout objects.

1) using them as properties or globals makes the timeout reference remain
alive and
2) the timeout remains active, even after calling forgot() on the variable.

e.g.
gTimeoutObject = timeout("waitForaWhile").new(yada yada...)
....

on killTimer
  gTimeoutObject.forget()
  put gTimeoutObject


-- timeout("waitForaWhile")

The same thing happens with property variables too. The odd thing is that
the timeout would get deleted from the timeoutList. The only way to kill it
then is to explicitly void the variable

gTimeoutObject = VOID

Solution? I use the timeout NAME as the reference. Like so -

gTimeoutName = "waitForaWhile"
vTmp = timeout(gTimeoutName).new(....

on killTimer
  timeout(gTimeoutName).forget()
end

I dont have _any_ references at all to timeout objects in my code. Been
working like a charm since the past three years or so. All this used to
happen on my office machine - WinNT, D8. I don't know how DMX functions with
timeouts.

Pranav Negandhi
concept-I
www.cimultimedia.com

Does your operat~1 system unders~1 long filena~1?

<snip>
> QUESTION: Based on recent discussion threads related to timeout objects,
> should each timeout object be assigned its own variable when
> instantiated, and if so should the timeout object variables be global?
>
> The code below has been working without any problems for my game, but I
> want to make sure I'm not using timeout objects in a "dangerous" way.
>
> -- WAIT, THEN START THE NEXT ROUND
> on waitForNextRound me
>   gNextRoundTimeout = timeOut("NewRound").new(2000, #startNextRound)
> end
>
> -- WAIT, THEN GO TO THE END OF GAME SCREEN
> on waitForEndGameScreen me
>   gEndOfGameTimeout = timeOut("EndOfGame").new(3000,
> #handleGameOverScreen)
> end
>
> on startNextRound
>   timeOut("NewRound").forget() -- reset the new round timer
>   timeOut("WaitMoveHand").forget() -- reset the move computer hand timer
> end
>
<snip>

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
dirGames-L mailing list  -  dirGames-L@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l

Earn $52 per hosting referral at Lunarpages.