Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-23-2002, 08:27 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
playerscount

is kindof buggy for me, it is giving me two different variables for players...
when used clientsided, it counts me (1) and I think it is also counting two npcs with showcharacter; so that's 3
serverside its giving me 1, which is the correct number
Could something please be done to make playerscount clientsided work right?
__________________
GONE, BAI
Reply With Quote
  #2  
Old 09-24-2002, 08:33 AM
gokux33 gokux33 is offline
Registered User
gokux33's Avatar
Join Date: Jul 2002
Location: Florida
Posts: 785
gokux33 is on a distinguished road
Send a message via ICQ to gokux33 Send a message via AIM to gokux33 Send a message via Yahoo to gokux33
Re: playerscount

Quote:
Originally posted by Graal2001_NAT
is kindof buggy for me, it is giving me two different variables for players...
when used clientsided, it counts me (1) and I think it is also counting two npcs with showcharacter; so that's 3
serverside its giving me 1, which is the correct number
Could something please be done to make playerscount clientsided work right?
No, because plaerscount is a serverside variable. Use saves.
__________________

Name: Wind Seablaze
E-Mail: [email protected]
10/4/02 My last day on the forums. Don't forget me. <3
Reply With Quote
  #3  
Old 09-24-2002, 08:34 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
playerscount isnt only a serverside var, if you could just do with(players[index]) then there would be no use to use players[index].x which I need to use since constantly accessing serverside from a clientside script using weapons is laggy
__________________
GONE, BAI
Reply With Quote
  #4  
Old 09-25-2002, 01:12 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Can't you just use a distinguishing characteristic (like an id of -1 or whatever they have) to filter out the NPCs?
__________________
Reply With Quote
  #5  
Old 09-25-2002, 03:58 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Kaimetsu
Can't you just use a distinguishing characteristic (like an id of -1 or whatever they have) to filter out the NPCs?
thank you, I had forgotten about players[index].id
__________________
GONE, BAI
Reply With Quote
  #6  
