Spawning "constrained" yet moving actors (how to?)

RPRP Member Posts: 1,990
edited March 2012 in Working with GS (Mac)
Alright, not sure if I am running into a limitation here. I have played with the constrain attributes a while back for making actors move up/down left/right circle etc, but since they are being "constrained", placing a move function is a no-go. What other method could I use to say, spawn an actor and have them travel in a given direction along with a specific movement live a bobbing or circular motion? Seems that GS has to collect that position and without a X or Y constrain how is it going to be able to know what the limitations of travel are? Is there a way to tell it to move 20 pix up and down with a move behavior so I could have these fellows spawn or be manually placed randomly?

I will dream about this in my sleep tonight now doubt.

Comments

  • bloomerbloomer Member Posts: 53
    The trig functions can get an actor bobbing up and down in a nice wave motion as they also travel in a general direction across the screen. The other day I managed to dig up how-to links for this from this forum leading to an old version of the gamesalad cookbook in the internet archive(!). I was unable to find that link again today, so I'm gonna just paste what I found there into this topic. Apologies for the big posts to follow.

    To make the following techniques flexible enough that they work for multiple directions of core movement would take some more programming, but hopefully it gives you a direction. Even if you don't use trig, the basic idea is that if you use constrains to control movement, you have to feed the entire formula for movement into those constrains, figuring in the variables that create waggling, etc. Alternately, use a second constrain which takes the core constrain and modifies it with wave or waggling motions.

    The trouble with using wave motion and constrains AND multi-directional movement is that if your character suddenly turns a corner, it will probably 'teleport' at the moment it does. Unless you limit corner-turning to moments when the trig functions are returning a 0 (ie not modifying movement)... Hey, I just programmed my own solution to a problem I've been thinking about out aloud!

    Anyway, trig stuff coming up.
  • bloomerbloomer Member Posts: 53
    Okay, I found the link again in others' posts, so I don't need to paste the whole thing.

    Go here: http://web.archive.org/web/20101201124532/http://gamesalad.com/wiki/interface_reference:expression_editor

    Look under sin and cos and you'll find examples with graphics and even maybe demos.

  • CloudsClouds Member Posts: 1,599
    edited March 2012
    Alright, not sure if I am running into a limitation here. I have played with the constrain attributes a while back for making actors move up/down left/right circle etc, but since they are being "constrained", placing a move function is a no-go.
    Works fine for me ?


    You could have a constrain to move your actor up and down and a 'move' to move it left to right, is that the kind of thing you are after ?
  • RPRP Member Posts: 1,990
    @bloomer Had been playing with the sin as cos this evening, no worky thus far. I'll have to check the suggestions /linkyou have in the morning. Even in the demos I have seen, the actors are locked in place since they need an x or y start/reference point. So when you tell an actor to spawn, it will only spawn the actor in that location and the move behavior does not function. In my case I want the actors to spawn off screen (left or right) and move onto the scene and out again while sporting a bobbing motion.

    @Tynan yup, Just like that. Seems simple enough but I'm overlooking something :-??
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    @RP
    @Tynan yup, Just like that. Seems simple enough but I'm overlooking something :-??
    Maybe I'm misunderstanding your question ?


    Here is a actor moving left to right with:
    Move - Direction 0° - Speed 200

    And moving Up and Down with:
    Constrain Y to 50*cos( self.Time *400)+384


    (I've stuck a 'trail' on the actor so you can see the path the above rules make it follow).

    image
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    . . . when you tell an actor to spawn, it will only [place] the [spawned] actor in that location and the move behavior does not function. In my case I want the actors to spawn off screen (left or right) and move onto the scene and out again while sporting a bobbing motion.
    Doesn't seem that complex ? Like I say above I might be misunderstanding your issue, but from what I can see you want actor A to spawn actor B (offscreen) - and then actor B needs to wobble up and down - at the same time wobble into the scene and then wobble back out !?


    You can do that with a couple of constraints on actor B (one for X, one for Y)
    And then simply get actor A to spawn actor B . . . . . ?


    Let me chuck something together . . .

  • CloudsClouds Member Posts: 1,599
    Here you go:


    Rule on actor A (the one that spawns actor B)

    image



    Rule on actor B (the one that wobbles into the scene)

    image


    Result:

    image
  • RPRP Member Posts: 1,990
    @bloomer & @Tynan
    Aaaaah! I see what I did wrong now. I had the order inside the constrain in the wrong format.
    Sorry if I was not clear, looooong day and my brain was sizzling.

    @Tynan Yup, just like that!

    Big thanks to both of you!
    =D>
  • RPRP Member Posts: 1,990
    edited March 2012
    Ummmm.... What happened to @Tynan there?
    I just came back to resource what he had put into this discussion and now Tynan has disappeared? Strange things are afoot at the Circle K.

    Ughhh...and I was just getting back to work on this part too.....

    *Edit. Alright I got it via cache, so all is good.

  • MotherHooseMotherHoose Member Posts: 2,456
    for … @Tynan …status: click that purple highlight …

    sad day for us all :(( …
    and why were all those wonderful posts and demoLinks removed form our members' Forum?

    image MH
  • RPRP Member Posts: 1,990
    Yeah I saw that too @MotherHoose I was like Whaaaaa????? Um....Alright. I'm not sure how this came to be, but whatever the reason I'll just say @Tynan was always very helpful. I'm bummed to see this as well.
Sign In or Register to comment.