Update Spawn Location

2

Comments

  • ChessPawnChessPawn Member Posts: 127
    BUMP!
  • JPickardJPickard Member Posts: 477
    Well, dude. After I finish these freelance jobs tomorrow I think we should try to work on it together to figure it out.
  • ChessPawnChessPawn Member Posts: 127
    Dude, that's the best idea I've heard so far!
  • JPickardJPickard Member Posts: 477
    I just bought Photics Unofficial GameSalad textbook, so hopefully that will help us.

    I'll put aside some time saturday afternoon to try to fathom it.
  • ChessPawnChessPawn Member Posts: 127
    JPickard, if you solve this mystery, I will so put you in the credits of my game! You'll be my hero. Tomorrow, I will be following this thread while studying for my exam. :P
  • JPickardJPickard Member Posts: 477
    That's what community is for. :)
  • ChessPawnChessPawn Member Posts: 127
    True said.
  • ORBZORBZ Member Posts: 1,304
    Hi,

    Yes, I am on the forums a lot less lately. I found your thread via JPickard's comment on my "issues with 0.9.5" post. Anyhow, the solution you seek is thus:

    Two parts:

    Part 1: You want the actor himself to be able to launch himself. That's easy enough, instead of spawning a blue ball, just spawn an actor that looks like the stationary actor, when it comes to a full stop then switch back to the "laucher" version of the actor. In this way you have two actors, that to the player, look like one actor. One version is the stationary "launcher" version and the other is the in-flight flying actor.

    To detect a full stop constrain speed = magnitude(linearVelX, linearVelY)
    rule when speed < 100 .... spawn launcher, destroy self

    The second part of your question: How do you set up the trajectory arc from anywhere on the field instead of the bottom left corner is a bit more complex. That demo I made takes some assumptions, the most important of which is that the launcher is in the bottom left corner. At this point it's to complicated to explain how to set up the trajectory arc from a different location and I encourage you to talk to your math teacher about it. It should be a fun exercise for the both of you. It is very possible to do (I've done it before, but the code isn't mine and I can't post it) You should have fun learning how the math works and you'll be able to be more creative in your designs once you understand what the code is doing.

    I rigged up the trajectory arc demo after reading this:

    http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
  • ChessPawnChessPawn Member Posts: 127
    Hey ORBZ. Thanks for coming to this thread and visiting my problem. So thanks for the full stop thing that was very helpful and yes, I will probably end up asking my math teacher. This is a 1 part problem though, because I only want the trajectory arc to come from the actor that is moving across the field. So I guess I would change the fire blue ball to moving the gun itself, and then that is where the trajectory field comes from… the exact same actor, just on a different coordinate. Is there anyway to get the arc to start specifically from the character using it as a variable of some sort? Also, brain fart here, I know I've done it before, but how do I get the character to move along the path?
  • JPickardJPickard Member Posts: 477
    I am so glad ORBZ pitched in. Because that math is so far beyond me it's ridiculous.
  • ChessPawnChessPawn Member Posts: 127
    I feel the same way, but I'm still confused. By the way, how is Photics' GameSalad textbook coming along?
  • JPickardJPickard Member Posts: 477
    I haven't had much time to look through it yet. But it most probably doesn't go into the kinda detail that orbz was talking about.
  • ChessPawnChessPawn Member Posts: 127
    Who knows??? You're probably right.
  • JPickardJPickard Member Posts: 477
    Is it possible to separate just this issue into it's own project file and share it with me and the community looking to help?
  • ChessPawnChessPawn Member Posts: 127
    If I understand you correctly, you want to see like how the dots are spawning and stuff?? I am basing my game off this template so just search trajectory in the GameSalad Creator, double click it and press preview. You can see how the dots spawn and move accordingly with the mouse. Now go back into the editor, and move the gun (rectangle) somewhere in the middle of the screen, doesn't really matter where, just away from the (0,0) corner. Now press Preview. You should see my issue right away!
  • JPickardJPickard Member Posts: 477
    ah, ok.
  • ChessPawnChessPawn Member Posts: 127
    I knew somebody would soon understand!
  • ChessPawnChessPawn Member Posts: 127
    The math in this trajectory article is really complicated. I understand the different ratios like sin cos and tan, but not when it's all put together.
  • JPickardJPickard Member Posts: 477
    Well. I fiddled a bit with the demo. Moving the Cannon like you said, so now I know exactly what you need. And then Game Salad crashed. Naturally.

    Beyond the math, I'm wondering if the math is already done, can you just constrain the cannon to the last trajectory ball, or something? I'll mess around with it a bit more in the morning.
  • ChessPawnChessPawn Member Posts: 127
    Cool. Thanks again for all your help JPickard!
  • ChessPawnChessPawn Member Posts: 127
    I made it stick to the center of the actor on the X axis, but then it was all demented while moving up and down. And obviously, so close to a breakthrough, GameSalad crashed on me. :(
  • JPickardJPickard Member Posts: 477
    Thrilled you made progress, though! You DID save early and often, right? RIGHT??? ;)
  • ChessPawnChessPawn Member Posts: 127
    OF COURSE (I knew I should have saved, but I didn't)

    How's your messing around coming along?
  • ChessPawnChessPawn Member Posts: 127
    Oh man, my brain hurts just thinking about this!
  • JPickardJPickard Member Posts: 477
    I'm trying to be too clever for my own good. I'm trying to just replace the projectile actor with the gun actor (or a duplicate of it) and then destroy the original gun actor. It might work. As a work around.

    edit: It beats doing math. ;)
  • ChessPawnChessPawn Member Posts: 127
    I am interested in seeing a screenie of this!
  • JPickardJPickard Member Posts: 477
    I didn't say it worked. :)

    But actually, I still have to put in a few actual actor images instead of just color squares to test it.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    dont wanna sound rude, but its just you 2 talkign back and forth, you guys can email each other now

    the forum isnt a personal messageboard
  • JPickardJPickard Member Posts: 477
    Well, I still think we're gonna need help from the community. And no one HAS to click the thread link if they don't want to.
  • ChessPawnChessPawn Member Posts: 127
    JohnPapiomitis said:
    dont wanna sound rude, but its just you 2 talkign back and forth, you guys can email each other now

    the forum isnt a personal messageboard

    I guess I'm keeping this thread alive in the hopes that one of the Chefs will come along one day and help me to start making my first game!
Sign In or Register to comment.