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 02-19-2006, 03:05 AM
ArushenP2P ArushenP2P is offline
Graal Developer
ArushenP2P's Avatar
Join Date: Feb 2006
Location: Oakland, Calif. USA
Posts: 336
ArushenP2P is on a distinguished road
Send a message via AIM to ArushenP2P
Help

NPC Code:

//#CLIENTSIDE

if (created || timeout) {timeout=.05;} //infinite loop

if (timeout) {
if (mousex in |playerx,playerx+2| && mousey in |playery,playery+2|) {
showcharprop #a;
}
}



I need it to be so it can show the players account not my account, you know when you put your mouse over them it shows there account.

Someone please help me
__________________


Your abilities to create wonder relies on your level of imagination.

Reply With Quote
  #2  
Old 02-19-2006, 03:06 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Wow...

You work on a server?
__________________
[signature]insert here[/signature]
Reply With Quote
  #3  
Old 02-19-2006, 03:15 AM
talkingnoodle talkingnoodle is offline
Rapidwolve
talkingnoodle's Avatar
Join Date: Nov 2005
Location: Leominster, MA
Posts: 229
talkingnoodle is on a distinguished road
Send a message via AIM to talkingnoodle Send a message via MSN to talkingnoodle
Quote:
Originally Posted by screen_name
Wow...

You work on a server?
IM LOLING IN REAL LIFE

and...

wat is this supposed to be?
__________________


AIM: Rapidwolve Graal
MSN: [email protected]


2/12/06 - Crossroads NPC Admin
Reply With Quote
  #4  
Old 02-19-2006, 03:27 AM
Chicken_l33t Chicken_l33t is offline
Banned
Join Date: Sep 2002
Location: NewZealand
Posts: 467
Chicken_l33t is on a distinguished road
//#CLIENTSIDE
if (created){
timeout = .05;
}

if (timeout){
if (mousex in |playercraphere,playercraphere| && mousey in|playercraphere,playercraphere|){
setplayerprop #c,#a; // #c is the players chat and #a is account
}
timeout = .05;
}

// You have to have timeout = .05; inside the timeout itself for it to loop.

Ohh, and if this is to test another player and not yourself you're best using testplayer(x,y);
Reply With Quote
  #5  
Old 02-19-2006, 03:30 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Chicken_l33t
//#CLIENTSIDE
if (created){
timeout = .05;
}

if (timeout){
if (mousex in |playercraphere,playercraphere| && mousey in|playercraphere,playercraphere|){
setplayerprop #c,#a; // #c is the players chat and #a is account
}
timeout = .05;
}

// You have to have timeout = .05; inside the timeout itself for it to loop.

Ohh, and if this is to test another player and not yourself you're best using testplayer(x,y);
Stop giving bad advice...
That will still work but it is bad scripting.

Anyway, you need to iterate through 'playerscount' and check the mousex/y in players[index].x/y. Then display the account using #a(index).
__________________
Liek omigosh.

Reply With Quote
  #6  
Old 02-19-2006, 03:40 AM
Chicken_l33t Chicken_l33t is offline
Banned
Join Date: Sep 2002
Location: NewZealand
Posts: 467
Chicken_l33t is on a distinguished road
Umm, I was fixing his script not giving him a whole new one. It's not bad advice becaue I was fixing what he already had and testplayer(x,y) returns the index of the player so you don't have to do what you said.

Don't be such a prick aswell. Wee, good advice.
Reply With Quote
  #7  
Old 02-19-2006, 09:22 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Chicken_l33t
Umm, I was fixing his script not giving him a whole new one. It's not bad advice becaue I was fixing what he already had and testplayer(x,y) returns the index of the player so you don't have to do what you said.

Don't be such a prick aswell. Wee, good advice.
I don't see much of a difference between your script and the thread-maker's. But it is a bit of an improvement.
Also last time I checked, testplayer index does not work on clientside anymore. It returns 0 for yourself, or it returns -1. Anyone care to debate?
Nonetheless, iterating through all the players in a level using a for loop, then checking coordinates using players[index].xy, then using #a(index) to display the account name will work.
__________________
Reply With Quote
  #8  
Old 02-20-2006, 05:41 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Ajira
Stop giving bad advice...
That will still work but it is bad scripting.
How is it bad scripting?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #9  
Old 02-20-2006, 06:14 AM
Chicken_l33t Chicken_l33t is offline
Banned
Join Date: Sep 2002
Location: NewZealand
Posts: 467
Chicken_l33t is on a distinguished road
Quote:
I don't see much of a difference between your script and the thread-maker's. But it is a bit of an improvement.
Also last time I checked, testplayer index does not work on clientside anymore. It returns 0 for yourself, or it returns -1. Anyone care to debate?
No, it does work and it returns the players index. For some reason though it only seems to work on the gmap, but you're right though about the better way to do it.
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 02:51 PM.


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