Give Player Grenade

From CryWiki

Jump to: navigation, search


Flowgraph Walkthrough

First, the Input:Key node detects when the player pushes the 'U' key. We move from the Pressed port to the first input port on the Logic:Once node. This will ensure that we only give the player a grenade the first time they push the key down.

If the logic gate fires, we use the Inventory:AddItem node and give them a FragGrenade.

If you want to keep giving them a grenade each time they push the key down, just remove the Logic:Once node and directly link the Input:Key node to the Inventory:AddItem node. You can change which key they need to push by changing the value of the Key input node on Input:Key. You can also change what item they receive by changing the Item input node on Inventory:AddItem.


Flowgraph Image

Preview of Give Player Grenade.
Preview of Give Player Grenade.

   

About this Sample

Name

Give Player Grenade

Created by

Vloktboky

Compatible with Multiplayer

No

Description

This will show you how to give the player a grenade when they push the 'U' key.


Download

Click here to download this sample's Graph XML file.

You may need to right-click on the link and select "Save As" from the menu.


» Discuss this sample...

» View other Flowgraph Samples

» Return to Crysis Modding Code Samples

Personal tools