# How to store weapon fire modes in a data table?

**URL:** <https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894>\
**Category:** Blueprint\
**Tags:** Struct, datatable, unreal-engine, Blueprint, question\
**Created:** [April 17, 2024, 11:32am UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894 "2024-04-17T11:32:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![EejayD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EejayD](https://forums.unrealengine.com/u/EejayD)\
**Post date:** [April 17, 2024, 11:32am UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/1 "2024-04-17T11:32:35Z")

</div>

I’ve been trying to create a weapon loadout system (like Call of Duty) and I have been using Data Tables to do so. The thing is, the weapons I plan to use are more arcadey and have alt-fires similar to the ones seen in games like Unreal Tournament and Doom Eternal, but because the effects of the alt-fire are so varied (some summon projectiles while some switch the weapon to fully automatic) it’s hard to classify it under just one class. Some insight would be helpful. Thanks.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [April 17, 2024, 11:50am UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/2 "2024-04-17T11:50:27Z")

</div>

you could use an array of Enums or GameplayTags and then use a switch to use the appropriate ability

---

<div class="post-metadata">

**Author:** ![EejayD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EejayD](https://forums.unrealengine.com/u/EejayD)\
**Post date:** [April 17, 2024, 4:35pm UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/3 "2024-04-17T16:35:59Z")

</div>

Would this be through GAS or is there another method I don’t know about?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [April 18, 2024, 12:42am UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/4 "2024-04-18T00:42:07Z")

</div>

i havent used GAS myself but if so you’d be using the ‘Tag’ to choose what ability to alt-fire so it should work with anything.

you alt fires could even be an actor component that you add/remove to the weapon as desired and then choose which one to activate based on the ‘tag’

---

<div class="post-metadata">

**Author:** ![EejayD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EejayD](https://forums.unrealengine.com/u/EejayD)\
**Post date:** [April 19, 2024, 12:07pm UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/5 "2024-04-19T12:07:46Z")

</div>

Could you go a little more in depth? I’m not sure I’m totally understanding what you’re saying.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [April 19, 2024, 3:14pm UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/6 "2024-04-19T15:14:11Z")

</div>

if you mean firemode you can use an array of GameplayTags such as  
Firemode.Single  
Firemode.Burst  
Firemode.FullyAuto  
etc

if you mean fire modes like normal and alt-fire id create an actor component to handle the logic, create an EventFire and in the component you can handle the logic anyway you like,

so you can have a component for normal fire which shoots a projectile and another childcomponent that fires rockets or something.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [April 19, 2024, 3:58pm UTC](https://forums.unrealengine.com/t/how-to-store-weapon-fire-modes-in-a-data-table/1807894/7 "2024-04-19T15:58:47Z")

</div>

You could use an enum for the full range of fire types and a `UENUM(meta=(`Bitflags``))` uproperty to set the available enum entries for a specific weapon
