License from €75
DE EN FR ES IT CZ

How to set a new object point (and angle/alignment) via lua?

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hey guys,
    I have a situation here where the character should not walk all around an object to comment it. So I want to adjust the foot point and also the alignment if the character stands behind (instead of before) an object. So I plan to start a lua command if he reaches a specific object area,

    Does anybody know how to set a new object point and the angle/alignment) via lua?
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 9 years ago
    game.CurrentCharacter.CharacterDestination = {x = 500, y = 500}

    wait until character stops
    align character

    You should probably use the action part for checking the characters current direction, if that's something you need to check.
  4. · 9 years ago
    game.CurrentCharacter.CharacterDestination = {x = 500, y = 500}

    wait until character stops
    align character

    Sory, I believe this is a misunderstanding - or I don't understand what you mean with that. smile How can I give an object - for example an object named "chair" - a different object point and a new alignment angle?

  5. · 9 years ago
    These are not scriptable. So maybe these get lost after saving.
    But if you use them directly it should work
    Objects["myobject"].ObjectDirection = 45 --integer ( degrees )
    Objects["myobject"].ObjectPosition = {x=100,y=300} --coordinates


    you could also use the left click (immediate) and check if the character is above Y and then deside to send hin below or above the object.
  6. · 9 years ago
    That's working. Thanks a lot guys smile
  7. · 9 years ago
    Sorry Thomas. Misunderstood what you were asking. My bad.
  8. · 9 years ago
    These are not scriptable. So maybe these get lost after saving.
    Just tested, it seems that these changes are permanent and they even get saved smile

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?