Layers solution

gariantrollgariantroll Member Posts: 219
edited November -1 in Working with GS (Mac)
I am trying to make sure that when a character is higher than another character that it is covered by the lower character. How do I do this, I am actually puzzled.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi gariantroll; from what I can understand, you've made actor 1, then after another actor 2 but still 2 is behind 1? Or at least you want to reorder the layers...

    Couple of things might help if you don't know:

    First, you can change layer of an actor quickly by selecting the actor, then going to the GS menu bar >Layout. THere you can move it back or forward, or totally to the back or front. A shortcut for this is holding the mouse down on the actor with control pressed.

    The second way and thing to check is Layer folders. THese can be found in the Scenes Editor > Scene > Layers.
    Here you can move actor higher up the list in any folder or lower, or move them from one folder to another; add layer folders and delete, etc. Possibly your confusion lies in the fact that one actor is in one folder but another is in another layers folder which is beneath the first actor's folder. If you get my meaning....all come clear when you check it out. Hope that helps. :-)

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

  • 8x8n88x8n8 Member, PRO Posts: 81
    gyro I think he means doing this in-game. Like so that when an actor's x position is higher than another, then the layer order will be switched accordingly. I'd like to know how to do this too.

    So far as I can tell there is no way to access an actor's layer order using behaviors.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    No you cannot rearrange the order however you can have your actor actually be two actors so and then have the alpha of the two switching back and forth based on the y positions . He was a really cool video made of something like this. When I get up in the morning I'll look through my YouTube history and see if I can find it unless someone el posts it
  • gariantrollgariantroll Member Posts: 219
    Yes I am trying to do it real time. But with a bunch of different actors.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Darren came up with a way to do this. So lets say you want to be able to go in front of a tree and then go behind a tree. What you have to do is have two trees and three layers. The moving actor is on the middle layer. The tree actor has one instance on the top layer and another on the bottom layer. Then you have rules so that if the y value of the hero is below the y value of the top tree the top tree changes alpha to 0 and if it is above the y value of the tree the top changes its alpha to 1. You'll have to tweak the exact settings that trigger the alpha switch but it should work.
  • gariantrollgariantroll Member Posts: 219
    MAn, that might not work because my game has moving characters. I will find a way though. Thanks for your help. If you come up with any more ideas for a solution, please share them with me.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Well it took some digging but heres the video.



    I believe whats being done here is, the y value of the moving player is being tracked by a game attribute. And then for every tree there are to actors. on is in a layer above the player and one is in a layer below the player. Then when the players position is higher the the position of the tree the lower one changes alpha to 0 and the higher layer tree changes alpha to 1. Then switch them if the position of the player is lower.

    you don't see the change because they are at the same position but it will appear you are moving in front of and behind it.

    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • gariantrollgariantroll Member Posts: 219
    Thanks, I think this might work, but keep in mind that the other objects are moving too. I will report back to you my findings.
Sign In or Register to comment.