Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   scheduleevent seems to be a bit delayed. (https://forums.graalonline.com/forums/showthread.php?t=134259864)

Jiroxys7 07-17-2010 02:07 AM

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? >_<

fowlplay4 07-17-2010 02:30 AM

That's a bad way to be doing things, this should be moved to NPC Scripting btw.

Jiroxys7 07-17-2010 03:31 AM

I figured it might be some sort of bug since the delay is noticeably large.

fowlplay4 07-17-2010 03:46 AM

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:

//#CLIENTSIDE
function onCreated() {
  
this.scheduleevent(1"ScheduledEvent"timevar2);
}

function 
onScheduledEvent(init) {
  
player.chat "This took event " timevar2 init " seconds!";



cbk1994 07-17-2010 03:58 AM

The "delay" is almost always less than one-twentieth of a second unless the wait time is more than a minute or so.

Jiroxys7 07-17-2010 04:42 AM

Quote:

Originally Posted by fowlplay4 (Post 1588011)
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:

//#CLIENTSIDE
function onCreated() {
  
this.scheduleevent(1"ScheduledEvent"timevar2);
}

function 
onScheduledEvent(init) {
  
player.chat "This took event " timevar2 init " seconds!";



Well it seems to come back early effortlessly on larger numbers like 1 second +. however when i tried it at ~0.095 seconds (roughly the amount of time in question) it struggles to go below ~0.13. usually remains near the 0.19 mark. So I guess I might need to have to make due with the small delay on the quicker weapons.

LoneAngelIbesu 07-17-2010 05:18 AM

Quote:

Originally Posted by fowlplay4 (Post 1588001)
That's a bad way to be doing things, this should be moved to NPC Scripting btw.

What is the good way?

Inverness 07-17-2010 05:36 AM

Quote:

Originally Posted by fowlplay4 (Post 1588011)
There's a delay in between the triggerserver and onActionServerSide because it has to send data from the client to the server.

He said triggeraction, not triggerserver.

fowlplay4 07-17-2010 05:55 AM

Quote:

Originally Posted by LoneAngelIbesu (Post 1588025)
What is the good way?

Well it's obviously not using two triggeractions/server.

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.

Jiroxys7 07-17-2010 06:11 AM

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.

DustyPorViva 07-17-2010 06:16 AM

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.