Construct 2
Construct 3
Weapon System is a Construct behavior that serves as manager of weapons and their properties. It is mostly designed for shooter games but can be used with any other game where a player or enemy can have multiple weapons with various properties. Not only guns but melee weapons as well or even magical spells.
Imagine you want to make a shooter game where you want to feature plenty of different weapons and several can be owned at the same time: pistols, rifles, rocket launchers, melee weapons or magical ones. Each of them has different properties such as damage, rate of fire, ammunition capacity, reloading time etc.
Such a mechanic obviously requires you to handle large amounts of variables and functions with lots of correlations. Moreover, let’s assume you want it to be a multiplayer game, where each player can loot a weapon of the defeated opponent, along with its properties such as currently loaded ammunition or upgrades applied. This makes such a system even more complicated and harder to handle.
With the Weapon System you can easily add, remove, alter, select and use weapons owned by a user (player/enemy/ally/whatever). It’s a behavior, therefore you can easily manage them independently for each instance.
Weapon System allows you to set and change on the fly any property of the weapon such as:
or a custom property of your design if you like.
With this addon you can also remove the weapon and “drop” it, so it can be “picked” by another instance or object that has the behavior.
Once the behavior is added, you will need to set just three crucial events:
That’s enough for a most basic weapon setup. Optionally, you can add more events to enrich your games weaponry:
Thanks to dedicated actions and expressions, you can easily change which of the owned weapons is to be used and respectively trigger a shot with a currently selected weapon or other weapon of your choice by indicating its ID.