Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Problem with the conversations  (Read 2972 times)

0 Members and 1 Guest are viewing this topic.

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Problem with the conversations
« on: February 22, 2006, 02:45:58 PM »

Hello! I'm a new member of this forum. I'm spanish gamemaker, but in the WME forum of Spain I have not obtained a valid response to solve this problem.

My game begins with a conversation. The actor talks with a secondary actor. It not is a entity, is a actor.

In the script I have a while(true). It is a loop to execute constant the conversation, until the player selects the option to finish the above mentioned conversation. Later the program should execute the orders necessary to be able to select the different options of the conversation, but when it he comes to this point, the options do not appear and the game does not answer to the events of the mouse.

The problem is that when he executes "while(true)", there do not appear the phrases that the player can choose. The game remains stopped, but it he does not give me mistakes of code.

The code of the secondary actor is here:

Code: [Select]
#include "scripts\base.inc"

var ProtaFrases;
var ShappletonFrases;
var Selected;
var SelectedNivel2;
var SelectedNivel3;
var SelectedNivel4;
var Loop = true;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//DIALOGO

ProtaFrases[0] = "¿No quiere oir mi última oferta?";
ProtaFrases[1] = "Al fin y al cabo, no quería esa espada.";
ProtaFrases[2] = "Conseguiré esa espada aunque no me la venda.";
ProtaFrases[3] = "5000 dobols y es mi última oferta.";
ProtaFrases[4] = "Y es una MUY buena oferta.";
ProtaFrases[5] = "2500 dobols y es mi última oferta.";
ProtaFrases[6] = "Es una oferta justa, y Vd.lo sabe.";
ProtaFrases[7] = "Espere un momento que vea cuánta calderilla tengo en el bolsillo…";
ProtaFrases[8] = "Emm… ¿Ha oído hablar alguna vez del noctambulismo?";
ProtaFrases[9] = "Umm… Estoy vendiendo estas magníficas cazadoras de cuero.";
ProtaFrases[10] = "Estooo… Usted gana. Me largo.";
ProtaFrases[11] = "Eso ya lo veremos.";
ProtaFrases[12] = "No lo diga usted muy alto.";
ProtaFrases[13] = "Tiene razón. Soy un mierda.";
ProtaFrases[14] = "Ese tío tendría que haber llegado a un acuerdo conmigo.";
ProtaFrases[15] = "Si no quiere venderme esa espada medieval por el precio que le ofrecí,";
ProtaFrases[16] = "entonces quiere que se la robe.";
ProtaFrases[17] = "Además, como no consiga la espada, el Sr. Watts me romperá las piernas,";
ProtaFrases[18] = "y mucho me temo que no será lo único que me quiera romper.";

ShappletonFrases[0] = "Te repito que no me importa si eres comerciante de antigüedades o un enano de circo.";
ShappletonFrases[1] = "Ya te he dicho que no quiero vender esa espada. Es de alto valor sentimental.";
ShappletonFrases[2] = "Dispara.";
ShappletonFrases[3] = "¿Entonces que haces en la puerta de mi casa?";
ShappletonFrases[4] = "No te atreverás.";
ShappletonFrases[5] = "¿5000? ¿Esa es tu última oferta?. Pues ya puedes largarte por donde has venido.";
ShappletonFrases[6] = "¿2500? ¿Te estas riendo de mi? ¡Lárgate y no vuelvas!";
ShappletonFrases[7] = "No me hagas perder mi valioso tiempo, muchacho.";
ShappletonFrases[8] = "¿Y tu has oido hablar alguna vez de los bates de beisbol y de los puños americanos?";
ShappletonFrases[9] = "Precisamente ayer compré una a un tipo con sombrero. No necesito otra.";
ShappletonFrases[10] = "Lárgate y no vuelvas.";
ShappletonFrases[11] = "No quiero volver a verte por mi casa o llamaré a la policía.";
ShappletonFrases[12] = "Lárgate, fanfarrón engreido.";
ShappletonFrases[13] = "Y tanto que lo eres. Vete de mi casa y no vuelvas.";

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

this.Talk(ShappletonFrases[0]);
this.Talk(ShappletonFrases[1]);