Old 09-26-2002, 12:40 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Can't you just use a distinguishing characteristic (like an id of -1 or whatever they have) to filter out the NPCs?
That doesn't work anymore - even showcharacter NPCs have a positive ID. Unfortunatly.
Use strlen(#n(i))>0 or something like that. I was thinking of players[i]fullhearts>0 but I fear that doesn't work online (client-side).
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #7  
Old 09-26-2002, 01:28 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Com013

That doesn't work anymore - even showcharacter NPCs have a positive ID. Unfortunatly.
Use strlen(#n(i))>0 or something like that. I was thinking of players[i]fullhearts>0 but I fear that doesn't work online (client-side).
Well, there's bound to be some characteristic feature that you can use. Like an #a of "" or whatever.
__________________
Reply With Quote
  #8  
Old 09-26-2002, 01:35 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Can't read #a(index)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #9  
Old 09-26-2002, 01:38 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Tyhm
Can't read #a(index)
Still? I coulda sworn Stefan made it so that we could. Guess I must be thinking of something else.
__________________
Reply With Quote
  #10  
Old 09-26-2002, 02:40 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Com013

That doesn't work anymore - even showcharacter NPCs have a positive ID. Unfortunatly.
Use strlen(#n(i))>0 or something like that. I was thinking of players[i]fullhearts>0 but I fear that doesn't work online (client-side).
for(a=0;a<playerscount;a++){
if(players[a].id!=-1){
worked for me (and #n wouldnt work if an npc was given a nickname with setcharprop #n)
__________________
GONE, BAI
Reply With Quote
  #11  
Old 09-26-2002, 11:00 PM
BinaryCrash BinaryCrash is offline
No memory dump.
Join Date: Jul 2002
Location: Brazil
Posts: 70
BinaryCrash is on a distinguished road
Send a message via ICQ to BinaryCrash Send a message via MSN to BinaryCrash
filter the npcs using
if (!players[i].hearts=0) { } //not npc
Reply With Quote
  #12  
Old 09-27-2002, 12:03 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
players[...].id never worked for me. At least not offline.

players[...].hearts is worse than checking the nickname. Many showcharacter NPCs are using hearts.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #13  
Old 09-27-2002, 12:14 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
On client-side the showcharacter npcs can be accessed like players. That's an old feature that has been added because for graphical things npcs and players are like the same. It is still helpful sometimes, on graal2002 we use it for displaying the hp bar for all players and monsters.

On server-side its not possible, only players are in the playerlist because players and npcs are quite different, most scripts that want to access players dont want to do stuff with showcharacter npcs.

I will check the id thing, normally it should be -1 for showcharacter npcs (when accessed as player)
Reply With Quote
  #14  
Old 09-27-2002, 12:21 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Stefan

I will check the id thing, normally it should be -1 for showcharacter npcs (when accessed as player)
I think it is currently using the npcs[..].id for it...
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #15  
Old 09-27-2002, 03:36 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Stefan
on graal2002 we use it for displaying the hp bar for all players and monsters.
I'm off-topic now, but how do you hide the default hearts and spar rating display over the players?
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #16  
Old 09-27-2002, 03:52 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by BinaryCrash
filter the npcs using
if (!players[i].hearts=0) { } //not npc
npcs can have hearts guy
__________________
GONE, BAI
Reply With Quote
  #17  
Old 09-27-2002, 04:03 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Actually, I did some testing, it seems to be taking the NPC id and %ing it by 32767 or so.

Of course, when I said it, nobody listened...^_~
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #18  
Old 09-27-2002, 06:11 AM
BinaryCrash BinaryCrash is offline
No memory dump.
Join Date: Jul 2002
Location: Brazil
Posts: 70
BinaryCrash is on a distinguished road
Send a message via ICQ to BinaryCrash Send a message via MSN to BinaryCrash
Quote:
Originally posted by Graal2001_NAT

npcs can have hearts guy
i mean if they don't use hearts on npcs and use another variable for hearts.
Reply With Quote
  #19  
Old 09-30-2002, 01:54 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Tyhm
Actually, I did some testing, it seems to be taking the NPC id and %ing it by 32767 or so.

Of course, when I said it, nobody listened...^_~
o_O what kindof level would have >32767 npcs
__________________
GONE, BAI
Reply With Quote
  #20  
Old 09-30-2002, 02:38 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Quote:
Originally posted by Graal2001_NAT

o_O what kindof level would have >32767 npcs
a gmap?
__________________

subliminal message: 1+1=3
Reply With Quote
  #21  
Old 09-30-2002, 04:01 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Falcor


a gmap?
which (i dont think) are enabled on classic? that would have to be a huge gmap to get that many npcs o.O I wonder if the 2k2 gmaps even have that many...
__________________
GONE, BAI
Reply With Quote
  #22  
Old 09-30-2002, 04:16 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Graal2001_NAT

which (i dont think) are enabled on classic
Why shouldn't they being enabled? I can even use them offline. I never tried to use them on Classic, because the old arrows wouldn't work anymore.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #23  
Old 09-30-2002, 04:29 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Com013

Why shouldn't they being enabled? I can even use them offline. I never tried to use them on Classic, because the old arrows wouldn't work anymore.
different kinds of g-servers (now why does this have to remain cencered =/), only server I have gotten gmaps to work great on is 2k1
__________________
GONE, BAI
Reply With Quote
  #24  
Old 10-01-2002, 01:13 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
?
Um, it's playerid, not npc id - so the question should be when will there ever be more than 32767 players on the server.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #25  
Old 10-02-2002, 03:40 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Now I tested it again (offline), and the players[..].id was -1. So it is working.
But I remember it not working, and I couldn't read it anywhere in the newfeatures that it was fixed... Strange.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
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:41 AM.


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