12-Jul-2023
Highly customizable item that can be stored in player inventory based on visual interface, and applies bunch of optional effects on players. Item_inventory contains a lot of trigger conditions. It's possible to make other entities require specific item, abort to have an item, force to drop item e.t.c. You can also make this item usable at player's will from inventory menu (self-activation). This is how you can implement gas masks, invincibility, speed boots, healing potions, keys to locked doors, remote controllers, capture the flag, air tanks and many more! Those entities are fully integrated with item_inventory, each including inventory related keyvalues:
Keyvalues |
OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.
Name targetname : Set name of item_inventory so other entities can trigger it. Only 'On' and 'Toggle' trigger use-types are accepted which makes item be picked up by player '!activator'. Kill-targeting this entity will remove item_inventory and stop it from respawning, also removing from inventory.
Pitch Yaw Roll (X Y Z) angles : Where Z means Y and Y means Z, that is, when you're thinking Hammer-grid. (Hammer uses Z for height and Y for depth, while every other sane 3D-application does this the other way round; nonetheless this keyvalue description has the letters in the conventional order) This, technically, is a 3D-vector containing Euler-angles to describe either the entity's rotation or direction of effect. E.g. a func_door_rotating will use this as its initial rotation, while a trigger_push will keep its original alignment and use this for the direction of its push-effect instead. Euler-angles are a hierarchical system to determine an object's orientation in 3D-space. A yaw-value of 0 would mean the entity would face east. (right in top-down view) 90 would mean it would face north. (up in top-down-view) After yaw, pitch is applied. Think aiming up/down with your character in first person. At last, the roll-value is applied. Think your character falling over sideways in first person. Some entities, mostly point entities, do not use the angles keyvalue for any purpose.
Render FX renderfx : Set custom render FX effect. Only works when "Render Mode" is set to different than 'Normal'
Render Mode rendermode : Render mode determines how this entity is rendered.
FX Amount (1 - 255) renderamt : Render amount to use when other than "Render Mode" 'Normal' is used.
FX Color (R G B) rendercolor : Used with "Render Mode" 'Color' and 'Glow' to set color. Also sets color of 'Glow Shell' "Render Mode".
Gravity Setting movetype : Determines how items behave after spawn.
Solid Setting solid : Determines item solidity.
Custom Model model : You need to specify model of item_inventory.
Skin skin : Model skin to use, if model have multiple skins.
Body body : Model body to use, if model have multiple bodies.
Sequence Name sequencename : Default model sequence name to set.
Sequence Number (overrides name) sequence : Change model sequence by specifying it's number.
Scale Model scale : Model size scale, higher values for bigger model. Hull is resized as well.
Custom Min Hull Size (X Y Z) minhullsize : If set, this will overwrite the monster's default minimum hullsize. Minimum and maximum hullsize form a solid cuboid which define the monster's collision hull. Think of them as two span-vectors originating from the monster's origin.
Custom Max Hull Size (X Y Z) maxhullsize : If set, this will overwrite the monster's default maximum hullsize. Minimum and maximum hullsize form a solid cuboid which define the monster's collision hull. Think of them as two span-vectors originating from the monster's origin.
Sound Replacement File soundlist : Set the path to a sound replacement file for the item. The path begins in 'svencoop/sound/mapname', whereas 'mapname' would be your map's name. You can go to the parent directory using '../'. A valid sound replacement file contains one or more lines with two sound-paths, which are seperated by a space and wrapped into quotes. The first sound is the sound to be replaced. The second sound is the new sound. Sound-paths start in the sound directory. You cannot go to the parent directory using '../' in that case. These sounds do not need to be precached using a custom_precache point entity.
Target target : Entity to trigger when item is picked up. Trigger use-type is 'Toggle'.
Delay Before Trigger delay : Delay before trigger entity specified in "Target".
Kill Target killtarget : Same as target, except that this supposedly causes the specified entity/entities to be removed from the game. Not all entities which have a target to trigger will also handle killtarget. You may want to use a trigger_relay to make sure it is working.
Item name item_name : Name of the item to refer to. This is not a "targetname". You can trigger this item by a "targetname" and you can refer to this item by it's "Item name".
Item group name item_group : You can assign this item to group. You can refer to item group from other item-related keyvalues as well.
Display name (HUD) display_name : It's a display name of item that show up at the inventory menu window.
Description (HUD) description : It's a description of the item player can read at the the inventory menu window.
Item icon (HUD) item_icon : Name of the sprite file to use as item hud icon. Provide the full file name and path relative to the 'sprites' directory.
Self-activation limit (0 = infinite) activate_limit : If "Holder:Allowed to self-activate" is set to 'Yes', this is a number of times player can activate this item.
Collection limit (0 = infinite) collect_limit : How many item duplicates player can hold in his inventory. '0' for no limit.
Item weight (0-100) weight : Item weight. The limit for all items in inventory is '100', Over that value player cannot pick up more items.
Collect: Entity target names filter_targetnames : Only enitites with given name(s) can pick up this item.
Collect: Entity class names filter_classnames : Optional filter. Only entities with given class(es) can pick up this item.
Collect: Teams filter_teams : Optional filter. Only players that are part of given team(s) name can pick up this item.
Collect: NPC classifications filter_npc_classifications : Optional filter. Only Monsters with given class(es) are able to pick up this item.
Collect: Need item(s) item_name_required : Name of required item(s) (held in inventory) to pick up this item.
Collect: Need item(s) from group(s) item_group_required : Name of group(s) (in which item(s) from player inventory belongs) required to pick up this item.
Collect: Item count in group need have (0 = all) item_group_required_num : Total number of items that are part of specified group(s) required to pick up this item. Specify a group names in keyvalue above.
Collect: Item(s) moved item_name_moved : Allow to pick up this item only when specified item_inventory wasn't relocated yet (and is not in someone's inventory).
Collect: CAN'T have item item_name_canthave : Name of item(s) in player inventory that prevents from picking up this item off the ground.
Collect: CAN'T have item from group item_group_canthave : Name of group(s) (in which item(s) from player inventory belongs) that prevents from picking up this item off the ground.
Collect: Item count in group CAN'T have (0 = all) item_group_canthave_num : Total number of items that are part of specified group(s) that prevents from picking up this item from a ground. Specify a group names in keyvalue above.
Collect: Item(s) NOT moved item_name_not_moved : Allow to pick up this item only when specified entities (of item_inventory class) has been moved from it's starting position.
Carried: Hide item (3rd person) carried_hidden : Hide item from 3rd person view. When 'No' is selected, the item model is floating above player head when equipped.
Carried: Skin carried_skin : Change models' skin of carried item (only when it's not hidden).
Carried: Body carried_body : Change models' body of carried item (only when it's not hidden).
Carried: Sequence Name carried_sequencename : Change models' sequence of carried item (only when it's not hidden).
Carried: Sequence Number (overrides name) carried_sequence : Change models' sequence by specifying it's number.
Return: Wait (-1 = never) return_timelimit : After this amount of time the item returns to it's starting position (when dropped somewhere else).
Return: Delay respawn (materialisation) return_delay_respawn : Allows to specify if item_inventory will wait for respawn after returning to it's default position.
Holder: Hold time limit (0 = never) holder_timelimit : Maximum time the item can be held on for, then it's returning if possible.
Holder: Delay between self-activations (0 = none) holder_time_activate_wait : If 'Holder:Allowed to self-activate' is set to 'Yes', this is a delay between which player can activate this item.
Holder: Wearing out trigger time (0 = none) holder_time_wearout : Time before "Holder: Hold time limit" reach it's limit to trigger target specified in "Target: On wearing out" keyvalue. If you set it to e.g. 4, it will trigger a target 4 seconds before this item's "Holder: Hold time limit" ends. It's useful if you want to trigger a sound or a game_text informing player that item will be worn out soon. Example: player picked up power-up which have "Holder: Hold time limit" set to 10, and "Holder: Wearing out trigger time" to 3, so 3 seconds before item is removed from player (in other words, before "Holder: Hold time limit" ends) game_text specified in "Target: On wearing out" is triggered with message "Warning! 3 seconds for buff to end!".
Holder: Allowed to self-activate holder_can_activate : Set it to 'Yes' allows players to activate this item by themselves from inventory menu.
Holder: Hold time limit doesn't start until item activated holder_timelimit_wait_until_activated : If set to 'Yes', hold time limit doesn't start until item is activated by player through inventory menu.
Holder: Allowed to drop holder_can_drop : Determines whenever item can be dropped manually by player from within inventory menu.
Holder: Keep item on death holder_keep_on_death : Self-explanatory. Note that player will lost this item after respawn if keyvalue below isn't set to 'Yes'.
Holder: Keep item on respawn holder_keep_on_respawn : Self-explanatory. Remember that player can also lose his item on death, if "Keep item on death" is set to 'No', the player won't keep this item.
Target: On collect (self) target_on_collect : Trigger specified target(s) when item is successfully collected (uses 'Toggle' trigger state). Player who collected it is passed as the '!activator'.
Target: On collect (team) target_on_collect_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On collect (others) target_on_collect_other : Same as above, but passes everyone else but player as '!activator'.
Target: On can't collect (self) target_cant_collect : Trigger specified target(s) when item collecting attempt failed (uses 'Toggle' trigger state). Player who failed to collect item is passed as the '!activator'.
Target: On can't collect (team) target_cant_collect_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On can't collect (others) target_cant_collect_other : Same as above, but passes everyone else but player as '!activator'.
Target: On drop (self) target_on_drop : Trigger specified target(s) when item is dropped (uses 'Toggle' trigger state). Player who dropped it is passed as the '!activator'.
Target: On drop (team) target_on_drop_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On drop (others) target_on_drop_other : Same as above, but passes everyone else but player as '!activator'.
Target: On can't drop (self) target_cant_drop : Trigger specified target(s) when item is drop failed (uses 'Toggle' trigger state). Player who failed dropping item it is passed as the '!activator'.
Target: On can't drop (team) target_cant_drop_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On can't drop (others) target_cant_drop_other : Same as above, but passes everyone else but player as '!activator'.
Target: On self-activate (self) target_on_activate : Trigger specified target(s) when player activate item from inventory menu, only if "Allowed to self-activate" is set to 'Yes' (uses 'Toggle' trigger state). Player who activated it is passed as the '!activator'.
Target: On self-activate (team) target_on_activate_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On self-activate (others) target_on_activate_other : Same as above, but passes everyone else but player as '!activator'.
Target: On can't self-activate (self) target_cant_activate : If "Allowed to self-activate" is set to 'Yes' and item activation limit hit 0, this is a target to trigger when player attempts to activate it again (uses 'Toggle' trigger state). Player who failed it is passed as the '!activator'.
Target: On can't self-activate (team) target_cant_activate_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On can't self-activate (others) target_cant_activate_other : Same as above, but passes everyone else but player as '!activator'.
Target: On use by trigger (self) target_on_use : Trigger specified target(s) when item is used by trigger (uses 'Toggle' trigger state). Player is passed as the 'activator!'.
Target: On use by trigger (team) target_on_use_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On use by trigger (others) target_on_use_other : Same as above, but passes everyone else but player as '!activator'.
Target: On wearing out (self) target_on_wearing_out : Trigger specified target(s) when item's "Wearing out trigger time" ends (which must be greater than 0 but less than "Holder: Hold time limit" value), see "Holder: Wearing out trigger time" above for more info (uses 'Toggle' trigger state). Player who owns this item is passed as the '!activator'.
Target: On wearing out (team) target_on_wearing_out_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On wearing out (others) target_on_wearing_out_other : Same as above, but passes everyone else but player as '!activator'.
Target: On return (self) target_on_return : Trigger specified target(s) when item returns to it's starting position (uses 'Toggle' trigger state).
Target: On return (team) target_on_return_team : Same as above, but passes whole team (in which player belongs, including this player) as '!activator'.
Target: On return (other) target_on_return_other : Same as above, but passes everyone else but player as '!activator'.
Target: On materialise after return target_on_materialise : Trigger specified target when item gets materialised after a drop or return (uses 'Toggle' trigger state).
Target: On destroy target_on_destroy : Trigger specified target when item gets destroyed by environment (uses 'Toggle' trigger state).
Effects: Wait until item is self-activated? effects_wait_until_activated : If "Allowed to self-activate" is set to 'Yes', this will determine if effects should be applied only when player activate an item from inventory menu.
Effects: Permanent? (Until respawn) effects_permanent : Specify if effects below effect applied on player are permanent ('Yes') or temporary ('No'). If option 'No' is chosen, the effects ends after "Holder: Hold Time Limit" is hit, and if 'Yes' is selected, effect ends after respawn.
Effects: Glow shell color (R G B) effect_glow : Color of glow shell effect to apply. '0 0 0' for none.
Effects: Block weapons effect_block_weapons : Prevent player from using weapons ('Yes'/'No').
Effects: Invulnerable effect_invulnerable : Makes player invulnerable ('Yes'/'No').
Effects: Invisible effect_invisible : Makes player invisible (for enemies) ('Yes'/'No').
Effects: Non-solid effect_nonsolid : Makes player not-solid for different dynamic objects ('Yes'/'No').
Effects: Time before drown (seconds) effect_respiration : Additional amount of time before drown (can be negative!).
Effects: Friction modifier (%) effect_friction : Percent of friction to change on player.
Effects: Gravity modifier (%) effect_gravity : Percent of gravity to change on player.
Effects: Speed modifier (%) effect_speed : Percent of speed to change on player. Weapon_minigun does not affect this value.
Effects: Damage modifier (%) effect_damage : Player damage modifier in percent.
128 : TOUCH Only : Pick this item up only by touching it.
256 : USE Only : Pick this item up only by using it ('USE' key).
512 : Can Use w/o LoS : Player can pick up this item even when it's not within his line of sight.
1024 : Disable Respawn : Disables default item respawning.
2048 : Not in Deathmatch : Obsolete in Sven Co-op. Makes the entity don't appear in Multiplayer Games.
Use semicolon ';' to separate multiple item/target/group names in filters and conditions.
If both 'TOUCH only' and 'USE only' flags are selected, the item can only be collected by trigger, but only if player is the !activator.
Item can be collected on trigger, touch and use when none of flags above are selected.
You can specify a group of affected players in all trigger fields making it possible to have different action for different players.