Generic Device Functions - DeviousDevices/Docs GitHub Wiki

There are a number of functions that can help deal with unknown devices, these are the Generic Functions. These can add or remove items with minimal information, some as little as the keyword for the item type you want to remove. There are additional functions that can find information about a specific device in use such as the key required to remove it or other information that may be needed to add or remove them.


ManipulateGenericDevice

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

This function can be used with any devices where all you know is the Device but not the DeviceRendered or the DeviceKeyword. This function is useful in that you can add or remove items from other mods without having to add that mod as a dependency so long as that item does not have the keyword zad_BlockGeneric.

The function is pretty much identical to the standard ManipulateDevice function as it requires the same information to work except that it will go find the Rendered item and Keyword for it is. The downside to using this command is that it takes much longer to equip or unequip an item since it has to search for the information itself.

ManipulateGenericDeviceByKeyword

bool Function ManipulateGenericDeviceByKeyword(Actor akActor, Keyword kw, bool equipOrUnequip, bool skipEvents = false, bool skipMutex = false)

This function is similar to the ManipulateGenericDevice except instead of knowing what the Device is all you need to know is the DeviceKeyword. The useful thing with this command is you can tell it to remove a particular type of item such as a belt or collar without having to know anything else about it. As with the ManipulateGenericDevice this will not work on items containing the zad_BlockGeneric keyword.

As with the ManipulateGenericDevice function it will take time to work especially if using it on multiple devices at the same time.

GetWornDevice

Armor Function GetWornDevice(Actor akActor, Keyword kw)

This function will find out what the currently equipped inventory Device item on a person is by the DeviceKeyword. Once you have the Device item you can use that information either in one of the other commands or to compare it to something else in your mod.

GetWornDeviceFuzzyMatch

Armor Function GetWornDeviceFuzzyMatch(Actor akActor, Keyword kw)

This function is similar to the GetWornDevice except it looks for the keyword on a currently equipped DeviceRendered instead of the Device. Useful for situation where you just want to get the device occupying a specific slot without further differentiation.

GetDeviceKey

Key Function GetDeviceKey(armor device)

This function retrieves the correct key needed to unlock a given device.

GetDeviceKeyword

Keyword Function GetDeviceKeyword(armor device)

This function will give you the DeviceKeyword for a particular Device. With the information supplied you can use it in other functions or check to against something else in your mod.

GetRenderedDevice

Armor Function GetRenderedDevice(armor device)

This function will give you the DeviceRendered for a particular Device. With the information supplied you can use it in other functions or check to against something else in your mod.