How do I replace Tumbleweed verb images?

Started by matdogpig, Mon 17/02/2025 17:13:16

Previous topic - Next topic

matdogpig

Hi, I want to make a game using the Tumbleweed template and I'd like to replace the 9 verb icons with my own images, but can't figure out how to do it...

I found this old forum post (https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/solved-can-t-change-gui-image-9-verb/msg636604775/#msg636604775) which explains why simply changing the image number in the GUI: gMain editor doesn't work, because (I think) the script overrides whatever you've put when the game runs. And it explains you need to use the SetActionButton command to change this. I've read what the Tumbleweed.pdf says but I can't for the life of me figure out how to make the command work.

I don't have a coding background so I'm not great at this stuff. Please could someone explain what I need to add & where to set my own verb images? Or if there's a step-by-step guide for idiots out there already, point me to it?! Thanks in advance!

Khris

Do you want to permanently replace the button images? Because in that case you can simply overwrite the sprites in Main/GUI/en with your own sprites.

Kara Jo Kalinowski

#2
In your VerbGui.asc (Tumbleweed/VerbGui/Edit Script), there is a function static void Verbs::Localize()

In that, it appears as so:

Code: ags
// English - eLangEN
    // yes/no-keys
    Verbs.SetKeys(eLangEN,  'y',  'n');
    
    Verbs.LocalizeActionButton(eLangEN,eGA_Open,    59, 60, 'q');
    Verbs.LocalizeActionButton(eLangEN,eGA_Close,   61, 62, 'a');
    Verbs.LocalizeActionButton(eLangEN,eGA_GiveTo,  63, 64, 'y');
    Verbs.LocalizeActionButton(eLangEN,eGA_PickUp,  71, 72, 'w');
    Verbs.LocalizeActionButton(eLangEN,eGA_LookAt,  73, 74, 's');
    Verbs.LocalizeActionButton(eLangEN,eGA_TalkTo,  75, 76, 'x');
    Verbs.LocalizeActionButton(eLangEN,eGA_Push,    65, 66, 'e');
    Verbs.LocalizeActionButton(eLangEN,eGA_Pull,    67, 68, 'd');
    Verbs.LocalizeActionButton(eLangEN,eGA_Use,     69, 70, 'c');

And similar code for other languages.

So you can do 1 of 3 things:

Change the sprite ids from within this function. The first sprite is the ID of the regular sprite and the 2nd ID is the sprite with mouseover. This is if you want your sprites to have different ids for whatever reason. It would be then be the "default" values of the sprites.

Paste this function wherever inside the code you want to change the buttons, and from then on, it will use the new sprites.

Open your sprites folder and just import over the old sprites. This is the most simple and sounds like what you really want to do.

matdogpig

Thank you both so much! You're both right, all I wanted to do was replace the sprites. It never occured to me to just import over the ones the game was currently using  (roll). Thanks for the longer explanation Kara, it'll be helpful if I decide to get more ambitious.

Much appreciated!

SMF spam blocked by CleanTalk