Emergency Ammo Crate

By LadylexUK

I used this in my FPS game Wonderland Attacks. In my game you had limited ammo. You could collect more ammo from crates dropped by dead enemies. However, you could get a situation where the player had fired all their bullets and picked up all the available crates. So this emergency crate appears when their gun is completely empty, so they will always have bullets available. It disappears once the player has bullets, either because they have collected this crate’s contents or picked up another crate. Unlike the normal ammo crates it is not destroyed when collected.

  1. WHEN DO [pace][equals][5] // this makes sure the fx is not still visible when the crate is not active
  2. WHEN [IWP:player][numvar:total ammo][plus][IWP:player][numvar:bullets][equal to][0] DO [visible][equals][true]
  3. …WHEN DO [boolvar:active][equals][true]
  4. …WHEN DO [collidable][equals][true]
  5. …WHEN DO [play fx][fx:Navigation Interest][on][me]
  6. …WHEN [else]
  7. …/…WHEN DO [boolvar:active][equals][false]
  8. …/…WHEN DO [collidable][equals][false]
  9. …/…WHEN DO [visible][equals][true]
  10. WHEN [boolvar:active]
  11. …WHEN [detect player] DO [objvar:collector][equals][it]
  12. …/…WHEN [objvar:collector][numvar:ammo packs][less than][10]
  13. …/…/…WHEN [started to] DO [objvar:collector][numvar:ammo packs][increment by][1] // in  my game each ammo crate contained 2 ammo packs.
  14. …/…./…WHEN DO [global][numvar:collect][increment by][1] // You can use this in a sound board to create a sound when collected

Comments are closed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: