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

  • #1, by marvelSunday, 17. September 2017, 15:15 7 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?

    Key Killer

    599 Posts


  • #2, by afrlmeSunday, 17. September 2017, 16:44 7 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.

    Imperator

    7285 Posts

  • #3, by marvelSunday, 17. September 2017, 16:51 7 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?

    Key Killer

    599 Posts

  • #4, by sebastianSunday, 17. September 2017, 17:01 7 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.

    Thread Captain

    2346 Posts

  • #5, by marvelSunday, 17. September 2017, 17:43 7 years ago
    That's working. Thanks a lot guys smile

    Key Killer

    599 Posts

  • #6, by afrlmeSunday, 17. September 2017, 19:30 7 years ago
    Sorry Thomas. Misunderstood what you were asking. My bad.

    Imperator

    7285 Posts

  • #7, by dionousMonday, 18. September 2017, 17:15 7 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

    Forum Fan

    246 Posts