Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-12-2007, 02:47 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Class Calling Problem

Hey.

I'm trying to make a script that holds an array of class names, and i'm trying to call it like this:

PHP Code:
this.classes = {"control"}

for (
temp.curClassthis.classes)
{
     
this.join(temp.curClass);
     (@ 
temp.curClass)::start();

It simply doesn't work, because I get this error:

Quote:
Originally Posted by RC
error: missing semicolon at line 6: (@ temp.curClass)::start();
error: unexpected token: :: at line 6: (@ temp.curClass)::start();
I've had this problem before. Is there any way to call a class through this method?

I appreciate it in advance.

-Hikaru
__________________
What signature? I see no signature?
Reply With Quote
  #2  
Old 04-12-2007, 03:15 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Would 'this.start()' work? Since its already joined
Reply With Quote
  #3  
Old 04-12-2007, 03:40 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Unless you *need* them joined to the NPC you could do something along the lines of:

PHP Code:
this.classes = {"control"}

for (
temp.curClassthis.classes)
{
     
this.(@ temp.curClass) = new TStaticVar();
     
with (this.(@ temp.curClass)) {      
      
join(temp.curClass);
      
start();
     } 

__________________

Coming soon (Hopefully:P)
Reply With Quote
  #4  
Old 04-12-2007, 03:45 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by JkWhoSaysNi View Post
Unless you *need* them joined to the NPC you could do something along the lines of:

PHP Code:
this.classes = {"control"}

for (
temp.curClassthis.classes)
{
     
this.(@ temp.curClass) = new TStaticVar();
     
with (this.(@ temp.curClass)) {      
      
join(temp.curClass);
      
start();
     } 

Thank you, That works (with a little editing).
__________________
What signature? I see no signature?
Reply With Quote
  #5  
Old 04-12-2007, 02:21 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Am I the only one that see that you have no semicolon after:

PHP Code:
this.classes = {"control"
Should be..

PHP Code:
this.classes = {"control"}; 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 04-12-2007, 02:57 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by xXziroXx View Post
Am I the only one that see that you have no semicolon after:

PHP Code:
this.classes = {"control"
Should be..

PHP Code:
this.classes = {"control"}; 
Relax. Typo.
__________________
What signature? I see no signature?
Reply With Quote
Reply


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 11:02 PM.


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