//Nivel 1 Conversacion
while(Loop)
    {
     Game.AddResponse(0, ProtaFrases[0]);
     Game.AddResponse(1, ProtaFrases[1]);
     Game.AddResponse(2, ProtaFrases[2]);

     Selected = Game.GetResponse();
     actor.Talk(ProtaFrases[Selected]);


//Nivel 2 Conversacion
     if(Selected==0)
       {
       this.Talk(ShappletonFrases[2]);

       Game.AddResponse(0, ProtaFrases[3]);
       Game.AddResponse(1, ProtaFrases[5]);
       Game.AddResponse(2, ProtaFrases[7]);

       SelectedNivel2 = Game.GetResponse();
       actor.Talk(ProtaFrases[SelectedNivel2]);

       if(SelectedNivel2==0)
         {
         actor.Talk(ProtaFrases[4]);
         this.Talk(ShappletonFrases[5]);
         }
       if(SelectedNivel2==1)
         {
         actor.Talk(ProtaFrases[6]);
         this.Talk(ShappletonFrases[6]);
         }
       if(SelectedNivel2==2)
         {
         actor.Talk(ProtaFrases[7]);
         this.Talk(ShappletonFrases[7]);
         }
       }


     if(Selected==1)
       {
       this.Talk(ShappletonFrases[3]);

       Game.AddResponse(0, ProtaFrases[8]);
       Game.AddResponse(1, ProtaFrases[9]);
       Game.AddResponse(2, ProtaFrases[10]);

       SelectedNivel3 = Game.GetResponse();
       actor.Talk(ProtaFrases[SelectedNivel3]);

       if(SelectedNivel3==0)
         {
         this.Talk(ShappletonFrases[8]);
         }
       if(SelectedNivel3==1)
         {
         this.Talk(ShappletonFrases[9]);
         }
       if(SelectedNivel3==2)
         {
         this.Talk(ShappletonFrases[10]);
         }
       }

     if(Selected==2)
       {
       this.Talk(ShappletonFrases[4]);

       Game.AddResponse(0, ProtaFrases[11]);
       Game.AddResponse(1, ProtaFrases[12]);
       Game.AddResponse(2, ProtaFrases[13]);

       SelectedNivel4 = Game.GetResponse();
       actor.Talk(ProtaFrases[SelectedNivel4]);

       if(SelectedNivel4==0)
         {
         this.Talk(ShappletonFrases[11]);
         Loop = false;
         }
       if(SelectedNivel4==1)
         {
         this.Talk(ShappletonFrases[12]);
         Loop = false;
         }
       if(SelectedNivel4==2)
         {
         this.Talk(ShappletonFrases[13]);
         Loop = false;
         }
       }
    }

actor.Talk(ProtaFrases[14]);
actor.Talk(ProtaFrases[15]);
actor.Talk(ProtaFrases[16]);
actor.Talk(ProtaFrases[17]);
actor.Talk(ProtaFrases[18]);

The code of Response Box is here:

Code: [Select]
RESPONSE_BOX
{
  FONT = "fonts\outline_white.font"
  FONT_HOVER = "fonts\outline_red.font"
  HORIZONTAL = FALSE
  SPACING = 5

  AREA {0, 400, 640, 80}

  WINDOW
  {   
    X = 0
    Y = 400
    WIDTH = 640
    HEIGHT = 80

    BUTTON
    {
      TEMPLATE = "ui_elements\template\but.button"
      IMAGE = "ui_elements\arrow_up.bmp"
      TEXT = ""
      NAME = "prev"

      X = 0
      Y = 0
      WIDTH = 30
      HEIGHT = 30
    }

    BUTTON{
      TEMPLATE = "ui_elements\template\but.button"
      IMAGE = "ui_elements\arrow_down.bmp"
      TEXT = ""
      NAME = "next"

      X = 0
      Y = 150
      WIDTH = 30
      HEIGHT = 30
    }
  }
}


The game resolution is 640 x 480.
I need help urgently, go two weeks trying to solve this mistake.

A lot of thanks!
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with the conversations
« Reply #1 on: February 22, 2006, 03:01:29 PM »

Note that the AREA definition is relative to the responses window, NOT relative to screen, so you'll probably need to change it to:

AREA {0, 0, 640, 80}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Re: Problem with the conversations
« Reply #2 on: February 22, 2006, 03:28:02 PM »

Thanks! this is the solution of the problem!

I was imagining that it would be some bilge of the response box, but not wise to detect the problem.

Thank you very much, indeed.

Maidnet
Logged
 

Page created in 0.049 seconds with 24 queries.