Osiris core APIs come in three categories:
- Events are Osiris' way to inform you that something happened, often to a particular object
- Queries allow you to request information about an object or the game state. Occasionally, they also change the game state and return the result of the change (e.g. creating a new item)
- Calls instruct Osiris to change an object or the game state. Calls never directly return results in any way.
Additionally, this page also links to a number of useful helper routines and databases from the Shared mod.
List of All APIs
The Osiris API documentation is a work in progress, as there are hundreds of them. However, you can always have a look at the declarations of all Osiris APIs in the Story editor to see what is available:
- Generate definitions
- Choose File -> Open Story Header. You can also find this file in ".\Data\Mods\<mod name>\Story\RawFiles\story_header.div"
In many cases, the usage of an API is fairly straightforward. If you are unsure about it,
- Create an Adventure Add-on that targets story and that depends on DivinityOrigins
- Build story for that mod
- In the Story editor, press ctrl-shift-f and enter the name of the API. You will get a list of all locations in our scripting where this call is used
- If you are still unsure and the API is not documented yet here, ask on the Scripting Forum.
Once you have built the story for this mod, you can also find it in ".\Data\Mods\<mod name>\Story\RawFiles\story.div". You can open this file in any text editor, so you can search it while you have another mod open in the editor that may not depend on Divinity Origins
This category has the following 11 subcategories, out of 11 total.