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 11-08-2006, 05:39 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Class question

Hey, I have one npc spread between alot of levels. I need to make a class that all the npcs can copy to so when I update the class it updates all. How would I do that? I constantly update the script too.
Thanks!


EDIT:
would this work? Btw this is going in an npc in the level so I used gs1. I want the npc to be the class npc basicly...
Quote:
//#CLIENTSIDE
if (created){
join class;
}

Last edited by wild8900; 11-08-2006 at 05:50 AM..
Reply With Quote
  #2  
Old 11-08-2006, 05:55 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
You make very little sense. Just make a class, add the script there, and use join scripts in the levels instead of the same script over and over again.
Reply With Quote
  #3  
Old 11-08-2006, 06:02 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
So this script would work?
PHP Code:
//#CLIENTSIDE
if (created){
join class;

Reply With Quote
  #4  
Old 11-08-2006, 06:12 AM
hotrian hotrian is offline
Who?
Join Date: May 2003
Location: Eatonville, Washington, 98328
Posts: 56
hotrian is on a distinguished road
Send a message via AIM to hotrian Send a message via MSN to hotrian
On another note, GS2 does not work offline, However once the level is online, a level based GS2 script, will work
__________________
Sometimes I wonder if I think too big.
Quote:
Originally Posted by Admins
I've moved the fox map to "levelstoobig/" because a terrain gmap of 1024x1024 levels is clearly too huge (the kingdoms main map is 40x40 and is already quite big). It was taking a lot of memory and was slowing down the computer.
Reply With Quote
  #5  
Old 11-08-2006, 07:35 PM
MegaMasterX90875 MegaMasterX90875 is offline
Retired Graalian (2009)
MegaMasterX90875's Avatar
Join Date: Feb 2006
Location: North Carolina
Posts: 132
MegaMasterX90875 is on a distinguished road
Send a message via AIM to MegaMasterX90875
I used to just clear out the entire script and do

NPC Code:
join("class");

__________________
Mess with the best, Die like the rest.



Reply With Quote
  #6  
Old 11-08-2006, 08:34 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by wild8900 View Post
Hey, I have one npc spread between alot of levels. I need to make a class that all the npcs can copy to so when I update the class it updates all. How would I do that? I constantly update the script too.
Thanks!


EDIT:
would this work? Btw this is going in an npc in the level so I used gs1. I want the npc to be the class npc basicly...
You basically described the function of a class. A class is just a script that you can call upon to use in other scripts. If you put join classname; in a level npc, and you have a class on your server with that name, the level npc will use the script in that class.

Whenever you update the class, it would update the script in that level. Though usually you have to also update the level to refresh the class, but not with everything.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #7  
Old 11-08-2006, 11:47 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Example:

Local NPC:
PHP Code:
function onCreated()
{
  
join("door");

Class NPC:
PHP Code:
function onCreated()
{
  
setimg("door.png");
  
setshape(13248);
}

function 
onPlayerTouchsMe()
{
  
hide();
  
sleep(3);
  
show();

^ Should work fine ^
Reply With Quote
  #8  
Old 11-09-2006, 12:57 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
please, use
HTML Code:
this.join("className");
Learn from Skyld--
__________________
Reply With Quote
  #9  
Old 11-09-2006, 02:14 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by xAndrewx View Post
please, use
HTML Code:
this.join("className");
Learn from Skyld--
What's the difference between that and

join("class");

function onCreated() {
join("class");
}

etc
Reply With Quote
  #10  
Old 11-09-2006, 02:31 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Bl0nkt View Post
What's the difference between that and

join("class");

function onCreated() {
join("class");
}

etc
None, but I believe it should be in an event anyway.

-- Andrew =(.. sorry.

Only this. I use is in triggerserver("gui", this.name, "lolz");
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 12:51 AM.


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