ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

How do I allow the player to give a name to %Player%?

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

How do I allow the player to give a name to %Player%?

Postby willanik » Sat May 14, 2016 10:59 am

I am writing a story in Adrift 5 using the first person. At the start of the story I would to be able to allow the player to insert his or her name, so that it can then be used by other characters in the story as a substitute for %Player% in conversations that occur.

I cannot find a way to set this up at the start of the game and would be grateful if someone could help.

Thanks,
W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am

Re: How do I allow the player to give a name to %Player%?

Postby Jjbee62 » Sat May 14, 2016 12:35 pm

Create a System task to run immediately. Add an action to Set Property Player Name to %PopUpInput ["Please enter your name: ","Default Name"]%

You can the add some welcome message to the task completion text box:

Welcome to <Your Game Title> %CharacterProper [Player]%.
Jjbee62
 
Posts: 64
Joined: Fri Apr 15, 2016 5:20 pm

Re: How do I allow the player to give a name to %Player%?

Postby willanik » Sun May 15, 2016 1:05 am

Thanks Jjbee62, I appreciate your help.

I followed your notes and set up a system task with the following action:

Set [ThePlayerCharacter] name to %PopUpInput [“Please enter your name: ”,”Default name”]%

I modified your suggested message to - Hi %CharacterProper [Player]%! Welcome to

When I start the game in Runner, the popup works fine but then I get the message exactly as I have written it and not showing whatever name I entered into the popup. And the text in the game still refers to Player and not the entered name.

So, grateful for a bit more help on this.

W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am

Re: How do I allow the player to give a name to %Player%?

Postby Jjbee62 » Sun May 15, 2016 1:14 am

willanik wrote:Thanks Jjbee62, I appreciate your help.

I followed your notes and set up a system task with the following action:

Set [ThePlayerCharacter] name to %PopUpInput [“Please enter your name: ”,”Default name”]%

I modified your suggested message to - Hi %CharacterProper [Player]%! Welcome to

When I start the game in Runner, the popup works fine but then I get the message exactly as I have written it and not showing whatever name I entered into the popup. And the text in the game still refers to Player and not the entered name.

So, grateful for a bit more help on this.

W


Blame that on my typo. That should say %CharacterProper[Player]% No space between CharacterProper and the left bracket.
Jjbee62
 
Posts: 64
Joined: Fri Apr 15, 2016 5:20 pm

Re: How do I allow the player to give a name to %Player%?

Postby willanik » Sun May 15, 2016 1:55 am

Thanks, that fixed the opening message and the name I enter comes up in it.

But.... none of my references to %Player% in the main text change to the name that has been entered. is there something more that I need to do?

W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am

Re: How do I allow the player to give a name to %Player%?

Postby Jjbee62 » Sun May 15, 2016 2:47 am

Using %CharacterProper[Player]% when you want it to show the name should work anywhere.
Jjbee62
 
Posts: 64
Joined: Fri Apr 15, 2016 5:20 pm

Re: How do I allow the player to give a name to %Player%?

Postby willanik » Sun May 15, 2016 3:53 am

Yup, that does the trick. Stupid me should have set this up before I wrote all my tasks! I used %Player%, so now I need to go through and make the change in every task that has dialogue.

I am getting " " marks showing around the name. Is there any way to prevent these marks from appearing?

Thanks again for your help so far.
W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am

Re: How do I allow the player to give a name to %Player%?

Postby Jjbee62 » Sun May 15, 2016 4:06 am

Hmmm. You shouldn't have the " " showing up. Check to make sure you don't have an extra set of quotes anywhere. If you had the original PopUpInput written like this is would show the quotes everywhere:

"%PopUpInput["Please enter your name: ", "Default Name"]%"

The outside quotes would get saved as part of the Player name. It might be something like that.
Jjbee62
 
Posts: 64
Joined: Fri Apr 15, 2016 5:20 pm

Re: How do I allow the player to give a name to %Player%?

Postby willanik » Sun May 15, 2016 6:42 am

Very strange. I do not have any unnecessary "". Finally found the relevant page in the manual - http://wiki.adrift.co/General_Functions#PopUpInput - and it does not add any advice beyond what you gave me initially.

Hopefully someone else will comment.

W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am

Re: How do I allow the player to give a name to %Player%?

Postby Lazzah » Sun May 15, 2016 11:58 am

What version of ADRIFT5 are you using? The last version (5.0.33) had a bug whereby extra quotes were added to actions, so if you are using that version you should upgrade to v.5.0.34.
OUT NOW: Run, Bronwynn, Run!
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire and The Lost Children
User avatar
Lazzah
Moderator
 
Posts: 2101
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17

Re: How do I allow the player to give a name to %Player%?

Postby Lumin » Sun May 15, 2016 7:17 pm

There's a simple way to do this that avoids the need for the annoying popup, but I can't find the demo file I made. (Probably lost it with the others when my computer died. :( )

But it was just a matter of using some combination of FIRSTNAME and LASTNAME variables and "PCase(%text%)" iirc.
Currently working on: Nada. Zip. Zilch. [Check this space later.]
User avatar
Lumin
 
Posts: 1801
Joined: Fri Aug 06, 2004 5:48 pm
Location: Texas
Points: 34

Re: How do I allow the player to give a name to %Player%?

Postby willanik » Tue May 17, 2016 12:04 am

Lazzah wrote:What version of ADRIFT5 are you using? The last version (5.0.33) had a bug whereby extra quotes were added to actions, so if you are using that version you should upgrade to v.5.0.34.


Thanks for the thought Lazzah - I checked and I am using 5.0.34.

Still looking for a solution. Lumin I am sorry that your computer died, for both our sakes! Unfortunately my knowledge of Adrift is not strong enough for me to develop a method myself.

W
willanik
 
Posts: 16
Joined: Thu May 28, 2015 10:28 am


Return to ADRIFT 5.0

Who is online

Users browsing this forum: Lazzah and 1 guest