Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Another indepth scripting question by me (https://forums.graalonline.com/forums/showthread.php?t=19875)

dragoonvenganc 12-29-2001 12:03 PM

Another indepth scripting question by me
 
Ok i made something..lol the usual

i have a npc where i need about 50 of those npcs. but each npc is about .77 kb.

i have heard something about class script ..different npcs using the same script..

is there anyway to have 50 different npcs use the same script so the lvl will be smaller

this is for p2p


Thank u

kittygirl765 12-29-2001 12:10 PM

classes will work for this =)

first, you have to make an NPC class in nc, or by the text file. Then you put the script inside the class that you want to be joined. Then, to use the class, you have to create a new npc, and just put in "join classname;" in your script, and that will join the class script.

dragoonvenganc 12-29-2001 12:23 PM

ok... hum..
can u explain a little more indepth.. u lost me..
i have heard about classes but have no idea and will this work offline

kittygirl765 12-29-2001 01:11 PM

join command reference:
http://forums.graal2001.com/forums/s...threadid=17698

Phenom1K 12-29-2001 06:00 PM

Make the level, in a nw file, and when done, every NPC you want the script in, just put join textfilenamehere. this is basically just what was posted above but I feel as If I say something i get a consolation prize for a big mouth.

LiquidIce00 12-30-2001 04:53 AM

u really cant learn join offline .. either words or using the nc control ;\

GrowlZP2P 12-30-2001 05:05 AM

I have a workaround that doesn't need the join command and works perfectly offline, on p2p or non-p2p. Take the code of one NPC and add it to a text file. Keep that text file in the level's directory. Whenever you need that script, just call it with 'putnpc filename,x,y;'. Maybe slightly less advanced than you hoped, but it works.

dragoonvenganc 12-30-2001 09:03 AM

would put npc with 50 different ones lag because it puts the same script on there 50 times

Join has the npcs use the same script

Thanx to alll..

royce 12-30-2001 11:52 AM

there is a limit to amount of npc's in a level.

GrowlZP2P 12-30-2001 06:59 PM

Quote:

Originally posted by dragoonvenganc
would put npc with 50 different ones lag because it puts the same script on there 50 times

Join has the npcs use the same script

Thanx to alll..

You live, you learn. =P

kyle0654 12-31-2001 12:05 AM

Quote:

Originally posted by dragoonvenganc
would put npc with 50 different ones lag because it puts the same script on there 50 times

Join has the npcs use the same script

Thanx to alll..

putnpc = bad idea

Regular NPCs are handled differently than NPCs that join a class. So you're right, it will lag more. You'll want to make a class on your server and have the NPCs join it. You could probably use putnpc2 to place them in the level on initialized so you'd only have one script in your level.

dragoonvenganc 01-07-2002 09:49 AM

Hey another question thanx kyle..

but..
if i had like all the trees on there server had a little script so u can cut them down.. and i used join class would that lag at all

dragoonvenganc 01-09-2002 09:29 PM

some one please

Kumada 01-09-2002 11:17 PM

Quote:

Originally posted by dragoonvenganc
Hey another question thanx kyle..

but..
if i had like all the trees on there server had a little script so u can cut them down.. and i used join class would that lag at all

Matters on how many trees are in the level. ;)

Xaviar 01-09-2002 11:19 PM

Quote:

Originally posted by dragoonvenganc
some one please
Join would be the best thing you could do, in that case...


All times are GMT +2. The time now is 10:16 AM.

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