Drop items from chests

Hi everyone,
I would need to create an accidental drop when crates are broken

It only works for me on the first broken crate and the rest remain empty… I think the problem is the once trigger but if I deselect it no object is created on any crate.
I tried adding repeat for each object but nothing changes
Can anyone tell me how I can do it?
thank you in advance

We haven’t got the full picture of the leadup to these events. But would it be correct to assume it’s when the player has collided with a wooden chest?

If so, all those trigger once conditions are unnecessary. The random drop is only happening once for a wooden chest, correct? So get rid of all the trigger once conditions, and place a trigger once condition only on the first event, where the animation check is done.

in my first event only the animation of the wooden chest is changed

I followed your advice to insert a once trigger at the beginning of the event but things don’t change

I deselected the events before and set the variable save.fortune=5 where each broken chest should drop an item but it is only found once

How does save.fortune get changed? Is it set once, is it incremental or something else?

save.fortune is a powerup.
at the beginning of the game the powerup values are 0 and at each end of the level the player has the opportunity to choose the powerup he prefers.
the more the value of the powerup increases, the greater the probability of finding useful objects inside the chests

Once a chest’s animation is set to “rotta”, it’s not changed after. As a result, the trigger once condition isn’t reset, so the random item drop isn’t repeated.

To fix this, I’d suggest the following changes (excuse the dodgy cut n paste job). And add a condition that cassadilengo’s animation is not “rotta”:

1 Like