scheduleevent seems to be a bit delayed.
Im using scheduleevent im my weapon system. it first sends a triggeraction to everyone in front of the attacker, then uses scheduleevent to send a second triggeraction approximately halfway through the attack to check and see if the target is still there before dealing damage.
however for some reason the scheduled event is always being sent at the very end of the attack. why is this? >_< |
That's a bad way to be doing things, this should be moved to NPC Scripting btw.
|
I figured it might be some sort of bug since the delay is noticeably large.
|
There's a delay in between the triggerserver and onActionServerSide because it has to send data from the client to the server.
Try this code: PHP Code:
|
The "delay" is almost always less than one-twentieth of a second unless the wait time is more than a minute or so.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
For a standard sword system, a triggeraction to specific x, y and onActionDamage or w/e in a weapon npc works. Other systems use findplayer or testplayer to see if there's a player on that position then send the trigger to the server to confirm it and damage them. |
well i'm sending the first trigger that will be used to activate certain skills. since i'm experimenting with having a second trigger that hits whoever's in the way. this also adds a sense of weapon speed since it reads the speed of the equipped weapon (stronger weapons will have a longer delay. faster ones will have a shorter delay)
One of the skills i have will allow you to sometimes dash out of the way of an attack before it lands when it receives the first trigger. other uses may include things like allowing the defender to retaliate with damage or an effect before they get hit, or on the other hand, allowing the attacker to cause an effect just before they actually strike. tl;dr: It's intentional. |
Triggeraction itself has a 0.05-0.1 delay, I believe... and if you're triggering other players I'm sure there is a delay from sending the data from the server to them.
|
All times are GMT +2. The time now is 11:21 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.