Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After completing this tutorial, you will be able to give weapons and equipment items to AI entities and to the player.

You will also be able to carry the inventory of the player from one mission to another, as well as give the player specific items at the start of a level.

Table of Contents
maxLevel23
minLevel2
minlevel2
excludeOverview

Editing Equipment Packs

On the Game menu, click Edit Equipment-Packs:

Image RemovedImage Added

Using the drop-down list, select one of the Equipment-Packs:Image Removed

Image Added

Info

Player_Default is loaded by default unless specified otherwise through Flowgraph (Inventory:EquipPackAdd).

Or, create a new pack by clicking Add:

Image Removed

Add and remove weapons and equipment items to and from the lists by using the << and >> buttons.

...

Image Added

You can then add equipment from the Available Equipment list into the Used Equipment list, or remove equipment by using the << and >> buttons.

As ammo/weapons/accessories are added/removed from the build, the EquipmentPack Editor will automatically notify of changes and update available equipment accordingly.

Accessories Setup

Since CRYENGINE 3.5, the Equipment Pack tool also has the ability to sort Accessories/Attachments for Weapons.

Image Added

In the above example you can see several accessories are ticked, this means they are equipped on the weapon by default. Only one accessory can be selected to be the default per-category (as defined in the Weapon script).

This means the Pistol will start with PistolBulletAmmo, the Rifle will start with no accessories and the Shotgun will start with ShotgunSolidAmmo. If we wanted the Flashlight on the pistol by default, we'd check the box next to it in the 'bottom' category.

Ammunition

There is a fairly large overlap between Weapon scripts and Equipment packs which should be kept in mind. Ammunition amounts can be defined in the Accessory XML, in the Weapon XML or in the Equipment Pack.

Typically the 'greater' value will be accepted but kept within the limitations. If your maximum ammo capacity for PistolBullet is 54 and you put 200 in the Equipment pack you'd still only get 54. If you put 10 in the Equipment pack and 12 in the Weapon script, you'd have 22 ammo.

AI Equipment Packs

To assign a specific Equipment pack to an AI, simply reference the Equipment Pack name in the EquipmentPack field of the AI Properties.

Tip

Remember, if you're dealing with many AI/Equipment Packs, AI Entity Archetypes can be used.

You can also access the equipment pack Equipment Pack editor by clicking the EquipmentPack "..." button in the properties of a character with a weapon.Enemies can be configured to

Image Added

Tip

Note that AI have an unlimited amount of ammunition so

...

you don't need to specify the number of bullets for their Equipment packs.

Image Removed

Saving Players

...

Equipment Over Multiple Levels

During some point in the game you may want to load a new level, but also carry over the players weapons and items over to the next level.

...

Giving the Player Individual Weapons and Items

...

Right-click the Flow Graph window and find the Inventory nodes:

Image Removed

Node

Description

AddAmmo

Specify which ammo type to give and also the amount.

AddEquipPack

Specify an equipment pack to give. Opens up the Equipment Pack dialog to chose from there.

AddItem

Add a specific item to the players inventory.

HasAmmo

Check for a specific ammo type and amount in the players inventory.

HasItem

Check for a specific item in the players inventory.

HolsterItem

Trigger the player to holster / un-holster their weapon.

ItemSelected

Check for specific items in the players hands.

RemoveAllAmmo

Remove all ammunition from the specified entities inventory.

RemoveAllItems

Remove all inventory items (including weapons) from the specified entities inventory.

RemoveItem

Remove a specific item from the specified entities inventory.

RestorePlayerInventory

Use this to load up a previously saved player inventory.

SelectItem

For an item in the players inventory to be the selected weapon.

SetAmmo

Specify an ammo type and set an exact amount.

SetAmmoEx

Same as the SetAmmo node.

StorePlayerInventory

Save the players inventory state to be called on later with the RestorePlayerInventory node.

Use the Add Node/Misc/Start node to give the player a SCAR In the example below, the player would receive a RocketLauncher at the beginning of the level:

Image Removed

Result

When the player starts the mission, he will have the SCAR right at the beginning.

Image Removed

Some things to experiment with:

...

, then when they passed through the AreaTrigger, they would receive 2 additional Rockets:

Image Added

 

Excerpt
hiddentrue
This tutorial shows users how to set up equipment packs from within Sandbox.