User Tools

Site Tools


Sidebar

hpl3:game:scripting:user_modules:player_tool

Player Tool

Helper function prefix: Player_

This module handles the player's use of Prop_Tool objects that they pick up, including maintaining an inventory list, deciding if a tool is equipped (shown in the player's hands) and whether tools can be used on particular entities or areas. In SOMA, this covers things like the Omnitool or scan chips.

The Player Tool module uses Prop_Tool objects.

Prop_Tool Level Editor Properties

PickupCallback

Called when the tool is picked up from in level by the player.

UseCallback

Called when the tool is used on another object

CanBeUsedCallback

Called to check if the tool can currently be used

DropCallback

Called when the tools is dropped (Use returns false)

AutoHideAfterPickup

Hide when the tool is picked up.

HighlightActive

Is the tool highlighted in level when you're nearby?

Prop_Tool Model Editor Properties

HudObjectEntity

Which entity to use when held in the player's hands, equipped?

InventoryTextEntry

Text to show on the inventory screen

InventoryIcon

Icon to show on the inventory screen

HandAnimationSuffix

Suffix to add to player hand animation names, for custom anims for this tool.

IsHeavy

Will player be unable to jump / use terminals etc. when carrying this object?

CustomUseIcon

Icon to show when the tool is held over another object.

Important Functions

Player_PlayCustomToolAnimation

Plays an animation on the currently displayed tool's entity.

Player_ToolIsInInventory

Checks to see if the player has picked up a tool with this name.

Player_EquipTool

The player holds up the tool in his hand if it's in the inventory.

Player_UnequipTool

The player puts away the tool in his hand.

Player_RemoveTool

The tool is removed from the player's inventory

Player_RemoveAllTools

All tools are removed from the player's inventory

hpl3/game/scripting/user_modules/player_tool.txt · Last modified: 2015/09/16 15:37 by ian.thomas