![]() |
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 |
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. |
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 |
join command reference:
http://forums.graal2001.com/forums/s...threadid=17698 |
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.
|
u really cant learn join offline .. either words or using the nc control ;\
|
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.
|
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.. |
there is a limit to amount of npc's in a level.
|
Quote:
|
Quote:
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. |
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 |
some one please
|
Quote:
|
Quote:
|
| 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.