Enemy doesn't begin to move until after first player death.

Discussion and feedback on Construct 2

Post » Sun Jun 22, 2014 8:25 pm

Could somebody please explain to me why the following tidbit isn't working?

tidbit isn't working (the actual part is at the lower end, but I thought posting the whole might be easier to debug)

Image
Image

Essentially, I want the enemy sprite to constantly move from to the lower position at Y=470 to the higher one at Y=232 and back again.
This part however, only fires after the first player death and only in the first direction (470 to 232).
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Sun Jun 22, 2014 8:28 pm

Look at the pathfinding demo again, & read the manual. You can't call 'Move along path', until 'On pathfinding path found' is triggered.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Mon Jun 23, 2014 1:34 pm

Thanks. That helped. Now I just need to find a way to control the behaviour. Above script doesn't really work the way I imagined it.

EDIT: Sorry for being so "nonchalant", btw. The game is an entry for a contest that is going to end soon, so I'm in a bit of a rush.

EDIT2: Above question is still valid, but I'm using waypoints now. Which bears another question. Is there any way to set the UID inside both, condition and action? Say if enemy sprite is at Waypoint UID 97 and should thus move to Waypoint UID 98. Is this possible somehow?
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Mon Jun 23, 2014 2:32 pm

You can always 'Pick by UID' - you may need to 'Pick all' first to reset the pick-set.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Mon Jun 23, 2014 3:39 pm

Is that available for actions too? I usually pick that one, but only for conditions.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Mon Jun 23, 2014 3:55 pm

No, you add a subevent to do your Picks.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Mon Jun 23, 2014 4:16 pm

Could you give me a quick example? I can't quite seem to wrap my head around this.
Having the sprite move from down to up and up to down couldn't possibly be that difficult, could it?

EDIT:
Image

Shouldn't this work? What am I missing? I also tried a stop action on arrival/after traversal of the path. To no avail. It only traverses upwards, then stops there.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Mon Jun 23, 2014 5:10 pm

If you just want to move up and down, I recommend lunarray's LiteTween plugin.

viewtopic.php?t=70700&start=0

It's extremely useful.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Mon Jun 23, 2014 10:14 pm

Thanks.
Looks good. But also less "random".

Moving up and down isn't the only thing either. I have another enemy that is supposed to run in circles. Really wish there was an easy way to just have the sprite follow a pre-set path.

EDIT: I think I found the culprit. For some reason, the sprite never fully moves to the Y position. Not sure how to fix this though.

Please. Is there no one with a solution? I only got 4 days left to hand this hand. It's really stressing me out. Can't believe how inflexible Construct 2 is in regards to waypoints :(

I mean. All I want is have the sprite move on a predefined path. Is this so much to ask for?
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Tue Jun 24, 2014 1:10 am

Got it working with "bounding boxes" (sprite rectangles covering a certain area + path change on overlap with those), for now.
I'd still be interested to know why the sprite is never truly traversing to the exact point set, even though nothing is blocking its path.

I also feel like there should be a more direct way handling UIDs/IIDs inside an action. Something like "Sprite.UID.430" where 430 is the UID. Or possibly "Sprite.UID (430)", for easier separation of object properties.
B
6
S
2
Posts: 206
Reputation: 1,685


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests