Hi, I am new to Visionaire and one of the first Things I made for my Game is a Verb Coin, and I decided that it shall be visible only when leftclicking either a Character or a SceneObject, or else Leftclicking just means a usual GoTo-Command.
(Please forgive the Text-Wall, I am not sure how to express this in less Words, so please have Mercy.)
Now, I already had that Interface mostly working the Way I wanted -- mostly. I had to set up several Values/Conditions (for Example whether the Object underneath the Cursor is an Exit or not, whether the Cursor currently is a dragged Item or not, whether the Verb Coin is currently displayed or not), some of which had to be changed all the Time across several Actions on Objects in the Game's World, turning Setting-Up mundane Actions into a highly tedious and unneccessarily complicated Chore. Additionally, the mostly very useful Building Blocks from one can create Actions still had some Limitations I needed to get around. So I decided I should recreate the Action for displaying the Verb Coin or doing other Things (i.e. not showing the Verb Coin on Exits or when an Item is being dragged) with a LUA-Script, as that should offer more Possibilities -- which it does, as I can tell so far (for Example, I can simply query whether the current Object under the Cursor begins with a few particular Letters marking it as an Exit, that is much more comfortable for me). However, as a Beginner, I find Visionaire's LUA-API to be slightly confusing and almost chaotic, as certain Commands seem to change their Form depending on where and how they have to be implemented, so I am at a Loss right now and start to lose Orientation.
Right now, there are a few Things that I need and my Script should be complete:
1) IF Item is being dragged (i.e. Cursor is an Item, about to use an Item on so./sth.) ... ELSE (no item being dragged) ...
2) What are the LUA-Equivalents to:
2.1) IF Current Object is a Sene Object...
2.2) IF Current Object is a Character...
2.3) Save Object
2.4) Set ActiveCommand to DefaultCommand
Sorry if these Things seem very basic, but some of them I just could not find on the Site's LUA-Documentation or this Forum, and some Things I thought I had found but then wasn't sure about the exact Syntax for implementing them. (1) has the higher Priority right now.
If it should be any Help, here is the Code so far:
local verbcoin = getObject("Interfaces[Verbalmünze]")
local Erlene = getObject("Characters[Erlene]")
if not game.CurrentScene.SceneIsMenu then
--if CURRENT OBJECT == SCENE OBJECT OR CHARACTER (How do I get this?)
if string.find(getObject("Game.GameCurrentObject"):getName(), "Gen_") then
game:clearLink(GameCurrentObject)
game:clearLink(GameActiveCommand)
else
-- IF ITEM IS ~NOT~ BEING DRAGGED -- NOT SURE IT WORKS:
if game.UsedItem:isEmpty() then
Erlene:setValue(VCharacterState, 2)
verbcoin:setValue(VInterfaceVisible, 1)
verbcoin:setValue(VInterfaceTimeToDestVisibility, 100)
verbcoin:setValue(VInterfaceDestVisibility, 100)
else -- IF ITEM ~IS~ BEING DRAGGED -- DOESN'T WORK!
verbcoin:setValue(VInterfaceVisible, 0)
end
end
--end
end