Category:Osiris APIs

From Divinity Engine Wiki
Revision as of 15:57, 25 November 2017 by Tinkerer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

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:

  1. Generate definitions
  2. 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,

  1. Create an Adventure Add-on that targets story and that depends on DivinityOrigins
  2. Build story for that mod
  3. 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
  4. 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