Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

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
maxLevel2
minLevel2
minlevel2

Editing Equipment Packs

On the Game menu, click Edit Equipment-Packs:

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

Or, create a new pack by clicking Add:

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

Editing Enemy Equipment Packs

You can also access the equipment pack editor by clicking EquipmentPack in the properties of a character with a weapon.

Enemies can be configured to have an unlimited amount of ammunition so that you don't need to specify the number of bullets.

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.

In the following picture we have a setup where on the completion or failure of MissionObjective5 we will save the player's inventory, fade out the screen and then trigger the next level.

Then once the next level has been loaded, we will restore the saved inventory, fade in and then activate the mission MissionObjective1.

Giving the Player Individual Weapons and Items

To give the player individual weapons and items, the Inventory Flow Graph nodes should be used.

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

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 at the beginning of the level:

Result

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

Some things to experiment with:

  • Play with the equipment packs to give the player an interesting setup at the start of the level, or to create a unique and varied feel to the enemy types.
  • If you're working with multiple level setups, it's a good idea (for testing purposes) to give the player appropriate weapons. However, when streaming between levels, it's a good idea to make sure that you don't give the player new weapons for free, or even take away any.
  • Attached to this page is a demonstration Flowgraph xml that can be imported to your level to see the Inventory nodes in use. To do this, right click inside the Flowgraph window and click import and the xml sheet. The sheet can be found here.


 

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