dot big bang

Developer API
Menu
All
  • Public
  • Public/Protected
  • All

The Drop Collectables When Killed script lets you configure what is dropped and how far from the enemy it drops. Drops can appear for all players, just for the killer or in more advanced use cases the "owner" or player that spawned the enemy. Our example doesn't use the "owner" type but it is there for advanced users who understand how to use something like that.

Drops can just appear on the ground within a radius of the enemy or they can animate in a curve from the enemy to their final position. Visual effects templates can also be spawned for extra polish.

Let's look at what each property on the script does:

  • Drop Type

    • All Players - When killed the drops will appear on all players screens and each player can collect a copy of the drops. The enemy must be networked for this to work.
    • Killer - The drops will only appear on the killer's screen for them to collect.
    • Owner - The drops will only appear on the screen of the player that "owns" the enemy in the networking sense. This is the case if that player spawned the enemy. This is an advanced type that should only be used by those with a good understanding of dot big bangs networking.
  • Collectable Drop Data Ids

    • A comma separated list of Ids that match entries in "Collectable Drop Data" scripts in the "Collectable Drop Database" object in the Work Room.
  • Drop Position

    • An optional offset from the enemy that the drop will spawn at.
  • Drop Radius

    • The radius out from the drop spawn position that the drop can animate to or appear at. Good for scattering multiple drops.
  • Animate Drops

    • If true, the drops will animate in an arc from the enemy to their final positions.
  • Drop Fx

    • An optional template that will spawn when the drops appear. Make sure the template removes itself from the game when it is done by using a "dbb_destroy_after_delay" script.

The comma separated list of ids lets you share drop data among enemies and can help cut down on the total data in your game, though you can also just assign a single drop to each enemy since drops themselves can contain multiple types of collectables.

To edit or add this data just select the "Collectable Drop Database" object and look at the "Collectable Drop Data" scripts on it. The ids in this data are linked to the "Collectable Database" object with "Collectable Data" scripts.

Let's use the first Collectable Drop Data entry as an example. This entry contains the drops for the boss at the end of the level. You can see that the Data Id is "Boss Drop" and that it drops 3 Coins, 1 Potion and 1 Key.

Those Coin, Potion and Key Ids point to Collectable Data entries in the "Collectable Database". Selecting that and inspecting the scripts will show you the data used for those. You can read up on how that data works here: Collectables