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

  • #1, z RayManiacThursday, 01. December 2016, 20:39 hodinky 8 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.

    Bažant

    10 Posts


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

    Objects["name"]

    or
    Objects.name

    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

    If you want to only return the current value

    Objects["name"]:getFloat(VObjectScale)

    Zabiják klíčů

    810 Posts