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 01-08-2006, 10:01 AM
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
findplayer issue

Why in the world is findplayer returning me an RC? that shouldn't be allowed -_-
Reply With Quote
  #2  
Old 01-08-2006, 11:09 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by jake13jake
Why in the world is findplayer returning me an RC? that shouldn't be allowed -_-
I didn't think it was.

How are you sure it's an RC?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 01-08-2006, 12:30 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Yea, a little bit of code / variable output would be beneficial.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #4  
Old 01-08-2006, 12:57 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
Quote:
Originally Posted by ApothiX
Yea, a little bit of code / variable output would be beneficial.
PHP Code:
  else if (player.chat.starts("/focus")) {
    
player.chat.tokenize();
    if (
tokens[1] == "self")
      
this.cameraFocus player;
    else if (
tokens[1])
      
this.cameraFocus getPlayer(tokens[1]) == -player getPlayer(tokens[1]);
  } 
was using findplayer(tokens[1]) in this code. It is supposed to setfocus on the player in tokens[1]. However, when I used findplayer() I was having a slight problem. It was recognizing the other player's existence, but it wasn't getting the x or y values right. They remained constant at 30.5,30. When I asked the player to log off RC, the script with findplayer() worked. I just used a for loop function getPlayer i made to cycle through the players array for the level. Solved the problem. But should findplayer() really find RCs? would seem proper for it to cycle over them.
Reply With Quote
  #5  
Old 01-08-2006, 07:32 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
The ''players' array only draws from the players in the current level, so you can use that for referencing. It won't get an RC.

PHP Code:
gotten players[players.index(tokens[1])];
setfocus(gotten.xgotten.y); 
Reply With Quote
  #6  
Old 01-08-2006, 09:30 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
It is possible that findplayer clientside acts different from findplayer serverside (I am assuming that the script is clientside, since you are setting focus).

If that is the case, then it looks like Yen provides a good alternative.
Reply With Quote
  #7  
Old 01-08-2006, 09:44 PM
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
On clientside findplayer returns all possible players from the player list, so also 'virtual' players like people on other servers, or irc channels. May be you can check for the level of the player to check if its an actual player walking around somewhere.
Reply With Quote
  #8  
Old 01-08-2006, 09: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
Quote:
Originally Posted by Stefan
On clientside findplayer returns all possible players from the player list, so also 'virtual' players like people on other servers, or irc channels. May be you can check for the level of the player to check if its an actual player walking around somewhere.
couldn't really have done that since I wanted to return the actual player rather than the rc of the player. Just used players[i] cycle instead.
Reply With Quote
  #9  
Old 01-09-2006, 01:18 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Maybe the client should return normal players in priority over virtual players?
Reply With Quote
  #10  
Old 01-09-2006, 03:35 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
Yes that would make sense
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 12:32 AM.


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