Nested if-then or, How do I random loot

Get help using Construct 2

Post » Fri Apr 06, 2012 12:50 am

I would like to have the enemies in my shooter drop items like 10% of the time.
Currently, enemy death is an "if enemylife <= 0 then" event.
I was thinking something like "if lootroll=x then create x object" with blank sprites set to fade for no loot. Is this possible? Or do I need to
rethink my enemy death event?
B
5
Posts: 17
Reputation: 460

Post » Fri Apr 06, 2012 2:11 am

I made this example for someone asking a similar question about drop chances a few weeks a go, hope it helps.

DropChance.capxNimtrix2012-04-06 02:12:20
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Apr 06, 2012 2:42 am

How are you chaining the events like that?
E: OMG add sub-event, this changes everythingsilverback2012-04-06 02:43:39
B
5
Posts: 17
Reputation: 460

Post » Fri Apr 06, 2012 2:45 am

Sub-events can be created by right-clicking an event and selecting "Add new sub-event", or you could drag an already made event (child) to the bottom of another (parent) with the mouse, and it will become a sub-event.

Edit: Ah, you got it, the manual usually holds the answers as well.Nimtrix2012-04-06 02:46:56
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: emoticon, KeetonCat, makkancs, Matthew de, Yahoo [Bot] and 28 guests

cron