npc join command

I have a vague memory of reading somewhere of a function, triggerhack, or script that would tack on the contents of a text file to the end of the currently running NPC. I want to say it was “join” something?

I’ve searched the forums, newfeatures 200X, commands.rtf, and npcprogramming.doc and not found anything. I’ve also searched through the gserver’s config.cfg file for any appropriate looking triggerhacks. All of the above has brought up bupkis.

Anybody have any idea what I’m talking about and able to point me at a link with the right function name/params/triggerhack/whatever?

I am not sure but i think it s a “call text npc” script.
try this: join file.txt; and put the file.txt on your server folder.

The command execute the script on the file.txt.

I don’t follow. Is it a function name that I can put into an npc? Or are you saying that it’s a text file that I should exec with the “exec” triggeraction hack?

sounds like gscripts attempt at an include feature.

join doesn’t work like how you guys want it to.

Don’t put the file extension, it is automatically txt files. I use it for the bushes on Xialza. You put a script in the text file, then you use it on a certain NPC. Mainly for easy alteration I believe.

how does it work then? And what is it even? I can’t find anything like it in any documentation.

What you do is you put this in an NPC:

join test;

Now please tell me you understand?

Ok, I understand what you’re saying now. I’m just surprised that it’s not documented anywhere. Also, I can’t seem to make it work. I made an offline level called “test.nw”. In it I have an npc with the following:

// NPC made by traddles
if (created) {
}
if (playerchats && strequals(#c,test2)) {
  say2 you said test2;
}
join test;

In the same folder as test.nw I put a file test.txt with the following code:

if (playerchats && strequals(#c,test)) {
  say2 you chatted 'test';
}

Upon saying “test2” I see the say2. But upon saying “test”, I see nothing. I also tried the above but with the “join test;” line inside of the “if (created)” block. Is there something inside my client config that needs to be turned on to make this work?

it might be that the join command can be the only command in the npc.

I believe join only works online as it is a gserver feature.

Tried that as well. Hmmm. Some more googleing around has given me a couple of ideas.

ViaXia, is this with gs2?

Another idea: does this only work in online mode and/or are you running an NPC-server? I saw some stuff from a few years back about how “the join command appends text to the npc but it does this on the server side”.

My test is just running in offline mode

___Merged doublepost__________________

haha, you beat me to it. I’ll experiment with this in online mode later. Thanks for your help everyone. If I have troubles in online mode as well I’ll post them here so please leave this thread open till I can test this out.

Join is documented in readme.txt in the gserver download.

-------------------------------------
| Special Graal Reborn NPC commands |
-------------------------------------

The Graal Reborn gserver has a couple special NPC commands built in.

join somefile;
    Much like official Graal's server-side join command, this command searches for somefile.txt and appends the contents to the end of the NPC script.

singleplayer
    This command is like the sparringzone command.  When placed by itself with no semi-colon inside an NPC, it signifies that the level is "singleplayer."  (SEE: Singleplayer Levels).

Make sure your .txt file can be found! In RC, try: /find myfile.txt
If you can’t find it, it may be a foldersconfig.txt issue. Make sure it is in a proper path. The world/ folder should work fine.

Oh… Oh really? Is that so?

Ahhh, yep, putting my test.nw and test.txt on my gserver and hitting it in online mode did the trick.

Nailin, I knew I had read about join somewhere I just couldn’t remember where I had seen it. Thanks for pointing out the location.

More generally, thanks everyone. I think this should do exactly what I need it to. If my script idea works out I’ll post it up. :slight_smile:

Yeah, it is so.

so i could use this join command to join isweapon.txt into NPC. in that txt i can have the wasfired flags and all that stuff that is in every weapon. the isweapon.txt will eventually call the weaponFired() function at some point, and that function can be in the NPC instead of the isweapon.txt. This would work, right? if it doesnt then wtf.

I was thinking something very similar to this. I was thinking of making a “draggableNpc.txt” file with the basic functions that all npcs need in order to be dragged around. Then, to make any npc “draggable” just do “if (created) join draggableNpc.txt” :slight_smile:

join combines scripts. Used with classes you can have an class setup and in a script do:

//#CLIENTSIDE
join bush;
this.droprate = {5,5,3,2,1};

I’ve never used it with txt files, though. Hope it runs the same way.

What other extensions does join support other then .txt???