Changing Actor's Layer position

sparkaniasparkania Member, PRO Posts: 300
ok.. another quick question.
I know that Spawing allows the new actor to be placed in front or back of a layer. Is there a behavior which can change an active actor's position in it's layer?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @sparkania no, changing layer order with behaviours/during runtime is not possible at the moment, unfortunately.... possibly on the cards for a future GSC release though.... just have to go with the workarounds for the while...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • sparkaniasparkania Member, PRO Posts: 300
    deern.. I am trying to make an actor be able to be in front of an object but then jump behind it (out of site) without making it a complicated mess..
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    'Tis a nuisance, sometimes... but depending on your situation, the workarounds can help... for instance, if the object is to be totally out of site (outa sight, man! ;-) ) and hasn't got Rules for touch in it, just make its Alpha zero; or even move it outside of the visible screen temporarily, if that'd work in your situation....

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • sparkaniasparkania Member, PRO Posts: 300
    nah.. because there will be times where the actor is also partially visible, the Alpha trick would be a bit binary.. I'll figure something out.. I was just wondering if I was missing something.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    OK, so by the sound of it the only other workaround is to destroy it and spawn it in the back of the layer, as you know...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • sparkaniasparkania Member, PRO Posts: 300
    exactly..

    plus I just looked at the XML for the scene, the Layer position is not a value but rather the order in which the actor is written in the scene. so there's no real 'switch' to mess with.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    True, although there's a bit of leeway because of the fact you can make levels into separate groups; this helps out in a few situations.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • sparkaniasparkania Member, PRO Posts: 300
    yeah, I went down that road.. but ya can't swap those either. I've been exploring the possibility of having a 'mirror' actor on those scenes where it's relevant. So I am effectively in front to and behind, and then using a collision or a 'real' switch to make the front actor invisible where applicable..
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    There'd be no need to swap the layers groups if you made sure that, at least, the actor that appears in front, then at another time at the back of a second actor, that these two actors are in the same layer group... then destroying and spawning in the back of the layer will make the actor just in the back of the particular layer group its in.

    Just thought I'd clarify that for other members who might find it useful information...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • TryangleTryangle Member Posts: 37
    1. Split the actor into a top half and bottom half.

    2. Constrain the x-y coordinates of the bottom to table x/y attributes.

    3. Add a spawn actor behavior to the bottom half, to spawn the top half.

    4. In the top half, constrain the x/y constraints of the top half to the the table attributes + how many y pixels high that the top half sits on the bottom half.

    This will create a layering effect.

    - make sure that the top half is equal to the bottom or else the effect won't work when overlapping with other actors.
    - I was able to get away with about 10 actors at once without trouble, but after that it starts to hit the processor. The problem is that it processes to the thousandth decimal point. If the smooth temporal mapping was in tenths, it would probably allow many more actors at once.
    - there are ways to have actors automatically add themselves to table rows so you can have npc's automatically map themselves when having multiple npc's of the same type. Not explaining it here.
  • grimtoothgrimtooth Member Posts: 69
    I started a "Faux 3d" project just for fun and testing and this is exactly where it fell apart. Creating a "believable" (ie, not photorealistic but perceptually convincing) 3d atmosphere in gamesalad is actually possible with a combination of delicate artwork and delicate mathematical manipulation, but placing objects in that 3d environment causes it to fail because you cannot (or maybe just "I cannot") program a way for a player to walk around objects and have them change relative front/back position.

    In theory you COULD program that by causing a respawn of actors in order dictated by their distance from the player or camera every time there is movement, but that would get very very processor heavy and essentially be worthless for game creation.

    Grim
Sign In or Register to comment.