Inconsistent "Move To" behavior!?
rebump
Member Posts: 1,058
[CodeMonkey where are you? ;-) ]
You would think that you could throw in a sequence of "move to" behaviors for an actor and have the actor follow the path(s) in sequence as long as each "move to" was conditionally ran by a conditional based on a counter (i.e. say a shape "side" counter from 1 to some number where each step coincided with one of the sides of the shape - thusly a rectangle would have for steps/rules for the counter values 1 to 4).
I try this with a rectangle (and an arbitrary starting point on one side of the rectangle but that shouldn't matter as long as I start with the correct "side" counter starting value) and the rectangle is traversed by the actor but it doesn't repeat even when setting the "side" counter back to the value for "side" 1. Timers don't make sense for this and I don't want to setup multiple invisible wall actors.
I also try a simple horizontal back-and-forth motion actor with "move tos" and a toggle value for direction. This time it seems to repeat but doesn't travel the full distance of the intended motion. It just shakes almost in place and will sometimes move one way once. I don't want to use two invisible wall actors to bounce off of at the end points.
Finally, I take the back-and-forth actor and add a timer and it works but again a timer really doesn't make sense in this case.
It seems as if the "move to" behavior is inconsistent/buggy.
I haven't tried just a "move" but I didn't really want to setup a bunch of conditionals that are a bit more involved than testing for a "side" counter (in the case of the rectangle moving actor).
A demo project is here: http://gamesalad.com/game/play/33793
You would think that you could throw in a sequence of "move to" behaviors for an actor and have the actor follow the path(s) in sequence as long as each "move to" was conditionally ran by a conditional based on a counter (i.e. say a shape "side" counter from 1 to some number where each step coincided with one of the sides of the shape - thusly a rectangle would have for steps/rules for the counter values 1 to 4).
I try this with a rectangle (and an arbitrary starting point on one side of the rectangle but that shouldn't matter as long as I start with the correct "side" counter starting value) and the rectangle is traversed by the actor but it doesn't repeat even when setting the "side" counter back to the value for "side" 1. Timers don't make sense for this and I don't want to setup multiple invisible wall actors.
I also try a simple horizontal back-and-forth motion actor with "move tos" and a toggle value for direction. This time it seems to repeat but doesn't travel the full distance of the intended motion. It just shakes almost in place and will sometimes move one way once. I don't want to use two invisible wall actors to bounce off of at the end points.
Finally, I take the back-and-forth actor and add a timer and it works but again a timer really doesn't make sense in this case.
It seems as if the "move to" behavior is inconsistent/buggy.
I haven't tried just a "move" but I didn't really want to setup a bunch of conditionals that are a bit more involved than testing for a "side" counter (in the case of the rectangle moving actor).
A demo project is here: http://gamesalad.com/game/play/33793
Comments
For instance, I have a spellbook button & when you touch it a menu slides from off screen into place where it needs to be. When there was multiple things moving, sometimes it would never stop where it was supposed to. This only happens when the game starts lagging.
I'm not doing anything fancy in that demo project link in my first post in this thread...especially the horizontal back-and-forth actors.
When game.SpellPage = 1
Timer: After 1 sec
Move To X, Y
Speed 500
Otherwise
Move To X, Y
Like I said, mine works perfect. Only the lag messes with it.
I just want an actor to move in a rectangular path repeatedly and without a ton of wall actors to constrain it or a bunch of conditional logic to test for surpassing an X or Y bound of the rectangle (why? those methods seem like they would eat up more resources and impede performance).
rule
when overlaps with turnobject
change velocity (put new direction)
so it moves in a straight line (set the initial velocity) until it hits the object and then it turns. Then keep doing this (with separate turn actors - 4 for a rectangular movement)
For pacing back and forth I found this method to work the best too. Instead of change velocity i do a change attribute (linearmotionX to -linearmotionX)
rule
when overlaps with turnobject
change velocity (put new direction)
so it moves in a straight line (set the initial velocity) until it hits the object and then it turns. Then keep doing this (with separate turn actors - 4 for a rectangular movement)
For pacing back and forth I found this method to work the best too. Instead of change velocity i do a change attribute (linearmotionX to -linearmotionX)
One is called Move Left, Move Right, Move Up, & Move Down.
In your moving actor just put when collides with:
Move Left change velocity to 180.
Move Right change velocity to 0.
Move Up change velocity to 90
Move Down change velocity to 270.
Easy & takes up very little resources.
Mainly wanting CodeMonkey to say one of three things:
1) "move to" is not to be used how you intended
2) this is how you do it using "move to" sequences (hurray!)
3) it is a known bug and we are working on it
I really hope I am either doing it wrong or it is a known bug that they are working on. I really don't want to get four (or eight? could probably hack with four) actors per each rectangularly moving actor. I was wanting to replicate this movement scheme to five, six, seven, and eight sided paths for various levels and what not and may be able to come up with some parameterized actor that could handle them all.
This is a deal breaker on a couple of games I have in mind and the platform side-scroller is a bit in the air too as I cannot get near enough to quality Mario-esque player movement no matter how much I fiddle (but I only spent several hours on it).
I really want GameSalad to fly and use it as a paying member but I don't want to delve in if things are still a bit too flakey (lots of projects on the site blow up randomly in different ways...don't know if it is the underlying projects and/or the viewer). I think it is a great product but just needs some tuning. It seems a bit of luck on project selection and just luck-of-the-draw on whether your app will be stable enough but then again, I have only been playing with it a few days. I may just have to change my project decisions to fall inline with what is currently stable and working.
Still would like CodeMonkey's feedback on all this though since it seems things are a bit amiss and/or I'm missing out on something.
We'll try to pinpoint the cause and eliminate it.
If you look at that demo project (that works in the Preview but it seems to die alot of the time in the web viewer), the number displayed on the two gray moving rectangles is the "side" counter variable. It doesn't seem to update no matter what "side" it is on. It should go from 1 to 2 to 3 to 4 back to 1. Another odd thing is for side 4, I have the "side" counter variable set back to 1 but sometimes it reverts, in the behavior dialogue, back to 0!? So if you see 0 in there, it was not from me. Almost as if your behavior storage structure is somehow getting compromised. Lots of weird things. I even tried a fresh project with simpler versions of the same actors and the same results.
If you need people to upload the developers example projects to show the problems, please let us know.