(Solved) Thumbleweed layout GUI and Dialogue issues

Started by viktor, Thu 12/11/2020 17:17:57

Previous topic - Next topic

viktor

Hello,

I decided to get back in to AGS again and I'm a bit rusty. I want reposition the action verb (in classic view) in the GUI a couple of pixels up but can't seem to find where this is even possible in the thumbleweed template. On the same note I'm trying to work out how to code simple action responses with it and I'm having some strange issues. I made a test screen and wrote the code below. The issue is that even though my character says every sentence I wrote, he also says the defoult response afterwards. If he looks at something he rattles of my script but then also says "nice", which I didn't write.



Code: ags
// room script file

function room_FirstLoad()
{

}

function hStill_AnyClick()
{
//Open
  if (Verbs.UsedAction(eGA_Open)){
    player.Say("I'm not interested in the innerds.");
  }
//Close
  if (Verbs.UsedAction(eGA_Close)){
    player.Say("It's already closed.");
  }
//Talk
  if (Verbs.UsedAction(eGA_TalkTo)){
    player.Say("BJ and Hawk like to talk to it, but I'm not really that fond of it.");
  }
 //Push
  if (Verbs.UsedAction(eGA_Push)){
    player.Say("I could break it.");
  }
 //Pull
  if (Verbs.UsedAction(eGA_Pull)){
    player.Say("I could break it.");
  }
//Look at
  if (Verbs.UsedAction(eGA_LookAt)){
    player.Say("It's Bj's and Hawkeye's still.");
    player.Say("I don't like drinking from it.");
    player.Say("They use socks as the filter, eww.");
    }
//Use
   if (Verbs.UsedAction(eGA_Use)){
   player.Say("Eek, NO!");
   player.Say("That stuff would peel the paint offa my stomach.");
   player.Say("Anyway, I don't know how to use it.");
   }
//Pickup
   else if(Verbs.UsedAction(eGA_PickUp)) {
   Verbs.AnyClickWalkLookPick(88, 135, eDirectionLeft, "I think I'll just take an empty martiny glass.",oCup.ID,iCup);
   }

//Else
  else Verbs.Unhandled();
}
function hDoor_AnyClick()
{
  //OPEN
if (Verbs.UsedAction(eGA_Open)) {
  player.EnterRoom(1, 173, 132, eDirectionDown);
}
  //Look at
  if (Verbs.UsedAction(eGA_LookAt)) {
    player.Say("It's the door. It's a swell door but nothing special.");
  }
 //Else
  else Verbs.Unhandled();
  }


signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Khris

Open VerbGui.asc and check line 1073:
Code: ags
    lblAction.Y = verbsData.guiMain.Y - lblAction.Height;

Now this code should put the label exactly above the main gui, so ideally you open gAction, select lblAction and make sure its height is big enough for the text to fit inside. Or just add  - 5 to the end of that expression.

As for the Unhandled() message you get, that's because your verb handling block is supposed to have  else if  everywhere between the  if  at the top and the  else  at the end.

viktor

Quote from: Khris on Thu 12/11/2020 21:38:56
As for the Unhandled() message you get, that's because your verb handling block is supposed to have  else if  everywhere between the  if  at the top and the  else  at the end.

8-0 How did I not notice that? I feel silly now. Thank you for the help. I'll try it out this afternoon.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

SMF spam blocked by CleanTalk