"Use item with" - Tumbleweed Verbs template [SOLVED]

Started by Carles, Mon 26/06/2023 11:49:34

Previous topic - Next topic

Carles

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!

Khris

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?

Carles

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.

Khris

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
Code: ags
    // 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
Code: ags
    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

Carles

Thank you very much Khris!

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

AndreasBlack

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)

SMF spam blocked by CleanTalk