Spawning edges work with vertical elevators but not on horizontal? Pictures included for better help

2»

Comments

  • KIIVIINKIIVIIN Member Posts: 159

    @Lost_Oasis_Games said:
    Are you using real attributes to store the values?

    Yes I do, is that wrong?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Nope that is right becuase if you used integers they don't hold decimals and that would cause the pixel offset. As movement happens over hundredths of a pixel and you need those positions. So that is correct. Make sure you actors that make the edges spawn above the platform as code fires in the layers from bottom to top. So you want the position of the platform to update before the sides get that info. Try that.

  • KIIVIINKIIVIIN Member Posts: 159

    @Lost_Oasis_Games said:
    Nope that is right becuase if you used integers they don't hold decimals and that would cause the pixel offset. As movement happens over hundredths of a pixel and you need those positions. So that is correct. Make sure you actors that make the edges spawn above the platform as code fires in the layers from bottom to top. So you want the position of the platform to update before the sides get that info. Try that.

    I think I already got it in the right order?
    Check pic please :)

  • KIIVIINKIIVIIN Member Posts: 159

    if you mean that the Vertical platform should be below the Edge actor in the actor list then I already tried that. Still same issue!

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Show me the code in your edge actor.

  • KIIVIINKIIVIIN Member Posts: 159

    One more issue is that my player "bounces" on the platform while its moving down.
    I dont know why.

    Here is pictures of the code :

    This is how it looks when my hero "bounces" when the platform is on the way down.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Do you have any bounce set on those actors? Increase the density of your player actor.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Does this happen when the platform is not moving? In other words, if the platform is still, do the edges not line up?

    What behavior are you using to move the platforms (Move, Accelerate, Constrain Attribute, etc.)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @Lost_Oasis_Games said:
    Do you have any bounce set on those actors? Increase the density of your player actor.

    Bounce is set to 0 on both player and platform as in the tutorial & density to 100. In the tutorial it works fine but not for me ;/.

    @tatiang said:
    Does this happen when the platform is not moving? In other words, if the platform is still, do the edges not line up?

    What behavior are you using to move the platforms (Move, Accelerate, Constrain Attribute, etc.)?

    If I have the platform still the edges are on place. The movement is set as in the platform tutorial. Check picture,

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    My guess is that Interpolate and Constrain are working at different speeds. I know that's not very helpful but it does point to the cause. I wonder if the same thing would happen if you moved the platform using a Move/Move To behavior or a Change Attribute self.Position.Y behavior wrapped in a timer.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:
    My guess is that Interpolate and Constrain are working at different speeds. I know that's not very helpful but it does point to the cause. I wonder if the same thing would happen if you moved the platform using a Move/Move To behavior or a Change Attribute self.Position.Y behavior wrapped in a timer.

    I tried that but the elevator wont move.
    How should I write my exicting code?

    I removed the intepolate and added the
    timer for "self.myspeed"
    change attribute self position.y to self.MyMin

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    If you use a Timer, you'd need to change attribute self.Position.Y to self.Position.Y+10 or some other small number. But if you want it to stop at a specific point, you'd probably want to use Move To instead.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:
    If you use a Timer, you'd need to change attribute self.Position.Y to self.Position.Y+10 or some other small number. But if you want it to stop at a specific point, you'd probably want to use Move To instead.

    wont work man, Im getting crazy about this dammit haha

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2016

    No, it won't work. You have a rule that says if the Y position is greater than or equal to MyMax move to MyMin and when the Y position is less than or equal to MyMax move to MyMax. But if that actor is at or above MyMax and starts to move down, as soon as that actor crosses the point where MyMax is, the "Move Up" rule triggers and the actor moves up again.

    I think you meant to have ≤ self.MyMin as the rule condition in the "Move Up" rule. And maybe relative to scene instead of relative to actor? I'm not sure how you intend for it to work but the lower and upper bounds either need to be positive and negative relative to the actor or they need to be set positions relative to the scene.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:
    No, it won't work. You have a rule that says if the Y position is greater than or equal to MyMax move to MyMin and when the Y position is less than or equal to MyMax move to MyMax. But if that actor is at or above MyMax and starts to move down, as soon as that actor crosses the point where MyMax is, the "Move Up" rule triggers and the actor moves up again.

    I think you meant to have ≤ self.MyMin as the rule condition in the "Move Up" rule. And maybe relative to scene instead of relative to actor? I'm not sure how you intend for it to work but the lower and upper bounds either need to be positive and negative relative to the actor or they need to be set positions relative to the scene.

    I got 2 self attributes on the vElevator.

    MyMax & MyMin.

    If i set the rules ------------------

    Rule
    if attribute self.position.y >= self.MyMax

    DO
    Move to
    self.MyMin relative to scene.

    &

    Rule
    if attribute self.position.y <= self.MyMin
    Move to
    self.MyMax relative to scene.

    it should work right?

    Lets say the value of MyMin is 10 and MyMax is 1000
    Then the actor should move between y10 to y1000?

    Check the picture, It should be correct now.. Or Am I damn lost in space?
    Getting pritty enoying now with this elevator thing, frustrating little issue that prolly is more simple...

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    That looks correct. Does it work?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:
    That looks correct. Does it work?

    No its not working this way :(

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:
    That looks correct. Does it work?

    I even made this kind of elevator but then the issue is that when my player stands on the elevator he + the elevator fall down towards the bottom of the screen.

  • KIIVIINKIIVIIN Member Posts: 159
    edited January 2016

    :(

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I wish platforms were my specialty but I'm just making guesses here. Someone like @jamie_c might have an idea.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @jamie_c - What is your input of this issue? I used 2 different tutorials as source and it wont work :/

  • KIIVIINKIIVIIN Member Posts: 159
    edited January 2016

    Okey, I managed to get the elevator + edges move correctly up and down between 2 points... Issue now is that when my player jump on top of the elevator it falls down towards the bottom of the screen. I got the "movable" attribute checked else the elevator is stuck. What to do?

    Players Density is 100. But that does not change the fact that the elevator falls when he is jumping ontop of it.
    @tatiang @jamie_c

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2016

    Okey, I managed to get the elevator + edges move correctly up and down between 2 points.

    Hooray! So no more misaligned edges? That's great. On to bigger problems... ;)

    Have you tried adjusting the density on the elevator/platform actor?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang said:

    Okey, I managed to get the elevator + edges move correctly up and down between 2 points.

    Hooray! So no more misaligned edges? That's great. On to bigger problems... ;)

    Have you tried adjusting the density on the elevator/platform actor?

    I added 999999 density to the platform and now it works!!!
    Edges is correct, the platform works up and down and the player stays on it.

    OMFG finally HAHA! Thank you for being patient with this issue!!!!

  • KIIVIINKIIVIIN Member Posts: 159

    @tatiang This releef is damn better than drugs man! hahaha woaw Im glad now

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Lol! You're welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    You should watch my physics series. It covers the basics like density and friction and such. Good stuff to know.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @KIIVIIN, sorry. I wasn't online last night to see your request, glad you got it worked out though! :)

Sign In or Register to comment.