"give to" MIstyle with variables

Started by Bryan_abos, Mon 13/11/2017 15:38:30

Previous topic - Next topic

Bryan_abos

this is getting weird... I don't know if I'm missing some bracket or something... but here is what should happen: (the dialogue is in Spanish (actually chilean spanish xD) but the code is the same so ignore the things in spanish if you want (laugh)...

if the player speaks to a character (cVolao) he should at first say that he don't want to talk to the player... (because he is tripping and needs something to drink)... So, the player should "give (iBebida) to (cVolao)" to make him talk. (but if the bottle is closed (iBotellaT) the cVolao character will say that it is closed).

Then, cVolao will tell the player that he needs something else. if the claracter "give (iWeed) to (cVolao) or if the character "Talk to (cVolao)" having (iWeed) a dialog should start. The thing is that I can't "give" anything to cVolao. when I do, the player walks to cVolao, and nothing else happen. the "give" action doesn't work.

I'm working with the Monkey Island Style and the give function worked well until I stated putting variables i guess... now it doesn't do anything...

Here is the code for the cVolao character... is something wrong with it or I forgot something else... ???

Code: ags

function cVolao_AnyClick() {
  player.FaceDirection(eDirectionLeft); {
    if (UsedAction(eGA_TalkTo)) {
      if (vVolao == true) { // i put a bool here that changes (below) to true if the player "gives (iBotella)" to (cVolao). Now he is willing to help (A)
        if (player.HasInventory(iWeed)){
          dDialog6.Start(); /* if the player has (iWeed) (and give it to the character)it will start a dialog that will stop the interaction with this character... the aim of this chacarter, if you will, would be fulfilled. no idea if it works because it depends on the bottle thing working (B) */ 
        }
        else {
          cVolao.Say("¿Cómo te puedo ayudar?");
          dDialog5.Start(); //if the player does not have (iWeed) it will start another dialog. (saying that he is willing to help in exchange of (iWeed)) (B)
        }
      }
      else { // if he does not give the bottle the bool (vVolao) is initially false so this will happen, the character will refuse to talk (A)
        cVolao.FaceDirection(eDirectionRight);
        cVolao.Say("¡Dejame solo! ¡TENGO SED!.");
      }
    }
    else if (UsedAction(eGA_LookAt)) {
      player.Say("Que raro."); // looks at the character and say something... no problems here.
    }
    else if(UsedAction(eGA_GiveTo)) {
      if (ItemGiven == iBotellaT) { // This works... if the bottle is closed cVolao asks the player to open it 
        cVolao.Say("Abrela por favor.");
      }
    }
    else if (UsedAction(eGA_GiveTo)) { //this does not work!!! if the player give the bottle nothing happen!!!
      if (ItemGiven == iBebida) {
        cVolao.Say("Justo lo que necesitaba.");
        player.LoseInventory(iBebida);
        vVolao=true;
        cVolao.Say("¿Cómo te puedo ayudar?");
        dDialog5.Start();
      }
    }
    else if (UsedAction(eGA_GiveTo)) { // this does not work either 
      if (ItemGiven == iWeed) {
        dDialog6.Start(); 
      }
    }
    else Unhandled();
  }
}


I tryed to be as clear as possible but if I'm just talking riddles please tell me! if I forgot anything ask me! if I've made an stupid mistake don't hate me! if you can... help me (roll). thanks in advance guys

Bryan_abos

ok i'm gonna answer myself making justice to what you think (i guess)...

what an asshole man, is was as simple using else if in the egaGiveTo instead of making 3 different egaGiveTo... you are so stupid that you spent more time writing this post than trying that... this post should be deleted you moron. (PS: your english sucks too and your mom does not like you)

:(wrong)

SMF spam blocked by CleanTalk