remember object position?

  • #1, by constantinThursday, 03. August 2017, 19:29 7 years ago
    hallo,
    ich habe wieder eine frage und hoffe auf hilfe hier im forum. 
    ich verändere die position eines objekts mit "move object to (x,y)". das funktioniert soweit. sobald der charakter aber den raum erneut betritt, ist das object wieder in der grundposition. gibt es eine möglichkeit, dass sich das programm "merkt", wo das objekt platziert wurde? 

    Hello, I have another question and hope for help here in the forum. I change the position of an object with "move object to (x, y)". This works so far. But as soon as the character enters the room again later, the object is in the default position. Is there a possibility that the program "remembers", where the object was placed?

    constantin

    Forum Fan

    167 Posts


  • #2, by constantinThursday, 03. August 2017, 19:36 7 years ago
    eine wirklich kuriose situation: es scheint, als würde sich das programm die position doch "merken", da das objekt erkannt wird, sobald ich mit der mouse draufgehe, allerdings ist das bild dafür an der falschen stelle ...  

    Forum Fan

    167 Posts

  • #3, by MachtnixThursday, 03. August 2017, 19:56 7 years ago
    Ich meine, dass Objektbild und Objektareal zwei verschiedene Schuhe sind und nicht automatisch deckungsgleich sein müssen. Vielleicht geht's weg, wenn man statt dessen eine „Ein-Bild-Animation“ benutzt?

    Thread Captain

    1097 Posts

  • #4, by afrlmeThursday, 03. August 2017, 20:15 7 years ago
    hallo,
    ich habe wieder eine frage und hoffe auf hilfe hier im forum. 
    ich verändere die position eines objekts mit "move object to (x,y)". das funktioniert soweit. sobald der charakter aber den raum erneut betritt, ist das object wieder in der grundposition. gibt es eine möglichkeit, dass sich das programm "merkt", wo das objekt platziert wurde? 

    Hello, I have another question and hope for help here in the forum. I change the position of an object with "move object to (x, y)". This works so far. But as soon as the character enters the room again later, the object is in the default position. Is there a possibility that the program "remembers", where the object was placed?

    constantin
    You could use Lua script to store the offset values inside of some vs values - set the default values for both to 0. Create a pair of scene values & name them x & y. Now create an at end of scene action under the scene actions tab & create an execute a script action part & add this to it... (change "example" to actual name of the scene & "rock" to actual name of the scene object)
    local scn = Scenes["example"]
    local off = scn.SceneObjects["rock"].ObjectOffset 
    
    scn.SceneValues["x"].Int = off.x
    scn.SceneValues["y"].Int = off.y

    Now create an at begin of scene action under the scene actions tab (if you don't already have one) & create an execute a script action & add this to it.
    obj = game.CurrentScene.SceneObjects["rock"]
    obj.ObjectOffset = { x = game.CurrentScene.SceneValues["x"].Int, y = game.CurrentScene.SceneValues["y"].Int }

    Should do the trick.

    Imperator

    7278 Posts

  • #5, by constantinThursday, 03. August 2017, 21:50 7 years ago
    thanks afrlme, but it's not working. i can see that the variable for the offset is saved correctly, but it just doesnt move the object. strangely i doesnt even react, when i try to set it with "move object to". i just reacts the first time, not after revisiting the scene again. 

    Forum Fan

    167 Posts

  • #6, by afrlmeThursday, 03. August 2017, 21:55 7 years ago
    thanks afrlme, but it's not working. i can see that the variable for the offset is saved correctly, but it just doesnt move the object. strangely i doesnt even react, when i try to set it with "move object to". i just reacts the first time, not after revisiting the scene again. 
    Isn't that a bug in the current version? I'm sure I remember someone posting about this recently?

    Imperator

    7278 Posts

  • #7, by constantinFriday, 04. August 2017, 00:01 7 years ago
    I would be very happy if someone could confirm this. Is the bug still there in v5? Or did someone find a walkaround? (i remember a bug where characters disappeared after being moved to a new position. This was solved by switching them off and on afterwards.)

    Forum Fan

    167 Posts

  • #8, by dionousFriday, 04. August 2017, 09:08 7 years ago
    Isn't that a bug in the current version? I'm sure I remember someone posting about this recently?
    Hey guys, see below if it helps in any way:


    Simon fixed it, to be included in next version.

    Forum Fan

    246 Posts

  • #9, by constantinFriday, 04. August 2017, 09:16 7 years ago
    danke für die info! dann freue ich mich auf die nächste version.
    mittlerweile habe ich das problem auf sehr plumpe weise mit 39 neuen objekten und conditions gelöst. ;-) 

    thanks for the information! Then I look forward to the next version. meanwhile I have solved the problem in a very primitive way with 39 new objects and conditions. ;-)

    Forum Fan

    167 Posts