Player selection
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Player selection
Hi there !
So, here i am again, with some questions as i am really new to unity, and as i want to work with your awesome asset !
I am trying to do a player selection scene, but i'm a little bit lost about how to proceed, and most importantly, how to make it dialogue system friendly.
Since Dialogue System manage the characters name, is it possible tu let the player choose its name ?
Also, how should i proceed to create a character selection system ?
But, for exemple, what i want to do is to let the player swap few cards from left to right (il the order they want). When they click on a card, it let them choose a character. I don't know how to tell to unity "if the player has clicked on this card, then, he's [character race] and his story begin in the [Race Scene 2].
I am sorry if i'm not enough clear, i am a little bit lost, and i don't know what can i do with dialogue system about it
Thanks !
So, here i am again, with some questions as i am really new to unity, and as i want to work with your awesome asset !
I am trying to do a player selection scene, but i'm a little bit lost about how to proceed, and most importantly, how to make it dialogue system friendly.
Since Dialogue System manage the characters name, is it possible tu let the player choose its name ?
Also, how should i proceed to create a character selection system ?
But, for exemple, what i want to do is to let the player swap few cards from left to right (il the order they want). When they click on a card, it let them choose a character. I don't know how to tell to unity "if the player has clicked on this card, then, he's [character race] and his story begin in the [Race Scene 2].
I am sorry if i'm not enough clear, i am a little bit lost, and i don't know what can i do with dialogue system about it
Thanks !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: Player selection
Hi Caroline,
Node 1:
After the player has clicked a card, you can set the race value in a custom field of the Dialogue System's "Player" actor. Example C# code:
Yes. Store the name in the Player actor's "Display Name" field. If you want to ask the player to choose a name in a Dialogue System conversation, you can use the TextInput() sequencer command. If you use TextInput(), it will store the player's input in a variable. In the next dialogue entry node, you can assign that variable value to the actor's Display Name field. Example:Pendergast wrote: ↑Sat Feb 20, 2021 1:12 pmSince Dialogue System manage the characters name, is it possible to let the player choose its name ?
Node 1:
- Dialogue Text: "What's your name?"
- Sequence: TextInput(Text Field UI, Name:, playerName)
- Dialogue Text: "Nice to meet you, [var=playerName]!"
- Script: Actor["Player"].Display_Name = Variable["playerName"]
The cards sound like something that you should handle outside of the Dialogue System.Pendergast wrote: ↑Sat Feb 20, 2021 1:12 pmAlso, how should i proceed to create a character selection system ?
But, for exemple, what i want to do is to let the player swap few cards from left to right (il the order they want). When they click on a card, it let them choose a character. I don't know how to tell to unity "if the player has clicked on this card, then, he's [character race] and his story begin in the [Race Scene 2].
After the player has clicked a card, you can set the race value in a custom field of the Dialogue System's "Player" actor. Example C# code:
Code: Select all
using PixelCrushers;
using PixelCrushers.DialogueSystem;
...
public void SelectRace(string race)
{
DialogueLua.SetActorField("Player", "Race", race);
SaveSystem.LoadScene("Race Scene For " + race);
}
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: Player selection
Thank you so much, Tony !
I have a little question and it should be perfect !
When the text input shows up, there's already a "Name" in it. Where can i change the default name ?
Also, i can write into the text input, but whenever i accept the change and call for the variable of the player's name, it displays the "default" name.
Thanks !
I have a little question and it should be perfect !
When the text input shows up, there's already a "Name" in it. Where can i change the default name ?
Also, i can write into the text input, but whenever i accept the change and call for the variable of the player's name, it displays the "default" name.
Thanks !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: Player selection
Hi,
I put together an example scene:
DS_CharacterCreationExample2_2021-05-13.unitypackage
In the example scene's database, I added a variable named "pcName" and set its Initial Value to "Pendergast".
You can examine the conversation's Sequence, Conditions, and Script fields to see how they work. See also the [var=pcName] tag in the conversation's Dialogue Text.
Define a variable in your database.Pendergast wrote: ↑Thu May 13, 2021 6:00 pmWhen the text input shows up, there's already a "Name" in it. Where can i change the default name ?
Also, i can write into the text input, but whenever i accept the change and call for the variable of the player's name, it displays the "default" name.
I put together an example scene:
DS_CharacterCreationExample2_2021-05-13.unitypackage
In the example scene's database, I added a variable named "pcName" and set its Initial Value to "Pendergast".
You can examine the conversation's Sequence, Conditions, and Script fields to see how they work. See also the [var=pcName] tag in the conversation's Dialogue Text.
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: Player selection
Thanks a lot, Tony !
The default name is working, but even if i change it or select it as my name, it shows something else, i don't understand why.
I recorded to show what happen ; and what i writed in the script and condition fields.
What's weird, is that i don't recall enter "nil" anywhere in my project
Thanks !
The default name is working, but even if i change it or select it as my name, it shows something else, i don't understand why.
I recorded to show what happen ; and what i writed in the script and condition fields.
What's weird, is that i don't recall enter "nil" anywhere in my project
Thanks !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: Player selection
Hi,
"nil" means "no value". The player's Display Name field is probably not set to a value.
Please look at the example scene in my previous reply.
The TextInput() sequencer command stores the player's input in a variable named pcName.
The next node's Script field then copies this value to the Player actor's Display Name field, using this code:
"nil" means "no value". The player's Display Name field is probably not set to a value.
Please look at the example scene in my previous reply.
The TextInput() sequencer command stores the player's input in a variable named pcName.
The next node's Script field then copies this value to the Player actor's Display Name field, using this code:
Code: Select all
Actor["Player"].Display_Name = Variable["pcName"]
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: Player selection
Hi,
Well, i did, that's the thing I opened, i copied and past the line of code, but it doesn't change the fact that it doesn't want to store the variable pcName when entered in the game and i don't know why ! I checked and i use the same variable name everywhere, it's weird
Well, i did, that's the thing I opened, i copied and past the line of code, but it doesn't change the fact that it doesn't want to store the variable pcName when entered in the game and i don't know why ! I checked and i use the same variable name everywhere, it's weird
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: Player selection
Hi,
Would you please send a copy of your scene and dialogue database to tony (at) pixelcrushers.com? The easiest way is to select both in the Project view. (Ctrl+click to select multiple files.) Then right-click and select "Export package".
Would you please send a copy of your scene and dialogue database to tony (at) pixelcrushers.com? The easiest way is to select both in the Project view. (Ctrl+click to select multiple files.) Then right-click and select "Export package".
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: Player selection
I sent the e-mail with the Unity Package !
Thanks for your help !
Thanks for your help !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: Player selection
Thanks. I'll keep an eye out for it. I haven't received it yet.