Problem with spawning actor actor layers

BasGoodboyBasGoodboy Member, PRO Posts: 310
edited August 2013 in Working with GS (PC)
Hello all,

The idea:
So I'm having a vendor in my game where the player can buy new items, which will instantly be visible after buying by spawning an actor before the hero (like a headpeace actor, which will spawn in front of the head of the actor).

The problem:
I want it so, that the buyable headpiece goes over the chestpiece (cause of a larger picture)
Problem is a part of the headpiece will dissapear UNDER the chestpiece, while i want it to OVERLAP the chestpiece.

I can't set the layer of the headpiece actor higher then the chestpiece actor because the 'buyable item actors' are not in the layers because they are not spawned yet.

Please help.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Not 100% i understand lol but you could try making a duplicate actor, our layer template (free) might help.

    http://www.deepblueapps.com/layer-selection-template/

    Darren.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You could also consider not using spawn. Make a layer for all your items and start them off screen. Then when they are purchased move them to the correct X/Y coordinates.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Hey DeepBlueApps, that's not exactly what I ment. Let me try to make the problem obvious:

    Check

    Before the chest piece layer gets spawned:
    http://img801.imageshack.us/img801/8572/7amp.png

    After the chest piece layer gets spawned (you will notice the headpiece misses the lower piece of it's image, if you compare it to the screen above:
    http://imageshack.us/photo/my-images/4/0ior.png/

    See the problem?
  • UtopianGamesUtopianGames Member Posts: 5,692
    edited August 2013
    Ahh I see, i would simply have some separate sprites and just swap them, full body one with no chest piece and full body with chest piece unless you plan do do a lot of items?

    Or you could have the chest piece include the red scarf so it doesn't look odd.

    Darren.
  • VolontaArtsVolontaArts Member Posts: 510
    or you can have a invisible actor. layered on top of what you want it to be. and have the invisible actor spawn the headpiece on top of it. i think that should work
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    @DeepBlueApps, I'm planning to have a lot of items (or already do have), so that won't work. Thanks tho.

    @Mpaula620 that would be an idea, but how can I make an actor invisible?
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    edited August 2013
    @Mpaula620 I might have an idea, a transparant pixel in photoshop as an actor would make an actor invisible. Only I still was hoping for a better option to set layers of the unspawned actors.. would make all a lot more easy.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    @jamie_c I missed your reaction, that actually does make sense! I think I'm gonna try that!
  • VolontaArtsVolontaArts Member Posts: 510
    yea i understand. but btw you dont have to make it transparent in photoshop. GamaSalad can do that. just edit the color/alpha of the actor that will spawn the other actor. good luck bud
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    But of course, I honestly new that haha. Thanks mate.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    One problem I have now, I want to change the positions of the actors (I putted all item-actors outside the screen, and want to change their positions in the screen if an item is bought). How do I change the positions without a movement?
  • -Timo--Timo- Member Posts: 2,313
    change self.position.x (and y) to where you want?
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Im feeling completely noob now, but I can't find 'change self.position' rule????
  • -Timo--Timo- Member Posts: 2,313
    edited August 2013
    haha :D the behavior is change attribute
    and then you change self.position :)
    self.position is an attribute
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Got it hahaha.. Thanks mate.
  • -Timo--Timo- Member Posts: 2,313
    glad I could help :)
    good luck!
Sign In or Register to comment.