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

Object position in a display text

  • #1, by berthe-adrien 8 years ago Zitieren
    I would like to obtain the position of an object in the currentcharacter display text
  • #2, by afrlme 8 years ago Zitieren
    hmm... you would need to store the object position in a value as a string or in 2 values as numbers.

    1. create a new value in right hand values tab for the scene. rename it to something appropriate.

    2. just before the display text action part, create an execute a script action part & add this line to it...
    local obj = game.CurrentScene.Objects["example"].Position
    Values["example"].String =  ("x = " .. obj.x .. " y = " .. obj.y)

    3. now inside of your display text you need to link to the value so insert this...
    <vs=example>

    <vs=example></vs=example></b> into your display text somewhere.</vs=example></div>

    Quick note: "example" should be replaced with the actual name you gave the value & the actual name of the object you want to store the position of into the value.
  • #3, by berthe-adrien 8 years ago Zitieren
    Thank AFRLme I will try it.
  • #4, by afrlme 8 years ago Zitieren
    sorry, the auto-formatting on this forum sometimes. roll