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 10-16-2007, 08:18 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Player Gender?

Is there any way to read what gender the player has selected in his profile? I'm highly dependant on such a function right now, and player.ismale / player.isfemale always return true / false - no matter what's in their profile. And yes, I tried it both clientside and serverside.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #2  
Old 10-16-2007, 08:49 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
to set it

HTML Code:
player.setGender(gender);
to check it

HTML Code:
player.ismale - boolean
player.isfemale - boolean
__________________
Reply With Quote
  #3  
Old 10-16-2007, 09:24 AM
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
Read the question. :/
Quote:
Originally Posted by xAndrewx View Post
to set it

HTML Code:
player.setGender(gender);
to check it

HTML Code:
player.ismale - boolean
player.isfemale - boolean
Quote:
Originally Posted by xXziroXx
Is there any way to read what gender the player has selected in his profile?
No, I do not believe there is.
__________________
Skyld
Reply With Quote
  #4  
Old 10-16-2007, 12:04 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
There should be like some $profile:: variables and such.
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 10-16-2007, 12:22 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Set a client variable to either male/female on login then add that to the profile vars.
Reply With Quote
  #6  
Old 10-16-2007, 06:58 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Skyld View Post
Read the question. :/
just delete my post then... I didn't realise that he was referring to the profile var. calm down
__________________
Reply With Quote
  #7  
Old 10-16-2007, 10:40 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
You can still delete it ^_^
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 10-17-2007, 08:42 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Twinny View Post
Set a client variable to either male/female on login then add that to the profile vars.
Like I said... I dont want to SET it, I want to be able to READ what's in a players profile.

Stefan, is there a way to do so, or can you possibly add one?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 10-17-2007, 12:03 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
I think you can do sendtext("lister","getprofile",player.account) and then get the data in function onReceiveText()
Reply With Quote
  #10  
Old 10-17-2007, 07:53 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Just assume that it's male.
__________________
Reply With Quote
  #11  
Old 10-17-2007, 08:02 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by Googi View Post
Just assume that it's male.
So true.
__________________
Reply With Quote
  #12  
Old 10-17-2007, 10:05 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
There are no girls on The Internet.
__________________
Reply With Quote
  #13  
Old 12-01-2007, 02:51 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Stefan View Post
I think you can do sendtext("lister","getprofile",player.account) and then get the data in function onReceiveText()
Cheers, that did the trick.

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
sendtext("lister""getprofile"player.account);
}

function 
onReceiveText(texttypetextoptionstextlines)
{
  if (
textoptions == "profile") {
    
// textlines[3].tokenize("=")[1]
    // -------------------
    // 'unknown' returns '-'
    // 'Male' returns 'male'
    // 'Female' returns 'female'
    
player.gender = (textlines[3].tokenize("=")[1] != "-" textlines[3].tokenize("=")[1] : "male");  // custom player. variable
  
}

EDIT: Hmm, that's interesting. Seems like ismale/isfemale now displays what you've selected in your profile? Did this get changed lately?
EDIT x2: Also, it appears as though when you select "unknown", ismale/isfemale returns what gender you previously had selected?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto

Last edited by xXziroXx; 12-01-2007 at 03:05 PM..
Reply With Quote
  #14  
Old 12-01-2007, 03:18 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 xXziroXx View Post
EDIT: Hmm, that's interesting. Seems like ismale/isfemale now displays what you've selected in your profile? Did this get changed lately?
EDIT x2: Also, it appears as though when you select "unknown", ismale/isfemale returns what gender you previously had selected?
Not the case for me.
__________________
Reply With Quote
  #15  
Old 12-01-2007, 03:20 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Crow View Post
Not the case for me.
I tried to remove all scripts from my account, reset it, and then do this in the Control-NPC upon login:

PHP Code:
function onActionPlayerOnline() {
  echo(
player.account SPC "gender:" SPC player.ismale "/" player.isfemale);

Every time it echoed what I had selected in my profile. And I know for a fact, that it didn't work 2 months ago when I last tried it, else I wouldn't have made this thread to begin with.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
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 11:04 PM.


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