Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-18-2011, 06:34 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Weapons joined to a class do not stay joined after reconnecting.

Just as the topic title says. I've been using classes joined to weapons to handle buff processing as well as stat processing.

However each time I disconnect, upon connecting to the server again, the classes will be no longer joined to my weapon. They will remain unjoined until I open the weapon script and click "Apply". I end up having to do this every time I connect to the server.

I figured that joining them with

Graal Script Code:
function onTimeout(){
  
join("classname");
setTimer(0.05);} 
instead of the method I've been using which is
Graal Script Code:
function onCreated(){
  
join("classname");

would remedy the problem, but it doesn't make any difference. Using an onPlayerenters() event instead does not fix the issue either. Nor does calling onCreated(); inside of an onTimeout().

Is there something I'm missing? Is this a bug? What's going on?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 04-18-2011, 06:44 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You should always join classes on the serverside.
__________________
Reply With Quote
  #3  
Old 04-18-2011, 06:45 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crow View Post
You should always join classes on the serverside.
this.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #4  
Old 04-18-2011, 07:02 PM
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 Crow View Post
You should always join classes on the serverside.
I was under the impression that joining a class through the serverside only allowed you to call the serverside public functions of the script. I'll give it another shot though. Thanks.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #5  
Old 04-18-2011, 07:34 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Method I have used is

Graal Script Code:
while ( !isinclass( <CLASS>))
  
this.join( <CLASS>); 
Which will basically suspend the script till the class is loaded. Join it serverside but keep the class code clientside.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 04-19-2011 at 03:50 PM..
Reply With Quote
  #6  
Old 04-18-2011, 10:50 PM
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
Quote:
Originally Posted by MrOmega View Post
while ( !isiinclass( <CLASS>))
Typo, and there's no reason to use a while loop for this.

Quote:
Originally Posted by Jiroxys7 View Post
I was under the impression that joining a class through the serverside only allowed you to call the serverside public functions of the script. I'll give it another shot though. Thanks.
Nope. If you join classes on the serverside you can use both serverside and clientside functions, and you don't have to wait for the class to load like you would if you joined it clientside.

The only exception I know of is the player object, where you do need to join classes clientside if you want to access clientside methods.
__________________
Reply With Quote
  #7  
Old 04-19-2011, 05:20 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Alright thanks. I've changed one of the two weapons to join on the serverside. Though It seems like the other one was already being joined on the serverside. So I'll see what happens and I'll post back if I somehow run into this problem again.

Thanks a lot!
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #8  
Old 04-19-2011, 03:51 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by cbk1994 View Post
Typo, and there's no reason to use a while loop for this.
oops, thanks, fixed it, I did that post from my phone and didn't catch it. Reason behind the for loop is on clientside, I guess it takes time to load and I wait for it to load clientside, but as mention (and what I do today) is joining it via serverside
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
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 08:33 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.