Repository navigation
Home
Devious Wiki
Introduction: This wiki will explain the different features of Integration including how devices work, setting up your scripts and the commands available as well as how to create your own items and effects. There are some things you will need to know before getting started such as setting up scripts and properties and how to do things in the CK.
Glossary of Terms: Normally this is at the back but you will need to know these terms and what they are if you are going to understand what is to come.
General Terms
- Zadlibs – the base script that houses the bulk of the commands for Integration.
- Inventory Item – One of the two parts to a device. This piece contains the scripts that control the locking and unlocking of the device and the only part to show in your inventory.
- Rendered Item – The second part to a device. This contains the Meshes and Textures that will show on the wearer and contains a number of keywords that controls a number of effects but does not show up in the wearers inventory. It is also referred to the Script Instance item in the Creation Kit.
- Keywords – There are a number of types of keywords used in Integration on the different devices. Some will identify what type of device it is while others link it to various functions and effects.
Paramaters
- akActor – Actor Property - used in the functions to tell who is getting the device placed on or removed from.
- Device – Armor Property - used in functions to identify the Inventory item being manipulated.
- DeviceRendered – Armor Property - Used in functions to identify the Rendered item being manipulated.
- DeviceKeyword – Keyword Property - used in functions to identify what type of device is being manipulated.
- SkipEvents – bool (true / false) - used in functions to skip the normal start up or shut down of an item. This command can be used when you want to remove an item and replace it with the same type (ie: belt for belt). Using this in other cases can cause items to not work correctly and possibly break them.
- SkipMutex – bool (true / false) - used in functions to skip the check that is done to see if the target is already using the type of device being equipped. Using this can speed up the equipping process but you need to be sure that the target does not already have the type of device on.
- DestroyDevice – bool (true / false) - used in removal functions to tell if the device is to be added to the wearers inventory or if it is to be removed completely.
- EquiporUnequip – bool (true / false) - used in functions to tell if the device is to be equipped or removed. True will equip the item and false will remove it.
Setup: There are a few things you need to do to use the functions from Integration in your own scripts. The first is that Integration and all the mods it requires will need to be added as masters to your mod. The second is the Zadlibs script will need to be added as a property to any scripts that will need to use one of its functions. The property should be set up like this: Zadlibs Property Libs Auto This will allow you to access all the functions and properties contained within the zadlibs script by adding libs. to the beginning of the function or whatever else you want to reference. This is also handy as you will not have to add those keywords and items to your own scripts as properties saving yourself some work. When you go to fill the property in the Properties screen in the CK it will just give you one choice for what goes there so setting that is rather easy.
Basic Commands: There are 3 basic functions for adding and removing devices, 1 for standard items and 2 for custom ones. The various settings are explained in the glossary
ManipulateDevice – this function is used to add or remove a standard device and handles some of the settings automatically and will likely be the command you will use the most. Syntax: libs.ManipulateDevice(akActor, Device, EquiporUnequip, skipevents) 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, False) 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 – these functions are used to equip or remove custom devices from someone. ManipulateDevice refers to these functions but will look up some of the information for you. Syntax: Libs.EquipDevice(akActor, Device, DeviceRendered, DeviceKeyword, SkipEvents) or Libs.RemoveDevice(akActor, Device, DeviceRendered, DeviceKeyword, SkipEvents) 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, make sure you have the proper Rendered item for the Device or it can cause problems. 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. On the SkipEvents setting unless you are removing an item and replacing it with the same type you should set this to false.
Advanced Commands: 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 – 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. Syntax: Libs.ManipulateGenericDevice(akActor, Device, EquiporUnequip, skipevents) 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 – 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. Syntax: Libs.ManipulateGenericDeviceByKeyword(akActor, DeviceKeyword, EquiporUnequip, skipevents) As with the ManipulateGenericDevice function it will take time to work especially if using it on multiple devices at the same time.
GetWornDevice – 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. Syntax: Libs.GetWornDevice(akActor, DeviceKeyword)
GetWornDeviceFuzzyMatch – this function is similar to the GetWornDevice except it looks for the keyword on a currently equipped DeviceRendered instead of the Device. This is useful as there are additional keywords on the DeviceRendered items that are not on the inventory Device. Syntax: Libs.GetWornDeviceFuzzyMatch(akActor, DeviceKeyword)
GetDeviceKey – with this function you can find out what key is required to open a particular Device so you can retrieve it if needed. Syntax: Libs.GetDeviceKey(Device)
GetDeviceKeyword – 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. Syntax: libs.GetDeviceKeyword(Device)
GetRenderedDevice – 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. Syntax: libs.GetRenderedDevice (Device)