Random Object Spawn

Get help using Construct 2

Post » Mon Nov 04, 2013 5:23 pm

Hi, I want to be able to destroy a box then spawn one of 3 random objects, Ammo, HealthPack and a blank object which doesnt do anything.
I want the blank object to have a higher spawn rate if possible.
Thanks!
B
2
Posts: 1
Reputation: 152

Post » Mon Nov 04, 2013 5:34 pm

set a variable to choose(1,2,3,3,3)

then if variable is 1 spawn ammo
if variable is 2 spawn healthpack
if variable is 3 spawn blank

this way 3/5 of the time the blank is spawned.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jan 01, 2014 3:20 am

@LittleStain would this be the same for 1 object? I just want when the enemy is killed to randomly spawn a med pack lets say 30% chance of getting one...

Thanks
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
41
S
20
G
6
Posts: 367
Reputation: 7,541

Post » Wed Jan 01, 2014 3:42 am

@allmarkmade

its the same yea as littlestain told you

enemie on destroyed
system set (name of your var) choose(1,1,2)

compare variable (name of your var)=1 enemy spawn another object : medikit

increase or decrease the number 1 for the %chance


Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Wed Jan 01, 2014 2:47 pm

Thanks I'll give that a try. I appreciate it.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
41
S
20
G
6
Posts: 367
Reputation: 7,541

Post » Wed Jan 01, 2014 9:28 pm

Took A bit but I got it worked out... This worked perfectly.

Thank you.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
41
S
20
G
6
Posts: 367
Reputation: 7,541


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests