As you may or may not know, I'm pretty bad at fastloops however I've been getting better recently. My latest problem has to do with an enemy's movement. Very simply, I want them to walk back and forth on different platforms and once they get to the end of it they turn around and go the other way.
But first, an illustration!
I've set up detectors that are set to the bottom LH and RH of each enemy and this part works because I can see them. My idea is if the LH detector isn't overlapping a backdrop then the enemy's MOVEDIR value is set 2 and he walks to the right. If the RH detector isn't overlapping a backdrop then the enemy's MOVEDIR is set to 1 and he walks to the left. But for whatever reason all that happens is my enemies walk along the platform and fall off, down and off the screen. NEVER TO RETURN!
I have spread values working always for each enemy object and for the detectors. I have the check set up sorta' like this:
Always -> Spread value 0 in val Z for Group.Enemy
Always -> Spread value 0 in val Z for LH detector
Always Start Loop "ENEMYWALK" (# of group.enemy objects times)
On Loop "ENEMYWALK"
+Group.Enemy Val "Z" = LoopIndex("ENEMYWALK")
+LH detector Val "Z" = LoopIndex("ENEMYWALK")
+LH detector is overlapping a backdrop (NEGATED)
+Group.Enemy is overlapping a backdrop
+Group.Enemy Val (MOVEDIR) = 1
-> Set Group.Enemy Val (MOVEDIR) to 2 -> Change Direction to Right
And then I do the same thing for MOVEDIR 2 and the RH detector which should move him left. What the heck am I doing wrong?
Edited by Del Duio
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
I can't post the source because it's about 60MB and all top-secrety.
I'm using detectors for every enemy because they'll all be moving around differently from each other and all be subject to different platforms and possible objects in their paths and everything. Isn't what you're supposed to do?
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Why not switch to static detectors? Put a "Turn around" detector on the ends of the platform. Set it so that only enemies that follow this behavior are affected by it.
Originally Posted by aphant Why not switch to static detectors? Put a "Turn around" detector on the ends of the platform. Set it so that only enemies that follow this behavior are affected by it.
This is what I ended up doing. I've used them in the past but I originally wanted a bit more diversity with the bad guys. So say maybe if he was pushed off a ledge he'd fall and be able to safety move around on the platform or whatever below him.
Any port in a storm, and it works now. Thanks guys!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!