TEMPLATE: Tumbleweed Verbs 1.4

Started by abstauber, Sat 29/04/2017 15:41:50

Previous topic - Next topic

AndreasBlack

#180
You can solve this easy by throwing a duplicate GUI/Slighty changed blocking the buttons oyu don't want to be clickable) on top of the original gMain buttons, that you don't need. If you don't understand what i'm talking about go to GUI create a gui then copy the settings of gMain's Height, Left, Top and start the game, then you'll see. Go into AGS sprite folder and export the original buttons if you want any of them, and have the original gui's button you want left clickable by making your duplicate GUI not blocking it.

Then go into the images you'd like to change to whatever Verb you want. However here you could potentially run into problems if your new verb is longer in text/size then the one it's replacing since i believe it is locked into place by code, but i would still try this instead of messing around with the code.



abstauber

Removing some verbs is actually way easier than adding more ;)
First you need to set this constant to your new verb count + 1 (5 in your case)
Code: ags
#define ACT_COUNT 5  // Action Button Count (gMain)

Then you need to get rid of all unwanted verbs in these functions:

Code: ags
static void Verbs::CheckDefaultAction() 
static void Verbs::MapButtons() 
static void Verbs::Localize() 
Unfortunately you need to do it for all languages in Localize()

The last thing you need to do is removing the buttons. But since you need button IDs from 0 to 4, you have to remove the buttons from the gui, not the verbs you don't want.

So your edited GUI should like this (presented in glorious ascii art)
Code: ags
┌───────────────────────────────────────────────────────────────────────────────┐
│ ┌──────┐    ┌────────┐                                                        │
│ │Open  │    │Pick up │               ▲ ┌─────────┐ ┌──────────┐ ┌──────────┐  │
│ └──────┘    └────────┘               │ │         │ │          │ │          │  │
│ ┌──────┐                             │ │         │ │          │ │          │  │
│ │Close │                               └─────────┘ └──────────┘ └──────────┘  │
│ └──────┘                             │ ┌─────────┐ ┌──────────┐  ┌─────────┐  │
│ ┌──────┐                             │ │         │ │          │  │         │  │
│ │Give  │                             ▼ └─────────┘ └──────────┘  └─────────┘  │
│ └──────┘                                                                      │
└───────────────────────────────────────────────────────────────────────────────┘

The GUI script will take care of remapping the buttons with the correct verbs.

That should be it.

@Discussion about code complexity:
I know, there's a lot going on in this template and I already tried to keep it simple.

The goal was to provide the same functionality as Thimbleweed Park and there's not much out of the box to work with (Save / Load, Custom Dialog Rendering, double click handling). Of course there modules available providing these features, but at least this way the included modules are all compatible with the template.

Danvzare

The scroll_rows setting seems to be bugged. If you set it to more than 1, it will sometimes skip dialog options if another dialog option takes more than one line to display.


For example, say you set CustomDialogGui.DialogGuiOptions[eDialogGui_scroll_rows] to 4, because there's only ever four options on screen at once, so why not have it scroll past an entire screen.

Then say you have 9 dialog options, the fifth dialog option being very long.

You start the dialog and see the first four dialog options, 1, 2, 3, and 4.
You scroll down and see the next three dialog options, 5, 6, and 7. Number 8 doesn't appear because number 5 takes two lines, that's fine.
You scroll down and see the last dialog option, number 9. What happened to 8? It skipped it entirely!

Jackpumpkinhead

I am using the Tumbleweed template for my game and I just got started. In the VerbGUI.asc script it says "Please do not edit these options directly anymore, but use the VerbGuiSettings settings script instead!" Where is that? Also is this version what is included with AGS 3.6 or do I need to update?

Khris

Quote from: Jackpumpkinhead on Thu 16/01/2025 07:54:27Where is that?

Looking at my 3.6.0 Tumbleweed test game, the script is called TemplateSettings (and the template version is 1.4, so no need to update)

SMF spam blocked by CleanTalk