Grrrrr. Where is the "SnapTo" attribute? More Joystick tutorial confusion

design219design219 Member Posts: 2,273
edited November -1 in Working with GS (Mac)
I've been fighting all day with the joystick demo with no luck. I was copying from the template, but can't get it to work. And yes, I made sure all the "otherwise" were set.

I'm starting again by manually putting in everything in the tutorial, but I can't fine when I get to the change attribute "self.SnapTo" I'm not finding that attribute anywhere.

Am I just missing something obvious?

Thanks.

_______________

Nesen Probe http://itunes.apple.com/us/app/nesen-probe/id377766693?mt=8
Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    That means its inside the actor... Soooo look inside the actor that has Self.SnapTo on the left side where physics is and look under attributes and thats where it is...
  • design219design219 Member Posts: 2,273
    Yeah, I know "self" mean in the actor, but it's just not there. At all. I'm in .8.9.
  • RHRH Member Posts: 1,079
    It was made by CodeMonkey on the actor. You have to add it yourself.

    By the way, make sure to check EVERYTHING in that demo, it's such a pain to copy, as i found out the other day. Watch out for the otherwise sections of rules as well, they always get me :)
  • design219design219 Member Posts: 2,273
    That is a custom attribute? I wish it had said that in the tutorial. It lists 5 attributers you need to make.

    Thanks guys.
  • StusAppsStusApps Member, PRO Posts: 1,352
    Yeah, it's a boolean attribute inside the 'stick' actor. Don't also forget the 'WhichTouch' as well inside the same actor.
  • design219design219 Member Posts: 2,273
    "WhichTouch"?

    So, it seem this tutorial is a bit incomplete? I didn't think I needed any of the multi touch parts in the template. I just need a single stick control to move my actor.

    Thanks.
  • design219design219 Member Posts: 2,273
    So, the joystick tutorial as written is not all I need to make this work? I can't even get the stick to move.

    Do I need the multi-touch parts in the files for a single stick?
  • RHRH Member Posts: 1,079
    If the joystick is the only thing that the player can interact with, then no you won't need the multi touch parts. If you plan on having other buttons, such as jump or shoot, then yes you will need the multi touch part.

    I didn't even know that there was a tutorial, I just learn it from the file, doubt i'd use a tutorial anyway as it would seem like I'm just copying a list and not really learning.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Yeah I was going to say just download the project and figure out how it works... That way you'll know everything about it :D
  • StusAppsStusApps Member, PRO Posts: 1,352
    I picked it apart from the demo project. There are some things that can be changed, like changing the players rotation attribute to the game.angle once the stick1grabbed becomes false. This will stop the player auto-rotating back to the right when you take your thumb off.

    The multitouch points just have to be dragged into the scene if you want to then add things like fire buttons.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hi Stus: that was awesome, Incredible, you made the joystick an easy thing for me with that comment... Now can you elaborate in the rotational thing. I want it to keep facing the direction it was traveling to.
  • StusAppsStusApps Member, PRO Posts: 1,352
    LordTarantor said:
    Hi Stus: that was awesome, Incredible, you made the joystick an easy thing for me with that comment... Now can you elaborate in the rotational thing. I want it to keep facing the direction it was traveling to.

    Sure.

    Your movable actor should already have a rule telling it that when game.StickGrabbed1=true to **constrain** to game.Angle.

    You should add another to say that when game.StickGrabbed1=false to **change** to game.Angle.

    So, it constrains when the stick is being moved. When it is let go of it quickly changes to the last angle and stays there. You may need to set a very tiny delay (0.05 secs) between letting go of the stick and it turning StickGrabbed1 to false.

    Hope that makes sense.
  • StusAppsStusApps Member, PRO Posts: 1,352
    I also found it useful to use the DistancefromCenter for some rules as it tells you for sure that the stick is being moved.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Stus... another hit on the target.
    Sorry to take advantage of the situation but let me see if you can answer my questions about this. First it will be great if you can elaborate in the distancefromcenter thing that you mentioned (I just made the joystick work thanks to you and I will love to take full advantage of it by knowing as much as possible).
    My main question is: Let say that I want my moving actor to face either to the right or left, never up or down. If it move up,down it will continue be facing the last right or left direction. Obviously if it move in a diagonal direction it has to face the right or left depending on the direction.
Sign In or Register to comment.