Weapon

Weapons are to weaponTAGs what itemObjects are for itemTAGs.
When player pick-ups a weaponTAG the corresponding weapon is instanced, if not exists, and linked to player hands.
 
Following are the weapon specific parameters:
6.3.3.2. Weapon
1

MaxBullets

1. MaxBullets
<TODO>: Insert description text here...
2

<TODO : Control Name>

2. <TODO : Control Name>
<TODO>: Insert description text here...
3

Description

3. Description
<TODO>: Insert description text here...
4

TAGPrefab

4. TAGPrefab
<TODO>: Insert description text here...
5

MuzzleNode

5. MuzzleNode
<TODO>: Insert description text here...
6

ProjectileNode

6. ProjectileNode
<TODO>: Insert description text here...
7

BulletboxNode

7. BulletboxNode
<TODO>: Insert description text here...
8

MuzzlePrefab

8. MuzzlePrefab
<TODO>: Insert description text here...
9

SmokePrefab

9. SmokePrefab
<TODO>: Insert description text here...
10

ProjectilePrefab

10. ProjectilePrefab
<TODO>: Insert description text here...
11

BulletboxPrefab

11. BulletboxPrefab
<TODO>: Insert description text here...
12

maxAimDistance

12. maxAimDistance
<TODO>: Insert description text here...
13

Melee Related parameters

13. Melee Related parameters
<TODO>: Insert description text here...
14

Aiming related parameters

14. Aiming related parameters
<TODO>: Insert description text here...
15

hitmask

15. hitmask
<TODO>: Insert description text here...
16

MeleeHitEvent

16. MeleeHitEvent
<TODO>: Insert description text here...
17

Cross textures related parameters

17. Cross textures related parameters
<TODO>: Insert description text here...
18

Inventory Icon related parameters

18. Inventory Icon related parameters
<TODO>: Insert description text here...
 

Configuring a new weapon
 
Weapon are the objects that Player character holds when picking-up a weaponTAG or when selecting a weapon slot from the inventory to be equiped.
For this reason they must be configured in oerdr to be able to execute some logic (firing, reloading, etc..) and animations.
 
Starting from 2023 version weapons do not need to be already linked to the playerCharacter to work. In the new system the weaponTAG contains the reference to the weapon prefab to load and attach to the playerCharacter when picked-up.
 
To be 100% convincing a weapon must owns an sh2 model (hierarchical model) containing 4 nodes, BUT you can omit them if you want:
  • MuzzleNode
  • ProjectileNode
  • BulletBoxNode
  • LoaderNode: it is used for showing/hiding weapon loader during ammo re-loading.
 
Usually loader node is used in this way:
1. A loader model is attached to an hand node of the player, a loader mesh is on a node of the weapon object model.
2. When using the weapon the loader node in the players hand is hidden, the loader mesh in weapon object is showed
3. When reloading the weapon the loader node in player hand is showed while the loader mesh in weapon object is hidden.
 
Following is the screenshot of the M4 model provided with EasyGame Pack:
The green boxes are the nodes the model must have to be 100% working.
 
As you can see from the image, the hierarchy structure has a start node called ROOT to which are directrly linked all other nodes:
  • ROOT
  • Bullet Boxes node
  • Fire node
  • Loader mesh node
Usually muzzle and projectile nodes are the same