Distance from Attribute using constrain to a specific location

kirklandkirkland Removed Posts: 268
edited November -1 in Working with GS (Mac)
hey guys.

This is different to what i have said in the past. what i am wanting to know is how can i constrain an actor to another using the

constrain attribute self.distancefrom to ( self.Position.X - game.HeroX )( self.Position.Y - game.HeroY )

how do i constrain an actor to an specific location using that code with actor i want to constrain. i have used minus and plus like tsirtbooth has said in his tutorials. any ideas guys please comment below
«1

Comments

  • kirklandkirkland Removed Posts: 268
    bump
  • kirklandkirkland Removed Posts: 268
    Hi, tshirtbooth

    it probably isn't hard to you, yes it is a little tricky for me but that is why i am asking. please can you tell me where to look in the demo then please. to sort this problem out. please
  • kirklandkirkland Removed Posts: 268
    may i add, i want to move the actor from where you constrained it to another location
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    are u kidding me
  • kirklandkirkland Removed Posts: 268
    what, i know how to constrain to a specific location normally like i said. this is just with a distance from attribute i don't know. i feel you are all picking on me. these forums are for questions like this. if you just help me then this will be over.

    please help me guys
  • kirklandkirkland Removed Posts: 268
    hi,

    i will tell you what, if you tell me how to do it and it is the right thing for me and i don't understand it then i will not comment on this thread again.

    is that a deal
  • kirklandkirkland Removed Posts: 268
    thank you for helping me again.

    which bit do you want me to look at tshirtbooth
  • kirklandkirkland Removed Posts: 268
    ok tshirtbooth

    i am looking at this template i am in the wall codes right now i am looking at them which bit in the bottom to codes should i be changing please.

    thank you again
  • kirklandkirkland Removed Posts: 268
    ok

    i have checked it out however i still do not know what i need to change. please can you give me some more hints. thank you again for this help
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    kirkland -- I am not sure what you are trying to do. But I imagine that the template that TSB made for you is probably substantially different than the template you are now looking at. It might be difficult to combine them.

    If you are trying to put a bar on top of a triangle. Just give the grey actor a triangle image. Then delete three of the walls (but leave the one on the top). Then give the top "wall" a bar image.

    Does that help?
  • kirklandkirkland Removed Posts: 268
    i will tell you what i will do i will show you a photo of what i have got
  • kirklandkirkland Removed Posts: 268
    HI RThurman

    there is a screenshot of what is going on

    http://imageshack.us/photo/my-images/715/unledkbv.png/

    please let me know how i can change the location of the blue bar with the codes in the text editor please. thank you
  • kirklandkirkland Removed Posts: 268
    bump
  • kirklandkirkland Removed Posts: 268
    bump
  • keweworkshopkeweworkshop Member Posts: 377
    I just had a million dollar idea. Pocket Tshirtbooth. You need to create a personal virtual tshirtbooth for gs users to download, just like Siri!

    You're welcome... and I'll be expecting my check in the mail ;)
  • kirklandkirkland Removed Posts: 268
    ok please can you stick to topic
  • keweworkshopkeweworkshop Member Posts: 377
    sorry, :(
  • kirklandkirkland Removed Posts: 268
    tshirtbooth please can you give me a hint on where to change the code in my photo please.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    kirkland if you bump this thread again with just a bump or please help im gonna close it. Tshirt knows its here, if he wants to help again he will. By no means am i trying to pick on you buts its getting out of hand again.
  • kirklandkirkland Removed Posts: 268
    i am sorry. please do not class this as a bump though
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    kirkland said:
    HI RThurman

    there is a screenshot of what is going on

    http://imageshack.us/photo/my-images/715/unledkbv.png/

    please let me know how i can change the location of the blue bar with the codes in the text editor please. thank you

    Sorry kirkland, I've been trying to get my template to do what you want, but the template only works for walls that start at the zero direction. The math for a wall (or bar) at an angle escapes me at the moment.

    I will remind you that I gave you a perfectly workable solution to your needs several weeks ago. I repeat -- if you have an object that is permanently welded to another, then it should just be made as one object in the first place. (Just make the triangle and bar as one actor.)
  • kirklandkirkland Removed Posts: 268
    no this will not work because the ball will not roll down it accurately. the bar is only there to make it roll down it accuratly
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    tshirtbooth said:
    RThurman, he wants to make a triangle. then constrain 3 bars around it so its now a calidable triangle. then he wants to be able to move it and rotate it at will.

    cheers

    Ah yes! I remember that. He wants revolute joints.

    Hopefully in just a few more weeks GameSalad will have joints. However, I fear that the way GameSalad implement joints will interfere with physics. (Just like constrains interfere with physics.)

    That, by the way, is part of the problem I am currently having when making joints in GameSalad. The joints I currently make are not compatible with the physics engine. They fight each other.
  • kirklandkirkland Removed Posts: 268
    ok, does anybody else know how to do the maths such as JohnPapiomitis
    and tshirtbooth.

    and i know that tshirtbooth knows JohnPapiomitis. please can you help i am not that great at maths guys
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    kirkland said:
    no this will not work because the ball will not roll down it accurately. the bar is only there to make it roll down it accuratly

    The ball will roll down the side of any square actor as accurately (or as inaccurately) as you make it. If you make the actor like I said, its just a straight side of an actor.

    You already did this. I recall that the ball bounced kind of funny, but that was because you still needed to work on the physics (density and restitution).
  • kirklandkirkland Removed Posts: 268
    yh no i mean there would be a gap in the middle from the actor to the ball.

    i am wanting to do different shapes as well that is why i need have code that works
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    if you mean that the ball would collide with the ramp before actually touching it, that means you had transparency around your ball image and/or it wasnt set to a circular collision shape.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    kirkland said:
    yh no i mean there would be a gap in the middle from the actor to the ball.

    i am wanting to do different shapes as well that is why i need have code that works

    Any "gaps" were likely due to having a graphic with too much transparent background in it. Or due to too much bounce. Or perhaps some other things. But I can guarantee that a ball rolls down the side of an actor just as accurately (or inaccurately) as you make it. There will be no advantage to having a straight bar actor constrained to the straight edge of another actor.
  • kirklandkirkland Removed Posts: 268
    would this work with an hexagon. i am not sure what you are meaning rthurman
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    your ball actor, is the image for the circle croped all the way to the edge of the circle image AND has a circular collisoion shape set?
Sign In or Register to comment.