Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   join command (https://forums.graalonline.com/forums/showthread.php?t=17698)

mikepg 11-24-2001 04:25 AM

join command
 
Im a little (meaning totally) confused on how join works. Could someone give me a simple example on how to use it? I just cant seem to grasp that command, and maybe one of you guys/girls can help me out.

thanx.

KJS 11-24-2001 05:19 AM

join blah;


it will add in the coding of what ever is in the txt file blah

Saga2001 11-24-2001 03:55 PM

:-D
 
Very well put...

mikepg 11-24-2001 07:10 PM

thanks
 
thank you very much!

so, if i have a file called bomb.txt
i could put in another NPC join bomb;

Thanx!

Falcor 11-25-2001 02:49 AM

It works on p2p only and the script needs to be in a class.. (they can be added manually in the scripts directory of your FTP) or via NPC Control.exe

mikepg 11-25-2001 02:54 AM

:)
 
okay, I'll look into it.

BocoC 11-25-2001 10:41 AM

Here is my post:

Say you have a butterfly. You code the butterfly. Then, you save it as a class. Then, you create many butterfly npc's in NC:

if (created) {
setstring this.image,butterfly.png;
this.x=30;
this.y=30;
}
join butterfly;

What join does is pastes the script from the class file. Very helpful. This was a fragmented and hard to understand post from Boco.

KJS 11-25-2001 12:26 PM

bococ I like your avatart

Andor_NPC-Admin1 12-09-2001 01:22 PM

Okie, the NPC server doc says this:

"the internal representation is slightly different:
each npc has a list of scripts, the own script
is parsed and added as the first script in this list;
when you do join then another script is parsed
and added to the script list;
when the script for the requested class is already
in the memory (used by another npc) then it is not
copied, it is just added to the script list;
so when several npcs are using the same class
then it is only hold one time in the memory and
the script object is put into the script lists
of the npcs;
functions can be overwritten"


Can someone translate that to english?

jeff335 12-11-2001 05:33 AM

I wonder...could join be used with lists of functions, like:

in every npc, if(created){join standard_funcs;}

in NPCs in area Bomboria, if(created){join bomboria_funcs;]

?

Falcor 12-11-2001 05:45 AM

it jsut adds what is in the class file to the script so it is posible.

KJS 12-11-2001 05:54 AM

Quote:

Originally posted by jeff335
I wonder...could join be used with lists of functions, like:

in every npc, if(created){join standard_funcs;}

in NPCs in area Bomboria, if(created){join bomboria_funcs;]

?

you could do that....

You dont need to put it in any functions...

here is an example of how I use it...

NPC Code:

if (created) {
this.maxflakes = 100;
}
join snow;



I have the join outside of any if statements because when you join it its putting all the coding that you have from whats in that class file into the npc (not really putting it into it but thats how it reads the script)

BocoC 12-11-2001 06:23 AM

Quote:

Originally posted by Andor_NPC-Admin1
Okie, the NPC server doc says this:

"the internal representation is slightly different:
each npc has a list of scripts, the own script
is parsed and added as the first script in this list;
when you do join then another script is parsed
and added to the script list;
when the script for the requested class is already
in the memory (used by another npc) then it is not
copied, it is just added to the script list;
so when several npcs are using the same class
then it is only hold one time in the memory and
the script object is put into the script lists
of the npcs;
functions can be overwritten"


Can someone translate that to english?

Yes. Join puts Class script into NPC script.

Andor_NPC-Admin1 12-18-2001 02:01 AM

?

Xaviar 12-18-2001 08:30 AM

Quote:

Originally posted by Andor_NPC-Admin1
Okie, the NPC server doc says this:

"the internal representation is slightly different:
each npc has a list of scripts, the own script
is parsed and added as the first script in this list;
when you do join then another script is parsed
and added to the script list;
when the script for the requested class is already
in the memory (used by another npc) then it is not
copied, it is just added to the script list;
so when several npcs are using the same class
then it is only hold one time in the memory and
the script object is put into the script lists
of the npcs;
functions can be overwritten"


Can someone translate that to english?

What they're basically saying is that if you use the same section of your script over and over again, (like a string parsing function I find myself using over and over), you can say 'join stringparser.txt;', and have a text file with that function in it, then, the players only have to download that function once, even though it is in lots of different npcs

Andor_NPC-Admin1 12-18-2001 12:05 PM

okay, i know how to use join class already
i'm just wondering what its talking about when it says "memory" and "script lists" =P

Xaviar 12-18-2001 11:22 PM

Quote:

Originally posted by Andor_NPC-Admin1
okay, i know how to use join class already
i'm just wondering what its talking about when it says "memory" and "script lists" =P

That means they only have to download the script once, regardless of how many different npc's use it

Andor_NPC-Admin1 12-21-2001 06:24 AM

okay, nothin new then =)

Warcaptain 12-21-2001 07:23 AM

join script;


joins the script located on npc-server.

available on npc-server (p2p servers) only.

kittygirl765 12-26-2001 11:09 PM

Quote:

Originally posted by Warcaptain
join script;


joins the script located on npc-server.

available on npc-server (p2p servers) only.

hehe, okay, meh gets it now =P
(btw, andor_npc-admin1=me :) )

Faheria_GP2 12-30-2001 08:38 AM

using join to make a function library is quite useless without gscript supporting function parameters

kittygirl765 12-30-2001 01:46 PM

Quote:

Originally posted by Faheria_GP2
using join to make a function library is quite useless without gscript supporting function parameters
yea, o well, there are alternatives to passing parameters:)


All times are GMT +2. The time now is 09:29 AM.

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