0.3 & 0.3.1 Enemy Item Drops & Signal Bus Update


Important Changes

  • ItemDropsSignalBus is now a resource type which means you can save them to the project files and reference them in any script even setting it in many different scenes. This means that any scripts that used the ItemDropsSignalBus singleton now need to set a resource in the inspector. You most likely will want to create one ItemDropsSignalBus and then reference it in all Item Drops plugin nodes that use it (but if needed, you can also have separate signal busses to separate which scripts should receive signals from which emission objects.
PickupsCollector (Previously TakePickupsComponent)
  • Generic inventory add call is now set with property add_method_name. Set it to whatever your inventory container uses to add resource items to the container (default: try_add). It should return a bool success or number of items added int.
Pickup (Previously PickupsComponent)
  • Now emits pickup signals both locally from the pickup script and through the ItemDropsSignalBus so anything can react to a pickup occurring.
New Classes
  • DropsComponent - Add to any scene that needs to spawn item drops at a time of your choosing (call spawn_drops on the DropsComponent - ex. After an enemy reaches 0 HP and begins it's dead state

0.3.1 2D/3D Separation

  • Separated classes that rely on 2D nodes into their own 2d sub directories. These versions of scripts are for 2D games and are indicated as such. Base classes like SceneSpawner are left separate to be flexible enough to serve as a base class for 2D or 3D game object spawning. Scene spawner scripts themselves are Node instead of Node2D now so a spawn_point must be specified in the inspector. This allows a node is required to be either a Node2D or Node3D depending on the game's context.
  • Default group name for spawn_parent_group on SceneSpawner is set to "pickup" be sure to set this to the group name attached to whatever 2D/3D object you want to serve as the parent for your spawned_scenes (generally pickups / items)
  • Added extra results handlers to PickupsCollector inventory add call. Now should be able to evaluate results of type int, float, bool, nil, or array.

The addon still only supports 2D worlds at the moment but I wanted to add the ground work for possible future plugin updates. Therefore current classes were made to be more agnostics of 2D / 3D and rely more heavily on generic nodes.

Files

item_drops-0.3.1.zip 15 kB
Feb 25, 2024

Get Item Drops Plugin for Godot 4

Buy Now$20.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.