S2ENGINE HD 2023
User guide
×
Menu
Index

Picking

In Easy Game Pack Player character automatically interacts with active elements of the game, such as switches, doors, items or weapons to pick up, etc...
 
2 ways have been designed to make player character to interact with seen objects:
 
The first mode is usually used in 3rd person games, the second in first person games. By default player character uses By Aiming mode, by you can switch to By Range mode checking the actionByRange parameter of player character class.
 
The interaction works usually in the following way:
 
The action command button can be specified by setting the actionCommand parameter of the player character class. See commands and input mapping for more info.
You can also choose to make player performing actions, on all or on a subset of game objects, without pressing any button by setting the autoActionMask parameter. This could be, for example, the case of a frenetic FPS in which you want the player to take health by simply pass upon a health TAG.
 
The objects that can interact with the Player Character belong to the following classes:
 
When the player character aims on of these object (except the Target object that always works By Range) he sends them a AIMED event (and a message), see Player sending events.
This doesn't happen when By Range mode is enabled.
The aimed object replies to player character by sending him a actionToPerform message (see player receiving messages), that makes player to show what to do on the HUD in the targetText and targetCaption elements.
Then, if the user presses the action command button, the player character sends to the aimed object a ACTION event, and, depending on the aimed object class, this produces different results:
 
From 2023 version playerCharacter can visualize the key/command to press when aiming an interactive object. In the case of Switches you must be sure that parameters "openActionText" and "CloseActionText" contain the string "com:action". Be also sure that parameter "LockedActionText" contains only a "space" character.
As result of this modification the playerCharacter now is capable to visualize the command to press for interact with aimed switches:
 

Drop Items/Weapons
 
Player can also drop Items and Weapons from Inventory but pressing the drop command button if set.
In this case the relating item slot count in the Inventory is decremented (in the case of a weapon the weapon slot is emptied) and the relating itemTAG (or WeaponTAG in case of a weapon) is spawned again into the scene.
Player can drop either items and weapons from the intentory and items and weapons from hands (see Inventory for more info about how handling works).
To make Player Character re-spawning the itemTAG/weaponTAG you must create an itemTAG or weaponTAG prefab and put a reference to it from the itemObject prefab or weapon prefab setting the tagPrefab parameter.