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 03-06-2011, 02:43 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Player level/gmap in clientside allplayers loop

I'm trying to find out the level/gmap name of other players looping through allplayers on the clientside. Doesn't seem to work. obj.level.name and obj.gmap.name always return nothing. Any advice?
__________________
Reply With Quote
  #2  
Old 03-06-2011, 04:26 PM
Toxen Toxen is offline
A Toxic Fellow
Join Date: Jan 2008
Location: Georgia
Posts: 36
Toxen is on a distinguished road
for(a: allplayers) {
urvariable = a.level;
}

should work fine?
__________________
UN NAT.
Reply With Quote
  #3  
Old 03-06-2011, 05:11 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
It'd be:
PHP Code:
for (temp.plallplayers)
  echo(
pl.level.name); 
But no, it doesn't work.
__________________
Reply With Quote
  #4  
Old 03-06-2011, 07:29 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
try using players instead of allplayers,
PHP Code:
for (temp.plplayers
  echo(
pl.level.name); 
i dont got access to graal ATM to test.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #5  
Old 03-06-2011, 07:41 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
try using players instead of allplayers,
PHP Code:
for (temp.plplayers
  echo(
pl.level.name); 
i dont got access to graal ATM to test.
Not what I'm going for, but thanks anyway. I'm forced to use allplayers in this specific situation. I just want to know if I've missed anything that helps in this case. If there's nothing, I'll create a workaround using player attributes.
__________________
Reply With Quote
  #6  
Old 03-06-2011, 07:43 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
I don't think you'll be able to read player attributes, either. You only load information from players in the same level, iirc.
__________________
Reply With Quote
  #7  
Old 03-06-2011, 07:59 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by salesman View Post
I don't think you'll be able to read player attributes, either. You only load information from players in the same level, iirc.
There's a server option list thingy where you can add all attributes you want to have synchronized for all players whether they are in your level or not.
__________________
Reply With Quote
  #8  
Old 03-06-2011, 08:04 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Yeah, the problem is that player information isn't sent to you after they are more than 1 level away I think. This area can be altered with some recently added server options, but it isn't really a solution here since making the area too large would lag everything down.

The only solution, as far as I know, is the attribute/server option thing that you mentioned.
Reply With Quote
  #9  
Old 03-06-2011, 08:07 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Any chance you could share what you're trying to accomplish?
__________________
Quote:
Reply With Quote
  #10  
Old 03-06-2011, 08:09 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Player info is sent, it's just updated less frequently(only when the player changes level). However, it's just certain information.
Reply With Quote
  #11  
Old 03-06-2011, 08:11 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Use player.levelname instead of player.level.name because levelname is sent to all players.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #12  
Old 03-06-2011, 08:15 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Personally, I encountered a problem like this when making a minimap, because you won't have the exact player coordinates after they move far away enough. My solution was just to fade players out after they are far away enough, but I think we're going to change it soon.
Reply With Quote
  #13  
Old 03-06-2011, 08:25 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tigairius View Post
Use player.levelname instead of player.level.name because levelname is sent to all players.
Note that this only works on v6.
__________________
Reply With Quote
  #14  
Old 03-06-2011, 09:08 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Tigairius View Post
Use player.levelname instead of player.level.name because levelname is sent to all players.
Quote:
Originally Posted by cbk1994 View Post
Note that this only works on v6.
*sigh*


Quote:
Originally Posted by WhiteDragon View Post
Personally, I encountered a problem like this when making a minimap, because you won't have the exact player coordinates after they move far away enough. My solution was just to fade players out after they are far away enough, but I think we're going to change it soon.
DING DING FU-DING-KING

And we have a winner I fade on the minimap, but my minimap is, at the same time, my large map. And I don't want to fade on the large map.
__________________
Reply With Quote
  #15  
Old 08-24-2011, 02:53 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
I'm pretty new to scripting, and this might be a terrible idea but can't you do this.
Add this to allplayers
PHP Code:
function onActionServerSide() {
  
clientr.level == player.level.name;
}
//#CLIENTSIDE
function onPlayerEnters() {
  
triggerserver"gui"this.name);

And for the allplayers level thing
PHP Code:
for (temp.allplayers) {
  echo(
p.clientr.level);

__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


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:09 PM.


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