ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


inventory_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
inventory_functions [2018/01/08 01:07] korshuninventory_functions [2019/08/26 02:39] (current) – created korshun
Line 1: Line 1:
-====== ZDoom inventory functions ====== +====== Inventory functions ======
- +
-Just like with [[zdoom>SetInventory]] and [[zdoom>SetActorInventory]], functions with ''Actor'' in them work on the actor with the specified TID, while the functions without work on the activator. +
- +
-===== SetInventory ===== +
- +
-  void SetInventory(str item, int amount) +
-  void SetActorInventory(int tid, str item, int amount) +
- +
-Sets the amount of the specified inventory ''item'' to ''amount'', by giving or taking items. Example: ''SetInventory("SomeItem", 8)'' +
- +
-Optimized to minimize network traffic in Zandronum. +
- +
--------- +
-===== ToggleInventory ===== +
- +
- +
-  void ToggleInventory(str item) +
-  void ToggleActorInventory(int tid, str item) +
- +
-Gives one unit of ''item'' if it isn't present in inventory, or takes it away if it is. +
- +
- +
--------- +
-===== GiveMaxInventory ===== +
-  void GiveMaxInventory(str item) +
-  void GiveMaxActorInventory(int tid, str item) +
- +
-Gives the maxiumum amount of ''item''+
- +
- +
--------- +
-===== TakeMaxInventory ===== +
-  void TakeMaxInventory(str item) +
-  void TakeMaxActorInventory(int tid, str item) +
- +
-Takes all items of type ''item''.+
  
 +ACSUtils provide extra functions to work with actor inventory.
  
 +  * [[functions:SetInventory]]
 +  * [[functions:SetActorInventory]]
  
 +  * [[functions:GiveMaxInventory]]
 +  * [[functions:GiveMaxActorInventory]]
 +  * [[functions:TakeMaxInventory]]
 +  * [[functions:TakeMaxActorInventory]]
  
 +  * [[functions:ToggleInventory]]
 +  * [[functions:ToggleActorInventory]]
  
inventory_functions.1515366477.txt.gz · Last modified: 2018/01/08 01:07 by korshun