Random Item Drops (Ghost Shooter)

This forum is currently in read-only mode.
From the Asset Store
320 high-quality cinematic sound effects for trailers and game scenes.
  • Hello all,

    Total noob here! I've just completed the Ghost Shooter tutorial and decided to make it a bit more interesting - I've added a secondary rocket launcher with limited ammo and higher, splash damage; shootable monster spawn boxes; a frag counter; and rocket ammo + health powerups.

    I'm trying to get the monsters to randomly drop rocket ammo (25%); health (25%) or nothing (50%), but my attempts at random drops are not going well and although I did find a topic on the subject, I couldn't understand how to apply it.

    My latest attempt was to assign a private 'Drop' variable of random(4) to the monster sprite, then check it's value against 1 and 2 on death, but construct doesn't seem to like the random private variable, and keeps replacing it with 0. Ideally I would generate a random number and check against a single 'drop table' which would make the system much more scalable. Any suggestions please?

  • Here's an example:

    http://dl.dropbox.com/u/529356/Semi%20P ... nItems.cap

    v0.99.84

    Remember when you use random() it begins at 0, not 1. So random(4) will give you 0, 1, 2, and 3.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks; I can't open that file, Construct returns 'out of memory'.

    I'm running ver 0.99.62 which claims to be the latest version. There's no way I shouldn't have enough memory - any suggestions?

    EDIT:

    Never mind, I've found the latest unstable build on the forums.

    I get it now - thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)