![]() |
Changing the levels of an NPC
I need to change the level of a moving NPC. It's on a GMAP, and I'm currently just increasing its x to move it. It works, but sometimes it will stop when changing levels. It's currently clientside.
Any help? I'm thinking it's possible, since I've seen GK's ships before. |
Well, GK's ships are using x and y modifiers (obviously) But there is a 'warpto' command you can use for DB NPCs (I believe putnpc's are also DB NPCs)
|
GK's ships use a DB, not a levelnpc.
and putnpcs are -not- db's. they are local levelnpcs (and thus can be removed with /clearnpcs). if you drop a gralat in a level, you can find the script listed in rc ftp (i think its scripts/, but i don't remember) as a localnpc with the npcid and x and y in its filename |
Quote:
Quote:
|
*blinks*
now this I'm going to have to play with. |
Only serverside NPCs can warp.
canwarp2(); [ or canwarp() ] serverside this.x ++; should warp it. ( if on GMap ) You can also set it's level manually. |
I need it to move swiftly though. And it's very jagged while on the serverside. I'd use move() but that doesn't update x/y of an NPC. I might just have to manually set the level of it and use normal, non-gmap levels. How do I set the level of an NPC?
|
I was once told (by Stefan, I think?) that canwarp2() makes the NPC warp when it touches a link.
|
Quote:
Quote:
Quote:
|
I understand there's a warpto command, but what's the syntax? Is it the same as warpto x y level?
warpto(x, y, level.name); ? |
Quote:
Edit: Nevermind, found it within 5 minutes on the wiki. You really should try searching for yourself, though. Quote:
|
Quote:
|
Quote:
|
If you're using a gmap, why are you worrying about level warping? To an NPC, a gmap is just one huge level. Just change it's x/y positions.
|
warpto(level, x, y), same format as player.setlevel2
About npcs on a gmap: 1. There are local npcs, which are added with the level editor, directly in the .nw or .graal file. They can move freely on the whole gmap. It is recommended to do that on serverside though. Use move() for smooth movement. 2. The other npcs are called 'database npcs' - the npcs you see in the RC npcs list, the putnpc2s, and the items (gralats) although those are not often used anymore. They can freely move everywhere, and 'warpto' other levels. You can remove them with /clearnpcs levelname (only the npcs listed in the RC npcs list are protected), and watch their files in the "npcs/" folder. |
All times are GMT +2. The time now is 01:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.