How to interact between Lua and an object within the game?

  • #1, by RayManiacThursday, 01. December 2016, 20:39 4 years ago
    Hi, I want to start scripting with Lua, but I don't know how to interact e.g. with an object or a hotspot.

    For Example, I got in a scene an object called "picture" and I want to script if you're clicking on "picture" a text will be displayed: "It's a boring picture. What did you expect?".

    How to get I find out which name for the object has to be used?
    And I also want to know it for a hotspot in the same way.

    I thank you in advance.

    Newbie

    10 Posts


  • #2, by ke4Thursday, 01. December 2016, 21:18 4 years ago
    In Lua you can get object with

    Objects["name"]
    1

    or
    Objects.name
    1

    In the data structure table you can see all the things you can use
    https://wiki.visionaire-tracker.net/wiki/Data_Structure

    However at this point there's no option to start text with Lua. In this case you would have to display your text via an image or by calling an action that would be displaying the text through action part anyway.

    To give an example how to interact with an object. Let's say you want to set a scale to your object, then you would select your object as above and use the ObjectScale field in the data structure table

    Objects["name"].ObjectScale = 2
    1

    If you want to only return the current value

    Objects["name"]:getFloat(VObjectScale)
    1

    Key Killer

    810 Posts

Write post