Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Carles on Mon 26/06/2023 11:49:34

Title: "Use item with" - Tumbleweed Verbs template [SOLVED]
Post by: Carles on Mon 26/06/2023 11:49:34
Hello and thanks in advance, you have always solved all my doubts.

I am working with Tumbleweed Verbs template. I want that when the player picks up or uses an object on the room, it automatically shows in the action bar "use [item] with". Where [item] is an item that you will have in the inventory. The end result should be the same as if you had used the item from the inventory, but you must use it from a room object.

I hope it is understood. Thank you!
Title: Re: "Use item with" - Tumbleweed Verbs template
Post by: Khris on Wed 28/06/2023 06:58:24
Actually, I don't understand :-D

Can you give an example? Let's say I have a knife in my inventory. I click on "pick up", then a balloon object in the room. Instead of picking up the balloon, the game is supposed to switch to "Use knife with"? Or "Use knife with balloon" and immediately run that interaction?

Or do you want to be able to use room object A on room object B without picking one up first?
Title: Re: "Use item with" - Tumbleweed Verbs template
Post by: Carles on Wed 28/06/2023 09:47:23
Sorry if I didn't explain myself quite well. :-[

Exactly, it would rather be about using a room object A on another room object/hotspot B, without using it directly from the inventory.
Title: Re: "Use item with" - Tumbleweed Verbs template
Post by: Khris on Wed 28/06/2023 11:03:37
Ok, I gave this a shot.

Here's the download for the edited VerbGui module:
https://drive.google.com/file/d/1zZj0VC1VwE947E_gZXS8cJgTpM_x8fD1/view?usp=sharing

Usage example:

This goes into the click handling for the object
    // PICKUP
    else if(Verbs.UsedAction(eGA_PickUp)) {
      Verbs.UseObject(oBlueCup); // new function, tell game to "use" the object "with"
    }

This goes into the click handling for the target hotspot / object / character
    else if (Verbs.UsedAction(eGA_UseObj)) {
      if (Verbs.UsedObject(oBlueCup)) {
        Display("You use the cup on the screen.");
        // Verbs.UseObject(null); // call this to deselect the object
      }
    }

Consider this an alpha test! :-D
Title: Re: "Use item with" - Tumbleweed Verbs template
Post by: Carles on Wed 28/06/2023 19:58:58
Thank you very much Khris!

It's just what I was looking for. You have helped me a lot again.  :)
Title: Re: "Use item with" - Tumbleweed Verbs template [SOLVED]
Post by: AndreasBlack on Wed 28/06/2023 20:56:19
Quote from: Carles on Wed 28/06/2023 19:58:58Thank you very much Khris!

It's just what I was looking for. You have helped me a lot again.  :)

Khris is an AGS legend. So many times in the beginning stages of my AGS journey he had absolute patience with all my dumb questions!  (laugh)