Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - kelp

#1
Alright, so I am definitely unclear on how to separate this into multiple functions and go from one to the next. Got any examples of this? Thanks again.
#2
Yup, I've added that here:

Code: ags

 else if(DanTalk==1)
  {
    dDan4.Start();
    if (dDan4.HasOptionBeenChosen(1))
    {
      gGui1.Visible=true;
      String input = txtUserInput.Text;
      Parser.ParseText(input);
      if (Parser.Said("window"))
      {
        cDanielle.Say("xxx.");
        cDanielle.Say("xxxxxx");
      }
      else
      {
        cDanielle.Say("xxxxxxxxxx");
      }
    }


gGui1 is the textbox gui in question (lazy name because lazy)

Alright. New issue with it:

The GUI is coming up, but not when I have it scheduled to. The GUI doesn't appear until after I've "talked" to cDanielle twice, when it should happen immediately after the dDan4 stops. Not sure why.
#3
Thank you for the play by play! (The manual is usually great...until you get to these sorts of things!)

I tried this, but when I tried to enter a script name of txtUserInput, I got the error that something else already had that script name...but I have no idea what thing that is, or where to find it. :/

Found it. But now when I playtest, the GUI doesn't appear when it's supposed to...
#4
Quote from: Crimson Wizard on Fri 27/04/2018 01:06:35
You need to create a GUI with text parser item on it, called "txtUserInput".
...any guides on that? I wasn't able to find anything in the manual about creating new GUIs for text parser/input. Thanks!
#5
Here's the code I've got:

Code: ags

function cDanielle_Talk()
{
  cElle.FaceCharacter(cDanielle);
  if (DanTalk==0)
  {
    dDan1.Start();
    DanTalk=1;
  }
  else if(DanTalk==1)
  {
    dDan4.Start();
    if (dDan4.HasOptionBeenChosen(1))
    {
      String input = txtUserInput.Text;
      Parser.ParseText(input);
      if (Parser.Said("window"))
      {
        cDanielle.Say("xxx");
        cDanielle.Say("xxxxx");
      }
      else
      {
        cDanielle.Say("xxxxxxx");
      }
    }
    else
    {
      cDanielle.Say("xxxxxxxx")
    }
  }
}


When I attempt to run this, I get this error code: undefined symbol 'txtUserInput'

I took this section of the code directly from the manual, so I'm at a loss. But also I've never attempted to use the parser before, so it's probably user error.

Thanks in advance!
#6
Quote from: Crimson Wizard on Sat 21/04/2018 01:13:45
Code: ags

cElle.Walk(200, 420, eBlock, eAnywhere);


AHA! The eAnywhere is unnecessary because there is definitely a walkable area at (200,420), but the eBlock seems to have done the trick! (Never mind that I don't understand why...yet)

Thank you so much, Crimson Wizard! :-D
#7
Quote from: Crimson Wizard on Sat 21/04/2018 00:19:33
This way she will keep telling that she needs meds, and walk away from the edge.

Right, that makes plenty of sense. :) Modified and tried it the way you've provided...and we're still getting stuck. :/ She is not walking to the specified location, although she does turn immediately to the direction to do so, rather than going in 90 degree turns (which was the previous behavior) (whoops I lied, sorry, she is still going in 90 degree increments).
#8
Okay, so I've also tried this now:

Code: ags

int Tried=0;

function room_LeaveLeft()
{
  if(player.HasInventory(iCita))
  {
    player.ChangeRoom(5,  730,  400, eDirectionLeft);
  }
  else if (Tried == 1)
  {
    cElle.Walk(200, 420);
  }
  else
  {
    cElle.Think("I should probably find and take my meds first.");
    Tried=1;
  }
}


With the logic being that, if it goes through once and Elle thinks her thought, the tried variable is set to one and if it loops again, it should make her walk back inside the edge (and thus quit the loop)... and it works, sort of? The loop stops, the thought text disappears and the walk cursor returns, but Elle doesn't walk to the given spot, and clicking around doesn't make her move.

This of course isn't ideal, because I'll have to reset the tried variable such that, if the player attempts to leave again without the necessary item, it will give the same thought instead of immediately walking away.
#9
Quote from: Crimson Wizard on Fri 20/04/2018 23:42:12
What event is this function connected to?

Also, silly question, but did you just wait, or also tried clicking/pressing any key?

Yes, I waited for ~30 seconds, which I imagine is long enough. The text seems to flash about every 3 seconds, which is what first clued me into the fact that it might be a loop. Also yes, I clicked the mouse and pressed random keyboard keys. None of that did anything. :/

Also, now time for me to look dumb lol, I have no idea what event it's connected to (or what that means). What I posted is the only thing in my room script file. Am I missing something?
#10
Here's what I've written in my room script file:

Code: ags

function room_LeaveLeft()
{
  if(player.HasInventory(iCita))
  {
    player.ChangeRoom(5,  730,  400, eDirectionLeft);
  }
  else
  {
    cElle.Think("I should probably find and take my meds first.");
  }
}


When I run the game, if Elle attempts to leave by the left side without the item Cita, it displays her thought, but it displays it forever, and I can't move or do anything except exit the game completely. The cursor becomes a small clock icon while it loops. The intended result of attempting to leave the room without Cita is to display the thought once and exit the loop, but I'm not sure what I'm doing wrong/how to do that. Feels like it should be simple, but I'm stuck.

Many thanks in advance.
SMF spam blocked by CleanTalk