How do I fix this randomly spawning platform?

Get help using Construct 2

Post » Fri Dec 26, 2014 3:52 am

So I have the floor of my level preset in the layout, it's made up of small rectangle segments and each segment has the chance to spawn a platform above it. For some reason the first segment ALWAYS spawns a platform above it and the last few NEVER do. There are sometimes a few in between, those seem pretty random, but the last couple and the first are as far as I can tell guaranteed to have the same outcome.
My setup looks like this:
On ground created:
random(0,100) <= 15, spawn platform

I don't know why it would be so guaranteed for some of it but not all, is it something to do with Construct's random algorithm? Hopefully someone can help.
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:04 am

I'm not sure if it will help or not but you could try using this: floor(random(101))
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Dec 26, 2014 4:13 am

Well flooring just makes it always round down, I'll try it, but I don't see how it'd help.
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:27 am

Yeah that did nothing, any other ideas?
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:30 am

can you share your capx?
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Dec 26, 2014 4:31 am

I'll share a simplified one, hang on
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:35 am

Here's the simplified one with only the platforming spawning stuff. Thank you, I hope you can help!
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:41 am

I can't replicate your problem with your provided capx. Sometimes there is a platform spawning at the beginning (directly above the players head on the start of the layout) and sometimes there isn't.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Dec 26, 2014 4:46 am

Hm, when I used the simplified one it also didn't spawn there every time. It must be a problem somewhere else, thanks for testing this out with me I'm sure I can find the problem now
B
5
S
1
Posts: 59
Reputation: 497

Post » Fri Dec 26, 2014 4:48 am

No problem. Also, I think you should be using choose rather then random for the image points. ;) Good luck getting it figured out.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests