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 - DBoyWheeler

#21
Thanks.  I'll take a look-see and respond if some things are a tad confusing.
#22
Hi.

Aside from the verb coin, I had in mind making a custom dialog GUI for doing dialogues.

The graphics are a main field.


And an up arrow and down arrow, if there are sufficient dialog topics to warrant going up and down.


How can I set it so the field only appears when having dialogue, and the arrows only appear when there needs to be scrolling?  I know there's a regular dialogue thing in AGS, but I'm wondering if it is possible to make a custom dialogue thing.
#23
I think it's working now.  I'll test it on doors next time I do testing.  Thanks.  I'll let you know if I run into any more trouble.

[Update]
Now I have a new issue.

There's a part in my "intro tutorial" where I show the player how to use the "Spirit Falcon".
Code: ags
function cLara_AnyClick()
{if(mouse.Mode == eModeSpFalcon)
  {if((cLara.Room == 2)&&(LaraAwakened == false))
  {
    player.FaceCharacter(cLara, eBlock);
    player.Say("Spirit Falcon, this dear child needs help!");
    cLara.Animate(1, 5, eOnce, eBlock, eForwards);
    Wait(20);
    cLara.Animate(2, 5, eOnce, eBlock, eForwards);
    cLara.UnlockView();
    cLara.FaceDirection(eDirectionDown, eBlock);
    LaraAwakened = true;
    cLara.Name = "Lara Blaapeppe";
    cLara.Say("Where am I?");
    player.Say("I'm curious to that myself, but I got you out of that bag.");
    player.Say("My name is Sarimento.");
    cLara.Say("Thank you, Mr. Sarimento.  My name is Lara.  Lara Blaapeppe.");
    cLara.FaceDirection(eDirectionRight, eBlock);
    cLara.Say("My home town is not too far away.  Follow me.");
    Display("This is where we would transport to the Blaapeppe neighborhood.  For now, we'll end here.");
    QuitGame(0);
    }
  else
  {
    player.Say("She's already awoken from my Spirit Falcon's powers.");
  }}
}

But when I test it in game, nothing happens.  No error messages, no animations... nothing.  What could I be doing wrong?
#24
Yeah, I don't know what the heck I'm doing wrong with the code.

Here's the mouse click one (well, the portion of the mouse click that's important here):
Code: ags
function on_mouse_click(MouseButton button)
{
  if (interface == null || !enabled)
  {
    // don't do anything if GUI isn't set or is disabled
  }
  else if (button == eMouseLeft)
  {
    if (GetLocationType(mouse.x, mouse.y) != eLocationNothing)
    {
      if (player.ActiveInventory != null)
      {
        Room.ProcessClick(mouse.x, mouse.y, eModeUseinv);
      }
      else if (interface.Visible)
      {
        interface.Visible = false;
      }
      else if (interface_inv != null && interface_inv.Visible)
      {
        interface_inv.Visible = false;
      }
      else if (Character.GetAtScreenXY(mouse.x, mouse.y) != player)
      {
        if(GetLocationType(context_x, context_y) == eLocationObject)
        {
          Object* o = Object.GetAtScreenXY(context_x, context_y);
          ThingToPickUp = o.GetProperty("CanObjectBePickedUp");
          DoorToOpen = o.GetProperty("ADoorToOpen");
        }
        if(GetLocationType(context_x, context_y) == eLocationHotspot)
        {
          Hotspot* h = Hotspot.GetAtScreenXY(context_x, context_y);
          PlaceToInspect = h.GetProperty("PlaceToInspect");
        }
        context_x = mouse.x;
        context_y = mouse.y;
        interface.X = Maths.Clamp(context_x - interface.Width / 2, 0, SCREEN_WIDTH - interface.Width);
        interface.Y = Maths.Clamp(context_y - interface.Height / 2, 0, SCREEN_HEIGHT - interface.Height);

        if (button_auto_disable)
        {
          for (int i; i < interface.ControlCount; i ++)
          {
            if (interface.Controls[i].AsButton != null)
            {
              interface.Controls[i].Enabled = IsInteractionAvailable(context_x, context_y, modemap[interface.Controls[i].ID]);
            }
          }
        }

        interface.Visible = true;
        ThingToPickUp = false;
        DoorToOpen = false;
        PlaceToInspect = false;
      }
    }
    // close windows or unset the active inventory item
    else if (interface.Visible)
    {
      interface.Visible = false;
    }
    else if (interface_inv != null && interface_inv.Visible)
    {
      interface_inv.Visible = false;
    }
    else if (player.ActiveInventory != null)
    {
      player.ActiveInventory = null;
    }
    else
    {
      // ...except when there is no nothing to deselect or close,
      // so just walk to this position
      Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
    }
  }

And here's the repeatedly execute code (again, the portion that's important here)
Code: ags
if (interface.Visible)
    {
      // update text label for verb coin actions
      GUIControl* control = GUIControl.GetAtScreenXY(mouse.x, mouse.y);

      if (action_label == null)
      {
        // pass
      }
      else if (control != null && control.AsButton != null && control.Enabled && context_text != null)
      {
        String action = actionmap[control.ID];
        if (control == btnUse)
        {
          if (ThingToPickUp) action = "Pick up";
          else if (DoorToOpen) action = "Open";
          else if (PlaceToInspect) action = "Check";
        }
        action_label.Text = String.Format("%s %s", action, context_text);
      }
      else if (context_text != null)
      {
        action_label.Text = context_text;
      }
    }
    else if ((interface_inv != null && !interface_inv.Visible) || GetLocationType(mouse.x, mouse.y) == eLocationNothing)
    {
      // update regular text label
      context_text = Game.GetLocationName(mouse.x, mouse.y);

      if (action_label != null)
      {
        action_label.Text = context_text;
      }
    }
  }

What am I screwing up?
#25
It's gone back to "Use" [object] (regardless of what the spot or object is).
#26
Would I put that resetting the values in this section of the repeatedly_execute code?

Code: ags
if (interface == null || !enabled)
  {
    // don't do anything if GUI isn't set or is disabled
  }
#27
Okay, something is REALLY screwed up.

The verbs are working again, but when I got to the opened door (a HotSpot), the interact command is still "Use Opened Door" (instead of "Check Opened Door").  When the Dark Star appears after getting the inventory bag, when I click on the revealed Dark Star, it ends up saying "Check Dark Star" (instead of "Pick up Dark Star", which is what it is supposed to read; again the "Check" verb is for certain hotspots, not objects).  Do I need to change the Booleans into some other variables to make them work properly?
#28
I'm assuming it's this code in the verb coin script
Code: ags
function repeatedly_execute()
{
  if (interface == null || !enabled)
  {
    // don't do anything if GUI isn't set or is disabled
  }
  else if (player.ActiveInventory == null)
  {
    if (interface.Visible)
    {
      // update text label for verb coin actions
      GUIControl* control = GUIControl.GetAtScreenXY(mouse.x, mouse.y);

      if (action_label == null)
      {
        // pass
      }
      else if (control != null && control.AsButton != null && control.Enabled && context_text != null)
      {
        if(control == btnUse)
        {if(ThingToPickUp == true){action_label.Text = String.Format("Pick up %s", context_text);}
        else if (DoorToOpen == true){action_label.Text = String.Format("Open %s", context_text);}
        else if (PlaceToInspect == true){action_label.Text = String.Format("Check %s", context_text);}}
        else action_label.Text = String.Format("%s %s", actionmap[control.ID], context_text);
      }
      else if (context_text != null)
      {
        action_label.Text = context_text;
      }
    }
    else if ((interface_inv != null && !interface_inv.Visible) || GetLocationType(mouse.x, mouse.y) == eLocationNothing)
    {
      // update regular text label
      context_text = Game.GetLocationName(mouse.x, mouse.y);

      if (action_label != null)
      {
        action_label.Text = context_text;
      }
    }
  }
  else
  {
    if (interface_inv != null && interface_inv.Visible && GUI.GetAtScreenXY(mouse.x, mouse.y) != interface_inv)
    {
      // close inventory window once the cursor leaves
      interface_inv.Visible = false;
    }

    // update text label for 'combining' items
    String location = Game.GetLocationName(mouse.x, mouse.y);
    InventoryItem *i = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    if ((i != null && i.ID == player.ActiveInventory.ID) || location == "")
    {
      location = "...";
    }

    if (action_label != null)
    {
      action_label.Text = String.Format("Use %s with %s", player.ActiveInventory.Name, location);
    }
  }
}

