Bueno, te conmtesto muy rápido y solo a lo del dialogo, porque dado el dia que es no me puedo liar y pro otra parte supongo que hoy a estas horas no estarás liado.
Te paso un script de un dialogo, con posibles preguntas y respuestas a esas preguntas, para que lo vayas estudiando, a ver si el domingo mas tranquilo te contesto a otras cosas.
Unas cosas:
- Esto es un dialogo sacado de nuestro juego, por lo que veras cosas que no sabras ni que son, entre ellas, las siguientes.
- El WinNarrator.DisplayText, lo usamos en vez del actor.Talk
- El ExpandString, coge los textos de un fichero en funcion del idioma del juego.
- El Bill_flores, Bill_dani, Bill_curro, etc son variables para cambiar las preguntas en funcion de si se han hecho o no.
- Fijate solamente en AddREesponse, GetResponse, etc que son las funciones para montar los dialohgos.
Y si te lias, no pasa nada, el domingo te pongo un código limpio, que en este no hay quien entienda nada ya que ni siquiera hay frases.
Feliz Navidad
function BillDialogue()
{
var Responses;
var Selected;
var Loop = true;
while(Loop)
{
// prepare the sentences
if (!Bill_flores)
Responses[0] = Game.ExpandString("/WOF0001038/");
else
Responses[0] = Game.ExpandString("/WOF0001039/");
if (!Bill_curro)
Responses[1] = Game.ExpandString("/WOF0001040/");
else
Responses[1] = Game.ExpandString("/WOF0001041/");
if (!Bill_dani)
Responses[2] = Game.ExpandString("/WOF0001042/");
else
Responses[2] = Game.ExpandString("/WOF0001043/");
Responses[3] = Game.ExpandString("/WOF0001044/");
// fill the response box
Game.AddResponse(0, Responses[0]);
Game.AddResponse(1, Responses[1]);
Game.AddResponse(2, Responses[2]);
Game.AddResponse(3, Responses[3]);
// let the player choose one
Selected = Game.GetResponse();
// let the actor say the selected sentence
// (that's why I use the array for storing the sentences)
actor.PlayAnimAsync("Hablar");
WinNarrator.DisplayText(Responses[Selected], "Jhonny", -1); //Dejamos que la máquina calcule el tiempo que se muestra la frase.
actor.PlayAnimAsync("IdleHablar");
// now let Bill reply depending on the selected sentence
if(Selected==0)
{
if (!Bill_flores)
{
this.PlayAnimAsync("Hablando");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001045/"),"Bill",-1);
this.PlayAnimAsync("Idle");
actor.PlayAnimAsync("Hablar");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001046/"),"Jhonny",-1);
actor.PlayAnimAsync("IdleHablar");
this.PlayAnimAsync("Hablando");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001047/"),"Bill",-1);
this.PlayAnimAsync("Idle");
actor.PlayAnimAsync("Hablar");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001048/"),"Jhonny",-1);
actor.PlayAnimAsync("IdleHablar");
this.PlayAnimAsync("Hablando");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001049/"),"Bill",-1);
this.PlayAnimAsync("Idle");
actor.PlayAnimAsync("Hablar");
WinNarrator.DisplayText(Game.ExpandString("/WOF0001050/"),"Jhonny",-1);
actor.PlayAnimAsync("IdleHablar");
Bill_flores=true;
}
else
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001051/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001052/"),"Jhonny",-1);
}
}
else
{
if(Selected==1)
{
if (!Bill_curro)
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001053/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001054/"),"Jhonny",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001055/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001056/"),"Jhonny",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001057/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001058/"),"Jhonny",-1);
Bill_curro=true;
}
else
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001059/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001060/"),"Jhonny",-1);
}
}
else
{
if(Selected==2)
{
if (!Bill_dani)
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001061/"),"Bill",-1);
BillDialogue2();
Bill_dani=true;
}
else
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001062/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001063/"),"Jhonny",-1);
}
}
else
{
if(Selected==3)
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001064/"),"Bill",-1);
Loop = false; // we want to end the dialogue
}
}
}
}
}
// Comprobamos si Bill le ha contado todo y en caso afirmativo
// se puede ya cerrar el cementerio
if(Bill_flores && Bill_curro && Bill_dani)
EstadoJuego.CementerioCerrado = true;
else
EstadoJuego.CementerioCerrado = false;
}
////////////////////////////////////////////////////////////////////////////////
function BillDialogue2()
{
var Responses;
var Selected;
var Loop = true;
while(Loop)
{
// prepare the sentences
Responses[0] = Game.ExpandString("/WOF0001065/");
Responses[1] = Game.ExpandString("/WOF0001066/");
Responses[2] = Game.ExpandString("/WOF0001067/");
// fill the response box
Game.AddResponse(0, Responses[0]);
Game.AddResponse(1, Responses[1]);
Game.AddResponse(2, Responses[2]);
// let the player choose one
Selected = Game.GetResponse();
// let the actor say the selected sentence
// (that's why I use the array for storing the sentences)
WinNarrator.DisplayText(Responses[Selected], "Jhonny", -1);
// now let the Old Guy reply depending on the selected sentence
if(Selected==0)
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001068/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001069/"),"Jhonny",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001070/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001071/"),"Jhonny",-1);
}
else
{
if(Selected==1)
{
WinNarrator.DisplayText(Game.ExpandString("/WOF0001072/"),"Bill",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001073/"),"Jhonny",-1);
WinNarrator.DisplayText(Game.ExpandString("/WOF0001074/"),"Bill",-1);
}
else
{
if(Selected==2) Loop = false;
}
}
}
}