Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: tinchopunk on February 08, 2005, 01:27:34 AM

Title: script problem
Post by: tinchopunk on February 08, 2005, 01:27:34 AM
I want to talk between actors
I have my actor and another 3dactor called vago you can not use that

the script:
  #include "scripts\base.inc"

global Statecallejon;
global vago;
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
 
  Game.Interactive = false;
  if(!Statecallejon.TalkedTovago) actor.Talk("Hola alienigena");
  else actor.Talk("Soy yo otra ves");
  vago.Talk("Hola");
  Statecallejon.TalkedTovago = true;
  vagoDialogue();
  Game.Interactive = true;
}


////////////////////////////////////////////////////////////////////////////////
function vagoDialogue()
{
  var Responses;
  var Selected;

  var Loop = true;

  while(Loop)
  {
    Responses[0] = "¿Qué sos?";
    Responses[3] = "Es una perdida de tiempo hablar con un alienigena";

   
    Game.AddResponse(0, Responses[0]);
    Game.AddResponse(3, Responses[3]);

    // let the player choose one
    Selected = Game.GetResponse();

     actor.Talk(Responses[Selected]);

     if(Selected==0)
    {
      vago.Talk("Soy un Kiwutziano");
      actor.Talk("Ah si mi primo es Kiwutziano...");
      vago.Talk("No creo que sea del mismo lugar que yo");
    }
    else
    {
      vago.Talk("Lo mismo digo");
      Loop = false; // we want to end the dialogue
    }
  }
}





////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{

  actor.Talk("Parece ser un alienigena amistoso");
 
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{


  actor.Talk("Creo que un conflicto intergaláctico no es la solución para tantos problemas");
}




Title: Re: script problem
Post by: Mnemonic on February 08, 2005, 08:55:47 AM
And the problem is...?
Title: Re: script problem
Post by: tinchopunk on February 08, 2005, 01:32:27 PM
the rpoblem is that vago make an error script when it talk
something like that
22:43: Runtime error. Script 'actors\vago\vago.script', line 16
22:43:   Call to undefined method 'Talk'. Ignored.
Title: Re: script problem
Post by: blmw911 on February 08, 2005, 01:48:04 PM
Where is line 16 in your script?


And did you tried

this.Talk("Hola");

instead of

vago.Talk("Hola");
Title: Re: script problem
Post by: tinchopunk on February 09, 2005, 04:32:12 AM
ok thanks that work for that
 MArtin