Instant hit - exceed range?

For questions about using Classic.

Post » Sun Apr 22, 2012 10:16 am

I've been working a bit with the Instant Hit option in Construct, and I've run into a problem. I want the bullet to create an object when it exceeds its range, and then disappear. However, instead it creates the object in the spot where the bullet was created - in other words, the bullet doesn't move at all.

Here's my cap file so you can see exactly what the problem is.

Mediafire upload

WASD to move, left click to fire.Chezzy2012-04-22 10:17:02
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Sun Apr 22, 2012 2:25 pm

Tragic and sad - from what I can tell, the bullet behavior places the object back at it's starting point after looping through every step.

Instead of using the range exceeded action, check instead the traveled distance using Fbullet[Bullet].Travelled compared to your maximum desired range. I gave that a go and everything worked as you'd expect, so it's at the very least a simple workaround.

I hope this helps. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Apr 22, 2012 11:37 pm

Thanks it helped a lot :)
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Mon Apr 23, 2012 12:18 am

Ok I have another problem now, I may as well post it in this thread as it's related to the cap.

I now want the bullets to create an object and then disappear when they hit the walls. I've created an event which checks On Step and If Bullet is overlapping Wallblock (which is the collision detection block for the walls). However, the bullet just goes straight through. I've tried On collision with Wallblock aswell, to no avail.Chezzy2012-04-23 00:19:10
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Mon Apr 23, 2012 12:34 am

Looks like it's related to the collision type on your bullet - I set it from per-pixel to bounding box and it worked as you would expect.

On a related note, you'll need to rethink how your wall collision boxes are setup. As it is now, if you shoot diagonally at a wall between the collision boxes, there's a chance that the bullet will skip right through. I'd suggest either filling these diagonal spots with another collision box to keep shots from coming through, or -- and this is probably preferable -- replace your boxes with isometric ones so you have unbroken surfaces all along the walls.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon Apr 23, 2012 3:30 am

Ah great, that works.

Yeah I understand what you mean about the wall collision boxes. I've made them diagonal now, with no gaps :)
B
3
S
1
G
3
Posts: 105
Reputation: 1,312


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests