Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-17-2010, 02:07 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 07-17-2010, 02:30 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
That's a bad way to be doing things, this should be moved to NPC Scripting btw.
__________________
Quote:
Reply With Quote
  #3  
Old 07-17-2010, 03:31 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
I figured it might be some sort of bug since the delay is noticeably large.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #4  
Old 07-17-2010, 03:46 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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!";

__________________
Quote:
Reply With Quote
  #5  
Old 07-17-2010, 03:58 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The "delay" is almost always less than one-twentieth of a second unless the wait time is more than a minute or so.
__________________
Reply With Quote
  #6  
Old 07-17-2010, 04:42 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
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.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #7  
Old 07-17-2010, 05:18 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by fowlplay4 View Post
That's a bad way to be doing things, this should be moved to NPC Scripting btw.
What is the good way?
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #8  
Old 07-17-2010, 05:36 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by fowlplay4 View Post
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.
__________________
Reply With Quote
  #9  
Old 07-17-2010, 05:55 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by LoneAngelIbesu View Post
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.
__________________
Quote:
Reply With Quote
  #10  
Old 07-17-2010, 06:11 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #11  
Old 07-17-2010, 06:16 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:39 PM.


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