Hi guys!
I'm trying to change what the Action line says...ie.
Change "Look at Door" to "Peek through keyhole".
This seems so simple but there's no obvious way to do it.
Any help is much appreciated!
I think you should be able to search for the line, it should be in the global script probably. Click Edit then Find all and click "currect document" and search for it. If you find it, change it to your liking.
Thank you for the reply but I'm so confused!
I'm probably missing something. I'm not sure what you mean by "search for the line".
Do you mean I look for this
VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Look at");
And change "Look at" to "Peek"?
I'm not trying to change it globally just on specific objects.
Place the code inside an if condition.
if (can_peek) VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Peek through"); // I'm assuming the keyhole is a hotspot/object.
else VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Look at");
can_peek is a bool, just set it up where needed. (probably better to use custom variables for this though - change the code appropriately)
Thank you so much, that's what I'm looking for.
You have no idea how awesome you are!!!
THANK YOU!
If you want to do this for a bunch of interactions, you can use custom properties.
Here's the one for looking at stuff (you need to create this):
(https://i.imgur.com/drlrN4y.png)
Now open the main VerbCoin Script and replace line 506 (the one that sets action_label.Text) with this:
String actionString = String.Format("%s %%s", actionmap[control.ID]);
switch(modemap[control.ID]) {
case eModeLookat:
actionString = GetPropertyText(context_x, context_y, "look_at");
}
action_label.Text = String.Format(actionString, context_text);
Now scroll up a bit and put this right above the function repeatedly_execute:
String GetPropertyText(int sx, int sy, String property) {
gVerbCoin.Clickable = false;
LocationType lt = GetLocationType(sx, sy);
Hotspot* h = Hotspot.GetAtScreenXY(sx, sy);
Object* o = Object.GetAtScreenXY(sx, sy);
Character* c = Character.GetAtScreenXY(sx, sy);
gVerbCoin.Clickable = true;
if (lt == eLocationNothing) return "";
if (lt == eLocationCharacter) return c.GetTextProperty(property);
if (lt == eLocationHotspot) return h.GetTextProperty(property);
if (lt == eLocationObject) return o.GetTextProperty(property);
}
To actually use this, open the properties for the door and change "Look at %s" to "Peek through keyhole".
To change actions other than look you need to add the property to the Schema and an according case to the switch block.
This is perfect!
Thank you so much!
Sorry to be a pain!
If I want to change the interact verb do I need to edit this part? I'm not sure what you mean by switch block...
String actionString = String.Format("%s %%s", actionmap[control.ID]);
switch(modemap[control.ID]) {
:X case eModeLookat: :X
actionString = GetPropertyText(context_x, context_y, "look_at");
}
action_label.Text = String.Format(actionString, context_text);
A switch block works like this: https://www.adventuregamestudio.co.uk/manual/ags43.htm#switchstatement
You need to add a case:
switch(modemap[control.ID]) {
case eModeLookat:
actionString = GetPropertyText(context_x, context_y, "look_at");
break; // <-- don't forget this
case eModeInteract:
actionString = GetPropertyText(context_x, context_y, "interact"); // <-- custom property must exist
}
You've saved me from going mad!
Thank you so much Khris!!!
You're welcome :D