Function Delays

Function Delays

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Function Delays

Post by REVENGE »

When I was using GetUnitsInCylinder, I found that if a unit died within the detection cylinder, I had to wait about 10 frames before GetUnitsInCylinder would stop detecting the unit. Is this normal behavior? And is this frame delay synced across all machines?

EDIT: After thinking about this, I would like to know if 10 frames can be considered a reasonable safety value, or should I go for something higher?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Function Delays

Post by Peet »

Betcha it's 15, and updated every slowupdate (1/2 second of gametime). And yes, if it's a synced function the returned value is always synced.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Function Delays

Post by Tobi »

Could it be because the unit's kill script wasn't finished yet?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Function Delays

Post by REVENGE »

Tobi wrote:Could it be because the unit's kill script wasn't finished yet?
Hmm...well no fancy kill script, it was just an OTA flea. But anyways, during the sim, if you have a unit-self d it will remain intact at "0" or some garbage health # for a small number of frames before it actually explodes.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Function Delays

Post by Kloot »

That's because of the death countdown timer, which can still be > 0
when the killscript finishes (in 76b1 units are not completely deleted
until it reaches zero).
Post Reply

Return to “Lua Scripts”