Changing height only from top

networnetwor Member Posts: 89
edited November -1 in Working with GS (Mac)
Hi, I've got problem with interpolating height of actor.
So, I have a rule:
If actor "block01" collide with actor "block02" than interpolate self.height to 0...
It works but it interpolate height to the centre of actor... I need to change the size only from top...
I want effect like "forced back into ground"....
I saw a tutorial from Tshirtbooth when he making health bar he fix this, but my actors are moving, so I can't constrain Y position...Is there any way how to do this?
Thanks

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi, this came up 24 hours ago; the following will help, adjusting x for y, etc:

    http://gamesalad.com/forums/topic.php?id=23963

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

  • networnetwor Member Posts: 89
    Thanks, but my actor don't have permanent position. So, how can I get Y position? Have I to constrain Y position to some attribute and then use it?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Yup, that should work.

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

  • networnetwor Member Posts: 89
    I tried this:

    constrain attribute self.Position.Y to self.y
    Interpolate self.Size.Height to 0
    Interpolate self.Position.Y to self.y

    I think, I don't understand properly, how this work... Can you help me please?
    Thanks again.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You just need to move the y position down half the distance of the height you are Reducing.

    So lets say you have an actor 100Px tall and you are going to shrink him to 50 to make it look like its only shrinking from the top you will interpolate the height to 50 and interpolate the y to (self.position.y-25)

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

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    tenrdrmer said:
    You just need to move the y position down half the distance of the height you are Reducing.

    So lets say you have an actor 100Px tall and you are going to shrink him to 50 to make it look like its only shrinking from the top you will interpolate the height to 50 and interpolate the y to (self.position.y-25)

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

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes

    That doesn't work; try it!

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

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Tendrmers way does it work, its just that you cant interpolate to + or - a because the interpolation constantly triggers and that effects the expression

    What you need to do is make a atribute called interpolatevalue (or whatever you want to call it)

    In the actor have this:

    change attribute interpolatevalue to self.position.y-25

    interpolate self.size.height to 50

    and interpolate self position y to interpolatevalue

    And the duration in both interpolate behaviors have to be the same.
    Try it out it works

    Hope it helps
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    JohnPapiomitis said:
    Tendrmers way does it work, its just that you cant interpolate to + or - a because the interpolation constantly triggers and that effects the expression

    Hi John, exactly what I meant; didn't you mean: "Tendrmers way doesn't work because you cant interpolate to + or - a because the interpolation constantly triggers and that effects the expression" ;-)

    My way works as well; more than one way to skin a cat.

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

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    gyroscope said:
    That doesn't work; try it!

    I'm not sure what your deal is on being hell bent on trying to prove me wrong on something man.

    I have a template that works perfectly using that method. I just checked it again. Apparently you can no longer use it that way but you sure as hell used to be able to. No one came in here saying your way didn't work. The guy posted that he still couldn't get it after several hours of your help. So I offered him another way.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    tenrdrmer said:
    I'm not sure what your deal is on being hell bent on trying to prove me wrong on something man.

    I have a template that works perfectly using that method. I just checked it again. Apparently you can no longer use it that way but you sure as hell used to be able to. No one came in here saying your way didn't work. The guy posted that he still couldn't get it after several hours of your help. So I offered him another way.

    Hey tenrdrmer, calm down, man! I wasn't having a go at you personally, I guarantee; I apologise for upsetting you. As well, I was being a bit too sensitive, because without reading the words: "this way works as well", I got a bit shirty (UK expression); and I did think: "I don't know why I bother trying to help sometimes". Silly of me. I'm far from perfect (still learning GS as we all are); correcting wht Jon said about your solution wasn't having a go at you, it was my attempt to let you know that I couldn't get it to work that way, in what I thought was a light-hearted way; really. I should have put: Unfortunately, I couldn't get that to work your way". I do try to be polite in the main! So, sorry again.

    Hey, let me buy you a pint. Friends?

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

Sign In or Register to comment.