Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-24-2006, 01:27 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
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.
Reply With Quote
  #2  
Old 06-24-2006, 07:36 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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)
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 06-24-2006, 05:42 PM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
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
__________________
Reply With Quote
  #4  
Old 06-24-2006, 06:09 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by calani
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).
Yes, they are. They are treated the same as 'regular' Database NPCs by the server (not tied to or in any way attached to one level, ability to warp about, be accessed using findNPC() by their this.name, etc).
Quote:
Originally Posted by calani
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
It's npcs/, and it is stored there along with the other Database NPCs.
__________________
Skyld
Reply With Quote
  #5  
Old 06-24-2006, 06:12 PM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
*blinks*
now this I'm going to have to play with.
__________________
Reply With Quote
  #6  
Old 06-24-2006, 07:03 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
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.
Reply With Quote
  #7  
Old 06-24-2006, 08:32 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
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?
Reply With Quote
  #8  
Old 06-24-2006, 10:50 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
I was once told (by Stefan, I think?) that canwarp2() makes the NPC warp when it touches a link.
Reply With Quote
  #9  
Old 06-25-2006, 03:25 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by JustBreathe
You can also set it's level manually.
You can't set it's level manually. You have to use the warpto command to warp it.

Quote:
Originally Posted by Bl0nkt
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 told you in the first post in this thread. I suggest you read it.

Quote:
Originally Posted by Yen
I was once told (by Stefan, I think?) that canwarp2() makes the NPC warp when it touches a link.
Indeed, that's what it's for.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 06-25-2006, 03:39 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
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); ?
Reply With Quote
  #11  
Old 06-25-2006, 04:37 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Bl0nkt
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); ?
Check commands.rtf, or newfeatures. I am on Linux right now and without the editor, I do not have a commands.rtf to check for you.

Edit: Nevermind, found it within 5 minutes on the wiki. You really should try searching for yourself, though.

Quote:
warpto(str, float, float)
Incase you still don't know, warpto(level, x, y)
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #12  
Old 06-25-2006, 04:59 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by ApothiX
Check commands.rtf, or newfeatures. I am on Linux right now and without the editor, I do not have a commands.rtf to check for you.

Edit: Nevermind, found it within 5 minutes on the wiki. You really should try searching for yourself, though.


Incase you still don't know, warpto(level, x, y)
I'm capable of common sense. And that's DB NPCs only?
Reply With Quote
  #13  
Old 06-25-2006, 07:24 AM
VulcanP2P VulcanP2P is offline
Registered User
VulcanP2P's Avatar
Join Date: May 2005
Location: Florida
Posts: 882
VulcanP2P is on a distinguished road
Quote:
Originally Posted by Bl0nkt
I'm capable of common sense. And that's DB NPCs only?
No.
__________________

For Zone or Guild Support use the Support Center
Reply With Quote
  #14  
Old 06-25-2006, 11:11 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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.
Reply With Quote
  #15  
Old 06-25-2006, 11:57 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:39 PM.


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