Hi!
I have a doubt... it´s quite hard of explain but i´ll do my best:
I´m using the VerbCoin template and I put as string text "Use" in eModeInteact... that´s works in mostly scenarios except in a specific one: a drawer where I think is better to say "Open" instead of "Use".
Is there a way to change the string text ("VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");") ONLY in the case of interact with the drawer? Somewhat like:
VerbCoin.InterfaceGui = gVerbCoin;
VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Inspect");
VerbCoin.RegisterButton(btnTalk, eVerbCoinPositionEast, eModeTalkto, "Talk with");
if (?????)
{
VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Open");
}
else
{
VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");
}
VerbCoin.RegisterButton(btnPickup, eVerbCoinPositionWest, eModePickup, "Pick Up");
Thank in advance!
Cheers!
The button should be a regular AGS GUIButton. Which means you can change its text directly using
btnInteract.Text = "Open";
A proper solution would be to add a custom string property to hotspots and objects with a default value of "Use", then change that to "Open" for the drawer.
Next you need to switch the text in rep_ex_always (just add the function to the global script if it doesn't exist already, otherwise add the contents inside the existing one)
function repeatedly_execute_always() {
int mx = Mouse.x; int my = Mouse.y;
int lt = GetLocationType(mx, my);
if (lt == eLocationHotspot) {
Hotspot* h = Hotspot.GetAtScreenXY(mx, my);
btnInteract.Text = h.GetTextProperty("interact");
}
else if (lt == eLocationObject) {
Object* o = Object.GetAtScreenXY(mx, my);
btnInteract.Text = o.GetTextProperty("interact");
}
}
Many thanks! It works smoothly! :D
The problem before was that I was'nt puting the code "in rep_ex_always" in the global script then the action only was perfoming once!
The only change is that I created an empty Hotspot over the drawer that is triggering a variable when mouse is over it and that simplified a bit everything.
Greetings!