Hello
My name is Marco and I'm working on my first graphic adventure with Visionaire.
I have made a SCUMM interface from scratch, learning a little bit of LUA and Visionaire Studio commands.
By the way, I have a simple problem:
I need the action text not to change until the action is performed.
Right now Visionaire display action text dinamically and resets it immediately after the click.
I tried a "wait until character stop" action, but this way the action text will remain until the character reaches destination, NOT until the action has been performed.
I'll try to explain by code:
Actual Visionaire Studio Default Action Text Handling:
function SCUMMActionText(mousePos)
local obj = game:getLink(VGameCurrentObject)
local verb = game:getLink(VGameActiveCommand):getTextStr(VButtonName)
local obj_name = obj:getTextStr(VObjectName)
if obj:getId().tableId == null then
return verb
end
if obj:getId().tableId == eObjects then
return verb
end
if obj:getId().tableId == eObjects then
return verb .. ' ' .. obj_name
else
return verb
end
end
registerHookFunction("getActionText", "SCUMMActionText")
What I would like to achieve
If a command is not set, just act as above.
if obj:getId().tableId == null then
return verb
end
Now the part I cannot implement.
If a command is set, (eg "Use") and then an object exist (Item, Character, Scene Obj)
return verb + object (eg Use the chair) as above.
IF command is set + object exist AND left mouse is clicked
return verb .. ' ' .. obj_name EVEN if the mouse exits the object area, until action is performed.
In Visionaire action text is changed when you move the mouse outside the object (even if a command + click on object is set).
I have also added a "wait until character stops" block on the code: in this case the action text remains until the character is at destination, but when the action is performed (Eg. Use Mechanism with Machine), the action text auto-resets to "Walk to" (default) before the action is completed.
If anyone could help me I’ll really appreciate it.