Random & Spawn

Get help using Construct 2

Post » Tue Apr 09, 2013 11:26 am

Hello!
MISSION Spawn a plant from mariobros pipe 40% of times.


my logic :
Pipe: 2 var ( spawn(40) e Random(0) )

ON CREATED pipe set floor random 100 / set a text print number
    ----> random < spawn : spawn plant /append text GOOD


RESULT :
-random number is generated and printed some times it append multiple times GOOD
-plant is spawned but not with my criteria, it spawn randomly(i dont know how)

i've also tried another sub event with the opposite(if greater than) print BAD
someteime plant is spawned printing both good and bad O_o


QUESTION: What is wrong with my logic? :) THX in Advance
B
4
Posts: 10
Reputation: 395

Post » Tue Apr 09, 2013 11:30 am

On pipe created
.. random(100) < pipe.spawn
... spawn the plant
... print the good text
.. else
... print the bad text

Should work :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Tue Apr 09, 2013 12:20 pm

i've not understood the difference :/
B
4
Posts: 10
Reputation: 395

Post » Tue Apr 09, 2013 1:12 pm

[QUOTE=TheRagMan] i've not understood the difference :/
[/QUOTE]

It's pretty much the same thing with few differences, post your .capx, as the problem is probably somewhere else.
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Tue Apr 09, 2013 3:49 pm

You're using floor on create and not on randomizing, maybe is it, I'm not sure if understanded your logic because it's not like it's on the C2 event sheets.

Do you have any CAPX to share the problem?
ImageImageImageImageImageImage
B
93
S
20
G
13
Posts: 1,217
Reputation: 18,996

Post » Tue Apr 09, 2013 7:04 pm

I've cleaned all,and i dont know why...it works :/   i had no other math,espression script :/ bah I,m sorry for bothering.
B
4
Posts: 10
Reputation: 395


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, mjj1990 and 7 guests