Skip to content

Basic Commands

MinLL edited this page Aug 13, 2014 · 9 revisions

There are 3 basic functions for adding and removing devices, one for standard items and two for custom ones. The various settings and what they refer to are explained in the glossary.

Function ManipulateDevice(actor akActor, armor device, bool equipOrUnequip, bool skipEvents = false)

This function is a wrapper around EquipDevice / RemoveDevice, and is intended to be used to add or remove a standard (Non-custom) device to akActor. This function handles several parameters automatically, and will likely be the command you will use the most.

Example Usage:

; If you wanted to equip a padded belt on a target (property set as Wearer) it would look like this:
libs.ManipulateDevice(Wearer,  libs.beltpadded,  True)

By adding the libs. in front of the beltpadded we were able to use the armor property from the zadlibs script so you wouldn’t have to define it yourself. If you were to change the True to False the padded belt would be removed.

##EquipDevice and RemoveDevice##

Function EquipDevice(actor akActor, armor deviceInventory, armor deviceRendered, keyword zad_DeviousDevice, bool skipEvents=false, bool skipMutex=false)
Function RemoveDevice(actor akActor, armor deviceInventory, armor deviceRendered, keyword zad_DeviousDevice, bool destroyDevice=false, bool skipEvents=false, bool skipMutex=false)

These functions are used to equip or remove custom devices from an actor. ManipulateDevice refers to these functions but will look up some of the information for you.

Where the basic ManipulateDevice function could equip a device with just the Inventory Item as there are a number of things set up in Integration to allow the command to look up the required information, since these are more for custom items they have to be identified in the function. You will need to have the armor properties for the Device and DeviceRendered set up in your script so it will know what items it needs to add. DeviceKeyword can still be called with libs. or you can set it up as a property just make sure the keyword used is for the same device type.

---Things to Note---

Device and DeviceRendered With custom devices you need to make sure that when Equipping or Removing them that you have the correct pair of items for the Device and DeviceRendered. Not having these can cause problems when adding and removing devices as they can leave behind pieces of the device and cause some major headaches when trying to equip another device later.

The SkipEvents setting should be set to False unless you are removing an item and replacing it with the same type immediately. Using it incorrectly can cause the device to not operate correctly or cause issues with the devices at a later time.