Is there something that might be out of order that is messing things up?
#29
I shrank down the pointer (hopefully it won't be TOO small).

Um, would the code that I need to check be in the main (global) script, or somewhere in the verbcoin script?  I'm a little lost here.
#30
Okay, I made the changes for the hotspot flag, but even then, no action verb is appearing before the target hotspot or object.
#31
Okay, I did the change from "button" to "control", but now some weird crap is happening.

The code is similar (tried to get creative with the booleans).

Here is the code I did.

In the Mouse Click section
Code: ags
        if(GetLocationType(context_x, context_y) == eLocationObject)
        {
          Hotspot* h = Hotspot.GetAtScreenXY(context_x, context_y);
          Object* o = Object.GetAtScreenXY(context_x, context_y);
          if (o.GetProperty("CanObjectBePickedUp") == 1){ThingToPickUp = true;} else {ThingToPickUp = false;}
          if (o.GetProperty("ADoorToOpen") == 1){DoorToOpen = true;} else {DoorToOpen = false;}
          if (h.GetProperty("PlaceToInspect") == 1){PlaceToInspect = true;} else {PlaceToInspect = false;}
        }

And in the repeatedly execute:
Code: ags
        if(control == btnUse)
        {if(ThingToPickUp == true){action_label.Text = String.Format("Pick up %s", context_text);}
        else if (DoorToOpen == true){action_label.Text = String.Format("Open %s", context_text);}
        else if (PlaceToInspect == true){action_label.Text = String.Format("Check %s", context_text);}}
        else action_label.Text = String.Format("%s %s", actionmap[control.ID], context_text);

The Look and Talk buttons work okay.



But the Do/Interact button just shows the spot and doesn't show any action at all.


What am I missing in the code?
#32
Okay, I've been trying to get some more done with the verb coin (namely, to make the hand button display different things, be it a door to open, an item to pick up, or something to inspect).  I need to specify which button, otherwise it might read something weird when I want to use the Look Button or Talk Button.

But I've been getting error messages when I try.

Here's the section of code (in the Repeated_Execute of the Verbcoin script).

Code: ags
 else if (control != null && control.AsButton != null && control.Enabled && context_text != null)
      {
        if(button == btnUse)
        {if(ThingToPickUp){action_label.Text = String.Format("Pick up %s", context_text);}
        else if (DoorToOpen){action_label.Text = String.Format("Open %s", context_text);}
        else if (PlaceToInspect){action_label.Text = String.Format("Check %s", context_text);}}
        else action_label.Text = String.Format("%s %s", actionmap[control.ID], context_text);
      }
      else if (context_text != null)
      {
        action_label.Text = context_text;
      }

But I keep getting this Error Message:
Quoteundefined symbol "button"

How do I set the code so that there can be special cases for a particular button, depending on what hotspot or object there is?
#33
Quote from: Khris on Sun 22/10/2023 09:16:06Yes, the text is set in the VerbCoin script's repeatedly_execute. You could add a custom property, a bool "isFood" with a default value of false, the set it to true for each edible item. The rep_exe will read this property and set the text accordingly.

I checked your game and override inv click handling was still set to false. I changed that but left-clicking an item only makes it active, as opposed to opening the VerbCoin. So you'd have to also implement that somehow.

Ah, so that's how it works.  I might have to experiment with variables to change stuff around.
#34
General Discussion / Needing fillings soon.
Mon 16/10/2023 15:45:53
Fan-freakin'-tastic.

Found out there was a small patch of decay between two of my teeth (thankfully they caught it just in time).  But come November, I'll be needing fillings.

Yeah, my luck had to run out at some point.
#35
Thank you.  I look forward to seeing the fixes.  This verb coin issue was kind of a choke point in the making of this game.  Hopefully once I get the fixes, I can really start getting more stuff worked on with this.

[Update] Okay, rather interesting question here.
See, I have some food items in game inventory.  And similar to Curse of Monkey Island, I want to make it so the "Talk" button in the Verb Coin GUI could change to "Eat" [Item name here.]  Is there a way to change the action text or whatever it is called for certain items or objects?
#36
Okay, I'll put it in Google Drive, and send the link in a PM.
#37
Quote from: Khris on Thu 05/10/2023 07:45:11So have you changed the place_button function accordingly / removed the call from the RegisterButton function?

Plus it looks like the GUI is set to block the game? Can you check its visibility setting?

Yes, I removed the place_button call from the RegisterButton function, and its visibility is set to "False" when not in use.
#38
Quote from: eri0o on Tue 26/09/2023 00:24:10@cat , what is OROW?
I can answer that for you.

OROW = One Room One Week.  Basically, you'd have a week to make a really short game that only takes place in one room.
#39
Here's what I put in the game_start function.

Code: ags
function game_start()
{
  // setup VerbCoin GUI and buttons
  VerbCoin.InterfaceGui = gVerbcoin;
  //Will need to update verb buttons later.
  VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorthWest, eModeLookat, "Look at");
  VerbCoin.RegisterButton(btnUse, eVerbCoinPositionNorth, eModeInteract, "Use");
  VerbCoin.RegisterButton(btnTalk, eVerbCoinPositionNorthEast, eModeTalkto, "Talk to");
  VerbCoin.RegisterButton(btnDarkStar, eVerbCoinPositionSouthWest, eModeDarkStar, "Use Dark Star on");
  VerbCoin.RegisterButton(btnDDSpore, eVerbCoinPositionSouth, eModeDDSpore, "Use DandiiDooDad Spore on");
  VerbCoin.RegisterButton(btnSpFlcn, eVerbCoinPositionSouthEast, eModeSpFalcon, "Use Spirit Falcon on");
  // select the inventory GUI and action label
  VerbCoin.InventoryGui = gInventoryGUI;
  VerbCoin.ActionLabel = lblText;

  // disable buttons where click events would be unhandled
  VerbCoin.ButtonAutoDisable = true;
}
#40
I made the changes... when I get the chance, I'll test it out, and update this post if I encounter any problems.

[Update time] Okay, so I got out some fixes, but now I have this issue.

I get this weird verb coin (and one that don't work)



I want the verb coin to look like this:


If I need to make a serious change in the verb coin template, so be it.  I really want this verb coin to work.
SMF spam blocked by CleanTalk