Shooter module overview popularité : 69
Weapons popularité : 88
Ammunition popularité : 91
Advanced API popularité : 92
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
Slide 10
IMAGE OR CARROUSEL for section header You successfully read this important alert message.

TEXTE AVANT FILTRAGE

Shooter API

Same way you use Triggers, Conditions and Actions to interact with the Shooter module, you can write your own scripts to do the same. Here’s an overview of the Shooter API.

Character Shooter

The Character Shooter component contains a bunch of public methods that allow you to interact with how this Character will behave.
It is important to notice that the Player uses another component called Player Shooter, but it inherits from Character Shooter, so everything available in one is available too on the other one.

Events
There are a few events you can subscribe to in order to react when the Character Shooter performs certain tasks.

Queries

You can also query different states without any performance overheads. All queries start with the prefix is- and return a bool.

Methods

There are many methods that allow you to interact with the Shooter module.


Changes the currently equipped weapon and ammunition. If no ammunition is provided, the one set by default in the weapon will be used.


Changes the currently equipped ammunition


Reloads the currently equipped weapon if possible


Starts aiming with the weapon. It is required for the Character to be holding a weapon before. The AimingBase class is an abstract class that requires an instance from one of the following specific classes:

- AimAtTarget Aims at a specific target and will keep pointing at it until told otherwise. Useful for locking in targets.

- AimingCameraDirection Aims where the camera looks at. Useful for games that use the first person motor or the adventure camera motor.

- AimingGroundPlane Aims where the mouse points at, along the surface of a horizontal plane surrounding the shooter. Specifically designed for top-down shooters.

- AimingMuzzleForward Aims where the muzzle points.

- AimingSideScrollPlane Aims where the mouse is along a vertical plane. This plane can be set along the X axis or the Z axis. Specifically designed for side scroll games.


-void StopAiming()-
Stops aiming with the weapon.

{{void Shoot()}}
Shoots wherever the character is aiming at. Mind that where the Character aims at is specified using the

StartAiming


method.
{{void StartChargedShot()}}
Starts charging a shot. This method must always be proceeded by the

ExecuteChargedShot()

.

-void ExecuteChargedShot()-
Executes a charged shot. This method must be preceded by a


StartChargedShot()
. Otherwise it will be ignored.

-float GetCharge()-
Gets the amount of charge being accumulated. The result is a value between 0 and 1, which indicates the percentage of the charge.
This method should always be called between StartChargedShot() and


ExecuteChargedShot()
. Otherwise it will always return 0.

-int GetAmmoInClip(string ammoID)-
Returns the amount of ammunition in the weapon’s clip. The ammoID is the identifier of the Ammo object.


-int GetAmmoInStorage(string ammoID)- Returns the amount of spare ammunition the character has. This is the total amount of ammunition available minus the amount in the clip.
{{void SetAmmoToClip(string ammoID, int amount)}}
Sets the amount of ammunition in the clip without triggering a reload.

-void AddAmmoToClip(string ammoID, int amount)-
Adds the amount of ammunition specified in the clip without triggering a reload.

{{void SetAmmoToStorage(string ammoID, int amount)}}
Sets the amount of spare ammunition.

-void AddAmmoToStorage(string ammoID, int amount)-
Adds a certain amount of ammunition to the spare ammo. This method is the one that should be calTEXTE APRES FILTRAGE
-  : liste tous les intertitres de l’article
-  : liste tous les documents de l’article sous forme de mini-vignette non cliquables. Avec deux paramètres :

width : largeur de la vignette en px,
raz : nombre de vignette sur une seule ligne. Juste après la Nième(raz) vignette, un
est inséré.

>