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 11-01-2005, 06:47 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
finding players/npcs

I'm so confused by the lack of documentation on these functions. Not sure if it's findnpc(whattheheckaretheparams)or getnpc(whattheheckaretheparams), getplayer(somekindofparams)... etc.
What I really want to do is find an NPC or player by coordinates. How the heck do you do that? The only way i know how is to cycle through the index until you find one in a range of coords.
Reply With Quote
  #2  
Old 11-01-2005, 07:17 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
findplayer(account) is the GS2 version of getplayer(account).

It only works on the serverside, because it does all actions to the player you specify.
For example..
findplayer("Yen").hearts = 0;
This would set my hearts to 0.

If you want to find an NPC or player by coordinates, you can use testplayer(x,y) or testnpc(x,y). This returns the ID of the player/NPC on those coordinates. You can then access that player/NPC by npcs[#] or players[#].

For example, if testnpc(30,30) returned 3, you could do npcs[3].chat = "Hi.";
This would set the chat of the NPC at 30,30's chat to 'Hi.'
Reply With Quote
  #3  
Old 11-01-2005, 07:38 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
Also, findPlayerByID(id); serverside.
__________________
Skyld
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 09:53 AM.


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