Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

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

  • #1, by marvel 9 years ago Zitieren
    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, by afrlme 9 years ago Zitieren
    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.
  • #3, by marvel 9 years ago Zitieren
    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?

  • #4, by sebastian 9 years ago Zitieren
    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.
  • #5, by marvel 9 years ago Zitieren
    That's working. Thanks a lot guys smile
  • #6, by afrlme 9 years ago Zitieren
    Sorry Thomas. Misunderstood what you were asking. My bad.
  • #7, by dionous 9 years ago Zitieren
    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