<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.larian.game/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LaughingLeader</id>
	<title>Divinity Engine Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.larian.game/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LaughingLeader"/>
	<link rel="alternate" type="text/html" href="https://docs.larian.game/Special:Contributions/LaughingLeader"/>
	<updated>2026-05-12T23:08:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris/API/CharacterFollowCharacter&amp;diff=6764</id>
		<title>Osiris/API/CharacterFollowCharacter</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris/API/CharacterFollowCharacter&amp;diff=6764"/>
		<updated>2022-06-02T19:21:40Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added a link to CharacterSetFollowCharacter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Full Definition(s) =====&lt;br /&gt;
* call  '''CharacterFollowCharacter'''(''(CHARACTERGUID)'''''_Character''', ''(CHARACTERGUID'')'''''_ToCharacter''')&lt;br /&gt;
&lt;br /&gt;
===== Description =====&lt;br /&gt;
Makes '''_Character''' start following '''_ToCharacter'''.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
* Preferably use [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] from the Shared mod. This will ensure that '''_Character''''s following behaviour gets suspended when it enters combat, and resumed afterwards.&lt;br /&gt;
* Use [[Osiris/API/CharacterStopFollow|CharacterStopFollow]] to stop the following behaviour (or [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]] if you used [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]).&lt;br /&gt;
* Make sure to stop following a previous character before starting to follow a new one. [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] will automatically take care of this.&lt;br /&gt;
* Note that this call does ''not'' turn '''_Character''' in a so-called &amp;quot;party follower&amp;quot; or minion, which is done via [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]. The difference between &amp;quot;regular followers&amp;quot; (as created by this routine) and party followers/minions is that regular followers simply follow any other character around (you can have one NPC follow another one, if you want), while party followers/minions always follow a player-controlled character and can be partially controlled by the [[Osiris/API/CharacterGetReservedUserID|user]] that controls this player character.&lt;br /&gt;
&lt;br /&gt;
===== See Also =====&lt;br /&gt;
* [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]&lt;br /&gt;
* [[Osiris/API/CharacterStopFollow|CharacterStopFollow]]&lt;br /&gt;
* [[Osiris/API/CharacterSetFollowCharacter|CharacterSetFollowCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Osiris Calls|CharacterFollowCharacter]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris/API/CharacterSetFollowCharacter&amp;diff=6763</id>
		<title>Osiris/API/CharacterSetFollowCharacter</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris/API/CharacterSetFollowCharacter&amp;diff=6763"/>
		<updated>2022-06-02T19:20:50Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added definition information for CharacterSetFollowCharacter.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Full Definition(s) =====&lt;br /&gt;
* call  '''CharacterSetFollowCharacter'''(''(CHARACTERGUID)'''''_Character''', ''(CHARACTERGUID'')'''''_CharacterToFollow''')&lt;br /&gt;
&lt;br /&gt;
===== Description =====&lt;br /&gt;
Sets '''_CharacterToFollow''' as the target to follow for '''_Character''', which is used by the behavior scripting condition '''CharacterGetFollow'''.  &lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
* Use '''NULL_00000000-0000-0000-0000-000000000000''' as the '''_CharacterToFollow''' value to clear the internal follow target for '''_Character'''.&lt;br /&gt;
* The internal value set is used by the '''Base.charScript''' reactions '''StartFollow''' and '''StopFollow''', via the '''CharacterGetFollow''' condition. Every character automatically has this script attached via its inclusion in '''DefaultCharacter.charScript'''.&lt;br /&gt;
* [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]] sets the same internal follower value, except the character is visibly &amp;quot;attached&amp;quot; in the UI, like summoned characters.&lt;br /&gt;
* Preferably use [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]], as it automatically handles conditions where following may need to be started or stopped).&lt;br /&gt;
&lt;br /&gt;
===== See Also =====&lt;br /&gt;
* [[Osiris/API/CharacterFollowCharacter|CharacterFollowCharacter]]&lt;br /&gt;
* [[Osiris/API/CharacterStopFollow|CharacterStopFollow]]&lt;br /&gt;
* [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Osiris Calls|CharacterSetFollowCharacter]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6702</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6702"/>
		<updated>2020-08-27T01:01:55Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added a screenshot for the content browser button.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already [[Project browser|created a mod project]], and have a [[Osiris Overview|general idea on Osiris syntax]]. For the purposes of this tutorial, we will be using a basic &amp;quot;Addon&amp;quot; project that targets &amp;quot;Story&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Required Reading ==&lt;br /&gt;
The following is required reading, as it covers the Story Editor, and Osiris syntax and concepts:&lt;br /&gt;
* [[Story_editor|Story Editor]]&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
&lt;br /&gt;
=== API Docs ===&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
While some basic concepts are covered here, Osiris syntax and defintitions should be referred to in [[Osiris Overview]], as the goal of this tutorial is to guide you in creating a foundation for your code to run, via a parent script and child script.&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
==== Generate Definitions ====&lt;br /&gt;
When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
==== Prefixing ====&lt;br /&gt;
Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we could prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two.&lt;br /&gt;
&lt;br /&gt;
''This concept also applies for entries in the stats editor, as multiple entries with the same name will conflict.''&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended. For the sake of this tutorial, we'll be parenting our parent goal to __Start, which is a goal provided by Shared.&lt;br /&gt;
&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click &amp;quot;__Start&amp;quot; and select &amp;quot;Add New Sub Item...&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ParentingToStart.png|thumb|Right click the goal and click &amp;quot;Add New Sub Item...&amp;quot;]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Parenting to a DOS2 Goal ====&lt;br /&gt;
----&lt;br /&gt;
Instead of handling the completion events yourself, simply parenting your parent goal to some specific goals provided by Larian is an easy way to ensure your goal runs at the right time.&lt;br /&gt;
&lt;br /&gt;
;Parenting to __Start (No Origins Dependency)&lt;br /&gt;
:If your mod doesn't depend on Origins (see: [[Project_settings_window#The_Dependencies_Tab|Dependencies]], parenting your parent goal to __Start will ensure that it runs when the game is ready.&lt;br /&gt;
&lt;br /&gt;
;Parenting to Start (Origins Dependency)&lt;br /&gt;
:Start (not to be confused with __Start) is a top-level goal in Origins that completes when character creation is ready, or if a mode other than &amp;quot;Campaign&amp;quot; is started. Parenting to this goal requires your mod to have Origins as a dependency.&lt;br /&gt;
&lt;br /&gt;
;Manual Completion&lt;br /&gt;
:Rather than relying on an existing parent goal, it's possible to make a top-level goal that completes on its own. See more on that here: [[Your_First_Story_Script#Manually_Completing_Parent_Goals|Manually Completing Parent Goals]].&lt;br /&gt;
&lt;br /&gt;
==== Parenting Example ====&lt;br /&gt;
----&lt;br /&gt;
Inside of the INIT section of our new goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_WikiTutorial_ModStarted(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_WikiTutorial_ModStarted(1)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The goal should look like so:&lt;br /&gt;
[[File:FirstStoryScript_ParentGoal.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor.&lt;br /&gt;
# Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
The way this example works is, as soon as __Start calls GoalCompleted; (which occurs when the event GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;) fires), our goal then sets a database value, which then triggers our own code for GoalCompleted.&lt;br /&gt;
&lt;br /&gt;
Additionally, if this mod is added to an existing save, where __Start was already completed, our parent goal will complete as well, due to the way the parent-child goal relationship works (if a parent is already complete when a new child is added, that child will run).&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, parented sub-goals will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Content Browser]].&lt;br /&gt;
[[File:ContentBrowserButton.png|thumb|Open the Content Browser with this button.]]&lt;br /&gt;
*  Example: Open the oontent browser and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Databases are a powerful tool for making your scripting logic extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
=== Manually Completing Parent Goals ===&lt;br /&gt;
----&lt;br /&gt;
Instead of parenting your parent goal to one of the Start goals, it's possible to handle goal completion yourself, using a few different events:&lt;br /&gt;
&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
;[[Osiris/API/GameEventSet|GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)]]&lt;br /&gt;
: The first story event that gets thrown after the game engine has been initialised when starting a new game. This particular event will only fire the first time a new game is started, so additional rules are needed for cases where your mod is added to an existing save.&lt;br /&gt;
;[[Osiris/API/Osiris/API/SavegameLoaded|Osiris/API/SavegameLoaded]]&lt;br /&gt;
: Fires when a save is being loaded on an existing save. This can be used to complete your goal on existing saves that just added your mod.&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
The following is an example of handling initial goal completion yourself:&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyMod_Internal_CompleteIfStarted();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_Start()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Parent goal complete.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_CompleteIfStarted()&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:CompleteIfStarted] Story was already started.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
// For saves where this goal is active, but wasn't completed&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:SavegameLoaded] Mod added to an existing save.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:ContentBrowserButton.png&amp;diff=6701</id>
		<title>File:ContentBrowserButton.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:ContentBrowserButton.png&amp;diff=6701"/>
		<updated>2020-08-27T00:50:09Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Shows where the content browser button is in the DOS2 Definitive Edition engine.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Shows where the content browser button is in the DOS2 Definitive Edition engine.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6688</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6688"/>
		<updated>2019-10-17T21:13:01Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Typo fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWings, INT:applyOnHorns, INT:applyOnOverhead, INT:applyOnWeapon[,INT:applyNormalMap, INT:overlay, INT:fading])'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1], INT:noBlend=0])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation.&lt;br /&gt;
&lt;br /&gt;
ExitOnFinish means if the exit will kill itself after it was played (revert back to still).&lt;br /&gt;
&lt;br /&gt;
WaitForCompletion means if the action will wait for the animation to be played at least once.&lt;br /&gt;
&lt;br /&gt;
noBlend means no blending will be performed when doing this animation.  &lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6687</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6687"/>
		<updated>2019-10-17T21:12:26Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Line break fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWings, INT:applyOnHorns, INT:applyOnOverhead, INT:applyOnWeapon[,INT:applyNormalMap, INT:overlay, INT:fading])'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1], INT:noBlend=0])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation.&lt;br /&gt;
&lt;br /&gt;
ExitOnFinish means if the exit will kill itself after it was played (revert back to still).&lt;br /&gt;
&lt;br /&gt;
WaitForCompletion means if the action will wait for the animation to be played at least once.&lt;br /&gt;
&lt;br /&gt;
noBlend means no blending will be performaed when doing this animation.  &lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6686</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6686"/>
		<updated>2019-10-17T21:11:10Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Updated CharacterPlayAnimation with a missing parameter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWings, INT:applyOnHorns, INT:applyOnOverhead, INT:applyOnWeapon[,INT:applyNormalMap, INT:overlay, INT:fading])'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1], INT:noBlend=0])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation&lt;br /&gt;
ExitOnFinish means if the exit will kill itself after it was played (revert back to still)&lt;br /&gt;
WaitForCompletion means if the action will wait for the animation to be played at least once.&lt;br /&gt;
noBlend means no blending will be performaed when doing this animation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Triggers&amp;diff=6666</id>
		<title>Talk:Triggers</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Triggers&amp;diff=6666"/>
		<updated>2019-09-11T22:06:55Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Suggestions / Requests */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The section for event triggers should be updated, the description should include items as event triggers also generate item events:&lt;br /&gt;
&lt;br /&gt;
=== [[File:TemplateType_Trigger_Event.png|32px]] Event Trigger ===&lt;br /&gt;
A trigger that broadcasts an event entered or exited. These triggers are automatically [[Osiris/API/TriggerRegisterForCharacter|registered]] for all characters (player or not) and items in the game.&lt;br /&gt;
:Thanks, fixed! [[User:Tinkerer|Tinkerer]] ([[User talk:Tinkerer|talk]])&lt;br /&gt;
&lt;br /&gt;
== Suggestions / Requests ==&lt;br /&gt;
&lt;br /&gt;
Could we get a blurb about how polygon shape triggers need control points to form their shape, and you create these by clicking the + button with the trigger selected, then clicking in the scene?&lt;br /&gt;
&lt;br /&gt;
Additionally the &amp;quot;View -&amp;gt; Trigger Shapes&amp;quot; option is gone from the view menu in the DE version of the editor, replaced with the Show selected/Show/hide all triggers visibility buttons to the side of the game view. This makes the current View -&amp;gt; Trigger Shapes screenshot a bit outdated.&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;br /&gt;
[[User:LaughingLeader|LaughingLeader]] ([[User talk:LaughingLeader|talk]]) 00:06, 12 September 2019 (CEST)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6507</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6507"/>
		<updated>2019-01-29T20:59:26Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added missing parameters for SetMaterial.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWings, INT:applyOnHorns, INT:applyOnOverhead, INT:applyOnWeapon[,INT:applyNormalMap, INT:overlay, INT:fading])'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still) &lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=UI_Colors_Reference_Sheet&amp;diff=6492</id>
		<title>UI Colors Reference Sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=UI_Colors_Reference_Sheet&amp;diff=6492"/>
		<updated>2018-12-16T20:46:24Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added hex code / samples for all RGBA colors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below, you can find the color sheet for all engine-registered colors.&amp;lt;br /&amp;gt;&lt;br /&gt;
There are several tables. All but the last table contain engine entries, used throughout the game for UI consistency, gameplay denotations (red = enemy,...),...&amp;lt;br /&amp;gt;&lt;br /&gt;
These values are in RGBA format.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The last table contains all registered colors used for text purposes. This table contains dialog colors, colors for status afflictions,...&amp;lt;br /&amp;gt;&lt;br /&gt;
All of the [[Stats_Editor|Stats Editor]]'s FormatColor field values come from this table as well.&amp;lt;br /&amp;gt;&lt;br /&gt;
These are defined in HEX format.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Base !! Color Value (HEX) !! Color Example !! Color Value (RGBA)&lt;br /&gt;
|-&lt;br /&gt;
| Black || #000000 || &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.0, 0.0, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Blue || #0078FF || &amp;lt;span style=&amp;quot;color:#0078FF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.0, 0.470588, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Green || #00F27D || &amp;lt;span style=&amp;quot;color:#00F27D&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.0, 0.94902, 0.490196, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Red || #FF0200 || &amp;lt;span style=&amp;quot;color:#FF0200&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.00784314, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| White || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Yellow || #FFFF00 || &amp;lt;span style=&amp;quot;color:#FFFF00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 0.0, 1.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! General !! Color Value (HEX) !! Color Example !! Color Value (RGBA)&lt;br /&gt;
|-&lt;br /&gt;
| ActiveCharacter || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| AoO || #FF0100 || &amp;lt;span style=&amp;quot;color:#FF0100&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.00784314, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| AreaInteract || #FFD400 || &amp;lt;span style=&amp;quot;color:#FFD400&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.831373, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Attack || #FF0200 || &amp;lt;span style=&amp;quot;color:#FF0200&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.00784314, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| BackstabRegion || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| DefaultRangeOutlineColor || #4BA0FF || &amp;lt;span style=&amp;quot;color:#4BA0FF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.294118, 0.627451, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| DefaultTaskColor || #FFD400 || &amp;lt;span style=&amp;quot;color:#FFD400&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.831373, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| FallbackOutline || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| InvalidAction || #FF0200 || &amp;lt;span style=&amp;quot;color:#FF0200&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.00784314, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| MaximumSkillRange || #CCCCCC || &amp;lt;span style=&amp;quot;color:#CCCCCC&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.8, 0.8, 0.8, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| MoveFootstep || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| MoveTargetCircle || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| MoveTargetCross || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| MutedEffect || #00FFFF || &amp;lt;span style=&amp;quot;color:#00FFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| OutlineInterract || #FFD400 || &amp;lt;span style=&amp;quot;color:#FFD400&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.831373, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| OutlineMoveItem || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| OutlineMoveItemDestination || #FFFF00 || &amp;lt;span style=&amp;quot;color:#FFFF00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 0.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| PeaceOutline || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 1.0, 1.0, 1.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arena Team !! Color Value (HEX) !! Color Example !! Color Value (RGBA)&lt;br /&gt;
|-&lt;br /&gt;
| ArenaTeam1 || #318666 || &amp;lt;span style=&amp;quot;color:#318666&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.192157, 0.52549, 0.4, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| ArenaTeam2 || #3C6983 || &amp;lt;span style=&amp;quot;color:#3C6983&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.235294, 0.411765, 0.513726, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| ArenaTeam3 || #85662F || &amp;lt;span style=&amp;quot;color:#85662F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.521569, 0.4, 0.184314, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| ArenaTeam4 || #87365C || &amp;lt;span style=&amp;quot;color:#87365C&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.529412, 0.211765, 0.360784, 1.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Skill School !! Color Value (HEX) !! Color Example !! Color Value (RGBA)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolAir || #7478DC || &amp;lt;span style=&amp;quot;color:#7478DC&amp;quot;&amp;gt;'''Aerotheurge'''&amp;lt;/span&amp;gt; || (0.458824, 0.47451, 0.831373, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolEarth || #AA895B || &amp;lt;span style=&amp;quot;color:#AA895B&amp;quot;&amp;gt;'''Geomancer'''&amp;lt;/span&amp;gt; || (0.666667, 0.537255, 0.356863, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolFire || #C76537 || &amp;lt;span style=&amp;quot;color:#C76537&amp;quot;&amp;gt;'''Pyrokinetic'''&amp;lt;/span&amp;gt; || (0.780392, 0.396078, 0.215686, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolNecromancy || #9A5085 || &amp;lt;span style=&amp;quot;color:#9A5085&amp;quot;&amp;gt;'''Necromancer'''&amp;lt;/span&amp;gt; || (0.603922, 0.313726, 0.521569, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolPolymorph || #FFB811 || &amp;lt;span style=&amp;quot;color:#FFB811&amp;quot;&amp;gt;'''Polymorph'''&amp;lt;/span&amp;gt; || (0.960784, 0.721569, 0.0705882, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolRanger || #5A9646 || &amp;lt;span style=&amp;quot;color:#5A9646&amp;quot;&amp;gt;'''Huntsman'''&amp;lt;/span&amp;gt; || (0.352941, 0.588235, 0.27451, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolRogue || #566C6C || &amp;lt;span style=&amp;quot;color:#566C6C&amp;quot;&amp;gt;'''Scoundrel'''&amp;lt;/span&amp;gt; || (0.337255, 0.423529, 0.423529, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolSource || #6EB09D || &amp;lt;span style=&amp;quot;color:#6EB09D&amp;quot;&amp;gt;'''Source'''&amp;lt;/span&amp;gt; || (0.431373, 0.690196, 0.615686, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolSummoning || #9440B3 || &amp;lt;span style=&amp;quot;color:#9440B3&amp;quot;&amp;gt;'''Summoning'''&amp;lt;/span&amp;gt; || (0.580392, 0.25098, 0.701961, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolWarrior || #A11919 || &amp;lt;span style=&amp;quot;color:#A11919&amp;quot;&amp;gt;'''Warfare'''&amp;lt;/span&amp;gt; || (0.631373, 0.0980392, 0.0980392, 0.85098)&lt;br /&gt;
|-&lt;br /&gt;
| SchoolWater || #579CCA || &amp;lt;span style=&amp;quot;color:#579CCA&amp;quot;&amp;gt;'''Hydrosophist'''&amp;lt;/span&amp;gt; || (0.341176, 0.611765, 0.792157, 0.85098)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Alignments !! Color Value (HEX) !! Color Example !! Color Value (RGBA)&lt;br /&gt;
|-&lt;br /&gt;
| Party_Base || #00A2FD || &amp;lt;span style=&amp;quot;color:#00A2FD&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.0, 0.639, 0.992, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Party_Light || #6CCBFF || &amp;lt;span style=&amp;quot;color:#6CCBFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.424, 0.796, 1.0, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Ally_Base || #11D77A || &amp;lt;span style=&amp;quot;color:#11D77A&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.067, 0.847, 0.478, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Ally_Light || #80FFC3 || &amp;lt;span style=&amp;quot;color:#80FFC3&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.502, 1.0, 0.765, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Neutral_Base || #F3D347 || &amp;lt;span style=&amp;quot;color:#F3D347&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.953, 0.827, 0.278, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Neutral_Light || #FFEA8C || &amp;lt;span style=&amp;quot;color:#FFEA8C&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.918, 0.549, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Base || #D7001F || &amp;lt;span style=&amp;quot;color:#D7001F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.843, 0.0, 0.122, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Light || #FF001F || &amp;lt;span style=&amp;quot;color:#FF001F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.302, 0.404, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Item_Base || #F3D347 || &amp;lt;span style=&amp;quot;color:#F3D347&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (0.953, 0.827, 0.278, 1.0)&lt;br /&gt;
|-&lt;br /&gt;
| Item_Light || #FFEA8C || &amp;lt;span style=&amp;quot;color:#FFEA8C&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt; || (1.0, 0.918, 0.549, 1.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Text !! Color Value (HEX) !! Color Example&lt;br /&gt;
|-&lt;br /&gt;
| White || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| DarkGray || #454545 || &amp;lt;span style=&amp;quot;color:#454545&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gray || #A8A8A8 || &amp;lt;span style=&amp;quot;color:#A8A8A8&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LightGray || #DBDBDB || &amp;lt;span style=&amp;quot;color:#DBDBDB&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Red || #C80030 || &amp;lt;span style=&amp;quot;color:#C80030&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Blue || #188EDE || &amp;lt;span style=&amp;quot;color:#188EDE&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| DarkBlue || #004672 || &amp;lt;span style=&amp;quot;color:#004672&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LightBlue || #CFECFF || &amp;lt;span style=&amp;quot;color:#CFECFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Green || #40B606 || &amp;lt;span style=&amp;quot;color:#40B606&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PoisonGreen || #00AA00 || &amp;lt;span style=&amp;quot;color:#00AA00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Yellow || #FCD203 || &amp;lt;span style=&amp;quot;color:#FCD203&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Orange || #FF9600 || &amp;lt;span style=&amp;quot;color:#FF9600&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Pink || #FFC3C3 || &amp;lt;span style=&amp;quot;color:#FFC3C3&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Purple || #7F00FF || &amp;lt;span style=&amp;quot;color:#7F00FF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Brown || #B97A57 || &amp;lt;span style=&amp;quot;color:#B97A57&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gold || #C7A758 || &amp;lt;span style=&amp;quot;color:#C7A758&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Black || #000000 || &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Storyitem || #D040D0 || &amp;lt;span style=&amp;quot;color:#D040D0&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Shadow || #797980 || &amp;lt;span style=&amp;quot;color:#797980&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Poison || #65C900 || &amp;lt;span style=&amp;quot;color:#65C900&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Earth || #7F3D00 || &amp;lt;span style=&amp;quot;color:#7F3D00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Air || #7D71D9 || &amp;lt;span style=&amp;quot;color:#7D71D9&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Water || #4197E2 || &amp;lt;span style=&amp;quot;color:#4197E2&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Fire || #FE6E27 || &amp;lt;span style=&amp;quot;color:#FE6E27&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Source || #46B195 || &amp;lt;span style=&amp;quot;color:#46B195&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Decay || #B823CB || &amp;lt;span style=&amp;quot;color:#B823CB&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Polymorph || #F7BA14 || &amp;lt;span style=&amp;quot;color:#F7BA14&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ranger || #81AB00 || &amp;lt;span style=&amp;quot;color:#81AB00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Rogue || #639594 || &amp;lt;span style=&amp;quot;color:#639594&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Summoner || #7F25D4 || &amp;lt;span style=&amp;quot;color:#7F25D4&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Void || #73F6FF || &amp;lt;span style=&amp;quot;color:#73F6FF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Warrior || #DA2512 || &amp;lt;span style=&amp;quot;color:#DA2512 =&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Special || #C9AA58 || &amp;lt;span style=&amp;quot;color:#C9AA58&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Healing || #97FBFF || &amp;lt;span style=&amp;quot;color:#97FBFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Charm || #FFB8B8 || &amp;lt;span style=&amp;quot;color:#FFB8B8&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reputation || #FFAB00 || &amp;lt;span style=&amp;quot;color:#FFAB00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Karma || #7F00FF || &amp;lt;span style=&amp;quot;color:#7F00FF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Stats_Off_Def || #411600 || &amp;lt;span style=&amp;quot;color:#411600&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Stats_LvlUp || #007431 || &amp;lt;span style=&amp;quot;color:#007431&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Stats_Greyed_Out || #403625 || &amp;lt;span style=&amp;quot;color:#403625&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Stat_Boosted || #00547F || &amp;lt;span style=&amp;quot;color:#00547F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_NoPlayer || #FFFFFF || &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Peer_Owns_Player || #9A6A46 || &amp;lt;span style=&amp;quot;color:#9A6A46&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Peer_Not_Owns_Player || #745035 || &amp;lt;span style=&amp;quot;color:#745035&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Player_Is_Enemy || #AA3938 || &amp;lt;span style=&amp;quot;color:#AA3938&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Player_Not_Popular || #ED9D07 || &amp;lt;span style=&amp;quot;color:#ED9D07&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Player_Neutral || #FCD203 || &amp;lt;span style=&amp;quot;color:#FCD203&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Player_Popular || #88A25B || &amp;lt;span style=&amp;quot;color:#88A25B&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dialog_Player_Super_Popular || #34789C || &amp;lt;span style=&amp;quot;color:#34789C&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Rps_Charm || #D66565 || &amp;lt;span style=&amp;quot;color:#D66565&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Rps_Intimidate || #D85B00 || &amp;lt;span style=&amp;quot;color:#D85B00&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Rps_Reason || #E4CE93 || &amp;lt;span style=&amp;quot;color:#E4CE93&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Illegal_Action || #CD1F1F || &amp;lt;span style=&amp;quot;color:#CD1F1F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PlayerColor_Green || #318666 || &amp;lt;span style=&amp;quot;color:#318666&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PlayerColor_Blue || #3C6983 || &amp;lt;span style=&amp;quot;color:#3C6983&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PlayerColor_Yellow || #85662F || &amp;lt;span style=&amp;quot;color:#85662F&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PlayerColor_Red || #87365C || &amp;lt;span style=&amp;quot;color:#87365C&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sticky || #F1D466 || &amp;lt;span style=&amp;quot;color:#F1D466&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| TutorialKey || #008858 || &amp;lt;span style=&amp;quot;color:#008858&amp;quot;&amp;gt;'''sample'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Scripting&amp;diff=6488</id>
		<title>Talk:Scripting</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Scripting&amp;diff=6488"/>
		<updated>2018-12-11T18:10:49Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added a section for typo/mistake (requests for corrections)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Mistakes/Typos ===&lt;br /&gt;
&lt;br /&gt;
In the section &amp;quot;CHECK or IF&amp;quot;, ACTIONS needs to be declared after the INTERRUPT, above Reset().&lt;br /&gt;
&lt;br /&gt;
[[User:LaughingLeader|LaughingLeader]] ([[User talk:LaughingLeader|talk]]) 19:10, 11 December 2018 (CET)&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&lt;br /&gt;
Some very useful information here. I'm slightly confused about the purpose of SCRIPTFRAMES. It would be nice to see an example of one, including the Osiris code. Also an example of a LIST in action would be nice. I also think the example EVENT is not super helpful, since most people aren't going to know what the archetypes are.&lt;br /&gt;
&lt;br /&gt;
I also find the Behavior example confusing. It looks like maybe there's a ! on the second condition (for dangerous surfaces), that shouldn't be there?&lt;br /&gt;
&lt;br /&gt;
Under common mistakes there's CHECK or IF. Are there situations where you would use IF over CHECK in behavior?&lt;br /&gt;
&lt;br /&gt;
Another common mistake I think could be checking things in the wrong order. Something like:&lt;br /&gt;
&lt;br /&gt;
IsGreaterThen(_Vitality,.5)&lt;br /&gt;
CharacterGetStat(_Vitality,__Me,Vitality)&lt;br /&gt;
&lt;br /&gt;
(I mean, that is a mistake, right?)&lt;br /&gt;
&lt;br /&gt;
Will DebugText print the text exactly as you put it in? Like printing out the float value 0.47 exactly as &amp;quot;0.47&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Going over types of variables (INT, FLOAT, FIXEDSTRING, STATUS, CHARACTERTEMPLATE, etc.) here or somewhere else would be useful too.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6401</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6401"/>
		<updated>2018-10-01T02:21:38Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added the optional notify parameter to CharacterRemoveStatus.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWeapon[)'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still) &lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6400</id>
		<title>Character and Item Script Triggers, Calls, and Queries</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Character_and_Item_Script_Triggers,_Calls,_and_Queries&amp;diff=6400"/>
		<updated>2018-09-30T20:10:39Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added GetStatusTurns&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with ''On''. Queries provide information and are always inside an ''IF'' or ''CHECK.'' Calls are actions that are always after THEN.&lt;br /&gt;
&lt;br /&gt;
CharScript/ItemScript Functions&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Classic=&lt;br /&gt;
== CALLS ==&lt;br /&gt;
&lt;br /&gt;
'''Set(OUT OBJECT:variable, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a variable&lt;br /&gt;
&lt;br /&gt;
'''SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Set the value of a global variable&lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable&lt;br /&gt;
&lt;br /&gt;
'''Print(OUT STRING:output, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Prints the text to the output with possible parameters: [1], [2], ...&lt;br /&gt;
&lt;br /&gt;
'''Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Adds both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)'''&lt;br /&gt;
&lt;br /&gt;
Subtracts both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Multiplies both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)'''&lt;br /&gt;
&lt;br /&gt;
Divides both values and stores it in the first variable&lt;br /&gt;
&lt;br /&gt;
'''Abs(INOUT INT|FLOAT:variable)'''&lt;br /&gt;
&lt;br /&gt;
Takes the absolute value of a variable&lt;br /&gt;
&lt;br /&gt;
'''Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Clamps a variable between min and max&lt;br /&gt;
&lt;br /&gt;
'''GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with random one of the values.&lt;br /&gt;
&lt;br /&gt;
'''GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)'''&lt;br /&gt;
&lt;br /&gt;
Gets a weighted random of the given values!&lt;br /&gt;
&lt;br /&gt;
'''GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)'''&lt;br /&gt;
&lt;br /&gt;
Gets a random value between min and max (both included)&lt;br /&gt;
&lt;br /&gt;
'''GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Get a random position in a trigger area&lt;br /&gt;
&lt;br /&gt;
'''GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)'''&lt;br /&gt;
&lt;br /&gt;
Fills in the variable with the index one of the values (starting from 0)&lt;br /&gt;
&lt;br /&gt;
'''SetPriority(FIXEDSTRING:reactionName, INT:priority)'''&lt;br /&gt;
&lt;br /&gt;
Changes the priority of a reaction. Priority 0 and below are not executed!&lt;br /&gt;
&lt;br /&gt;
'''DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
The reaction will not be chosen for the specified time&lt;br /&gt;
&lt;br /&gt;
'''SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)'''&lt;br /&gt;
&lt;br /&gt;
Sets the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''ClearScriptFrame(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Clears the scriptframe on the character.&lt;br /&gt;
&lt;br /&gt;
'''Goto(FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label. Two label names are built-in: &amp;quot;Start&amp;quot; for the first instruction of the reaction, and &amp;quot;End&amp;quot; for the last one.&lt;br /&gt;
&lt;br /&gt;
'''GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to the label if the 2 objects are equal&lt;br /&gt;
&lt;br /&gt;
'''GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to a random label in the list&lt;br /&gt;
&lt;br /&gt;
'''CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )'''&lt;br /&gt;
&lt;br /&gt;
Spawn a puddle at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface at the target's position for a certain lifetime (in turns)&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a polygon surface at the target's position. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a surface within &amp;lt;areaTrigger&amp;gt;. Grows &amp;lt;growStep&amp;gt; every &amp;lt;growTimer&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)'''&lt;br /&gt;
&lt;br /&gt;
Spawn a Cone surface at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect at the target's position&lt;br /&gt;
&lt;br /&gt;
'''ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])'''&lt;br /&gt;
&lt;br /&gt;
Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile&lt;br /&gt;
&lt;br /&gt;
'''DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext&lt;br /&gt;
&lt;br /&gt;
'''StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts&lt;br /&gt;
&lt;br /&gt;
'''DebugText(CHARACTER|ITEM:target, STRING:text)'''&lt;br /&gt;
&lt;br /&gt;
Adds debugtext above the character/item for a short amount of time.&lt;br /&gt;
&lt;br /&gt;
'''CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)'''&lt;br /&gt;
&lt;br /&gt;
Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)&lt;br /&gt;
&lt;br /&gt;
'''Log(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Log's the the scriptlog. (for debugging purposes)&lt;br /&gt;
&lt;br /&gt;
'''Output(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to the output panel (e.g. Output(&amp;quot;An int [1]&amp;quot;, INT:10))&lt;br /&gt;
&lt;br /&gt;
'''Assert(STRING:text, ...)'''&lt;br /&gt;
&lt;br /&gt;
Pass text with optional parameters to display as an assert message (e.g. Assert(&amp;quot;This number is wrong: [1]&amp;quot;, INT:666))&lt;br /&gt;
&lt;br /&gt;
'''Label(FIXEDSTRING:name)'''&lt;br /&gt;
&lt;br /&gt;
Marks this line as a label where Goto actions can jump to&lt;br /&gt;
&lt;br /&gt;
'''StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)'''&lt;br /&gt;
&lt;br /&gt;
Start a timer which will throw the timer event. Set repeatcount &amp;lt; 0 for a permanent timer.&lt;br /&gt;
&lt;br /&gt;
'''StopTimer(FIXEDSTRING:timerName)'''&lt;br /&gt;
&lt;br /&gt;
Stop a timer which will throw the timer event&lt;br /&gt;
&lt;br /&gt;
'''DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Start a dialog between the targets. You can specify fewer targets than the maximum number.&lt;br /&gt;
&lt;br /&gt;
{{warning|Starting a dialog from behaviour script will always start it as an [[Dialog_editor#Automated|Automated Dialog]]. Interactive dialogs can only be started from [[Osiris]].}}&lt;br /&gt;
&lt;br /&gt;
'''DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)'''&lt;br /&gt;
&lt;br /&gt;
Stops a certain dialog on a certain speaker&lt;br /&gt;
&lt;br /&gt;
'''Check(-)'''&lt;br /&gt;
&lt;br /&gt;
Reevaluate the conditions in the CHECK section of this reaction&lt;br /&gt;
&lt;br /&gt;
'''Reset(-)'''&lt;br /&gt;
&lt;br /&gt;
Resets the current reaction. It will start from the beginning again&lt;br /&gt;
&lt;br /&gt;
'''Interrupt(FIXEDSTRING:reactionName)'''&lt;br /&gt;
&lt;br /&gt;
Interrupt the reaction.&lt;br /&gt;
&lt;br /&gt;
'''GlobalSetEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Sets a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''GlobalClearEvent(FIXEDSTRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Clears a global event. Scripts and Story can catch it.&lt;br /&gt;
&lt;br /&gt;
'''StopLoopEffect(INT64:fxHandle)'''&lt;br /&gt;
&lt;br /&gt;
Stops a looping effect&lt;br /&gt;
&lt;br /&gt;
'''IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item in range. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a character&lt;br /&gt;
&lt;br /&gt;
'''SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)'''&lt;br /&gt;
&lt;br /&gt;
Spawns an item&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at the source (with offset, can be null) shooting at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Spawns a projectile at worldPos shooting at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) in a direction&lt;br /&gt;
&lt;br /&gt;
'''ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from source (with offset, can be null) at the target&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos in a direction. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])'''&lt;br /&gt;
&lt;br /&gt;
Shoots a cone from worldPos at the target. Source can be null.&lt;br /&gt;
&lt;br /&gt;
'''SetVisible(CHARACTER|ITEM:object, INT:visible)'''&lt;br /&gt;
&lt;br /&gt;
Sets a character or item visible or not.&lt;br /&gt;
&lt;br /&gt;
'''RotateY(INOUT FLOAT3:vector, FLOAT:degrees)'''&lt;br /&gt;
&lt;br /&gt;
Rotate the vector around the Y-axis for a certain angle (in degrees)&lt;br /&gt;
&lt;br /&gt;
'''SetHealth(CHARACTER|ITEM:target, FLOAT:percent)'''&lt;br /&gt;
&lt;br /&gt;
Set a characters or items health on the given percentage. (percentage between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a sound event at the target&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForEveryone(STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on all the clients&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on a character for all peers (3D)&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character&lt;br /&gt;
&lt;br /&gt;
'''PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)'''&lt;br /&gt;
&lt;br /&gt;
Plays a music event on the peer of the character concated with _INSTRUMENT&lt;br /&gt;
&lt;br /&gt;
'''SetX(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the X component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetY(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Y component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Z component of the FLOAT3&lt;br /&gt;
&lt;br /&gt;
'''SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)'''&lt;br /&gt;
&lt;br /&gt;
Changes the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)'''&lt;br /&gt;
&lt;br /&gt;
Resets the atmosphere of the trigger&lt;br /&gt;
&lt;br /&gt;
'''AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1], [INT:force=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status influence strength on the object.&lt;br /&gt;
&lt;br /&gt;
'''AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=&amp;quot;&amp;quot;], [INT:isWeather=1])'''&lt;br /&gt;
&lt;br /&gt;
Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again&lt;br /&gt;
&lt;br /&gt;
'''CallFunction(FIXEDSTRING:functionName)'''&lt;br /&gt;
&lt;br /&gt;
Calls a function with the ID&lt;br /&gt;
&lt;br /&gt;
'''SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWeapon[)'''&lt;br /&gt;
&lt;br /&gt;
Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map&lt;br /&gt;
&lt;br /&gt;
'''TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])'''&lt;br /&gt;
&lt;br /&gt;
Teleport object to or near the target&lt;br /&gt;
&lt;br /&gt;
'''Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Transforms &amp;lt;object&amp;gt; using &amp;lt;root&amp;gt;, returns &amp;lt;currentHP&amp;gt;, plays &amp;lt;fx&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''SaveGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Save the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadGame(FIXEDSTRING:saveGameName)'''&lt;br /&gt;
&lt;br /&gt;
Load the savegame with name &amp;lt;saveGameName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LoadLevel(FIXEDSTRING:levelName)'''&lt;br /&gt;
&lt;br /&gt;
Load the level with name &amp;lt;levelName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''KillCombat(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Kill all the enemies in the combat which contains &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Tag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''ClearGlobalFlag(FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Global Flag&lt;br /&gt;
&lt;br /&gt;
'''SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the Object&lt;br /&gt;
&lt;br /&gt;
'''SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Sets the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)'''&lt;br /&gt;
&lt;br /&gt;
Clears the Flag on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''StartVoiceBark(STRING:barkName, CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Start a voicebark on character&lt;br /&gt;
&lt;br /&gt;
'''ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)'''&lt;br /&gt;
&lt;br /&gt;
Resolve the crime with id CrimeID for the specified criminals&lt;br /&gt;
&lt;br /&gt;
'''CrimesceneInvestigationDone(CHARACTER:investigator)'''&lt;br /&gt;
&lt;br /&gt;
Crimescene is considered investigated by this NPC, start looking for culprits&lt;br /&gt;
&lt;br /&gt;
'''ListAdd(LIST&amp;lt;OBJECT&amp;gt;:list, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;entry&amp;gt; at the back of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListRemove(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index)'''&lt;br /&gt;
&lt;br /&gt;
Remove the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListSet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, OBJECT:entry)'''&lt;br /&gt;
&lt;br /&gt;
Set the entry at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt; to &amp;lt;entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListClear(LIST&amp;lt;OBJECT&amp;gt;:list)'''&lt;br /&gt;
&lt;br /&gt;
Remove all entries of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''EndTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Ends the object's current turn&lt;br /&gt;
&lt;br /&gt;
'''SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can fight. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity can join combats. Optional for the whole group&lt;br /&gt;
&lt;br /&gt;
'''SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the entity is a boss.&lt;br /&gt;
&lt;br /&gt;
'''GetAIHintTriggers(OUT LIST&amp;lt;TRIGGER&amp;gt;:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)'''&lt;br /&gt;
&lt;br /&gt;
Returns all AIHintAreaTriggers in &amp;lt;triggers&amp;gt;. Uses contraints if set.&lt;br /&gt;
&lt;br /&gt;
'''SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)'''&lt;br /&gt;
&lt;br /&gt;
Overwrites the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''ResetCombatTimeout(CHARACTER|ITEM:entity)'''&lt;br /&gt;
&lt;br /&gt;
Resets the entity's combat timeout check.&lt;br /&gt;
&lt;br /&gt;
'''EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)'''&lt;br /&gt;
&lt;br /&gt;
Enters combat with target&lt;br /&gt;
&lt;br /&gt;
'''LeaveCombat(CHARACTER|ITEM:source)'''&lt;br /&gt;
&lt;br /&gt;
Leaves the combat&lt;br /&gt;
&lt;br /&gt;
'''SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)'''&lt;br /&gt;
&lt;br /&gt;
Changes the faction of a character or item&lt;br /&gt;
&lt;br /&gt;
'''SetInvulnerable(CHARACTER|ITEM:target, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character or item invulnerable or not. (Allow damage)&lt;br /&gt;
&lt;br /&gt;
'''JumpToTurn(CHARACTER|ITEM:Target)'''&lt;br /&gt;
&lt;br /&gt;
Jumps to targets turn (ends the current turn)&lt;br /&gt;
&lt;br /&gt;
'''Sleep(FLOAT:timeInSeconds)'''&lt;br /&gt;
&lt;br /&gt;
Sleeps for a certain amount of time&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Moves in weapon range and attacks the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])'''&lt;br /&gt;
&lt;br /&gt;
Attacks the target without checking weaponranges and without moving&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])'''&lt;br /&gt;
&lt;br /&gt;
Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail) &lt;br /&gt;
&lt;br /&gt;
'''CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)'''&lt;br /&gt;
&lt;br /&gt;
Moves to the target, calculated by the AI. Should only be used with results from the AI!&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST&amp;lt;TRIGGER&amp;gt;:hintTriggers=null, INT:mustBeInTrigger=0])'''&lt;br /&gt;
&lt;br /&gt;
Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveOutOfSight(FLOAT:angle)'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1])'''&lt;br /&gt;
&lt;br /&gt;
Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still) &lt;br /&gt;
&lt;br /&gt;
'''CharacterStopAnimation(-)'''&lt;br /&gt;
&lt;br /&gt;
Stops all animations.&lt;br /&gt;
&lt;br /&gt;
'''CharacterPickUpItem(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and picks it up&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseItem(ITEM:item [, INTEGER:LongPath])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and uses it&lt;br /&gt;
&lt;br /&gt;
'''CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])'''&lt;br /&gt;
&lt;br /&gt;
Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;skill&amp;gt; to &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveSkill(CHARACTER:character, SKILL:skill)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;skill&amp;gt; from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])'''&lt;br /&gt;
&lt;br /&gt;
Cast a skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appear at the target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)'''&lt;br /&gt;
&lt;br /&gt;
Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])'''&lt;br /&gt;
&lt;br /&gt;
Move out of screen and go of stage, will run if &amp;lt;isRunning&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOffStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set Off Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetOnStage(-)'''&lt;br /&gt;
&lt;br /&gt;
Set On Stage&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates the character to look at the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])'''&lt;br /&gt;
&lt;br /&gt;
Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the target for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)'''&lt;br /&gt;
&lt;br /&gt;
Follow the leader or owner for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])'''&lt;br /&gt;
&lt;br /&gt;
Wander around for a certain time&lt;br /&gt;
&lt;br /&gt;
'''CharacterSwitchWeaponType(WEAPON:type)'''&lt;br /&gt;
&lt;br /&gt;
If necessary switch to the new weapon type&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFrom(RELATION:relation, FLOAT:range)'''&lt;br /&gt;
&lt;br /&gt;
Run away from certain characters if necessary&lt;br /&gt;
'''&lt;br /&gt;
CharacterFleeFromSurface(SURFACE:surface)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a certain surface if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterFleeFromDangerousSurface(-)'''&lt;br /&gt;
&lt;br /&gt;
Run away from a dangerous surfaces if necessary&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddSourcePoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Adds x source points (x can be negative to substract)&lt;br /&gt;
&lt;br /&gt;
'''CharacterDie(CHARACTER:character[, DEATH:type=DoT])'''&lt;br /&gt;
&lt;br /&gt;
Kills the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterHeal(CHARACTER:character, FLOAT:percentage)'''&lt;br /&gt;
&lt;br /&gt;
Heals the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume(CHARACTER:character, POTION:potion)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Disables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterEnableAllCrimes(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Enables all generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
'''&lt;br /&gt;
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Enables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)'''&lt;br /&gt;
&lt;br /&gt;
Disables the specified generic behaviours for &amp;lt;target&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetLongInvestigationDuration(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Calculate the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiStopCalculate(-)'''&lt;br /&gt;
&lt;br /&gt;
Stop the calculation of the AI of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFinishMoveSkill(-)'''&lt;br /&gt;
&lt;br /&gt;
Finish the current MoveSkill.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Make it no longer interesting for the AI to destroy that Item&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)'''&lt;br /&gt;
&lt;br /&gt;
Sets the archetype of the character, used in AI calculations&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStoryNPC(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character storyNPC or not.&lt;br /&gt;
'''&lt;br /&gt;
CharacterAddActionPoints(CHARACTER:character, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Give character some action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetImmortal(CHARACTER:character, INT:bool)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character immortal or not. (Allow dying)&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the character and it follows the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterEvent(CHARACTER:character, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw a character/character event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)'''&lt;br /&gt;
&lt;br /&gt;
Changes the relationship between 2 characters.&lt;br /&gt;
'''&lt;br /&gt;
CharacterForceUpdate(INT:forceUpdate)'''&lt;br /&gt;
&lt;br /&gt;
Makes sure the attached character is always being update or not. &lt;br /&gt;
'''&lt;br /&gt;
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)'''&lt;br /&gt;
&lt;br /&gt;
Sets the current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null])'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterDestroy(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can spot sneaking characters.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the fact if the character can do attack of opportunities.&lt;br /&gt;
&lt;br /&gt;
'''CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])'''&lt;br /&gt;
&lt;br /&gt;
Resurrects the character at [2]% health.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])'''&lt;br /&gt;
&lt;br /&gt;
Add the item to the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])'''&lt;br /&gt;
&lt;br /&gt;
Remove the item from the character. If Amount is -1, then all are removed&lt;br /&gt;
&lt;br /&gt;
'''CharacterDrinkPotion(FIXEDSTRING:statID)'''&lt;br /&gt;
&lt;br /&gt;
Makes the character drink a potion from the inventory.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation override, only walk/run/die animations can override it.&lt;br /&gt;
&lt;br /&gt;
'''CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])'''&lt;br /&gt;
&lt;br /&gt;
Uses x action points&lt;br /&gt;
&lt;br /&gt;
'''CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Adds &amp;lt;treasureTable&amp;gt; to the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)'''&lt;br /&gt;
&lt;br /&gt;
Removes &amp;lt;treasureTable&amp;gt; from the treasure list of &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterClearTreasureTables(CHARACTER:character)'''&lt;br /&gt;
&lt;br /&gt;
Removes all treasure tables from &amp;lt;character&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)'''&lt;br /&gt;
&lt;br /&gt;
Creates a temporary hostile relation between the 2 characters!&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Set the character in sheath/unsheated mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])'''&lt;br /&gt;
&lt;br /&gt;
Applies &amp;lt;statsEntry&amp;gt; from character.xlsm to &amp;lt;character&amp;gt;, returns &amp;lt;currentHP&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets walk speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])'''&lt;br /&gt;
&lt;br /&gt;
Sets run speed override of &amp;lt;character&amp;gt;, removes it if &amp;lt;override&amp;gt; is 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the dialog of the character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)'''&lt;br /&gt;
&lt;br /&gt;
Start patroling from the given index along the given spline with the given character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterStopPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Let the character stop patrolling whatever spline he's on!&lt;br /&gt;
&lt;br /&gt;
'''CharacterInterruptPatrol(-)'''&lt;br /&gt;
&lt;br /&gt;
Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)'''&lt;br /&gt;
&lt;br /&gt;
Sets an animation set override for a character. Empty fixedstring clears the override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)'''&lt;br /&gt;
&lt;br /&gt;
Sets &amp;lt;target&amp;gt; floating if &amp;lt;isFloating&amp;gt; is not 0&lt;br /&gt;
&lt;br /&gt;
'''CharacterResetCooldowns(CHARACTER:target)'''&lt;br /&gt;
&lt;br /&gt;
Resets the skill cooldowns for &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ItemEvent(ITEM:item, STRING:eventName)'''&lt;br /&gt;
&lt;br /&gt;
Throw an item event which you can catch in scripts and story&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimation(FIXEDSTRING:animation)'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])'''&lt;br /&gt;
&lt;br /&gt;
Plays an animation on the item to the target time (percentage of the total duration)&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays an effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])'''&lt;br /&gt;
&lt;br /&gt;
Plays a looping effect on the item and it follows the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetOnStage(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item on or offstage&lt;br /&gt;
&lt;br /&gt;
'''ItemSetCanInteract(ITEM:item, INTEGER:bool)'''&lt;br /&gt;
&lt;br /&gt;
Sets an item (not) interactible&lt;br /&gt;
&lt;br /&gt;
'''ItemClose(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Close an item&lt;br /&gt;
&lt;br /&gt;
'''ItemOpen(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Open an item&lt;br /&gt;
&lt;br /&gt;
'''ItemDrop(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Drop an item&lt;br /&gt;
&lt;br /&gt;
'''ItemLock(ITEM:item, FIXEDSTRING:key)'''&lt;br /&gt;
&lt;br /&gt;
Lock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemUnlock(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Unlock an item&lt;br /&gt;
&lt;br /&gt;
'''ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])'''&lt;br /&gt;
&lt;br /&gt;
Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second) &lt;br /&gt;
&lt;br /&gt;
'''ItemRemoveStatus(ITEM:item, STATUS:statusId)'''&lt;br /&gt;
&lt;br /&gt;
Removes the status from the item&lt;br /&gt;
&lt;br /&gt;
'''ItemDie(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Kills the item&lt;br /&gt;
&lt;br /&gt;
'''ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target&lt;br /&gt;
&lt;br /&gt;
'''ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])'''&lt;br /&gt;
&lt;br /&gt;
Moves the item to the target's inventory&lt;br /&gt;
&lt;br /&gt;
'''ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)'''&lt;br /&gt;
&lt;br /&gt;
Rotates the item to look at the target&lt;br /&gt;
&lt;br /&gt;
'''ItemDestroy(ITEM:item)'''&lt;br /&gt;
&lt;br /&gt;
Destroys the item&lt;br /&gt;
&lt;br /&gt;
'''ItemSetAmount(ITEM:item, INT:amount)'''&lt;br /&gt;
&lt;br /&gt;
Change the amount of the item&lt;br /&gt;
&lt;br /&gt;
'''IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])'''&lt;br /&gt;
&lt;br /&gt;
Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.&lt;br /&gt;
&lt;br /&gt;
'''ItemAddCharges(ITEM:TargetItem, INT:charges)'''&lt;br /&gt;
&lt;br /&gt;
Add/subtract charges from an item&lt;br /&gt;
&lt;br /&gt;
'''ItemResetChargesToInitial(ITEM:TargetItem)'''&lt;br /&gt;
&lt;br /&gt;
Resets charges from item to initial state&lt;br /&gt;
&lt;br /&gt;
'''MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make peace between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])'''&lt;br /&gt;
&lt;br /&gt;
Make war between users of the characters&lt;br /&gt;
&lt;br /&gt;
'''FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest surface of a specific type.&lt;br /&gt;
&lt;br /&gt;
'''FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest valid position (where the object can stand.)&lt;br /&gt;
&lt;br /&gt;
'''FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])'''&lt;br /&gt;
&lt;br /&gt;
Finds the closest position from the source (within radius) where the conditions are matched. &lt;br /&gt;
&lt;br /&gt;
'''Cast(OUT OBJECT variable, OBJECT value)'''&lt;br /&gt;
&lt;br /&gt;
Casts the value to the variable.&lt;br /&gt;
&lt;br /&gt;
'''StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)'''&lt;br /&gt;
&lt;br /&gt;
Appends stringB to stringA. Resulting string is stored in the third parameter.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current position of an object&lt;br /&gt;
&lt;br /&gt;
'''GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current forward direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current right direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the current up direction of an object&lt;br /&gt;
&lt;br /&gt;
'''GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the direction from src to target (optional: returns the distance between the objects as well)&lt;br /&gt;
&lt;br /&gt;
'''GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the rotation of an object&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTargetSpline(INT: SplineIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.&lt;br /&gt;
&lt;br /&gt;
'''IsEqual(OBJECT:variable, OBJECT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if they are equal.&lt;br /&gt;
&lt;br /&gt;
'''IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is smaller.&lt;br /&gt;
&lt;br /&gt;
'''IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares both objects and see if the first one is bigger.&lt;br /&gt;
&lt;br /&gt;
'''IsRandom(FLOAT:percentage)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)&lt;br /&gt;
&lt;br /&gt;
'''IsRound(INT:roundNumber)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if we are currently in combat in round x&lt;br /&gt;
&lt;br /&gt;
'''IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character, item, trigger or position is currently within the specific surface.&lt;br /&gt;
&lt;br /&gt;
'''IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if &amp;lt;target&amp;gt; is currently in on a dangerous surface. Uses &amp;lt;character&amp;gt; for path influences if provided (is necessary with non-character targets)&lt;br /&gt;
&lt;br /&gt;
'''IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in a dialog, optionally ignoring automated dialogs&lt;br /&gt;
&lt;br /&gt;
'''IsInAutomatedDialog(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character or item is currently in an automated dialog&lt;br /&gt;
&lt;br /&gt;
'''GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 positions&lt;br /&gt;
&lt;br /&gt;
'''GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the 2D distance between 2 positions (ignores height)&lt;br /&gt;
&lt;br /&gt;
'''GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.&lt;br /&gt;
&lt;br /&gt;
'''GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the position of a gameobject (character, item, trigger, ...)&lt;br /&gt;
&lt;br /&gt;
'''GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a global variable from the target&lt;br /&gt;
&lt;br /&gt;
'''GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the closest player near the source, default being being the object itself&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerCount(OUT INT:playerCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the number of players in the party&lt;br /&gt;
&lt;br /&gt;
'''GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a player from the party by index&lt;br /&gt;
&lt;br /&gt;
'''GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a random character in the current level&lt;br /&gt;
&lt;br /&gt;
'''ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if there is any surface of the type within a radius of the source&lt;br /&gt;
&lt;br /&gt;
'''IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the whole radius around the source is the specified surface type&lt;br /&gt;
&lt;br /&gt;
'''IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if the source is standing on the target&lt;br /&gt;
&lt;br /&gt;
'''GetX(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the X component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetY(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Y component of the vector&lt;br /&gt;
&lt;br /&gt;
'''GetZ(FLOAT3:vector, OUT FLOAT:value)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the Z component of the vector&lt;br /&gt;
&lt;br /&gt;
'''CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the sight is blocked between 2 points.&lt;br /&gt;
&lt;br /&gt;
'''IsVisible(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is set invisible or not with SetVisible.&lt;br /&gt;
&lt;br /&gt;
'''GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets how long a text needs to be displayed&lt;br /&gt;
&lt;br /&gt;
'''IsCasual(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Casual&lt;br /&gt;
&lt;br /&gt;
'''IsHardcore(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the current game mode is Hardcore&lt;br /&gt;
&lt;br /&gt;
'''IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the object is tagged.&lt;br /&gt;
&lt;br /&gt;
'''TranslatedStringKeyExists(FIXEDSTRING:key)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the TranslatedString key exists.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombat(CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the objects are in combat with each other.&lt;br /&gt;
&lt;br /&gt;
'''IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object is facing the position within the given angle.&lt;br /&gt;
&lt;br /&gt;
'''GameIsSaving(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is saving.&lt;br /&gt;
&lt;br /&gt;
'''GameIsLoading(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game is loading.&lt;br /&gt;
&lt;br /&gt;
'''GetUserCount(OUT INT:userCount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the user count.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentCharacter(OUT CHARACTER:character, INT:user)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character currently being controlled by the specified user.&lt;br /&gt;
&lt;br /&gt;
'''GetCurrentLevel(OUT FIXEDSTRING:currentLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current levelname&lt;br /&gt;
&lt;br /&gt;
'''GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns AI bounds of &amp;lt;source&amp;gt; in &amp;lt;bounds&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''HasGlobalFlag(FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Global Flag is set&lt;br /&gt;
&lt;br /&gt;
'''HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the Object&lt;br /&gt;
&lt;br /&gt;
'''HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the user's characters&lt;br /&gt;
&lt;br /&gt;
'''HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the Flag is set on the party's characters&lt;br /&gt;
&lt;br /&gt;
'''DialogExists(STRING:dialogue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the dialogue exists.&lt;br /&gt;
&lt;br /&gt;
'''IsActive(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character or item is currently active.&lt;br /&gt;
&lt;br /&gt;
'''ListGetSize(LIST&amp;lt;OBJECT&amp;gt;:list, out INT:size)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of elements in &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGet(LIST&amp;lt;OBJECT&amp;gt;:list, INT:index, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;entry&amp;gt; at &amp;lt;index&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ListGetRandom(LIST&amp;lt;OBJECT&amp;gt;:list, out OBJECT:entry)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a random &amp;lt;entry&amp;gt; of &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IsBoss(CHARACTER|ITEM:Object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the entity is tagged as a boss&lt;br /&gt;
&lt;br /&gt;
'''IsProjectileSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a ranged skill (uses a projectile)&lt;br /&gt;
&lt;br /&gt;
'''IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether &amp;lt;target&amp;gt; is a valid target for &amp;lt;skill&amp;gt; at &amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the faction of the provided character or item&lt;br /&gt;
&lt;br /&gt;
'''IsInActiveTurn(CHARACTER|ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if it's the character's or item's turn in combat.&lt;br /&gt;
&lt;br /&gt;
'''IsSkillActive(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has &amp;lt;skillId&amp;gt; active (in memory).&lt;br /&gt;
&lt;br /&gt;
'''HasSkillAi(SKILLID:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is using the new Ai system&lt;br /&gt;
&lt;br /&gt;
'''IsInArena(CHARACTER::character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in an arena fight&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the type of the crime with this id.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the criminals of that crime. They might all be null.&lt;br /&gt;
&lt;br /&gt;
'''IsSourceSkill(SKILL:skill)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the skill is a source skill.&lt;br /&gt;
&lt;br /&gt;
'''IsInGameMasterMode(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the game in game master mode.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a character within a certain range conforming to the filled in restraints. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Counts the characters within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character's owner&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the character to follow&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get current enemy of character&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can cast the skill: will check cooldown, actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSitOnItem(CHARACTER:source, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can sit or lie on an item.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can drink the potion: will check inv and actionpoints&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in the world&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character source can use the item in his inventory&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character has target in his line of sight. &lt;br /&gt;
&lt;br /&gt;
'''CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character can shoot the target.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPlayer(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is a player&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInParty(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if the character is in the party&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsEnemy(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is enemy of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsAlly(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is ally of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsNeutral(CHARACTER:source, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is neutral of source&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsDead(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is dead&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsMoving(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is moving (speed &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsSummon(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a summon&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPartyFollower(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a party follower&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsStoryNPC(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a story NPC&lt;br /&gt;
&lt;br /&gt;
'''CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the current's weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if target is in the character's touch range &lt;br /&gt;
&lt;br /&gt;
'''CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasTalent(CHARACTER:character, TALENT:talent)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the talent&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasSkill(CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has the skill&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character currently has a weapon of this type in his inventory or equipped&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Vitality, ...)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's sight range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current weapon range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's current touch range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's skill range&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's value of the specified ability&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetHostileCount(OUT INT:value, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanFight(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can fight.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanSpotSneakers(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can spot sneaking characters&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsFloating(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if character is a floating character&lt;br /&gt;
&lt;br /&gt;
'''CharacterInCreation(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character is in character creation&lt;br /&gt;
&lt;br /&gt;
'''CharacterAvoidsTraps(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character avoids traps&lt;br /&gt;
&lt;br /&gt;
'''CharacterCheckRelation(CHARACTER:character, RELATION:relation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if relation check succeeds&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if score is higher or equal than the current score&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character was hit by this type.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasCastedSpellLastTurn(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has casted a spell in his last turn.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasHadStatus(CHARACTER:character, STATUS:status)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has had a specific status this combat.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasAnimationOverride(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character has an animation override.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanUnlock(CHARACTER:character, ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the character can unlock the item (if the item is already unlocked it returns true!)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the character's reserved User id.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the &amp;lt;character&amp;gt;'s race in &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt;'s race is &amp;lt;race&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true + &amp;lt;destination&amp;gt; if &amp;lt;character&amp;gt; can move &amp;lt;item&amp;gt; somewhere between &amp;lt;minRadius&amp;gt; and &amp;lt;maxRadius&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns death type of &amp;lt;character&amp;gt; in &amp;lt;deathType&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the still animation to play&lt;br /&gt;
&lt;br /&gt;
'''CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try and transfer the leadership of this crime to someone else.&lt;br /&gt;
&lt;br /&gt;
'''CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lead investigator for the crime.&lt;br /&gt;
&lt;br /&gt;
'''CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;source&amp;gt; can hit &amp;lt;target&amp;gt; with currently equipped ranged weapon. Will use &amp;lt;skill&amp;gt; instead of equipped weapon if provided.&lt;br /&gt;
&lt;br /&gt;
'''CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has has ranged weapon. Checks for non-wielded weapons if &amp;lt;checkInventory&amp;gt; is 1&lt;br /&gt;
&lt;br /&gt;
'''CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; could interact with &amp;lt;target&amp;gt;. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of sourcepoints of &amp;lt;character&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiIsCalculating(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character is still calculating the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Move Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Skill command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchConsumeCommand(OUT ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Consume command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Attack command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the character has a Fallback command to execute according to the AI.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the archetype of the character.&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; is polymorphed into &amp;lt;race&amp;gt;. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).&lt;br /&gt;
&lt;br /&gt;
'''CharacterIsPolymorphInteractionDisabled(CHARACTER:character)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if &amp;lt;character&amp;gt; has his interaction disabled because of a polymorph.&lt;br /&gt;
&lt;br /&gt;
'''ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get an item within a certain range conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the first item in the inventory conforming to the filled in restraints.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is in the inventory of the character&lt;br /&gt;
&lt;br /&gt;
'''ItemIsInTrigger(ITEM:item, TRIGGER:trigger)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check if item is in given trigger&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current value of the stat (Weight, ...)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMoving(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is moving or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsFalling(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is falling or not. (after teleport)&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpening(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is opening or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsClosing(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is closing or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsLocked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is locked or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsMovable(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is movable or not.&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeLockPicked(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is can be opened by lockpicking.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsOpen(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is open or not.&lt;br /&gt;
&lt;br /&gt;
'''IsStoryItem(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is a story item.&lt;br /&gt;
&lt;br /&gt;
'''ItemHasStatus(ITEM:item, STATUS:statusId)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item has the status.&lt;br /&gt;
&lt;br /&gt;
'''ItemIsDestroyed(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item is destroyed.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the roottemplate of the item.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetSkillId(ITEM:item, OUT SKILL:root)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the skillid of the item if it has one.&lt;br /&gt;
&lt;br /&gt;
'''ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the itemtype of the item: common, unique, rare, ...&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source character of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get the source item of a status&lt;br /&gt;
&lt;br /&gt;
'''ItemCanBeMoved(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the item can be moved.&lt;br /&gt;
&lt;br /&gt;
'''GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)''' &amp;lt;br &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns true if the object has the given status, and returns the amount of turns still left&lt;br /&gt;
&lt;br /&gt;
== EVENTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterEvent(CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemEvent(ITEM:item, STRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown from scripts or story&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroyed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDestroying(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is being destroyed&lt;br /&gt;
&lt;br /&gt;
'''OnItemOpened(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is opened&lt;br /&gt;
&lt;br /&gt;
'''OnItemClosed(ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is closed&lt;br /&gt;
&lt;br /&gt;
'''OnItemDropped(ITEM:item, STRING:itemTemplate)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item is dropped&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagSet(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is set&lt;br /&gt;
&lt;br /&gt;
'''OnGlobalFlagCleared(FIXEDSTRING:eventName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a global event is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is set on an item&lt;br /&gt;
&lt;br /&gt;
'''OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is cleared on an item&lt;br /&gt;
&lt;br /&gt;
'''OnTimer(FIXEDSTRING:timerName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a timer has ended&lt;br /&gt;
&lt;br /&gt;
'''OnInit(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is set&lt;br /&gt;
&lt;br /&gt;
'''OnLoaded(INT:major, INT:minor, INT:revision, INT:build)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the script is loaded from the savegame&lt;br /&gt;
&lt;br /&gt;
'''OnShutdown(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's script is removed&lt;br /&gt;
&lt;br /&gt;
'''OnVariableCleared(FIXEDSTRING:varName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object's script variable is cleared from Osiris with ClearVarObject&lt;br /&gt;
&lt;br /&gt;
'''OnCombatStarted(INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnCombatSwitched(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character switch from one combat to another&lt;br /&gt;
&lt;br /&gt;
'''OnLeftCombat(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character or item left the combat&lt;br /&gt;
&lt;br /&gt;
'''OnTurn(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn starts&lt;br /&gt;
&lt;br /&gt;
'''OnTurnEnded(CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's turn ended&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnItemVitalityChanged(ITEM:item, FLOAT:percentage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item's vitality changed&lt;br /&gt;
&lt;br /&gt;
'''OnAttackOfOpportunity(CHARACTER:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters gets an attack of opportunity on an enemy&lt;br /&gt;
&lt;br /&gt;
'''OnClearAttackOfOpportunity(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the characters attack of opportunity is cleared&lt;br /&gt;
&lt;br /&gt;
'''OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the object receives damage&lt;br /&gt;
&lt;br /&gt;
'''OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dodges something&lt;br /&gt;
&lt;br /&gt;
'''OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character is critical hit&lt;br /&gt;
&lt;br /&gt;
'''OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown before the character blocks something (at the start of the attack animation)&lt;br /&gt;
&lt;br /&gt;
'''OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character blocks something&lt;br /&gt;
&lt;br /&gt;
'''OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character dies&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusApplied(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusAttempt(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item attempts to gain a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatus(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item gains a status&lt;br /&gt;
&lt;br /&gt;
'''OnItemStatusRemoved(ITEM:item, STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item loses a status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusCreateVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should create the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnStatusDestroyVisuals(STATUS:status)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the item should destroy the visuals for this status&lt;br /&gt;
&lt;br /&gt;
'''OnSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character sees another character&lt;br /&gt;
&lt;br /&gt;
'''OnLostSight(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character doesn't see another character anymore&lt;br /&gt;
&lt;br /&gt;
'''OnUseItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses an item&lt;br /&gt;
&lt;br /&gt;
'''OnPickupItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character picks up an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterMovedItem(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character moved an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemEquipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character equips an item&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnequipped(CHARACTER:source, ITEM:item)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character unequips an item&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateItem(ITEM:source, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators&lt;br /&gt;
&lt;br /&gt;
'''OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by iterators after all iterations to inform you of the count.&lt;br /&gt;
&lt;br /&gt;
'''OnStoryOverride(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throw when story overrides what the character was doing: teleport, movement, on/offstage&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item entering an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown by a character or item leaving an EventTrigger&lt;br /&gt;
&lt;br /&gt;
'''OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character's currentenemy changes&lt;br /&gt;
&lt;br /&gt;
'''OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character unlocks a new talent&lt;br /&gt;
&lt;br /&gt;
'''OnTalentLocked(CHARACTER:character, TALENT:removedTalent)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the there's a talent removed from a character&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character changes class in the character creation screen&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has started, and gives where the character should walk to&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterCreationStopped(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character creation has stopped&lt;br /&gt;
&lt;br /&gt;
'''OnFunction(FIXEDSTRING:functionName)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Throws an event on itself with the functionName. This is to fake function calls &lt;br /&gt;
&lt;br /&gt;
'''OnSkillCast(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character casts a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the character needs to make a comment&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when you are hit by a skill from a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when an item gets unlocked by a character.&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a automated dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogStarted(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is started for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnDialogEnded(STRING:dialogName, INT:instanceID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog is ended for this speaker&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform a sensible action against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character needs to perform an interrogation against criminals&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
One NPC investigates a crimescene&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
All NPCs in a crimearea start looking around.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeReturnToNormal(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Investigation or Alarm timed out.&lt;br /&gt;
&lt;br /&gt;
'''OnCrimeAborted(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
The game interrupted the sensible action of this NPC.&lt;br /&gt;
&lt;br /&gt;
'''OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character reached a spline node.&lt;br /&gt;
&lt;br /&gt;
''''OnFinishCalculationAi(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the calculation of the AI is finished.&lt;br /&gt;
&lt;br /&gt;
'''OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when the grenades lands&lt;br /&gt;
&lt;br /&gt;
'''FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST&amp;lt;STATUS&amp;gt;:removeStatuses, STATUS:applyStatus, INT:turns)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script which statuses to remove and apply.&lt;br /&gt;
&lt;br /&gt;
'''FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script what skill to execute on damage.&lt;br /&gt;
&lt;br /&gt;
'''FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score) &amp;lt;br /&amp;gt;&lt;br /&gt;
Fetch from script the score of a skill with set source and target&lt;br /&gt;
&lt;br /&gt;
'''OnActivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item activates&lt;br /&gt;
&lt;br /&gt;
'''OnDeactivate(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character/item deactivates&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterUsedSourcePoint(CHARACTER:character)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character uses a source point&lt;br /&gt;
&lt;br /&gt;
'''OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character learns a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character activates (=adds to memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character deactivates (=removes from memory) a skill&lt;br /&gt;
&lt;br /&gt;
'''OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with an item&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a dialog event is shared with a character&lt;br /&gt;
&lt;br /&gt;
'''OnItemOffStageChanged(CHARACTER:character, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterOffStageChanged(ITEM:item, INT:offstage)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a item is set on/off stage&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character gets teleported with a teleport skill&lt;br /&gt;
&lt;br /&gt;
'''OnCombatTick(-)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.&lt;br /&gt;
&lt;br /&gt;
'''OnCombatRoundStarted(INT:combatID, INT:roundID) &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a round in a combat starts&lt;br /&gt;
&lt;br /&gt;
'''OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item is ready in combat&lt;br /&gt;
&lt;br /&gt;
'''OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item leaves a region&lt;br /&gt;
&lt;br /&gt;
'''OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character or item enters a region&lt;br /&gt;
&lt;br /&gt;
'''OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; inserts a rune with roottemplate &amp;lt;runeItemTemplate&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a &amp;lt;character&amp;gt; removes a &amp;lt;rune&amp;gt; from an &amp;lt;item&amp;gt; at a specified &amp;lt;slot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a character or item with default attack&lt;br /&gt;
&lt;br /&gt;
'''OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Thrown when a character attacks a position with default attack&lt;br /&gt;
&lt;br /&gt;
== INTERRUPTS ==&lt;br /&gt;
&lt;br /&gt;
'''OnMovementFailed(FLOAT3:targetPos)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a move action failing&lt;br /&gt;
&lt;br /&gt;
'''OnException(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by an exception&lt;br /&gt;
&lt;br /&gt;
'''OnBetterReactionFound(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by another reaction&lt;br /&gt;
&lt;br /&gt;
'''OnNoReactionFound(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because no reaction is valid&lt;br /&gt;
&lt;br /&gt;
'''OnScriptDisabled(-)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted because the scriptcontroller is disabled&lt;br /&gt;
&lt;br /&gt;
'''OnManualInterrupt(FIXEDSTRING:reactionName)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted using the interrupt action&lt;br /&gt;
&lt;br /&gt;
'''OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Thrown when the reaction is interrupted by a region swap&lt;br /&gt;
&lt;br /&gt;
= Divinity: Original Sin 2 Definitive Edition =&lt;br /&gt;
The following was added/changed for the Definitive Edition.&lt;br /&gt;
&lt;br /&gt;
== CALLS ==&lt;br /&gt;
'''ItemDrop(ITEM:item)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Drops an item from it's owner's inventory. Only characters are treated as owners.&lt;br /&gt;
&lt;br /&gt;
'''RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)&lt;br /&gt;
&lt;br /&gt;
'''SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Makes surfaces at 2 locations/positions interact as if they were adjacent.&lt;br /&gt;
&lt;br /&gt;
'''SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Stops surfaces at 2 distinctive locations/positions from interacting.&lt;br /&gt;
&lt;br /&gt;
== QUERIES ==&lt;br /&gt;
'''AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns a level-mapped value of a primary attribute. (Difficulty = &amp;quot;Easy&amp;quot;, &amp;quot;Normal&amp;quot; or &amp;quot;Hard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetCreationClass(CHARACTER:character,  OUT FIXEDSTRING: class)''' &amp;lt;br &amp;gt;&lt;br /&gt;
During character creation returns character class. Fails outside of character creation.&lt;br /&gt;
&lt;br /&gt;
'''CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Returns item equipped into slot. (Slot = &amp;quot;Helmet&amp;quot;, &amp;quot;Breast&amp;quot;, &amp;quot;Leggings&amp;quot;, &amp;quot;Weapon&amp;quot;, &amp;quot;Shield&amp;quot;, &amp;quot;Ring&amp;quot;, &amp;quot;Ring2&amp;quot;, &amp;quot;Belt&amp;quot;, &amp;quot;Boots&amp;quot;, &amp;quot;Gloves&amp;quot;, &amp;quot;Amulet&amp;quot; or &amp;quot;Wings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(CHANGED) '''CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)''' &amp;lt;br &amp;gt;&lt;br /&gt;
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6388</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6388"/>
		<updated>2018-09-16T05:24:12Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: SkillCast DE update.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already [[Project browser|created a mod project]], and have a [[Osiris Overview|general idea on Osiris syntax]]. For the purposes of this tutorial, we will be using a basic &amp;quot;Addon&amp;quot; project that targets &amp;quot;Story&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Required Reading ==&lt;br /&gt;
The following is required reading, as it covers the Story Editor, and Osiris syntax and concepts:&lt;br /&gt;
* [[Story_editor|Story Editor]]&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
&lt;br /&gt;
=== API Docs ===&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
While some basic concepts are covered here, Osiris syntax and defintitions should be referred to in [[Osiris Overview]], as the goal of this tutorial is to guide you in creating a foundation for your code to run, via a parent script and child script.&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
==== Generate Definitions ====&lt;br /&gt;
When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
==== Prefixing ====&lt;br /&gt;
Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we could prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two.&lt;br /&gt;
&lt;br /&gt;
''This concept also applies for entries in the stats editor, as multiple entries with the same name will conflict.''&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended. For the sake of this tutorial, we'll be parenting our parent goal to __Start, which is a goal provided by Shared.&lt;br /&gt;
&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click &amp;quot;__Start&amp;quot; and select &amp;quot;Add New Sub Item...&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ParentingToStart.png|thumb|Right click the goal and click &amp;quot;Add New Sub Item...&amp;quot;]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Parenting to a DOS2 Goal ====&lt;br /&gt;
----&lt;br /&gt;
Instead of handling the completion events yourself, simply parenting your parent goal to some specific goals provided by Larian is an easy way to ensure your goal runs at the right time.&lt;br /&gt;
&lt;br /&gt;
;Parenting to __Start (No Origins Dependency)&lt;br /&gt;
:If your mod doesn't depend on Origins (see: [[Project_settings_window#The_Dependencies_Tab|Dependencies]], parenting your parent goal to __Start will ensure that it runs when the game is ready.&lt;br /&gt;
&lt;br /&gt;
;Parenting to Start (Origins Dependency)&lt;br /&gt;
:Start (not to be confused with __Start) is a top-level goal in Origins that completes when character creation is ready, or if a mode other than &amp;quot;Campaign&amp;quot; is started. Parenting to this goal requires your mod to have Origins as a dependency.&lt;br /&gt;
&lt;br /&gt;
;Manual Completion&lt;br /&gt;
:Rather than relying on an existing parent goal, it's possible to make a top-level goal that completes on its own. See more on that here: [[Your_First_Story_Script#Manually_Completing_Parent_Goals|Manually Completing Parent Goals]].&lt;br /&gt;
&lt;br /&gt;
==== Parenting Example ====&lt;br /&gt;
----&lt;br /&gt;
Inside of the INIT section of our new goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_WikiTutorial_ModStarted(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_WikiTutorial_ModStarted(1)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The goal should look like so:&lt;br /&gt;
[[File:FirstStoryScript_ParentGoal.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor.&lt;br /&gt;
# Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
The way this example works is, as soon as __Start calls GoalCompleted; (which occurs when the event GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;) fires), our goal then sets a database value, which then triggers our own code for GoalCompleted.&lt;br /&gt;
&lt;br /&gt;
Additionally, if this mod is added to an existing save, where __Start was already completed, our parent goal will complete as well, due to the way the parent-child goal relationship works (if a parent is already complete when a new child is added, that child will run).&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, parented sub-goals will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Databases are a powerful tool for making your scripting logic extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
=== Manually Completing Parent Goals ===&lt;br /&gt;
----&lt;br /&gt;
Instead of parenting your parent goal to one of the Start goals, it's possible to handle goal completion yourself, using a few different events:&lt;br /&gt;
&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
;[[Osiris/API/GameEventSet|GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)]]&lt;br /&gt;
: The first story event that gets thrown after the game engine has been initialised when starting a new game. This particular event will only fire the first time a new game is started, so additional rules are needed for cases where your mod is added to an existing save.&lt;br /&gt;
;[[Osiris/API/Osiris/API/SavegameLoaded|Osiris/API/SavegameLoaded]]&lt;br /&gt;
: Fires when a save is being loaded on an existing save. This can be used to complete your goal on existing saves that just added your mod.&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
The following is an example of handling initial goal completion yourself:&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyMod_Internal_CompleteIfStarted();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_Start()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Parent goal complete.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_CompleteIfStarted()&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:CompleteIfStarted] Story was already started.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
// For saves where this goal is active, but wasn't completed&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:SavegameLoaded] Mod added to an existing save.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Item_Progression&amp;diff=6386</id>
		<title>Talk:Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Item_Progression&amp;diff=6386"/>
		<updated>2018-09-14T22:15:46Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added a request.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Open Request: Reformatting the stat examples to the stats editor format (a.k.a. tables) ===&lt;br /&gt;
If anyone is interested in reworking the stat examples into a table format, to be more in line with the other wiki pages (such as the Treasure Tables page), that would be greatly appreciated. Personally I prefer to work with the generated text files directly, but I know that many people start off (and stick) with the stats editor, so I don't mind in the slightest if someone would like to take a crack at reformatting things. Thanks. &lt;br /&gt;
&lt;br /&gt;
[[User:LaughingLeader|LaughingLeader]] ([[User talk:LaughingLeader|talk]]) 00:15, 15 September 2018 (CEST)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6063</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=6063"/>
		<updated>2018-08-08T04:25:12Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Reorganized reading links, starting tips, added some information to clarify the purpose of the tutorial, and simplified parent goal completion section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already [[Project browser|created a mod project]], and have a [[Osiris Overview|general idea on Osiris syntax]]. For the purposes of this tutorial, we will be using a basic &amp;quot;Addon&amp;quot; project that targets &amp;quot;Story&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Required Reading ==&lt;br /&gt;
The following is required reading, as it covers the Story Editor, and Osiris syntax and concepts:&lt;br /&gt;
* [[Story_editor|Story Editor]]&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
&lt;br /&gt;
=== API Docs ===&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
While some basic concepts are covered here, Osiris syntax and defintitions should be referred to in [[Osiris Overview]], as the goal of this tutorial is to guide you in creating a foundation for your code to run, via a parent script and child script.&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
==== Generate Definitions ====&lt;br /&gt;
When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
==== Prefixing ====&lt;br /&gt;
Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we could prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two.&lt;br /&gt;
&lt;br /&gt;
''This concept also applies for entries in the stats editor, as multiple entries with the same name will conflict.''&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended. For the sake of this tutorial, we'll be parenting our parent goal to __Start, which is a goal provided by Shared.&lt;br /&gt;
&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click &amp;quot;__Start&amp;quot; and select &amp;quot;Add New Sub Item...&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ParentingToStart.png|thumb|Right click the goal and click &amp;quot;Add New Sub Item...&amp;quot;]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Parenting to a DOS2 Goal ====&lt;br /&gt;
----&lt;br /&gt;
Instead of handling the completion events yourself, simply parenting your parent goal to some specific goals provided by Larian is an easy way to ensure your goal runs at the right time.&lt;br /&gt;
&lt;br /&gt;
;Parenting to __Start (No Origins Dependency)&lt;br /&gt;
:If your mod doesn't depend on Origins (see: [[Project_settings_window#The_Dependencies_Tab|Dependencies]], parenting your parent goal to __Start will ensure that it runs when the game is ready.&lt;br /&gt;
&lt;br /&gt;
;Parenting to Start (Origins Dependency)&lt;br /&gt;
:Start (not to be confused with __Start) is a top-level goal in Origins that completes when character creation is ready, or if a mode other than &amp;quot;Campaign&amp;quot; is started. Parenting to this goal requires your mod to have Origins as a dependency.&lt;br /&gt;
&lt;br /&gt;
;Manual Completion&lt;br /&gt;
:Rather than relying on an existing parent goal, it's possible to make a top-level goal that completes on its own. See more on that here: [[Your_First_Story_Script#Manually_Completing_Parent_Goals|Manually Completing Parent Goals]].&lt;br /&gt;
&lt;br /&gt;
==== Parenting Example ====&lt;br /&gt;
----&lt;br /&gt;
Inside of the INIT section of our new goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_WikiTutorial_ModStarted(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_WikiTutorial_ModStarted(1)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The goal should look like so:&lt;br /&gt;
[[File:FirstStoryScript_ParentGoal.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor.&lt;br /&gt;
# Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
The way this example works is, as soon as __Start calls GoalCompleted; (which occurs when the event GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;) fires), our goal then sets a database value, which then triggers our own code for GoalCompleted.&lt;br /&gt;
&lt;br /&gt;
Additionally, if this mod is added to an existing save, where __Start was already completed, our parent goal will complete as well, due to the way the parent-child goal relationship works (if a parent is already complete when a new child is added, that child will run).&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, parented sub-goals will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Databases are a powerful tool for making your scripting logic extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
=== Manually Completing Parent Goals ===&lt;br /&gt;
----&lt;br /&gt;
Instead of parenting your parent goal to one of the Start goals, it's possible to handle goal completion yourself, using a few different events:&lt;br /&gt;
&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
;[[Osiris/API/GameEventSet|GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)]]&lt;br /&gt;
: The first story event that gets thrown after the game engine has been initialised when starting a new game. This particular event will only fire the first time a new game is started, so additional rules are needed for cases where your mod is added to an existing save.&lt;br /&gt;
;[[Osiris/API/Osiris/API/SavegameLoaded|Osiris/API/SavegameLoaded]]&lt;br /&gt;
: Fires when a save is being loaded on an existing save. This can be used to complete your goal on existing saves that just added your mod.&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
The following is an example of handling initial goal completion yourself:&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyMod_Internal_CompleteIfStarted();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_Start()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Parent goal complete.&amp;quot;);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
GameEventSet(&amp;quot;GAMEEVENT_GameStarted&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Internal_CompleteIfStarted()&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:CompleteIfStarted] Story was already started.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&lt;br /&gt;
// For saves where this goal is active, but wasn't completed&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
DB_StoryStarted(_)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod:SavegameLoaded] Mod added to an existing save.&amp;quot;);&lt;br /&gt;
MyMod_Internal_Start();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentingToStart.png&amp;diff=6062</id>
		<title>File:FirstStoryScript ParentingToStart.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentingToStart.png&amp;diff=6062"/>
		<updated>2018-08-08T00:45:31Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentGoalComplete.png&amp;diff=6061</id>
		<title>File:FirstStoryScript ParentGoalComplete.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentGoalComplete.png&amp;diff=6061"/>
		<updated>2018-08-08T00:40:15Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: LaughingLeader uploaded a new version of File:FirstStoryScript ParentGoalComplete.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentGoal.png&amp;diff=6060</id>
		<title>File:FirstStoryScript ParentGoal.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:FirstStoryScript_ParentGoal.png&amp;diff=6060"/>
		<updated>2018-08-08T00:39:46Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6048</id>
		<title>Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6048"/>
		<updated>2018-07-23T03:36:56Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
An important part of the treasure system, Item Progression is the link between item stats and root templates, and is necessary to customize the level range, rarity, and names of items generated by stats, or by treasure tables.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionVisuals ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionVisuals links an itemgroup with a levelgroup (the level range and rarity), a root group (the root template used), and a namegroup (the names to use).&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#itemgroup|itemgroup]]||Name||The name of the itemgroup, defined as a property on an item stat.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#LevelGroup|levelgroup]]||MinLevel,MaxLevel,[[Rarity]]||The level range and rarity to link the subsequent rootgroup and namegroup to.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#RootGroup|rootgroup]]||RootTemplate,[[ItemColor]]||The RootTemplate is the GUIDSTRING of the root template to use. ItemColor is defined in its own stats file, and changes the color of items with materials that support MSK.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#NameGroup|namegroup]]||NameGroup,[[Item_Progression#Cool_Names|AffixType]],[[Item_Progression#Icon_Override|Icon]]||The namegroup to use, whether to use the &amp;quot;cool&amp;quot; version, and an icon to use in place of the root template's icon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ItemGroup ===&lt;br /&gt;
&lt;br /&gt;
ItemGroup is a property set in equipment stats, and is used to group progression settings in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
To define an itemgroup, simply define the property on an equipment stat (weapon, armor, or shield):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;Maces_1H&amp;quot;&lt;br /&gt;
data &amp;quot;ModifierType&amp;quot; &amp;quot;Item&amp;quot;&lt;br /&gt;
data &amp;quot;Act&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Requirements&amp;quot; &amp;quot;Strength 12&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_Clubs is used as a base stat inherited by other club weapons. Here it defines &amp;quot;Maces_1H&amp;quot; as the itemgroup. If we wanted to inherit from _Clubs, but create a new itemgroup, we simply have to override the ItemGroup property:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
data &amp;quot;Act part&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;1000&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Club,Hammer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In our new stat, &amp;quot;WPN_Common_Mace_1H_A&amp;quot;, we inherit from _Clubs, but override the ItemGroup with our own, thus placing progression for our new item within its own group.&lt;br /&gt;
&lt;br /&gt;
=== LevelGroup ===&lt;br /&gt;
&lt;br /&gt;
The levelgroup sets the level range and [[Rarity]] that the following rootgroups and namegroups will apply to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Uncommon&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;648d501c-2d8e-4464-acfb-6e6f061305f6&amp;quot;,&amp;quot;MageUncommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;MageRobe9&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will generate at levels 9-16 at the &amp;quot;Uncommon&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 17,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;94aaefe8-4843-4624-b1a0-92d63be2e5b8&amp;quot;,&amp;quot;LizardsCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Claymore&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will spawn at level 17 and above, at the &amp;quot;Common&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;Wings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;a71d1908-7499-42c2-8c6b-a2173be582dc&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Wings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item is generated at any level, and any rarity. ''Fun fact: These are the wings created by the Wings Polymorph skill.''&lt;br /&gt;
&lt;br /&gt;
=== RootGroup ===&lt;br /&gt;
&lt;br /&gt;
The rootgroup is simply the GUIDSTRING of the root template to link the itemgroup with. The second property is an optional ItemColor to use. You can get the GUIDSTRING of a root template by right clicking it in the [[Root template panel]], and selecting &amp;quot;Copy GUID to clipboard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 4,4,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;16600f2c-3817-42e7-be9d-5804f8ac77c8&amp;quot;,&amp;quot;HumansCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Twohander 2&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NameGroup ===&lt;br /&gt;
&lt;br /&gt;
The namegroup is a set of names to use with the item, defined in ItemProgressionNames. The first parameter is the name of the namegroup, while the second and third parameters are optional, and usually blank (&amp;quot;&amp;quot;). The second parameter activates the &amp;quot;namecool&amp;quot; version of a name (via &amp;quot;Cool&amp;quot;), and the third parameter specifies the icon to use, which overrides the icon on the root template.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry uses the namegroup named &amp;quot;Elven Sword&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this entry also uses the namegroup named &amp;quot;Elven Sword&amp;quot;, it uses the &amp;quot;namecool&amp;quot; entry thanks to &amp;quot;Cool&amp;quot;, and uses the &amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot; icon instead of the one set by the root template.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionNames ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionNames defines a set of names and (optional) descriptions to use for items defined in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|namegroup||Name||The name of the namegroup. Used in ItemProgressionVisuals.&lt;br /&gt;
|-&lt;br /&gt;
|name||ItemName,Description||The item name and (optional) description to use.&lt;br /&gt;
|-&lt;br /&gt;
|namecool||ItemName,Description||An optional, additional entry to use if &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Say we have an entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define the namegroup &amp;quot;Elven Sword&amp;quot; within ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;Elven Sword&amp;quot;&lt;br /&gt;
add name &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namecool &amp;quot;Elegant Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;name&amp;quot; is the name to use normally, followed by the name to use. The second parameter an optional description. If left blank, the description on the root template is used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;namecool&amp;quot; is the name to use when &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals, typically for higher rarity versions of an item.&lt;br /&gt;
&lt;br /&gt;
''Note: If the root template specifies a name (Display Name, or Display Name (Unknown)), that value will override the name provided by the namegroup.''&lt;br /&gt;
&lt;br /&gt;
== Cool Names ==&lt;br /&gt;
&lt;br /&gt;
Say we have the following entries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the item spawns at level 9-16 with the &amp;quot;Epic&amp;quot; rarity, the resulting item will use the name &amp;quot;Elegant Sword&amp;quot; instead of &amp;quot;Elven Sword&amp;quot;. Otherwise, the normal name is used.&lt;br /&gt;
&lt;br /&gt;
=== Icon Override ===&lt;br /&gt;
&lt;br /&gt;
The third parameter for the ItemProgressionVisuals namegroup entry is an icon override, allowing us to change the icon used for the weapon that matches the progression parameters.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;f6fd6b73-191d-4ba1-b844-cec875608fe3&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;c21de6ee-136b-45f7-b083-565d3f458726&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when a rare version of our ring spawns, it will use the icon &amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;, located in the Icons_DOS2_Items texture atlas.&lt;br /&gt;
&lt;br /&gt;
== Unique Items ==&lt;br /&gt;
&lt;br /&gt;
For cases where we want an item to be unique, and spawn regardless of level, an ItemProgression entry is still needed.&lt;br /&gt;
&lt;br /&gt;
Say we have a unique ring, defined in Armor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
type &amp;quot;Armor&amp;quot;&lt;br /&gt;
using &amp;quot;_Rings&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
data &amp;quot;Unique&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define a new entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;24c3d50a-c377-4c09-b3e8-274f8447494b&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, an entry in ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
add name &amp;quot;Brilliant Ring of Amun-Ra&amp;quot;,&amp;quot;This ring shines with a brilliant light. The metal is warm to the touch, and seems impervious to scuffing.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By making our levelgroup 0,0 with the &amp;quot;All&amp;quot; rarity, this makes our ring spawn at any level, and any rarity. Naturally, rarity is left out of the equation, since our ring is unique.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* '''Trying to generate an item with a level range or rarity that isn't defined.'''&lt;br /&gt;
&lt;br /&gt;
Say we have a weapon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Crossbow&amp;quot;&lt;br /&gt;
data &amp;quot;ObjectCategory&amp;quot; &amp;quot;Wikimod_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;MinAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MaxAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Priority&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MinLevel&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A single ItemProgressionVisuals entry:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 1,9,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;b8da3005-cc77-4150-b9f3-23e1d3cc92e9&amp;quot;,&amp;quot;DwarvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Dwarven Crossbow&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a TreasureTable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new treasuretable &amp;quot;ST_Wikimod_Crossbows&amp;quot;&lt;br /&gt;
new subtable &amp;quot;1,1&amp;quot;&lt;br /&gt;
object category &amp;quot;Wikimod_Crossbows&amp;quot;,1,1,0,0,0,0,0,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our table is attempting to generate our item at &amp;quot;Common&amp;quot; rarity, yet we only have an entry for the &amp;quot;Epic&amp;quot; rarity. Furthermore, attempting to generate this item at a level higher than 9 will fail. &lt;br /&gt;
&lt;br /&gt;
The solution is to add new entries for each level range and rarity we want to support (This is why the ItemProgressionVisuals in Shared contains so many entries).&lt;br /&gt;
&lt;br /&gt;
* '''Using a root template with a &amp;quot;defined&amp;quot; name, and expecting a namegroup to work.'''&lt;br /&gt;
&lt;br /&gt;
If a root template has a display name set, it will take priority over the namegroup. This includes &amp;quot;Display Name (Unknown)&amp;quot;.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6047</id>
		<title>Talk:Skill creation</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6047"/>
		<updated>2018-07-22T23:24:52Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* UseCharacterStats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Incorrect Info ==&lt;br /&gt;
Surface creation actually works like this: CreateSurface,Radius,Duration,Type,Chance,Hole [[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 08:58, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Hidden Parameters ==&lt;br /&gt;
&lt;br /&gt;
Some of the functions, at least in the skill properties section, have hidden parameters that are unused in the base game. Here is what I've discovered so far:&amp;lt;br /&amp;gt;&lt;br /&gt;
Douse,Radius,Chance?&amp;lt;br /&amp;gt;&lt;br /&gt;
Freeze,Chance,Duration,?,Radius&amp;lt;br /&amp;gt;&lt;br /&gt;
Contaminate,Chance,Duration&amp;lt;br /&amp;gt;&lt;br /&gt;
[[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 09:00, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== UseCharacterStats ==&lt;br /&gt;
&lt;br /&gt;
Would it be possible to add a little blurb on the 'UseCharacterStats' property? It appears to make a skill able to miss if a Requirement is also added.&lt;br /&gt;
&lt;br /&gt;
For instance, with this skill:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;Target_Wikimod_TestSkill_A&amp;quot;&lt;br /&gt;
type &amp;quot;SkillData&amp;quot;&lt;br /&gt;
using &amp;quot;Target_MosquitoSwarm&amp;quot;&lt;br /&gt;
data &amp;quot;Ability&amp;quot; &amp;quot;Rogue&amp;quot;&lt;br /&gt;
data &amp;quot;DisplayName&amp;quot; &amp;quot;Mosquito Swarm (Character Stats)&amp;quot;&lt;br /&gt;
data &amp;quot;Requirement&amp;quot; &amp;quot;MeleeWeapon&amp;quot;&lt;br /&gt;
data &amp;quot;UseCharacterStats&amp;quot; &amp;quot;Yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Adding UseCharacterStats and MeleeWeapon as a requirement makes this skill potentially miss, depending on the caster's accuracy.&lt;br /&gt;
&lt;br /&gt;
Furthermore, UseWeaponDamage appears to also make the skill able to miss if set to true, so adding that information could be helpful for those wanting to make missable skills.&lt;br /&gt;
&lt;br /&gt;
[[User:LaughingLeader|LaughingLeader]] ([[User talk:LaughingLeader|talk]]) 09:00, 22 July 2018 (CEST)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6046</id>
		<title>Talk:Skill creation</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6046"/>
		<updated>2018-07-22T23:24:07Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* UseCharacterStats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Incorrect Info ==&lt;br /&gt;
Surface creation actually works like this: CreateSurface,Radius,Duration,Type,Chance,Hole [[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 08:58, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Hidden Parameters ==&lt;br /&gt;
&lt;br /&gt;
Some of the functions, at least in the skill properties section, have hidden parameters that are unused in the base game. Here is what I've discovered so far:&amp;lt;br /&amp;gt;&lt;br /&gt;
Douse,Radius,Chance?&amp;lt;br /&amp;gt;&lt;br /&gt;
Freeze,Chance,Duration,?,Radius&amp;lt;br /&amp;gt;&lt;br /&gt;
Contaminate,Chance,Duration&amp;lt;br /&amp;gt;&lt;br /&gt;
[[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 09:00, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== UseCharacterStats ==&lt;br /&gt;
&lt;br /&gt;
Would it be possible to add a little blurb on the 'UseCharacterStats' property? It appears to make a skill able to miss if a Requirement is also added.&lt;br /&gt;
&lt;br /&gt;
For instance, with this skill:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;Target_Wikimod_TestSkill_A&amp;quot;&lt;br /&gt;
type &amp;quot;SkillData&amp;quot;&lt;br /&gt;
using &amp;quot;Target_MosquitoSwarm&amp;quot;&lt;br /&gt;
data &amp;quot;Ability&amp;quot; &amp;quot;Rogue&amp;quot;&lt;br /&gt;
data &amp;quot;DisplayName&amp;quot; &amp;quot;Mosquito Swarm (Character Stats)&amp;quot;&lt;br /&gt;
data &amp;quot;Requirement&amp;quot; &amp;quot;MeleeWeapon&amp;quot;&lt;br /&gt;
data &amp;quot;UseCharacterStats&amp;quot; &amp;quot;Yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Adding UseCharacterStats and MeleeWeapon as a requirement makes this skill potentially miss, depending on the caster's accuracy.&lt;br /&gt;
&lt;br /&gt;
Furthermore, UseWeaponDamage appears to also make the skill able to miss if set to true, adding that information could be helpful for those wanting to make missable skills.&lt;br /&gt;
&lt;br /&gt;
[[User:LaughingLeader|LaughingLeader]] ([[User talk:LaughingLeader|talk]]) 09:00, 22 July 2018 (CEST)&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6045</id>
		<title>Talk:Skill creation</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Skill_creation&amp;diff=6045"/>
		<updated>2018-07-22T23:23:21Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* UseCharacterStats */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Incorrect Info ==&lt;br /&gt;
Surface creation actually works like this: CreateSurface,Radius,Duration,Type,Chance,Hole [[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 08:58, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Hidden Parameters ==&lt;br /&gt;
&lt;br /&gt;
Some of the functions, at least in the skill properties section, have hidden parameters that are unused in the base game. Here is what I've discovered so far:&amp;lt;br /&amp;gt;&lt;br /&gt;
Douse,Radius,Chance?&amp;lt;br /&amp;gt;&lt;br /&gt;
Freeze,Chance,Duration,?,Radius&amp;lt;br /&amp;gt;&lt;br /&gt;
Contaminate,Chance,Duration&amp;lt;br /&amp;gt;&lt;br /&gt;
[[User:Lofgren|Lofgren]] ([[User talk:Lofgren|talk]]) 09:00, 25 June 2018 (CEST)&lt;br /&gt;
&lt;br /&gt;
== UseCharacterStats ==&lt;br /&gt;
&lt;br /&gt;
Would it be possible to add a little blurb on the 'UseCharacterStats' property? It appears to make a skill able to miss if a Requirement is also added.&lt;br /&gt;
&lt;br /&gt;
For instance, with this skill:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;Target_Wikimod_TestSkill_A&amp;quot;&lt;br /&gt;
type &amp;quot;SkillData&amp;quot;&lt;br /&gt;
using &amp;quot;Target_MosquitoSwarm&amp;quot;&lt;br /&gt;
data &amp;quot;Ability&amp;quot; &amp;quot;Rogue&amp;quot;&lt;br /&gt;
data &amp;quot;DisplayName&amp;quot; &amp;quot;Mosquito Swarm (Character Stats)&amp;quot;&lt;br /&gt;
data &amp;quot;Requirement&amp;quot; &amp;quot;MeleeWeapon&amp;quot;&lt;br /&gt;
data &amp;quot;UseCharacterStats&amp;quot; &amp;quot;Yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Adding UseCharacterStats and MeleeWeapon as a requirement makes this skill potentially miss, depending on the caster's accuracy.&lt;br /&gt;
&lt;br /&gt;
Furthermore, UseWeaponDamage appears to also make the skill able to miss if set to true, adding that information could be helpful for those wanting to make missable skills.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6044</id>
		<title>Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6044"/>
		<updated>2018-07-22T22:07:42Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
An important part of the treasure system, Item Progression is the link between item stats and root templates, and is necessary to customize the level range, rarity, and names of items generated by stats, or by treasure tables.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionVisuals ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionVisuals links an itemgroup with a levelgroup (the level range and rarity), a root group (the root template used), and a namegroup (the names to use).&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#itemgroup|itemgroup]]||ItemGroup||The itemgroup, defined via item stats. Consider this the &amp;quot;header&amp;quot; that subsequent entries are included under, until a new itemgroup is used.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#LevelGroup|levelgroup]]||MinLevel,MaxLevel,[[Rarity]]||The level range and rarity to link the subsequent rootgroup and namegroup to.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#RootGroup|rootgroup]]||RootTemplate,[[ItemColor]]||The RootTemplate is the GUIDSTRING of the root template to use. ItemColor is defined in its own stats file, and changes the color of items with materials that support MSK.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#NameGroup|namegroup]]||NameGroup,[[Item_Progression#Cool_Names|AffixType]],[[Item_Progression#Icon_Override|Icon]]||The namegroup to use, whether to use the &amp;quot;cool&amp;quot; version, and an icon to use in place of the root template's icon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ItemGroup ===&lt;br /&gt;
&lt;br /&gt;
ItemGroup is defined in equipment stats, and is used to define which group of stats the subsequent levelgroup, rootgroup, and namegroup use.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
A base stat inherited by other weapons:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;Maces_1H&amp;quot;&lt;br /&gt;
data &amp;quot;ModifierType&amp;quot; &amp;quot;Item&amp;quot;&lt;br /&gt;
data &amp;quot;Act&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Requirements&amp;quot; &amp;quot;Strength 12&amp;quot;&lt;br /&gt;
data &amp;quot;IsTwoHanded&amp;quot; &amp;quot;No&amp;quot;&lt;br /&gt;
data &amp;quot;AttackAPCost&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Type&amp;quot; &amp;quot;Physical&amp;quot;&lt;br /&gt;
data &amp;quot;Damage&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Range&amp;quot; &amp;quot;5&amp;quot;&lt;br /&gt;
data &amp;quot;DamageFromBase&amp;quot; &amp;quot;67&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalDamage&amp;quot; &amp;quot;150&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalChance&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponRange&amp;quot; &amp;quot;120&amp;quot;&lt;br /&gt;
data &amp;quot;Durability&amp;quot; &amp;quot;20&amp;quot;&lt;br /&gt;
data &amp;quot;DurabilityDegradeSpeed&amp;quot; &amp;quot;6&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;40&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;3500&amp;quot;&lt;br /&gt;
data &amp;quot;Movement&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponType&amp;quot; &amp;quot;Club&amp;quot;&lt;br /&gt;
data &amp;quot;Slot&amp;quot; &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;InventoryTab&amp;quot; &amp;quot;Equipment&amp;quot;&lt;br /&gt;
data &amp;quot;Charges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;MaxCharges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;ItemColor&amp;quot; &amp;quot;DefaultGray&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots_V1&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overriding the inherited ItemGroup with a new one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
data &amp;quot;Act part&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;1000&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Club,Hammer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LevelGroup ===&lt;br /&gt;
&lt;br /&gt;
The levelgroup sets the level range and [[Rarity]] that the following rootgroups and namegroups will apply to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Uncommon&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;648d501c-2d8e-4464-acfb-6e6f061305f6&amp;quot;,&amp;quot;MageUncommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;MageRobe9&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will generate at levels 9-16 at the &amp;quot;Uncommon&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 17,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;94aaefe8-4843-4624-b1a0-92d63be2e5b8&amp;quot;,&amp;quot;LizardsCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Claymore&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will spawn at level 17 and above, at the &amp;quot;Common&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;Wings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;a71d1908-7499-42c2-8c6b-a2173be582dc&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Wings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item is generated at any level, and any rarity. ''Fun fact: These are the wings created by the Wings Polymorph skill.''&lt;br /&gt;
&lt;br /&gt;
=== RootGroup ===&lt;br /&gt;
&lt;br /&gt;
The rootgroup is simply the GUIDSTRING of the root template to link the itemgroup with. The second property is an optional ItemColor to use. You can get the GUIDSTRING of a root template by right clicking it in the [[Root template panel]], and selecting &amp;quot;Copy GUID to clipboard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 4,4,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;16600f2c-3817-42e7-be9d-5804f8ac77c8&amp;quot;,&amp;quot;HumansCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Twohander 2&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NameGroup ===&lt;br /&gt;
&lt;br /&gt;
The namegroup is a set of names to use with the item, defined in ItemProgressionNames. The first parameter is the name of the namegroup, while the second and third parameters are optional, and usually blank (&amp;quot;&amp;quot;). The second parameter activates the &amp;quot;namecool&amp;quot; version of a name (via &amp;quot;Cool&amp;quot;), and the third parameter specifies the icon to use, which overrides the icon on the root template.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry uses the namegroup named &amp;quot;Elven Sword&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this entry also uses the namegroup named &amp;quot;Elven Sword&amp;quot;, it uses the &amp;quot;namecool&amp;quot; entry thanks to &amp;quot;Cool&amp;quot;, and uses the &amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot; icon instead of the one set by the root template.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionNames ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionNames defines a set of names and (optional) descriptions to use for items defined in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|namegroup||Name||The name of the namegroup. Used in ItemProgressionVisuals.&lt;br /&gt;
|-&lt;br /&gt;
|name||ItemName,Description||The item name and (optional) description to use.&lt;br /&gt;
|-&lt;br /&gt;
|namecool||ItemName,Description||An optional, additional entry to use if &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Say we have an entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define the namegroup &amp;quot;Elven Sword&amp;quot; within ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;Elven Sword&amp;quot;&lt;br /&gt;
add name &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namecool &amp;quot;Elegant Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;name&amp;quot; is the name to use normally, followed by the name to use. The second parameter an optional description. If left blank, the description on the root template is used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;namecool&amp;quot; is the name to use when &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals, typically for higher rarity versions of an item.&lt;br /&gt;
&lt;br /&gt;
''Note: If the root template specifies a name (Display Name, or Display Name (Unknown)), that value will override the name provided by the namegroup.''&lt;br /&gt;
&lt;br /&gt;
== Cool Names ==&lt;br /&gt;
&lt;br /&gt;
Say we have the following entries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the item spawns at level 9-16 with the &amp;quot;Epic&amp;quot; rarity, the resulting item will use the name &amp;quot;Elegant Sword&amp;quot; instead of &amp;quot;Elven Sword&amp;quot;. Otherwise, the normal name is used.&lt;br /&gt;
&lt;br /&gt;
=== Icon Override ===&lt;br /&gt;
&lt;br /&gt;
The third parameter for the ItemProgressionVisuals namegroup entry is an icon override, allowing us to change the icon used for the weapon that matches the progression parameters.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;f6fd6b73-191d-4ba1-b844-cec875608fe3&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;c21de6ee-136b-45f7-b083-565d3f458726&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when a rare version of our ring spawns, it will use the icon &amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;, located in the Icons_DOS2_Items texture atlas.&lt;br /&gt;
&lt;br /&gt;
== Unique Items ==&lt;br /&gt;
&lt;br /&gt;
For cases where we want an item to be unique, and spawn regardless of level, an ItemProgression entry is still needed.&lt;br /&gt;
&lt;br /&gt;
Say we have a unique ring, defined in Armor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
type &amp;quot;Armor&amp;quot;&lt;br /&gt;
using &amp;quot;_Rings&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
data &amp;quot;Unique&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define a new entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;24c3d50a-c377-4c09-b3e8-274f8447494b&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, an entry in ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
add name &amp;quot;Brilliant Ring of Amun-Ra&amp;quot;,&amp;quot;This ring shines with a brilliant light. The metal is warm to the touch, and seems impervious to scuffing.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By making our levelgroup 0,0 with the &amp;quot;All&amp;quot; rarity, this makes our ring spawn at any level, and any rarity. Naturally, rarity is left out of the equation, since our ring is unique.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* '''Trying to generate an item with a level range or rarity that isn't defined.'''&lt;br /&gt;
&lt;br /&gt;
Say we have a weapon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Crossbow&amp;quot;&lt;br /&gt;
data &amp;quot;ObjectCategory&amp;quot; &amp;quot;Wikimod_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;MinAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MaxAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Priority&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MinLevel&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A single ItemProgressionVisuals entry:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 1,9,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;b8da3005-cc77-4150-b9f3-23e1d3cc92e9&amp;quot;,&amp;quot;DwarvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Dwarven Crossbow&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a TreasureTable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new treasuretable &amp;quot;ST_Wikimod_Crossbows&amp;quot;&lt;br /&gt;
new subtable &amp;quot;1,1&amp;quot;&lt;br /&gt;
object category &amp;quot;Wikimod_Crossbows&amp;quot;,1,1,0,0,0,0,0,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our table is attempting to generate our item at &amp;quot;Common&amp;quot; rarity, yet we only have an entry for the &amp;quot;Epic&amp;quot; rarity. Furthermore, attempting to generate this item at a level higher than 9 will fail. &lt;br /&gt;
&lt;br /&gt;
The solution is to add new entries for each level range and rarity we want to support (This is why the ItemProgressionVisuals in Shared contains so many entries).&lt;br /&gt;
&lt;br /&gt;
* '''Using a root template with a &amp;quot;defined&amp;quot; name, and expecting a namegroup to work.'''&lt;br /&gt;
&lt;br /&gt;
If a root template has a display name set, it will take priority over the namegroup. This includes &amp;quot;Display Name (Unknown)&amp;quot;.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6043</id>
		<title>Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6043"/>
		<updated>2018-07-22T22:02:55Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
An important part of the treasure system, Item Progression is the link between item stats and root templates, and is necessary to customize the level range, rarity, and names of items generated by stat, or by treasure tables.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionVisuals ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionVisuals links an itemgroup with a levelgroup (the level range and rarity), a root group (the root template used), and a namegroup (the names to use).&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#itemgroup|itemgroup]]||ItemGroup||The itemgroup, defined via item stats. Consider this the &amp;quot;header&amp;quot; that subsequent entries are included under, until a new itemgroup is used.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#LevelGroup|levelgroup]]||MinLevel,MaxLevel,[[Rarity]]||The level range and rarity to link the subsequent rootgroup and namegroup to.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#RootGroup|rootgroup]]||RootTemplate,[[ItemColor]]||The RootTemplate is the GUIDSTRING of the root template to use. ItemColor is defined in its own stats file, and changes the color of items with materials that support MSK.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#NameGroup|namegroup]]||NameGroup,[[Item_Progression#Cool_Names|AffixType]],[[Item_Progression#Icon_Override|Icon]]||The namegroup to use, whether to use the &amp;quot;cool&amp;quot; version, and an icon to use in place of the root template's icon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ItemGroup ===&lt;br /&gt;
&lt;br /&gt;
ItemGroup is defined in equipment stats, and is used to define which group of stats the subsequent levelgroup, rootgroup, and namegroup use.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
A base stat inherited by other weapons:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;Maces_1H&amp;quot;&lt;br /&gt;
data &amp;quot;ModifierType&amp;quot; &amp;quot;Item&amp;quot;&lt;br /&gt;
data &amp;quot;Act&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Requirements&amp;quot; &amp;quot;Strength 12&amp;quot;&lt;br /&gt;
data &amp;quot;IsTwoHanded&amp;quot; &amp;quot;No&amp;quot;&lt;br /&gt;
data &amp;quot;AttackAPCost&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Type&amp;quot; &amp;quot;Physical&amp;quot;&lt;br /&gt;
data &amp;quot;Damage&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Range&amp;quot; &amp;quot;5&amp;quot;&lt;br /&gt;
data &amp;quot;DamageFromBase&amp;quot; &amp;quot;67&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalDamage&amp;quot; &amp;quot;150&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalChance&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponRange&amp;quot; &amp;quot;120&amp;quot;&lt;br /&gt;
data &amp;quot;Durability&amp;quot; &amp;quot;20&amp;quot;&lt;br /&gt;
data &amp;quot;DurabilityDegradeSpeed&amp;quot; &amp;quot;6&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;40&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;3500&amp;quot;&lt;br /&gt;
data &amp;quot;Movement&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponType&amp;quot; &amp;quot;Club&amp;quot;&lt;br /&gt;
data &amp;quot;Slot&amp;quot; &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;InventoryTab&amp;quot; &amp;quot;Equipment&amp;quot;&lt;br /&gt;
data &amp;quot;Charges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;MaxCharges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;ItemColor&amp;quot; &amp;quot;DefaultGray&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots_V1&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overriding the inherited ItemGroup with a new one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
data &amp;quot;Act part&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;1000&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Club,Hammer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LevelGroup ===&lt;br /&gt;
&lt;br /&gt;
The levelgroup sets the level range and [[Rarity]] that the following rootgroups and namegroups will apply to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Uncommon&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;648d501c-2d8e-4464-acfb-6e6f061305f6&amp;quot;,&amp;quot;MageUncommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;MageRobe9&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will generate at levels 9-16 at the &amp;quot;Uncommon&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 17,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;94aaefe8-4843-4624-b1a0-92d63be2e5b8&amp;quot;,&amp;quot;LizardsCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Claymore&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will spawn at level 17 and above, at the &amp;quot;Common&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;Wings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;a71d1908-7499-42c2-8c6b-a2173be582dc&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Wings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item is generated at any level, and any rarity. ''Fun fact: These are the wings created by the Wings Polymorph skill.''&lt;br /&gt;
&lt;br /&gt;
=== RootGroup ===&lt;br /&gt;
&lt;br /&gt;
The rootgroup is simply the GUIDSTRING of the root template to link the itemgroup with. The second property is an optional ItemColor to use. You can get the GUIDSTRING of a root template by right clicking it in the [[Root template panel]], and selecting &amp;quot;Copy GUID to clipboard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 4,4,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;16600f2c-3817-42e7-be9d-5804f8ac77c8&amp;quot;,&amp;quot;HumansCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Twohander 2&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NameGroup ===&lt;br /&gt;
&lt;br /&gt;
The namegroup is a set of names to use with the item, defined in ItemProgressionNames. The first parameter is the name of the namegroup, while the second and third parameters are optional, and usually blank (&amp;quot;&amp;quot;). The second parameter activates the &amp;quot;namecool&amp;quot; version of a name (via &amp;quot;Cool&amp;quot;), and the third parameter specifies the icon to use, which overrides the icon on the root template.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry uses the namegroup named &amp;quot;Elven Sword&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this entry also uses the namegroup named &amp;quot;Elven Sword&amp;quot;, it uses the &amp;quot;namecool&amp;quot; entry thanks to &amp;quot;Cool&amp;quot;, and uses the &amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot; icon instead of the one set by the root template.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionNames ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionNames defines a set of names and (optional) descriptions to use for items defined in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|namegroup||Name||The name of the namegroup. Used in ItemProgressionVisuals.&lt;br /&gt;
|-&lt;br /&gt;
|name||ItemName,Description||The item name and (optional) description to use.&lt;br /&gt;
|-&lt;br /&gt;
|namecool||ItemName,Description||An optional, additional entry to use if &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Say we have an entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define the namegroup &amp;quot;Elven Sword&amp;quot; within ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;Elven Sword&amp;quot;&lt;br /&gt;
add name &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namecool &amp;quot;Elegant Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;name&amp;quot; is the name to use normally, followed by the name to use. The second parameter an optional description. If left blank, the description on the root template is used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;namecool&amp;quot; is the name to use when &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals, typically for higher rarity versions of an item.&lt;br /&gt;
&lt;br /&gt;
''Note: If the root template specifies a name (Display Name, or Display Name (Unknown)), that value will override the name provided by the namegroup.''&lt;br /&gt;
&lt;br /&gt;
== Cool Names ==&lt;br /&gt;
&lt;br /&gt;
Say we have the following entries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the item spawns at level 9-16 with the &amp;quot;Epic&amp;quot; rarity, the resulting item will use the name &amp;quot;Elegant Sword&amp;quot; instead of &amp;quot;Elven Sword&amp;quot;. Otherwise, the normal name is used.&lt;br /&gt;
&lt;br /&gt;
=== Icon Override ===&lt;br /&gt;
&lt;br /&gt;
The third parameter for the ItemProgressionVisuals namegroup entry is an icon override, allowing us to change the icon used for the weapon that matches the progression parameters.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;f6fd6b73-191d-4ba1-b844-cec875608fe3&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;c21de6ee-136b-45f7-b083-565d3f458726&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when a rare version of our ring spawns, it will use the icon &amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;, located in the Icons_DOS2_Items texture atlas.&lt;br /&gt;
&lt;br /&gt;
== Unique Items ==&lt;br /&gt;
&lt;br /&gt;
For cases where we want an item to be unique, and spawn regardless of level, an ItemProgression entry is still needed.&lt;br /&gt;
&lt;br /&gt;
Say we have a unique ring, defined in Armor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
type &amp;quot;Armor&amp;quot;&lt;br /&gt;
using &amp;quot;_Rings&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
data &amp;quot;Unique&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define a new entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;24c3d50a-c377-4c09-b3e8-274f8447494b&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, an entry in ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
add name &amp;quot;Brilliant Ring of Amun-Ra&amp;quot;,&amp;quot;This ring shines with a brilliant light. The metal is warm to the touch, and seems impervious to scuffing.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By making our levelgroup 0,0 with the &amp;quot;All&amp;quot; rarity, this makes our ring spawn at any level, and any rarity. Naturally, rarity is left out of the equation, since our ring is unique.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* '''Trying to generate an item with a level range or rarity that isn't defined.'''&lt;br /&gt;
&lt;br /&gt;
Say we have a weapon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Crossbow&amp;quot;&lt;br /&gt;
data &amp;quot;ObjectCategory&amp;quot; &amp;quot;Wikimod_Crossbows&amp;quot;&lt;br /&gt;
data &amp;quot;MinAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MaxAmount&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Priority&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;MinLevel&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A single ItemProgressionVisuals entry:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 1,9,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;b8da3005-cc77-4150-b9f3-23e1d3cc92e9&amp;quot;,&amp;quot;DwarvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Dwarven Crossbow&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a TreasureTable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new treasuretable &amp;quot;ST_Wikimod_Crossbows&amp;quot;&lt;br /&gt;
new subtable &amp;quot;1,1&amp;quot;&lt;br /&gt;
object category &amp;quot;Wikimod_Crossbows&amp;quot;,1,1,0,0,0,0,0,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our table is attempting to generate our item at &amp;quot;Common&amp;quot; rarity, yet we only have an entry for the &amp;quot;Epic&amp;quot; rarity. Furthermore, attempting to generate this item at a level higher than 9 will fail. &lt;br /&gt;
&lt;br /&gt;
The solution is to add new entries for each level range and rarity we want to support (This is why the ItemProgressionVisuals in Shared contains so many entries).&lt;br /&gt;
&lt;br /&gt;
* '''Using a root template with a &amp;quot;defined&amp;quot; name, and expecting a namegroup to work.'''&lt;br /&gt;
&lt;br /&gt;
If a root template has a display name set, it will take priority over the namegroup. This includes &amp;quot;Display Name (Unknown)&amp;quot;.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Community_page_submission&amp;diff=6042</id>
		<title>Community page submission</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Community_page_submission&amp;diff=6042"/>
		<updated>2018-07-22T21:50:52Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added the new Item Progression guide to the list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;&lt;br /&gt;
Welcome to the community page submission section.&amp;lt;br /&amp;gt;&lt;br /&gt;
First and foremost: thanks to all of you from everyone at Larian Studios!&amp;lt;br /&amp;gt;&lt;br /&gt;
Without your love and feedback, we wouldn't be where we are today.&lt;br /&gt;
&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
That being said, let's do our best to keep this wiki just as lovely as you guys:&amp;lt;br /&amp;gt;&lt;br /&gt;
# To add your page to the main wiki pages, please add it to the list below.&lt;br /&gt;
# Once our moderators get a chance, they'll review the submissions and move approved pages to the appropriate location on the [[Community editor guides | Editor Guides]] and/or [[Community tutorials | Community Tutorials]] section.&lt;br /&gt;
# We'll leave the page link a couple of days on here with an approval stamp and a link to its new location, to give the editor a chance to find out where his/her page went.&lt;br /&gt;
# We love you all very much, but we do not tolerate any misbehavior. Please refrain from using foul language, messing with other people's pages,...&lt;br /&gt;
# This wiki follows the general open format. Anyone is allowed to edit a page. View an edit to your page as interest in your content, not as criticism.&lt;br /&gt;
# But do try to avoid editing someone else's pages before it has been approved and moved to the main sections, unless of course you have the permission to do so from the original editor.&lt;br /&gt;
# As always, stay awesome [[File: heart.png | 32px]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Example Submission|Example submission]]&amp;lt;/b&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Reflection_Dialogues|Creating new Reflection Dialogues]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='yellow'&amp;gt;AWAITING APPROVAL&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Item_Progression|Item Progression]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='yellow'&amp;gt;AWAITING APPROVAL&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community editor guides|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[How to create a basic adventure with quests, dialog and scripts|How to create a basic adventure with quests, dialog and scripts]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Party Management via Dialog|Party Management via Dialog]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Subregion UI Notifications|Subregion UI Notifications]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[How to make an NPC sit|How to make an NPC sit]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Creating a book with TEXT inside|Creating a book with TEXT inside]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Pak Extractor Guide|Pak Extractor Guide]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community editor guides|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Tutorial - Implementing a Basic Quest|Tutorial - Implementing a Basic Quest]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]]) ([[Community:_Getting_Started|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[NPC Patrols|NPC Patrols]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Basic Character Creation]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Character and Item Script Triggers, Calls, and Queries]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community:_Script_editor|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Scripting in New Talents, Attributes, and Combat Abilities]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])([[Community:_Story_editor|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Creating/Modifying Weapon Elements and Scaling]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])([[Community:_Stats_editor|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Adding New Icons]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])([[Community:_Texture_atlas_editor|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Your First Story Script]]&amp;lt;/b&amp;gt; [[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])([[Community:_Story_editor|Editor Guides]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Crime_System|Crime System]]&amp;lt;/b&amp;gt;[[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:LarianLogo_Icon.png|32px]] &amp;lt;big&amp;gt;&amp;lt;b&amp;gt;[[Experience_For_Exploration_Quests_And_Killing|Experience For Exploration Quests And Killing]]&amp;lt;/b&amp;gt;[[File:LarianLogo_Icon.png|32px]] &amp;lt;b&amp;gt;&amp;lt;font color='green'&amp;gt;APPROVED&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt; ([[Community tutorials|Community Tutorials]])&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:ItemProgression_NameMistake01.png&amp;diff=6041</id>
		<title>File:ItemProgression NameMistake01.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:ItemProgression_NameMistake01.png&amp;diff=6041"/>
		<updated>2018-07-22T21:36:48Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: An example of setting a name on a root template, which overrides the namegroup item name set in ItemProgressionVisuals.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An example of setting a name on a root template, which overrides the namegroup item name set in ItemProgressionVisuals.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6040</id>
		<title>Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6040"/>
		<updated>2018-07-22T21:32:47Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
An important part of the treasure system, Item Progression is the link between item stats and root templates, and is necessary to customize the level range, rarity, and names of items generated by stat, or by treasure tables.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionVisuals ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionVisuals links an itemgroup with a levelgroup (the level range and rarity), a root group (the root template used), and a namegroup (the names to use).&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#itemgroup|itemgroup]]||ItemGroup||The itemgroup, defined via item stats. Consider this the &amp;quot;header&amp;quot; that subsequent entries are included under, until a new itemgroup is used.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#LevelGroup|levelgroup]]||MinLevel,MaxLevel,[[Rarity]]||The level range and rarity to link the subsequent rootgroup and namegroup to.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#RootGroup|rootgroup]]||RootTemplate,[[ItemColor]]||The RootTemplate is the GUIDSTRING of the root template to use. ItemColor is defined in its own stats file, and changes the color of items with materials that support MSK.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#NameGroup|namegroup]]||NameGroup,[[Item_Progression#Cool_Names|AffixType]],[[Item_Progression#Icon_Override|Icon]]||The namegroup to use, whether to use the &amp;quot;cool&amp;quot; version, and an icon to use in place of the root template's icon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ItemGroup ===&lt;br /&gt;
&lt;br /&gt;
ItemGroup is defined in equipment stats, and is used to define which group of stats the subsequent levelgroup, rootgroup, and namegroup use.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
A base stat inherited by other weapons:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;Maces_1H&amp;quot;&lt;br /&gt;
data &amp;quot;ModifierType&amp;quot; &amp;quot;Item&amp;quot;&lt;br /&gt;
data &amp;quot;Act&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Requirements&amp;quot; &amp;quot;Strength 12&amp;quot;&lt;br /&gt;
data &amp;quot;IsTwoHanded&amp;quot; &amp;quot;No&amp;quot;&lt;br /&gt;
data &amp;quot;AttackAPCost&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Type&amp;quot; &amp;quot;Physical&amp;quot;&lt;br /&gt;
data &amp;quot;Damage&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Range&amp;quot; &amp;quot;5&amp;quot;&lt;br /&gt;
data &amp;quot;DamageFromBase&amp;quot; &amp;quot;67&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalDamage&amp;quot; &amp;quot;150&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalChance&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponRange&amp;quot; &amp;quot;120&amp;quot;&lt;br /&gt;
data &amp;quot;Durability&amp;quot; &amp;quot;20&amp;quot;&lt;br /&gt;
data &amp;quot;DurabilityDegradeSpeed&amp;quot; &amp;quot;6&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;40&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;3500&amp;quot;&lt;br /&gt;
data &amp;quot;Movement&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponType&amp;quot; &amp;quot;Club&amp;quot;&lt;br /&gt;
data &amp;quot;Slot&amp;quot; &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;InventoryTab&amp;quot; &amp;quot;Equipment&amp;quot;&lt;br /&gt;
data &amp;quot;Charges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;MaxCharges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;ItemColor&amp;quot; &amp;quot;DefaultGray&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots_V1&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overriding the inherited ItemGroup with a new one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
data &amp;quot;Act part&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;1000&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Club,Hammer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LevelGroup ===&lt;br /&gt;
&lt;br /&gt;
The levelgroup sets the level range and [[Rarity]] that the following rootgroups and namegroups will apply to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Uncommon&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;648d501c-2d8e-4464-acfb-6e6f061305f6&amp;quot;,&amp;quot;MageUncommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;MageRobe9&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will generate at levels 9-16 at the &amp;quot;Uncommon&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 17,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;94aaefe8-4843-4624-b1a0-92d63be2e5b8&amp;quot;,&amp;quot;LizardsCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Claymore&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will spawn at level 17 and above, at the &amp;quot;Common&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;Wings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;a71d1908-7499-42c2-8c6b-a2173be582dc&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Wings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item is generated at any level, and any rarity. ''Fun fact: These are the wings created by the Wings Polymorph skill.''&lt;br /&gt;
&lt;br /&gt;
=== RootGroup ===&lt;br /&gt;
&lt;br /&gt;
The rootgroup is simply the GUIDSTRING of the root template to link the itemgroup with. The second property is an optional ItemColor to use. You can get the GUIDSTRING of a root template by right clicking it in the [[Root template panel]], and selecting &amp;quot;Copy GUID to clipboard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 4,4,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;16600f2c-3817-42e7-be9d-5804f8ac77c8&amp;quot;,&amp;quot;HumansCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Twohander 2&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NameGroup ===&lt;br /&gt;
&lt;br /&gt;
The namegroup is a set of names to use with the item, defined in ItemProgressionNames. The first parameter is the name of the namegroup, while the second and third parameters are optional, and usually blank (&amp;quot;&amp;quot;). The second parameter activates the &amp;quot;namecool&amp;quot; version of a name (via &amp;quot;Cool&amp;quot;), and the third parameter specifies the icon to use, which overrides the icon on the root template.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry uses the namegroup named &amp;quot;Elven Sword&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this entry also uses the namegroup named &amp;quot;Elven Sword&amp;quot;, it uses the &amp;quot;namecool&amp;quot; entry thanks to &amp;quot;Cool&amp;quot;, and uses the &amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot; icon instead of the one set by the root template.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionNames ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionNames defines a set of names and (optional) descriptions to use for items defined in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|namegroup||Name||The name of the namegroup. Used in ItemProgressionVisuals.&lt;br /&gt;
|-&lt;br /&gt;
|name||ItemName,Description||The item name and (optional) description to use.&lt;br /&gt;
|-&lt;br /&gt;
|namecool||ItemName,Description||An optional, additional entry to use if &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Say we have an entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define the namegroup &amp;quot;Elven Sword&amp;quot; within ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;Elven Sword&amp;quot;&lt;br /&gt;
add name &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namecool &amp;quot;Elegant Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;name&amp;quot; is the name to use normally, followed by the name to use. The second parameter an optional description. If left blank, the description on the root template is used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;namecool&amp;quot; is the name to use when &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals, typically for higher rarity versions of an item.&lt;br /&gt;
&lt;br /&gt;
''Note: If the root template specifies a name (Display Name, or Display Name (Unknown)), that value will override the name provided by the namegroup.''&lt;br /&gt;
&lt;br /&gt;
== Cool Names ==&lt;br /&gt;
&lt;br /&gt;
Say we have the following entries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the item spawns at level 9-16 with the &amp;quot;Epic&amp;quot; rarity, the resulting item will use the name &amp;quot;Elegant Sword&amp;quot; instead of &amp;quot;Elven Sword&amp;quot;. Otherwise, the normal name is used.&lt;br /&gt;
&lt;br /&gt;
=== Icon Override ===&lt;br /&gt;
&lt;br /&gt;
The third parameter for the ItemProgressionVisuals namegroup entry is an icon override, allowing us to change the icon used for the weapon that matches the progression parameters.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;f6fd6b73-191d-4ba1-b844-cec875608fe3&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;c21de6ee-136b-45f7-b083-565d3f458726&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when a rare version of our ring spawns, it will use the icon &amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;, located in the Icons_DOS2_Items texture atlas.&lt;br /&gt;
&lt;br /&gt;
== Unique Items ==&lt;br /&gt;
&lt;br /&gt;
For cases where we want an item to be unique, and spawn regardless of level, an ItemProgression entry is still needed.&lt;br /&gt;
&lt;br /&gt;
Say we have a unique ring, defined in Armor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
type &amp;quot;Armor&amp;quot;&lt;br /&gt;
using &amp;quot;_Rings&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
data &amp;quot;Unique&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define a new entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;24c3d50a-c377-4c09-b3e8-274f8447494b&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, an entry in ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
add name &amp;quot;Brilliant Ring of Amun-Ra&amp;quot;,&amp;quot;This ring shines with a brilliant light. The metal is warm to the touch, and seems impervious to scuffing.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By making our levelgroup 0,0 with the &amp;quot;All&amp;quot; rarity, this makes our ring spawn at any level, and any rarity. Naturally, rarity is left out of the equation, since our ring is unique.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* '''Generating the Item with a level range or rarity that isn't defined.'''&lt;br /&gt;
&lt;br /&gt;
Say we have an ItemProgressionVisuals entry:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 1,9,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;b8da3005-cc77-4150-b9f3-23e1d3cc92e9&amp;quot;,&amp;quot;DwarvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Dwarven Crossbow&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attempting to generate this item at a higher level than 9, or a rarity other than &amp;quot;Common&amp;quot; will fail. The solution is to add new entries for each level range and rarity we want to support, and is why Shared's ItemProgressionVisuals contains so many entries.&lt;br /&gt;
&lt;br /&gt;
* '''Using a root template with a &amp;quot;defined&amp;quot; name, and expecting a namegroup to work.'''&lt;br /&gt;
&lt;br /&gt;
If a root template has a display name set, it will take priority over the namegroup. This includes &amp;quot;Display Name (Unknown)&amp;quot;.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6039</id>
		<title>Item Progression</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Item_Progression&amp;diff=6039"/>
		<updated>2018-07-22T21:31:55Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Initial ItemProgression draft.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
An important part of the treasure system, Item Progression is the link between item stats and root templates, and is necessary to customize the level range, rarity, and names of items generated by stat, or by treasure tables.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionVisuals ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionVisuals links an itemgroup with a levelgroup (the level range and rarity), a root group (the root template used), and a namegroup (the names to use).&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#itemgroup|itemgroup]]||ItemGroup||The itemgroup, defined via item stats. Consider this the &amp;quot;header&amp;quot; that subsequent entries are included under, until a new itemgroup is used.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#levelgroup|levelgroup]]||MinLevel,MaxLevel,[[Rarity]]||The level range and rarity to link the subsequent rootgroup and namegroup to.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#rootgroup|rootgroup]]||RootTemplate,[[ItemColor]]||The RootTemplate is the GUIDSTRING of the root template to use. ItemColor is defined in its own stats file, and changes the color of items with materials that support MSK.&lt;br /&gt;
|-&lt;br /&gt;
|[[Item_Progression#namegroup|namegroup]]||NameGroup,[[Item_Progression#Cool_Names|AffixType]],[[Item_Progression#Icon_Override|Icon]]||The namegroup to use, whether to use the &amp;quot;cool&amp;quot; version, and an icon to use in place of the root template's icon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ItemGroup ===&lt;br /&gt;
&lt;br /&gt;
ItemGroup is defined in equipment stats, and is used to define which group of stats the subsequent levelgroup, rootgroup, and namegroup use.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
A base stat inherited by other weapons:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;Maces_1H&amp;quot;&lt;br /&gt;
data &amp;quot;ModifierType&amp;quot; &amp;quot;Item&amp;quot;&lt;br /&gt;
data &amp;quot;Act&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Requirements&amp;quot; &amp;quot;Strength 12&amp;quot;&lt;br /&gt;
data &amp;quot;IsTwoHanded&amp;quot; &amp;quot;No&amp;quot;&lt;br /&gt;
data &amp;quot;AttackAPCost&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Type&amp;quot; &amp;quot;Physical&amp;quot;&lt;br /&gt;
data &amp;quot;Damage&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;Damage Range&amp;quot; &amp;quot;5&amp;quot;&lt;br /&gt;
data &amp;quot;DamageFromBase&amp;quot; &amp;quot;67&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalDamage&amp;quot; &amp;quot;150&amp;quot;&lt;br /&gt;
data &amp;quot;CriticalChance&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponRange&amp;quot; &amp;quot;120&amp;quot;&lt;br /&gt;
data &amp;quot;Durability&amp;quot; &amp;quot;20&amp;quot;&lt;br /&gt;
data &amp;quot;DurabilityDegradeSpeed&amp;quot; &amp;quot;6&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;40&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;3500&amp;quot;&lt;br /&gt;
data &amp;quot;Movement&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;WeaponType&amp;quot; &amp;quot;Club&amp;quot;&lt;br /&gt;
data &amp;quot;Slot&amp;quot; &amp;quot;Weapon&amp;quot;&lt;br /&gt;
data &amp;quot;InventoryTab&amp;quot; &amp;quot;Equipment&amp;quot;&lt;br /&gt;
data &amp;quot;Charges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;MaxCharges&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;ItemColor&amp;quot; &amp;quot;DefaultGray&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
data &amp;quot;RuneSlots_V1&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overriding the inherited ItemGroup with a new one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
type &amp;quot;Weapon&amp;quot;&lt;br /&gt;
using &amp;quot;_Clubs&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;WPN_Common_Mace_1H_A&amp;quot;&lt;br /&gt;
data &amp;quot;Act part&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
data &amp;quot;Value&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
data &amp;quot;Weight&amp;quot; &amp;quot;1000&amp;quot;&lt;br /&gt;
data &amp;quot;ComboCategory&amp;quot; &amp;quot;Club,Hammer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LevelGroup ===&lt;br /&gt;
&lt;br /&gt;
The levelgroup sets the level range and [[Rarity]] that the following rootgroups and namegroups will apply to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Uncommon&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;648d501c-2d8e-4464-acfb-6e6f061305f6&amp;quot;,&amp;quot;MageUncommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;MageRobe9&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will generate at levels 9-16 at the &amp;quot;Uncommon&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 17,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;94aaefe8-4843-4624-b1a0-92d63be2e5b8&amp;quot;,&amp;quot;LizardsCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Claymore&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item will spawn at level 17 and above, at the &amp;quot;Common&amp;quot; rarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;Wings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;a71d1908-7499-42c2-8c6b-a2173be582dc&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Wings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This item is generated at any level, and any rarity. ''Fun fact: These are the wings created by the Wings Polymorph skill.''&lt;br /&gt;
&lt;br /&gt;
=== RootGroup ===&lt;br /&gt;
&lt;br /&gt;
The rootgroup is simply the GUIDSTRING of the root template to link the itemgroup with. The second property is an optional ItemColor to use. You can get the GUIDSTRING of a root template by right clicking it in the [[Root template panel]], and selecting &amp;quot;Copy GUID to clipboard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 4,4,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;16600f2c-3817-42e7-be9d-5804f8ac77c8&amp;quot;,&amp;quot;HumansCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Twohander 2&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NameGroup ===&lt;br /&gt;
&lt;br /&gt;
The namegroup is a set of names to use with the item, defined in ItemProgressionNames. The first parameter is the name of the namegroup, while the second and third parameters are optional, and usually blank (&amp;quot;&amp;quot;). The second parameter activates the &amp;quot;namecool&amp;quot; version of a name (via &amp;quot;Cool&amp;quot;), and the third parameter specifies the icon to use, which overrides the icon on the root template.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry uses the namegroup named &amp;quot;Elven Sword&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this entry also uses the namegroup named &amp;quot;Elven Sword&amp;quot;, it uses the &amp;quot;namecool&amp;quot; entry thanks to &amp;quot;Cool&amp;quot;, and uses the &amp;quot;Item_WPN_Dwarves_Sword_1H_C&amp;quot; icon instead of the one set by the root template.&lt;br /&gt;
&lt;br /&gt;
== ItemProgressionNames ==&lt;br /&gt;
&lt;br /&gt;
ItemProgressionNames defines a set of names and (optional) descriptions to use for items defined in ItemProgressionVisuals.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Property&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Parameters&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|namegroup||Name||The name of the namegroup. Used in ItemProgressionVisuals.&lt;br /&gt;
|-&lt;br /&gt;
|name||ItemName,Description||The item name and (optional) description to use.&lt;br /&gt;
|-&lt;br /&gt;
|namecool||ItemName,Description||An optional, additional entry to use if &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Say we have an entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define the namegroup &amp;quot;Elven Sword&amp;quot; within ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;Elven Sword&amp;quot;&lt;br /&gt;
add name &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namecool &amp;quot;Elegant Sword&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;name&amp;quot; is the name to use normally, followed by the name to use. The second parameter an optional description. If left blank, the description on the root template is used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;namecool&amp;quot; is the name to use when &amp;quot;Cool&amp;quot; is specified in ItemProgressionVisuals, typically for higher rarity versions of an item.&lt;br /&gt;
&lt;br /&gt;
''Note: If the root template specifies a name (Display Name, or Display Name (Unknown)), that value will override the name provided by the namegroup.''&lt;br /&gt;
&lt;br /&gt;
== Cool Names ==&lt;br /&gt;
&lt;br /&gt;
Say we have the following entries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 9,16,&amp;quot;Epic&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;30102727-1802-4aad-b464-02b9816c07db&amp;quot;,&amp;quot;ElvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Elven Sword&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the item spawns at level 9-16 with the &amp;quot;Epic&amp;quot; rarity, the resulting item will use the name &amp;quot;Elegant Sword&amp;quot; instead of &amp;quot;Elven Sword&amp;quot;. Otherwise, the normal name is used.&lt;br /&gt;
&lt;br /&gt;
=== Icon Override ===&lt;br /&gt;
&lt;br /&gt;
The third parameter for the ItemProgressionVisuals namegroup entry is an icon override, allowing us to change the icon used for the weapon that matches the progression parameters.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;f6fd6b73-191d-4ba1-b844-cec875608fe3&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;Rare&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;c21de6ee-136b-45f7-b083-565d3f458726&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;Cool&amp;quot;,&amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when a rare version of our ring spawns, it will use the icon &amp;quot;Item_LOOT_Ring_B_Silver_Turquoise&amp;quot;, located in the Icons_DOS2_Items texture atlas.&lt;br /&gt;
&lt;br /&gt;
== Unique Items ==&lt;br /&gt;
&lt;br /&gt;
For cases where we want an item to be unique, and spawn regardless of level, an ItemProgression entry is still needed.&lt;br /&gt;
&lt;br /&gt;
Say we have a unique ring, defined in Armor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new entry &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
type &amp;quot;Armor&amp;quot;&lt;br /&gt;
using &amp;quot;_Rings&amp;quot;&lt;br /&gt;
data &amp;quot;ItemGroup&amp;quot; &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
data &amp;quot;Unique&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then define a new entry in ItemProgressionVisuals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 0,0,&amp;quot;All&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;24c3d50a-c377-4c09-b3e8-274f8447494b&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, an entry in ItemProgressionNames:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new namegroup &amp;quot;ARM_UNIQUE_WikiMod_BrilliantRing&amp;quot;&lt;br /&gt;
add name &amp;quot;Brilliant Ring of Amun-Ra&amp;quot;,&amp;quot;This ring shines with a brilliant light. The metal is warm to the touch, and seems impervious to scuffing.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By making our levelgroup 0,0 with the &amp;quot;All&amp;quot; rarity, this makes our ring spawn at any level, and any rarity. Naturally, rarity is left out of the equation, since our ring is unique.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* '''Generating the Item with a level range or rarity that isn't defined.'''&lt;br /&gt;
&lt;br /&gt;
Say we have an ItemProgressionVisuals entry:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new itemgroup &amp;quot;WPN_Wikimod_Crossbow_Plus&amp;quot;&lt;br /&gt;
&lt;br /&gt;
add levelgroup 1,9,&amp;quot;Common&amp;quot;&lt;br /&gt;
add rootgroup &amp;quot;b8da3005-cc77-4150-b9f3-23e1d3cc92e9&amp;quot;,&amp;quot;DwarvesCommon&amp;quot;&lt;br /&gt;
add namegroup &amp;quot;Dwarven Crossbow&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attempting to generate this item at a higher level than 9, or a rarity other than &amp;quot;Common&amp;quot; will fail. The solution is to add new entries for each level range and rarity we want to support, and is why Shared's ItemProgressionVisuals contains so many entries.&lt;br /&gt;
&lt;br /&gt;
* '''Using a root template with a &amp;quot;defined&amp;quot; name, and expecting a namegroup to work.'''&lt;br /&gt;
&lt;br /&gt;
If a root template has a display name set, it will take priority over the namegroup. This includes &amp;quot;Display Name (Unknown)&amp;quot;.&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Rarity&amp;diff=6038</id>
		<title>Rarity</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Rarity&amp;diff=6038"/>
		<updated>2018-07-22T20:23:52Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Created page with &amp;quot;Rarities are used in Treasure Tables, Item Progression, and Item Types.  # Common # Uncommon # Rare # Epic # Legendary # Divine # Unique&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rarities are used in [[Treasure Tables]], [[Item Progression]], and [[Item Types]].&lt;br /&gt;
&lt;br /&gt;
# Common&lt;br /&gt;
# Uncommon&lt;br /&gt;
# Rare&lt;br /&gt;
# Epic&lt;br /&gt;
# Legendary&lt;br /&gt;
# Divine&lt;br /&gt;
# Unique&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris/Shared/DB_GLO_Attribute_Check_AgainstLevel&amp;diff=5997</id>
		<title>Osiris/Shared/DB GLO Attribute Check AgainstLevel</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris/Shared/DB_GLO_Attribute_Check_AgainstLevel&amp;diff=5997"/>
		<updated>2018-07-06T19:23:05Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Replaced &amp;quot;Medium&amp;quot; with &amp;quot;Normal&amp;quot;, as per the description in &amp;quot;Attribute_Check_1_Difficulty&amp;quot; (Medium also spits out an error when used).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Full Definition(s) =====&lt;br /&gt;
* '''DB_GLO Attribute_Check_AgainstLevel'''(''(STRING)'''''_Dialog''',''(INTEGER)'''''_Index''',''(STRING)'''''_Attribute''',''(STRING)'''''_Difficulty''',''(INTEGER)'''''_Source''',''(INTEGER)'''''_Level''')&lt;br /&gt;
* '''DB_GLO Attribute_Check_AgainstSpeaker'''(''(STRING)'''''_Dialog''',''(INTEGER)'''''_Index''',''(STRING)'''''_Attribute''',''(STRING)'''''_Difficulty''',''(INTEGER)'''''_Source''',''(INTEGER)'''''_Target''')&lt;br /&gt;
===== Description =====&lt;br /&gt;
When the dialog '''_Dialog''' gets started, story will set the dialog variables needed for the '''Attribute Check ''&amp;lt;n&amp;gt;''''' script flag to function, with '''''&amp;lt;n&amp;gt;''''' equal to '''_Index'''. This script flag, when checked in the dialog, will then check whether the attribute '''_Attribute''' of speaker '''_Source''' is high enough. The required minimum value is set so that it is easy/hard to pass for a character of level '''_Level''' resp. the same level as '''_Target''' depending on the specified '''_Difficulty'''. &lt;br /&gt;
&lt;br /&gt;
'''_Index''' can be 1, 2 or 3 to define up to three different attribute checks in a single dialog.&lt;br /&gt;
&lt;br /&gt;
'''_Difficulty''' can be one of the following values: '''Always''', '''Easy''', '''Normal''', '''Hard''', '''Impossible'''.&lt;br /&gt;
===== Notes =====&lt;br /&gt;
* The valid values for '''_Attribute''' are the same as the ones for [[Osiris/API/CharacterGetAttribute|CharacterGetAttribute]].&lt;br /&gt;
===== See Also =====&lt;br /&gt;
* [[Osiris/API/CharacterGetAttribute|CharacterGetAttribute]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Osiris Shared Mod Helpers|Attribute Check AgainstLevel]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris/API/Follow&amp;diff=5898</id>
		<title>Osiris/API/Follow</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris/API/Follow&amp;diff=5898"/>
		<updated>2018-05-15T23:11:42Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Removed the _Running parameter since it doesn't exist within the call.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Full Definition(s) =====&lt;br /&gt;
* call  '''CharacterFollowCharacter'''(''(CHARACTERGUID)'''''_Character''', ''(CHARACTERGUID'')'''''_ToCharacter''')&lt;br /&gt;
&lt;br /&gt;
===== Description =====&lt;br /&gt;
Makes '''_Character''' start following '''_ToCharacter'''.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
* Preferably use [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] from the Shared mod. This will ensure that '''_Character''''s following behaviour gets suspended when it enters combat, and resumed afterwards.&lt;br /&gt;
* Use [[Osiris/API/CharacterStopFollow|CharacterStopFollow]] to stop the following behaviour (or [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]] if you used [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]).&lt;br /&gt;
* Make sure to stop following a previous character before starting to follow a new one. [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] will automatically take care of this.&lt;br /&gt;
* Note that this call does ''not'' turn '''_Character''' in a so-called &amp;quot;party follower&amp;quot; or minion, which is done via [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]. The difference between &amp;quot;regular followers&amp;quot; (as created by this routine) and party followers/minions is that regular followers simply follow any other character around (you can have one NPC follow another one, if you want), while party followers/minions always follow a player-controlled character and can be partially controlled by the [[Osiris/API/CharacterGetReservedUserID|user]] that controls this player character.&lt;br /&gt;
&lt;br /&gt;
===== See Also =====&lt;br /&gt;
* [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]&lt;br /&gt;
* [[Osiris/API/CharacterStopFollow|CharacterStopFollow]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Osiris Calls|CharacterFollowCharacter]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris/Shared/PROC_Follow&amp;diff=5897</id>
		<title>Osiris/Shared/PROC Follow</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris/Shared/PROC_Follow&amp;diff=5897"/>
		<updated>2018-05-15T23:08:01Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Fixed formatting, removed the _Running parameter since it doesn't currently exist in _PROC. Removed the Return Value section since it's a call.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== Full Definition(s) =====&lt;br /&gt;
* PROC '''ProcCharacterFollowCharacter'''(''(CHARACTERGUID)'''''_Char''',''(CHARACTERGUID)'''''_Target''')&lt;br /&gt;
===== Description =====&lt;br /&gt;
Same as the Osiris call [[Osiris/API/CharacterFollowCharacter|CharacterFollowCharacter]], except that it also first automatically cancels '''_Char''' from following if it was already following someone else. Additionally, it stops the following behaviour when '''_Char''' gets involved in combat and resumes it afterwards.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
* Stop following through [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]].&lt;br /&gt;
&lt;br /&gt;
===== See Also =====&lt;br /&gt;
* [[Osiris/API/CharacterFollowCharacter|CharacterFollowCharacter]]&lt;br /&gt;
* Helper [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Osiris Shared Mod Helpers|CharacterFollowCharacter]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5893</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5893"/>
		<updated>2018-04-17T19:30:21Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Databases Queries for Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Events ===&lt;br /&gt;
----&lt;br /&gt;
When used as an event, it becomes possible to create rules that run when an entry is added to a database.&lt;br /&gt;
&lt;br /&gt;
Say we have a database we use to start a timer, called &amp;quot;DB_ExampleMod_Timers&amp;quot;. Additionally, when the timer finishes, we'll add the timer name to a database as a sort of &amp;quot;On Complete&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_ExampleMod_Timers(_TimerName, _Time)&lt;br /&gt;
THEN&lt;br /&gt;
TimerLaunch(_TimerName, _Time);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
TimerFinished(_TimerName)&lt;br /&gt;
AND&lt;br /&gt;
DB_ExampleMod_Timers(_TimerName, _Time)&lt;br /&gt;
THEN&lt;br /&gt;
NOT DB_ExampleMod_Timers(_TimerName, _Time);&lt;br /&gt;
DB_ExampleMod_TimerFinished(_TimerName);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we'll trigger the events by pulling a lever, with an additional rule for the &amp;quot;DB_ExampleMod_TimerFinished&amp;quot; database, with our specific timer name in mind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedItem(_Player, ITEMGUID_Lever_RunTimer_4289a1de-0d4b-43b0-9c38-0d796dff1d43)&lt;br /&gt;
THEN&lt;br /&gt;
DB_ExampleMod_Timers(&amp;quot;ExampleMod_LeverTimer&amp;quot;, 1000);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_ExampleMod_TimerFinished(&amp;quot;ExampleMod_LeverTimer&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;ExampleMod_LeverTimer finished!&amp;quot;);&lt;br /&gt;
NOT DB_ExampleMod_TimerFinished(&amp;quot;ExampleMod_LeverTimer&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since database events only fire when an entry is ''added'', not removed, removing the entry right in the database rule works as expected.&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been bad this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the value of _Target is not specified in the database query, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Consider keeping the number of database columns at a manageable size. Databases can be cross-referenced with other databases if needed.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5844</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5844"/>
		<updated>2018-03-10T06:44:35Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Added a short example for database events.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Events ===&lt;br /&gt;
----&lt;br /&gt;
When used as an event, it becomes possible to create rules that run when an entry is added to a database.&lt;br /&gt;
&lt;br /&gt;
Say we have a database we use to start a timer, called &amp;quot;DB_ExampleMod_Timers&amp;quot;. Additionally, when the timer finishes, we'll add the timer name to a database as a sort of &amp;quot;On Complete&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_ExampleMod_Timers(_TimerName, _Time)&lt;br /&gt;
THEN&lt;br /&gt;
TimerLaunch(_TimerName, _Time);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
TimerFinished(_TimerName)&lt;br /&gt;
AND&lt;br /&gt;
DB_ExampleMod_Timers(_TimerName, _Time)&lt;br /&gt;
THEN&lt;br /&gt;
NOT DB_ExampleMod_Timers(_TimerName, _Time);&lt;br /&gt;
DB_ExampleMod_TimerFinished(_TimerName);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we'll trigger the events by pulling a lever, with an additional rule for the &amp;quot;DB_ExampleMod_TimerFinished&amp;quot; database, with our specific timer name in mind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedItem(_Player, ITEMGUID_Lever_RunTimer_4289a1de-0d4b-43b0-9c38-0d796dff1d43)&lt;br /&gt;
THEN&lt;br /&gt;
DB_ExampleMod_Timers(&amp;quot;ExampleMod_LeverTimer&amp;quot;, 1000);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_ExampleMod_TimerFinished(&amp;quot;ExampleMod_LeverTimer&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;ExampleMod_LeverTimer finished!&amp;quot;);&lt;br /&gt;
NOT DB_ExampleMod_TimerFinished(&amp;quot;ExampleMod_LeverTimer&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since database events only fire when an entry is ''added'', not removed, removing the entry right in the database rule works as expected.&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the value of _Target is not specified in the database query, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Consider keeping the number of database columns at a manageable size. Databases can be cross-referenced with other databases if needed.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5831</id>
		<title>Adding New Icons</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5831"/>
		<updated>2018-03-08T01:53:21Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Preparing Your Icon Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adding new icons requires a bit of preparation, but once the initial setup is complete, adding additional icons is quick and easy.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Icon Images ==&lt;br /&gt;
# Save your individual icons in a size and format supported by the Texture Atlas Editor.&lt;br /&gt;
## Support sizes are 16x16, 32x32, 64x64, 128x128, 256x256.&lt;br /&gt;
## Supported formats are .png, .tga, and .dds.&lt;br /&gt;
# Place your images in a directory you'll have easy access to later.&lt;br /&gt;
# In the Resource Manager, create a package to add your texture atlas/icons to later (click the Add Package button, next to the Add and Remove Folder buttons, in the upper-left of the Resource Editor and name it however you like).&lt;br /&gt;
[[File:IconGuide_ResourceManager_01.png|thumb|Using the resource manager.]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the Texture Atlas file: ==&lt;br /&gt;
# Open the Texture Atlas Editor.&lt;br /&gt;
# Click File -&amp;gt; New.&lt;br /&gt;
# Select ''&amp;quot;Public/MyModName_GUID/GUI&amp;quot;'' as the location for your .lsx file (create the GUI folder if it doesn't exist).&lt;br /&gt;
# Create a name for your texture file (something like ModName_Icons.dds), and select an ideal location inside your mod's Assets folder (i.e. ''&amp;quot;Data/Public/MyModName_GUID/Assets/Textures&amp;quot;'').&lt;br /&gt;
# Select the size of the individual icons (for skills: 64x64) and the size of the image.&lt;br /&gt;
# Select the package you created previously, then click Save.&lt;br /&gt;
# The Texture Atlas Editor should create a blank texture (.dds) file at the path specified previously.&lt;br /&gt;
&lt;br /&gt;
== Adding Atlas Entries: ==&lt;br /&gt;
# Go to Edit -&amp;gt; Add Entries, or simply click the 'Add Entries' button (next to the Remove Entries X button) in the upper-left of the Texture Atlas Editor.&lt;br /&gt;
# Navigate to where you placed your individual icon images (anywhere on your computer).&lt;br /&gt;
# Select your icon and add it (repeat as needed). All of the new icon entries should be automatically added to your texture file.&lt;br /&gt;
# Save.&lt;br /&gt;
[[File:IconGuide_AddingEntries_01.png|thumb|Multiple atlas entries may be added at once.]]&lt;br /&gt;
== Notes: ==&lt;br /&gt;
* This same process can be used to add custom portraits (recommended size: 80px wide by 100px tall).&lt;br /&gt;
* The icon names you use are the entry names in your texture atlas sheet. Within the texture atlas editor, you can right click on an entry and select &amp;quot;Copy name to clipboard&amp;quot; to make the process easier.&lt;br /&gt;
* Skills and statuses are assigned icons in the stats editor (there's a column specifically for the icon name). Root templates can also be assigned an icon.&lt;br /&gt;
&lt;br /&gt;
== Optional: ==&lt;br /&gt;
Texture files can be manually packed and created. Possible software for doing that is:&lt;br /&gt;
* [https://www.codeandweb.com/texturepacker TexturePacker] for packaging the icons. Example settings: [https://i.imgur.com/64aGPPr.png TexturePacker Settings]&lt;br /&gt;
* [https://github.com/castano/nvidia-texture-tools/releases nvidia-texture-tools] to convert the packed texture to DDS format. This is a command-line tool. &lt;br /&gt;
* For Photoshop users, Nvidia has a plugin to work with the DDS format: [https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop NVIDIA Texture Tools for Adobe Photoshop]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5830</id>
		<title>Adding New Icons</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5830"/>
		<updated>2018-03-08T01:51:40Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Preparing Your Icon Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adding new icons requires a bit of preparation, but once the initial setup is complete, adding additional icons is quick and easy.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Icon Images ==&lt;br /&gt;
1. Save your individual icons in a size and format supported by the Texture Atlas Editor.&lt;br /&gt;
:* Support sizes are 16x16, 32x32, 64x64, 128x128, 256x256.&lt;br /&gt;
:* Supported formats are .png, .tga, and .dds.&lt;br /&gt;
2. Place your images in a directory you'll have easy access to later.&lt;br /&gt;
3. In the Resource Manager, create a package to add your texture atlas/icons to later (click the Add Package button, next to the Add and Remove Folder buttons, in the upper-left of the Resource Editor and name it however you like).&lt;br /&gt;
[[File:IconGuide_ResourceManager_01.png|thumb|Using the resource manager.]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the Texture Atlas file: ==&lt;br /&gt;
# Open the Texture Atlas Editor.&lt;br /&gt;
# Click File -&amp;gt; New.&lt;br /&gt;
# Select ''&amp;quot;Public/MyModName_GUID/GUI&amp;quot;'' as the location for your .lsx file (create the GUI folder if it doesn't exist).&lt;br /&gt;
# Create a name for your texture file (something like ModName_Icons.dds), and select an ideal location inside your mod's Assets folder (i.e. ''&amp;quot;Data/Public/MyModName_GUID/Assets/Textures&amp;quot;'').&lt;br /&gt;
# Select the size of the individual icons (for skills: 64x64) and the size of the image.&lt;br /&gt;
# Select the package you created previously, then click Save.&lt;br /&gt;
# The Texture Atlas Editor should create a blank texture (.dds) file at the path specified previously.&lt;br /&gt;
&lt;br /&gt;
== Adding Atlas Entries: ==&lt;br /&gt;
# Go to Edit -&amp;gt; Add Entries, or simply click the 'Add Entries' button (next to the Remove Entries X button) in the upper-left of the Texture Atlas Editor.&lt;br /&gt;
# Navigate to where you placed your individual icon images (anywhere on your computer).&lt;br /&gt;
# Select your icon and add it (repeat as needed). All of the new icon entries should be automatically added to your texture file.&lt;br /&gt;
# Save.&lt;br /&gt;
[[File:IconGuide_AddingEntries_01.png|thumb|Multiple atlas entries may be added at once.]]&lt;br /&gt;
== Notes: ==&lt;br /&gt;
* This same process can be used to add custom portraits (recommended size: 80px wide by 100px tall).&lt;br /&gt;
* The icon names you use are the entry names in your texture atlas sheet. Within the texture atlas editor, you can right click on an entry and select &amp;quot;Copy name to clipboard&amp;quot; to make the process easier.&lt;br /&gt;
* Skills and statuses are assigned icons in the stats editor (there's a column specifically for the icon name). Root templates can also be assigned an icon.&lt;br /&gt;
&lt;br /&gt;
== Optional: ==&lt;br /&gt;
Texture files can be manually packed and created. Possible software for doing that is:&lt;br /&gt;
* [https://www.codeandweb.com/texturepacker TexturePacker] for packaging the icons. Example settings: [https://i.imgur.com/64aGPPr.png TexturePacker Settings]&lt;br /&gt;
* [https://github.com/castano/nvidia-texture-tools/releases nvidia-texture-tools] to convert the packed texture to DDS format. This is a command-line tool. &lt;br /&gt;
* For Photoshop users, Nvidia has a plugin to work with the DDS format: [https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop NVIDIA Texture Tools for Adobe Photoshop]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5829</id>
		<title>Adding New Icons</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Adding_New_Icons&amp;diff=5829"/>
		<updated>2018-03-08T01:49:03Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Preparing the Texture Atlas file: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adding new icons requires a bit of preparation, but once the initial setup is complete, adding additional icons is quick and easy.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Icon Images ==&lt;br /&gt;
# Save your individual icons in a size and format supported by the Texture Atlas Editor.&lt;br /&gt;
::* Support sizes are 16x16, 32x32, 64x64, 128x128, 256x256.&lt;br /&gt;
::* Supported formats are .png, .tga, and .dds.&lt;br /&gt;
# Place your images in a directory you'll have easy access to later.&lt;br /&gt;
# In the Resource Manager, create a package to add your texture atlas/icons to later (click the Add Package button, next to the Add and Remove Folder buttons, in the upper-left of the Resource Editor and name it however you like).&lt;br /&gt;
[[File:IconGuide_ResourceManager_01.png|thumb|Using the resource manager.]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the Texture Atlas file: ==&lt;br /&gt;
# Open the Texture Atlas Editor.&lt;br /&gt;
# Click File -&amp;gt; New.&lt;br /&gt;
# Select ''&amp;quot;Public/MyModName_GUID/GUI&amp;quot;'' as the location for your .lsx file (create the GUI folder if it doesn't exist).&lt;br /&gt;
# Create a name for your texture file (something like ModName_Icons.dds), and select an ideal location inside your mod's Assets folder (i.e. ''&amp;quot;Data/Public/MyModName_GUID/Assets/Textures&amp;quot;'').&lt;br /&gt;
# Select the size of the individual icons (for skills: 64x64) and the size of the image.&lt;br /&gt;
# Select the package you created previously, then click Save.&lt;br /&gt;
# The Texture Atlas Editor should create a blank texture (.dds) file at the path specified previously.&lt;br /&gt;
&lt;br /&gt;
== Adding Atlas Entries: ==&lt;br /&gt;
# Go to Edit -&amp;gt; Add Entries, or simply click the 'Add Entries' button (next to the Remove Entries X button) in the upper-left of the Texture Atlas Editor.&lt;br /&gt;
# Navigate to where you placed your individual icon images (anywhere on your computer).&lt;br /&gt;
# Select your icon and add it (repeat as needed). All of the new icon entries should be automatically added to your texture file.&lt;br /&gt;
# Save.&lt;br /&gt;
[[File:IconGuide_AddingEntries_01.png|thumb|Multiple atlas entries may be added at once.]]&lt;br /&gt;
== Notes: ==&lt;br /&gt;
* This same process can be used to add custom portraits (recommended size: 80px wide by 100px tall).&lt;br /&gt;
* The icon names you use are the entry names in your texture atlas sheet. Within the texture atlas editor, you can right click on an entry and select &amp;quot;Copy name to clipboard&amp;quot; to make the process easier.&lt;br /&gt;
* Skills and statuses are assigned icons in the stats editor (there's a column specifically for the icon name). Root templates can also be assigned an icon.&lt;br /&gt;
&lt;br /&gt;
== Optional: ==&lt;br /&gt;
Texture files can be manually packed and created. Possible software for doing that is:&lt;br /&gt;
* [https://www.codeandweb.com/texturepacker TexturePacker] for packaging the icons. Example settings: [https://i.imgur.com/64aGPPr.png TexturePacker Settings]&lt;br /&gt;
* [https://github.com/castano/nvidia-texture-tools/releases nvidia-texture-tools] to convert the packed texture to DDS format. This is a command-line tool. &lt;br /&gt;
* For Photoshop users, Nvidia has a plugin to work with the DDS format: [https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop NVIDIA Texture Tools for Adobe Photoshop]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5759</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5759"/>
		<updated>2018-02-24T18:18:18Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Recommended Reading */ Added a link to the story editor wiki page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already created a mod project. More on that here: [[Project browser]]. For the purposes of this tutorial, we will be using a basic Addon project that inherits from Story and targets Story.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Story scripts are a way to implement global logic with your mod, in a way that is compatible with other mods. Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
----&lt;br /&gt;
* When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
* Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we'd prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two. &lt;br /&gt;
** This idea should also be used for entries in the stats editor, as multiple entries with the same name will conflict.&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Story_editor|Story Editor]]&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended.&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click and select &amp;quot;Add New Item&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_AddNewItem.png|thumb]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Completion Events ====&lt;br /&gt;
----&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
Inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_Level, _EditorMode)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized. Level[&amp;quot;, _Level, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;] EditorMode(&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_EditorMode, _ModeStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _ModeStr, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;)&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor, then clear the message log by clicking &amp;quot;Clear&amp;quot;.&lt;br /&gt;
# Load a level in the main editor. Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
===== Standard Goal Completion =====&lt;br /&gt;
----&lt;br /&gt;
For a regular approach, without any debug messages or string combining, use this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_,_)&lt;br /&gt;
THEN&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this code block, the variables for _Level and _EditorMode are underscores, which means we're ignoring their values.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, sub-goals that are parented to the previous goal will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Databases are a powerful tool for making your scripting logic extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5515</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5515"/>
		<updated>2018-02-05T17:43:11Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already created a mod project. More on that here: [[Project browser]]. For the purposes of this tutorial, we will be using a basic Addon project that inherits from Story and targets Story.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Story scripts are a way to implement global logic with your mod, in a way that is compatible with other mods. Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
----&lt;br /&gt;
* When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
* Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we'd prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two. &lt;br /&gt;
** This idea should also be used for entries in the stats editor, as multiple entries with the same name will conflict.&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended.&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click and select &amp;quot;Add New Item&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_AddNewItem.png|thumb]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Completion Events ====&lt;br /&gt;
----&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
Inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_Level, _EditorMode)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized. Level[&amp;quot;, _Level, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;] EditorMode(&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_EditorMode, _ModeStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _ModeStr, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;)&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor, then clear the message log by clicking &amp;quot;Clear&amp;quot;.&lt;br /&gt;
# Load a level in the main editor. Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
===== Standard Goal Completion =====&lt;br /&gt;
----&lt;br /&gt;
For a regular approach, without any debug messages or string combining, use this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_,_)&lt;br /&gt;
THEN&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this code block, the variables for _Level and _EditorMode are underscores, which means we're ignoring their values.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, sub-goals that are parented to the previous goal will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Databases are a powerful tool for making your scripting logic extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5432</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5432"/>
		<updated>2018-01-27T18:35:55Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Databases Queries for Data Retrieval */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the value of _Target is not specified in the database query, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Consider keeping the number of database columns at a manageable size. Databases can be cross-referenced with other databases if needed.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5431</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5431"/>
		<updated>2018-01-27T18:34:58Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: /* Databases Queries for Data Retrieval */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since _Target was never set before the database query, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Consider keeping the number of database columns at a manageable size. Databases can be cross-referenced with other databases if needed.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5430</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5430"/>
		<updated>2018-01-26T16:25:14Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Did some testing on databases with more than 6 arity, and they seem to compile and work correctly.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since _Target was never set beforehand, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Consider keeping the number of database columns at a manageable size. Databases can be cross-referenced with other databases if needed.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5287</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5287"/>
		<updated>2017-12-21T11:25:01Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since _Target was never set beforehand, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Osiris may have issues with databases containing more than 6 columns.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5286</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5286"/>
		<updated>2017-12-21T11:24:42Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since _Target was never set beforehand, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Osiris may have issues with databases containing more than 6 columns.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5285</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5285"/>
		<updated>2017-12-21T11:24:15Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already created a mod project. More on that here: [[Project browser]]. For the purposes of this tutorial, we will be using a basic Addon project that inherits from Story and targets Story.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Story scripts are a way to implement global logic with your mod, in a way that is compatible with other mods. Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
----&lt;br /&gt;
* When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
* Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we'd prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two. &lt;br /&gt;
** This idea should also be used for entries in the stats editor, as multiple entries with the same name will conflict.&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[:Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended.&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click and select &amp;quot;Add New Item&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_AddNewItem.png|thumb]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Completion Events ====&lt;br /&gt;
----&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
Inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_Level, _EditorMode)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized. Level[&amp;quot;, _Level, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;] EditorMode(&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_EditorMode, _ModeStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _ModeStr, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;)&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor, then clear the message log by clicking &amp;quot;Clear&amp;quot;.&lt;br /&gt;
# Load a level in the main editor. Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
===== Standard Goal Completion =====&lt;br /&gt;
----&lt;br /&gt;
For a regular approach, without any debug messages or string combining, use this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_,_)&lt;br /&gt;
THEN&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this code block, the variables for _Level and _EditorMode are underscores, which means we're ignoring their values.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, sub-goals that are parented to the previous goal will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Using databases in this way is a powerful way to design your script logic in a way that is extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5284</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5284"/>
		<updated>2017-12-21T11:24:04Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already created a mod project. More on that here: [[Project browser]]. For the purposes of this tutorial, we will be using a basic Addon project that inherits from Story and targets Story.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Story scripts are a way to implement global logic with your mod, in a way that is compatible with other mods. Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
----&lt;br /&gt;
* When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
* Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we'd prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two. &lt;br /&gt;
** This idea should also be used for entries in the stats editor, as multiple entries with the same name will conflict.&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
* [[Category:Osiris_Calls|Osiris Calls]]&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended.&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click and select &amp;quot;Add New Item&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_AddNewItem.png|thumb]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Completion Events ====&lt;br /&gt;
----&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
Inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_Level, _EditorMode)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized. Level[&amp;quot;, _Level, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;] EditorMode(&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_EditorMode, _ModeStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _ModeStr, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;)&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor, then clear the message log by clicking &amp;quot;Clear&amp;quot;.&lt;br /&gt;
# Load a level in the main editor. Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
===== Standard Goal Completion =====&lt;br /&gt;
----&lt;br /&gt;
For a regular approach, without any debug messages or string combining, use this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_,_)&lt;br /&gt;
THEN&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this code block, the variables for _Level and _EditorMode are underscores, which means we're ignoring their values.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, sub-goals that are parented to the previous goal will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Using databases in this way is a powerful way to design your script logic in a way that is extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5283</id>
		<title>Osiris Tips and Examples</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Osiris_Tips_and_Examples&amp;diff=5283"/>
		<updated>2017-12-21T11:17:44Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a collection of practical examples and tips that will aid in your journey to learn how to power your mod through story script usage.&lt;br /&gt;
&lt;br /&gt;
== Rule Flow ==&lt;br /&gt;
Story scripts run on &amp;quot;rules&amp;quot;. Every frame, Osiris will evaluate the rules for every running story goal.&lt;br /&gt;
&lt;br /&gt;
The flow of every rule is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
AND&lt;br /&gt;
Query&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries between the event and the call section of a rule are optional. You can simply go from event to call if you desire:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
Event&lt;br /&gt;
THEN&lt;br /&gt;
Call();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries are both gatekeepers to the call section, and a way to retrieve information.&lt;br /&gt;
&lt;br /&gt;
== Databases ==&lt;br /&gt;
Databases can be used to store specific data (such as characters entering a trigger), or as a way to story settings used in your rules.&lt;br /&gt;
&lt;br /&gt;
=== Database Use Within Rules ===&lt;br /&gt;
----&lt;br /&gt;
Databases may be used in all three rule sections:&lt;br /&gt;
;IF&lt;br /&gt;
:Databases used in the event section will run when a new entry is added. It will never run when an entry is removed.&lt;br /&gt;
;AND&lt;br /&gt;
:Databases used in the query section can be used to evaluate if an entry exists, does not exist, or as a way to run subsequent lines on the whole database, or entries that match a particular value.&lt;br /&gt;
;THEN&lt;br /&gt;
:In the call section, new entries are added to databases, or existing entries are removed (i.e. NOT DB_MyDatabase(_VariableA, _VariableB).&lt;br /&gt;
&lt;br /&gt;
=== Database Queries ===&lt;br /&gt;
----&lt;br /&gt;
Used as a query, databases are powerful ways to retrieve data, or create complex conditions.&lt;br /&gt;
==== Databases Queries for Conditions ====&lt;br /&gt;
Passing values into Databases is an easy way to create dynamic conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You're been a bad guy this year! Coal for you!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Coal_df215b50-e18f-4527-a2ac-e7eec6cba576&amp;quot;, _Target, 1);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterUsedSkillOnTarget(_Santa, (CHARACTERGUID)_Target, &amp;quot;Target_GiveGift&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_Santa_NaughtyList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Santa, &amp;quot;Ho ho ho! You've been good this year! Have a present!&amp;quot;);&lt;br /&gt;
ItemTemplateAddTo(&amp;quot;QUEST_Present_29f926ff-bfb3-4c0f-b4a4-e356d6b88cf0&amp;quot;, _Target, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example assumes that characters were already added to a database, and uses it to determine which item to give to a target, when Santa casts his skill.&lt;br /&gt;
&lt;br /&gt;
==== Databases Queries for Data Retrieval ====&lt;br /&gt;
Now we'll use a database to iterate through a number of targets dynamically.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Santa, &amp;quot;Shout_SpreadCheer&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_Santa_NiceList(_Target)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Target, &amp;quot;HOLIDAY_CHEER&amp;quot;, -1.0);&lt;br /&gt;
PlayEffect(_Target, &amp;quot;RS3_FX_Santa_HolidayExplosion_01&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since _Target was never set beforehand, it acts as an out variable, calling subsequent lines on each entry added to DB_Santa_NiceList.&lt;br /&gt;
&lt;br /&gt;
=== Database Gotchas ===&lt;br /&gt;
----&lt;br /&gt;
While databases are a powerful way to create complex scripting logic, there are a few crucial concepts to keep in mind:&lt;br /&gt;
* Unless you take steps to clear it out, database data persists in existing saves, even if you no longer support a particular database in a later version of your mod.&lt;br /&gt;
* Osiris may have issues with databases containing more than 6 columns.&lt;br /&gt;
* Inherited types from GUIDSTRING (CHARACTERGUID, ITEMGUID, TRIGGERGUID) need to be declared once in a database, to properly set the type.&lt;br /&gt;
&lt;br /&gt;
=== System Methods ===&lt;br /&gt;
----&lt;br /&gt;
A few system methods, hidden from auto-complete, exist to enhance database use:&lt;br /&gt;
&lt;br /&gt;
;call [[Osiris/API/SysClear|SysClear]]((STRING)_Predicate, (INTEGER)_Arity)&lt;br /&gt;
* Predicate is the name of the database (&amp;quot;DB_MyDatabase&amp;quot;), while arity are the number of columns (DB_MyDatabase(&amp;quot;Apples&amp;quot;, 10) would be 2 arity).&lt;br /&gt;
* SysClear provides an ideal way of clearing older saves of old databases from previous version of your mod, or paving the way for a full reset of a database.&lt;br /&gt;
;query [[Osiris/API/SysCount|SysCount]]([in](STRING)_Predicate,[in](INTEGER)_Arity,[out](INTEGER)_Count)&lt;br /&gt;
* SysCount is a way to count the entries in a database. This is especially useful when creating conditions in reference to a database that is added to dynamically through gameplay (i.e. the number of players inside a trigger, the number of characters who had a particular status applied, and so on).&lt;br /&gt;
&lt;br /&gt;
=== Cross-Database Referencing ===&lt;br /&gt;
----&lt;br /&gt;
Using a consistent entry across multiple databases allows you to utilize various databases to dynamically enhance your mod.&lt;br /&gt;
&lt;br /&gt;
==== Adventure Mod Example ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
First, we'll create a few databases to store some settings.&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_FrontDoor&amp;quot;, (TRIGGERGUID)TRIGGERGUID_S_MyLevel_DoorEntry_b5ab6a49-b015-4908-8f49-7b152d6c5d30);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, TRIGGERGUID_S_MyLevel_Ambush1_1d089d37-fc5e-4cc6-807e-51d0535dc0cc);&lt;br /&gt;
DB_MyAdventureMod_Triggers(&amp;quot;MyLevel_GolemBoss&amp;quot;, TRIGGERGUID_S_MyLevel_Boss1_0a009ed0-61f5-4670-9d26-1417ebf02922);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_FrontDoor&amp;quot;, &amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_HallwayAmbush&amp;quot;,&amp;quot;12f866ca-a2e9-4da2-831c-d7d031638160&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(&amp;quot;MyLevel_GolemBoss&amp;quot;,&amp;quot;2052f790-d2d7-4cf7-95f0-4de478e98d28&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonLeader_584db8ce-8dcf-4906-bc6f-e51eb057de08&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonMage1_61bf204e-ba2e-412f-ac86-e132a3930105&amp;quot;);&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(&amp;quot;MyLevel_HallwayAmbush&amp;quot;, &amp;quot;MyMod_SkeletonRanger1_f7bd3244-e1e7-4079-ac95-fef6145a236e&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By using multiple databases together, we now only need to worry about the TRIGGERGUID in one database, while the others rely on the string name. This is easier to deal with in the long run.&lt;br /&gt;
&lt;br /&gt;
Next, we'll look for when a player enters one of these triggers, and store when it first activates.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterEnteredTrigger((CHARACTERGUID)_Character, (TRIGGERGUID)_TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_Triggers(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We'll then look for when a trigger is added to the &amp;quot;TriggerActivated&amp;quot; database, and create rules for changing the atmosphere and spawning enemies.&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerAtmosphere(_TriggerName, _Atmosphere)&lt;br /&gt;
THEN&lt;br /&gt;
TriggerSetAtmosphere(_TriggerID, _Atmosphere);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
DB_MyAdventureMod_TriggerActivated(_TriggerName, _TriggerID)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyAdventureMod_TriggerSpawns(_TriggerName, _CharacterTemplate)&lt;br /&gt;
AND&lt;br /&gt;
GetRandomPositionInTrigger(_TriggerID, _X, _Y, _Z)&lt;br /&gt;
AND&lt;br /&gt;
CharacterCreateAtPosition(_X, _Y, _Z, _CharacterTemplate, 1, _Enemy)&lt;br /&gt;
THEN&lt;br /&gt;
DB_MyAdventureMod_SpawnedEnemies(_TriggerName, _Enemy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have a good basis for changing atmosphere, spawning enemies, and tracking which enemies were spawned. This could easily be extended to support sounds, dialogs that need to start, and more.&lt;br /&gt;
&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
----&lt;br /&gt;
When you use databases as a way to store settings, this information will persist on existing saves unless you purposefully remove it.&lt;br /&gt;
&lt;br /&gt;
As an example, say you have a script like this:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_A_7e24b009-f2bc-47c0-a635-b776407833aa&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, _Skill, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(_Skill, _ItemTemplate, _Count)&lt;br /&gt;
THEN&lt;br /&gt;
ItemTemplateAddTo(_ItemTemplate, _Character, (INTEGER)_Count, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Later, after releasing your mod, you decide that you want &amp;quot;Target_MyMod_DiamondTransmutation&amp;quot; to spawn a different diamond item template. To properly do this, in a way that won't spawn the previous template for an existing save, you need to delete the previous entry from the database.&lt;br /&gt;
&lt;br /&gt;
==== Database Update Example ====&lt;br /&gt;
----&lt;br /&gt;
One way to implement internal mod &amp;quot;updates&amp;quot; for your databases is by storing a &amp;quot;mod version&amp;quot; in a database, and checking against this version when a save is loaded.&lt;br /&gt;
&lt;br /&gt;
In a top-level goal (one that will run before all others), enter the following:&lt;br /&gt;
&lt;br /&gt;
'''MyMod__MainScript.txt'''&lt;br /&gt;
INIT:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//The current mod version.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(&amp;quot;[MyMod] Mod update detected. Updating databases.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SavegameLoaded(_,_,_,_)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;)&lt;br /&gt;
THEN&lt;br /&gt;
MyMod_Update_UpdateDatabases();&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Version&amp;quot;, 1); // Clear existing mod versions.&lt;br /&gt;
DB_MyMod_Version(&amp;quot;1.1.1&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MyMod_Update_UpdateDatabases()&amp;quot; is a custom PROC we've created to handle updating databases. In the individual goals that we want to update databases for, creating new rules with the same PROC name will run our PROC when the top-level goal's PROC is triggered:&lt;br /&gt;
&lt;br /&gt;
'''MyMod_ExampleScript.txt'''&lt;br /&gt;
&lt;br /&gt;
KB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROC&lt;br /&gt;
MyMod_Update_UpdateDatabases()&lt;br /&gt;
THEN&lt;br /&gt;
SysClear(&amp;quot;DB_MyMod_Skill_ItemCreation&amp;quot;, 3);&lt;br /&gt;
DB_MyMod_Skill_ItemCreation(&amp;quot;Target_MyMod_DiamondTransmutation&amp;quot;, &amp;quot;LOOT_Gems_Diamond_B_Black_VW_94933c36-393e-4077-abec-95e04341fc92&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when the main script triggers the update, our second script will also run its own update, clearing out the previous database data and adding our new settings.&lt;br /&gt;
&lt;br /&gt;
=== Updating Mods: Beyond Databases ===&lt;br /&gt;
----&lt;br /&gt;
Beyond changing databases, updating your mod can be a more extensive ordeal, as there's a variety of factors to keep in mind. More on that here: [[Modding:_Versioning|Modding: Versioning]].&lt;br /&gt;
&lt;br /&gt;
== Further Information ==&lt;br /&gt;
More in-depth information on Osiris can be read on the following pages:&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Your First Story Script]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5282</id>
		<title>Your First Story Script</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Your_First_Story_Script&amp;diff=5282"/>
		<updated>2017-12-21T11:15:43Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: Updated page link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: this tutorial assumes you have already created a mod project. More on that here: [[Project browser]]. For the purposes of this tutorial, we will be using a basic Addon project that inherits from Story and targets Story.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Story scripts are a way to implement global logic with your mod, in a way that is compatible with other mods. Before we get started, some basic tips to keep in mind:&lt;br /&gt;
&lt;br /&gt;
=== Starting Tips ===&lt;br /&gt;
----&lt;br /&gt;
* When opening the story editor in a new project, always generate definitions (File -&amp;gt; Generate Definitions) and exit/re-open the story editor. This will generate the files necessary for auto-complete and syntax highlighting.&lt;br /&gt;
&lt;br /&gt;
* Prefix your goals (a.k.a. your script files), databases, queries, and procs in a way that will make then unique and least likely to conflict with other mods. For example, if our mod is called &amp;quot;Better Cupcakes&amp;quot;, and our username is &amp;quot;SuperChef&amp;quot;, we'd prefix our mod entries with SCBC, or SC_BetterCupcakes, or some combination of the two. &lt;br /&gt;
** This idea should also be used for entries in the stats editor, as multiple entries with the same name will conflict.&lt;br /&gt;
&lt;br /&gt;
== Recommended Reading ==&lt;br /&gt;
* [[Osiris Overview]]&lt;br /&gt;
* [[Osiris Design Patterns]]&lt;br /&gt;
* [[Osiris Gotchas]]&lt;br /&gt;
* [[Osiris_Tips_and_Examples|Osiris Tips and Examples]]&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris APIs]]&lt;br /&gt;
&lt;br /&gt;
== Implementing a Basic Story Script ==&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
----&lt;br /&gt;
# Open the [[Story editor]] by clicking the icon that looks like a book ([[File:StoryEditor_Icon.png|24px]]) under the &amp;quot;Editors&amp;quot; section, at the top-right of the Divinity Engine 2 editor. &lt;br /&gt;
# Inside the story editor, Click &amp;quot;File -&amp;gt; Generate Definitions and Build&amp;quot; on the top left.&lt;br /&gt;
#* This is an important step in generating the appropriate files. Any time you create new definitions (databases, PROCs, or queries), you need to generate definitions.&lt;br /&gt;
#* Building is as equally important, as your changes won't compile until you build.&lt;br /&gt;
#* Reloading the story is necessary to see your changes in-game. You can either do this from the story editor (&amp;quot;File -&amp;gt; Reload Story&amp;quot;), or from the main editor with &amp;quot;File -&amp;gt; Reload Level and Story&amp;quot;.&lt;br /&gt;
# Close the story editor and open it again to essentially reload the syntax highlighting and auto-complete features.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
For organizational purposes, creating a parent story goal is recommended.&lt;br /&gt;
# Inside the story editor, at the goal list on the left, right click and select &amp;quot;Add New Item&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_AddNewItem.png|thumb]]&lt;br /&gt;
# Name this script something unique to your mod in a prefix format (Username_ModName), such as &amp;quot;SuperChef_BetterCupcakes&amp;quot;. This has the best chance of not potentially conflicting with any other mod.&lt;br /&gt;
# After clicking OK, your script will automatically open. Hit CTRL+S to automatically save this script. Scripts with unsaved changes display and asterisk (*) next to their name.&lt;br /&gt;
&lt;br /&gt;
==== Tip: Story Script Naming ====&lt;br /&gt;
----&lt;br /&gt;
Goals in the story are ran in alphabetical order. This is important to keep in mind if you use a particular story goal as a sort of &amp;quot;top-level&amp;quot; script that has methods and databases your other goals reference to. &lt;br /&gt;
&lt;br /&gt;
With proper naming, you can control the order your scripts are run. For example, naming your top-level goal &amp;quot;WT_FS__Main&amp;quot;, and your second goal &amp;quot;WT_FS_Skills&amp;quot; ensures &amp;quot;WT_FS__Main&amp;quot; will always run before &amp;quot;WT_FS_Skills&amp;quot;.&lt;br /&gt;
[[File:FirstStoryScript_ScriptOrder.png|thumb|WT_FS__Main will always run before WT_FS_Skills.]]&lt;br /&gt;
&lt;br /&gt;
=== Completing the Parent Goal ===&lt;br /&gt;
----&lt;br /&gt;
Parent goals need to &amp;quot;complete&amp;quot; before their sub-goals will run. This is done by calling &amp;quot;GoalCompleted;&amp;quot; within the parent script. We have a few options for how to go about this:&lt;br /&gt;
&lt;br /&gt;
==== Completion Events ====&lt;br /&gt;
----&lt;br /&gt;
The following events are recommended to use for completing your parent goals:&lt;br /&gt;
; [[Osiris/API/GameStarted|GameStarted]]&lt;br /&gt;
: Thrown when a level has been loaded and is ready at both the server and client side. This will ensure all the base game scripts have already initialized.&lt;br /&gt;
; [[Osiris/API/RegionStarted|RegionStarted]]&lt;br /&gt;
: Thrown when the level has been loaded and is ready at the server side, but not yet at the client side.&lt;br /&gt;
&lt;br /&gt;
Both of these events can be used with specific level names, as a way to make your goal only complete once that level is loaded (as a way to create level-specific logic).&lt;br /&gt;
&lt;br /&gt;
==== Example Goal Completion ====&lt;br /&gt;
----&lt;br /&gt;
Inside the KB section of your goal, enter the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_Level, _EditorMode)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] WikiTutorial_FirstStory has initialized. Level[&amp;quot;, _Level, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;] EditorMode(&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_EditorMode, _ModeStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _ModeStr, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;)&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Save, then select &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Minimize the story editor, then clear the message log by clicking &amp;quot;Clear&amp;quot;.&lt;br /&gt;
# Load a level in the main editor. Inside the message log, you should see the message we added with DebugBreak.&lt;br /&gt;
[[File:FirstStoryScript_ParentGoalComplete.png|thumb|The debug message appears in the message log once the game is started.]]&lt;br /&gt;
&lt;br /&gt;
===== Standard Goal Completion =====&lt;br /&gt;
----&lt;br /&gt;
For a regular approach, without any debug messages or string combining, use this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
GameStarted(_,_)&lt;br /&gt;
THEN&lt;br /&gt;
GoalCompleted;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this code block, the variables for _Level and _EditorMode are underscores, which means we're ignoring their values.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Sub-Goal ===&lt;br /&gt;
----&lt;br /&gt;
With the parent goal completing properly, sub-goals that are parented to the previous goal will now run.&lt;br /&gt;
&lt;br /&gt;
==== Creating a Sub-Goal ====&lt;br /&gt;
----&lt;br /&gt;
Let's create a basic script that will display some text when a skill is cast.&lt;br /&gt;
&lt;br /&gt;
# Double click on your parent goal to have it selected.&lt;br /&gt;
#* Currently, there's a bug where not having your parent goal open may cause a sub-item created to not properly parent under the right goal. If this happens, simply click and drag the new goal to your parent goal, and it should move underneath it.&lt;br /&gt;
# Click &amp;quot;Add New Sub Item...&amp;quot;, then name it something appropriate, like &amp;quot;WikiTutorial_FirstStory_Skills&amp;quot;.&lt;br /&gt;
# Save the new script (CTRL+S).&lt;br /&gt;
&lt;br /&gt;
==== Creating a Rule ====&lt;br /&gt;
----&lt;br /&gt;
In the KB section of our new script, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;&amp;lt;font color='#00FF00' size='30'&amp;gt;Good job!&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule will run when the player casts &amp;quot;Encourage&amp;quot;, displaying some text, and resetting their cooldowns. The Encourage skill is added automatically to the player if they lack it.&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;Generate Definitions and Build&amp;quot;.&lt;br /&gt;
# In the main editor, select &amp;quot;File -&amp;gt; Reload Level and story&amp;quot;.&lt;br /&gt;
# Hit the &amp;quot;Switch Game/Editor&amp;quot; button to get in-game. [[File:FirstStoryScript_GameEditorButton.png|thumb|Click this button to switch between game and editor mode.]]&lt;br /&gt;
# In whatever level you're working in, your provided dummy character should spawn and be given the Encourage skill.&lt;br /&gt;
# Cast the skill to test that your script is working properly.&lt;br /&gt;
[[File:FirstStoryScript_SkillCast_Result.png|thumb|Our script in action.]]&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''HTML Font Formatting'''&lt;br /&gt;
* HTML font formatting can be used in DisplayText, CharacterStatusText, and in various text entries (skill descriptions, status names/descriptions, book text, and more).&lt;br /&gt;
&lt;br /&gt;
'''SkillCast '''&lt;br /&gt;
* This event runs when the skill's animation reaches the CastTextEvent value specified by the skill stats (which is &amp;quot;cast&amp;quot; in most cases).&lt;br /&gt;
* The textkey &amp;quot;cast&amp;quot; is a common textkey used in skill cast animations.&lt;br /&gt;
* To view the textkeys present in an animation, open it within the [[Content_browser|Resource Manager]].&lt;br /&gt;
*  Example: Open the resource manager and search for the &amp;quot;Humans_Hero_Female_ABC_Skill_Cast_Aoe_Air_01_Cast&amp;quot; animation under the Shared folder. Double click on the resource to open the animation preview to see the different textkeys. [[File:FirstStoryScript_SkillCast_Textkey.png|thumb|The cast textkey.]]&lt;br /&gt;
&lt;br /&gt;
'''DB_IsPlayer'''&lt;br /&gt;
* This is a base game database that is populated with all the current player characters when the game is started.&lt;br /&gt;
* By passing in the _Character value from the event parameters to DB_IsPlayer, we're matching the character against the database of player characters, to have the following code only run if the caster is a player-controlled character.&lt;br /&gt;
* Using DB_IsPlayer as an event makes the subsequent code run when a character is added to the DB_IsPlayer database.&lt;br /&gt;
&lt;br /&gt;
== Taking the Script Further ==&lt;br /&gt;
Now that we have a basic script heirarchy working, let's take the script further.&lt;br /&gt;
&lt;br /&gt;
=== Randomization ===&lt;br /&gt;
----&lt;br /&gt;
We can add randomization to the displayed text in our previous script to make the result more interesting.&lt;br /&gt;
&lt;br /&gt;
We'll do this by creating a custom procedure.&lt;br /&gt;
&lt;br /&gt;
;Procedure Tips:&lt;br /&gt;
: Procedures are declared with a &amp;quot;PROC&amp;quot; at the top of the block, and follow the same flow as a rule. &lt;br /&gt;
: Parameters for a procedure can be customized. You must declare their type.&lt;br /&gt;
: Procedures are called within the &amp;quot;call&amp;quot; section of a rule or a custom query.&lt;br /&gt;
&lt;br /&gt;
Add this to the INIT section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(0, &amp;quot;Woo!&amp;quot;, &amp;quot;00CED1&amp;quot;, &amp;quot;23&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(1, &amp;quot;Good job!&amp;quot;, &amp;quot;00FF00&amp;quot;, &amp;quot;30&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(2, &amp;quot;I did it!&amp;quot;, &amp;quot;DEB887&amp;quot;, &amp;quot;20&amp;quot;);&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(3, &amp;quot;I'm da best!&amp;quot;, &amp;quot;A52A2A&amp;quot;, &amp;quot;26&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the code in the KB section to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
DB_IsPlayer(_Player)&lt;br /&gt;
AND&lt;br /&gt;
CharacterHasSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;, 0)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterAddSkill(_Player, &amp;quot;Shout_InspireStart&amp;quot;);&lt;br /&gt;
DebugBreak(&amp;quot;[WT_FS] Added Encourage to player.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
PROC&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
Random(4, _Ran)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_Skills_RandomText(_Ran, _Text, _FontColor, _FontSize)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;&amp;lt;font color='#&amp;quot;, _FontColor, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot;' size='&amp;quot;, _Str2)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str2, _FontSize, _Str3)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str3, &amp;quot;'&amp;gt;&amp;quot;, _Str4)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str4, _Text, _Str5)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str5, &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;, _Message)&lt;br /&gt;
AND&lt;br /&gt;
IntegertoString(_Ran, _RanStr)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] Rolled a &amp;quot;, _RanStr, _DebugMessage)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, _Message);&lt;br /&gt;
DebugBreak(_DebugMessage);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;.&lt;br /&gt;
# Switch back to the main editor and hit the play button to get in-game.&lt;br /&gt;
# Cast the Encourage skill a few times in game mode to ensure the script is working properly. You should see the different messages, font colors, and font sizes.&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''Procedures''' &lt;br /&gt;
* WikiTutorial_FirstStory_Skills_DisplayRandomMessage is a custom subroutine call, called a PROC. By splitting our message logic off into a separate procedure, this ensures the calls for this rule are ran regardless of the result of our message logic (so CharacterResetCooldowns will always run if a player casts this skill). This also allows us to use this procedure elsewhere, and possible extend it further.&lt;br /&gt;
&lt;br /&gt;
'''Databases'''&lt;br /&gt;
* We create our &amp;quot;RandomText&amp;quot; settings in the INIT section by using a database we create, called &amp;quot;DB_WikiTutorial_FirstStory_Skills_RandomText&amp;quot;. Using databases in this way is a powerful way to design your script logic in a way that is extensible.&lt;br /&gt;
&lt;br /&gt;
'''[[Osiris/API/Random|Random]]''' &lt;br /&gt;
* [[Osiris/API/Random|Random]] returns a random integer value between 0 and (_Modulo - 1). Since our DB_WikiTutorial_FirstStory_Skills_RandomText has 4 entries, we want our random number to be between 0 and 3, so we use 4 as our _Modulo.&lt;br /&gt;
&lt;br /&gt;
=== Using Queries ===&lt;br /&gt;
----&lt;br /&gt;
Mastering queries is essential for creating complex conditions for your rules. &amp;quot;OR&amp;quot; logic is done within Osiris with multiple rules, subscribing to the same events, that look for different conditions through the use of queries.&lt;br /&gt;
&lt;br /&gt;
Let's add to our skills script. Add this to the KB section, so your SkillCast rules look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
WikiTutorial_FirstStory_Skills_DisplayRandomMessage(_Character);&lt;br /&gt;
CharacterResetCooldowns(_Character);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
SkillCast(_Character, &amp;quot;Shout_InspireStart&amp;quot;, _)&lt;br /&gt;
AND&lt;br /&gt;
NOT DB_IsPlayer(_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DisplayText(_Character, &amp;quot;Win... Please! Ahhhh!&amp;quot;);&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;FEAR&amp;quot;, 1.0, 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By simpling adding a NOT before our database check, our second rule will now run on any character (who's not a player) that casts Encourage, and apply fear. You can test this by loading an inherited level that contains some human enemies, or adding human enemies yourself to your test level.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Custom Query ===&lt;br /&gt;
----&lt;br /&gt;
Taking this idea further, we'll create a custom query.&lt;br /&gt;
&lt;br /&gt;
Custom queries are defined with the keyword &amp;quot;QRY&amp;quot; at the top of a block, and follow the same flow as a rule.&lt;br /&gt;
&lt;br /&gt;
Add the following code to your KB section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;HUMAN&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;DWARF&amp;quot;, 1)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding two query blocks with the same name, we're effectively adding an &amp;quot;OR&amp;quot; condition. This query will evaluate as true if the character is tagged as either a human or a dwarf.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;DB_NOOP(1);&amp;quot; is a dummy database fact. Since rules must have a call, DB_NOOP is used to have a rule succeed without using any actual calls.&lt;br /&gt;
&lt;br /&gt;
==== Implementing the Custom Query ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Below our query code, in the KB section, add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Perception_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusApplied(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
NOT WikiTutorial_FirstStory_QRY_CanApplyBonus(_Character)&lt;br /&gt;
AND&lt;br /&gt;
CharacterConsume(_Character, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;, _Handle)&lt;br /&gt;
THEN&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, &amp;quot;POTION_Minor_Constitution_Potion&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save, then &amp;quot;File -&amp;gt; Generate Definitions, Build and Reload&amp;quot;. Since we added a query and another database, we must generate the definitions again.&lt;br /&gt;
# Go in-game and test out the changes by casting Encourage on an human or dwarf (it will work on yourself as well).&lt;br /&gt;
&lt;br /&gt;
===== Notes =====&lt;br /&gt;
----&lt;br /&gt;
'''NOT''' &lt;br /&gt;
* By adding two rules for the same event, and checking for the opposite of our query, we're effectively adding an OR condition to this event.&lt;br /&gt;
&lt;br /&gt;
'''CharacterConsume/CharacterUnconsume'''&lt;br /&gt;
* Since CharacterConsume returns a value, it's a query instead of a call. We store the out value from the query (_Handle) in a database to later unconsume the potion effect when ENCOURAGED ends.&lt;br /&gt;
&lt;br /&gt;
'''Removing Database Entries'''&lt;br /&gt;
* When unconsuming the potion handle, notice we also remove that entry from the database by calling &amp;quot;NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&amp;quot; as a call. Using NOT before a database entry (in the call section) removes that entry.&lt;br /&gt;
* By using DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion) in the query section, the _Handle and _Potion value is returned with all entries that match the value we pass in (_Character), effectively unconsuming every potion handle we added for that character to the database.&lt;br /&gt;
&lt;br /&gt;
=== Using a Query as a Subroutine ===&lt;br /&gt;
----&lt;br /&gt;
While queries can be used as conditions, they can also be used to call specific procedures/calls before the main rule reaches that section of the flow.&lt;br /&gt;
&lt;br /&gt;
Let's try a simple example that runs when we unconsume a potion. Change our status removed event code to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF&lt;br /&gt;
CharacterStatusRemoved(_Character, &amp;quot;ENCOURAGED&amp;quot;, (CHARACTERGUID)_Causee)&lt;br /&gt;
AND&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck(_Character)&lt;br /&gt;
AND&lt;br /&gt;
DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
THEN&lt;br /&gt;
CharacterUnconsume(_Character, _Handle);&lt;br /&gt;
NOT DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
AND&lt;br /&gt;
IsTagged(_Character, &amp;quot;UNDEAD&amp;quot;, 1)&lt;br /&gt;
AND&lt;br /&gt;
CharacterGetDisplayName(_Character, _, _Name)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(&amp;quot;[WT_FS] &amp;quot;, _Name, _Str1)&lt;br /&gt;
AND&lt;br /&gt;
StringConcatenate(_Str1, &amp;quot; is a zombie! Ahh! Burn it!&amp;quot;, _Message)&lt;br /&gt;
THEN&lt;br /&gt;
ApplyStatus(_Character, &amp;quot;BURNING&amp;quot;, 1.0);&lt;br /&gt;
DebugBreak(_Message);&lt;br /&gt;
&lt;br /&gt;
QRY&lt;br /&gt;
WikiTutorial_FirstStory_QRY_ZombieCheck((CHARACTERGUID)_Character)&lt;br /&gt;
THEN&lt;br /&gt;
DB_NOOP(1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which this, our query will apply burning if the character is tagged as UNDEAD. Note how we added a second QRY rule that always evaluates as true - this is to keep the rest of our rule in the CharacterStatusRemoved event running, undead or not.&lt;br /&gt;
&lt;br /&gt;
Practically speaking, using queries as subroutines is ideal when:&lt;br /&gt;
* You need specific calls/procedures to run before iterating through a database. Calling your query before retrieving variables from a database ensures that those calls will only run once.&lt;br /&gt;
* You need to debug a rule to ensure it reaches a certain section of the conditions. If you're not sure if a specific condition is passing, adding a query with a DebugBreak message right before/after it is a good way to debug that situation.&lt;br /&gt;
&lt;br /&gt;
== Bonus Tips ==&lt;br /&gt;
&lt;br /&gt;
* In the story editor, select &amp;quot;File -&amp;gt; Open Story Header&amp;quot; for a list of all available events, queries, and calls. Heavily reference this file when you find yourself unsure if a specifc method exists, as not all methods appear in the auto-complete.&lt;br /&gt;
&lt;br /&gt;
* If you use databases to store global mod settings, and your mod users have played with that mod, changing that information post-mod install will not automatically remove that data from existing saves - you need to handle this update internally within your mod.&lt;br /&gt;
** More on implementing an update system here: [[Osiris_Tips#Updating_Databases|Manual Mod Updates]].&lt;br /&gt;
&lt;br /&gt;
* By using custom procedures and queries, you can reduce your rule redundancy and extend desired calls/conditions to multiple rules.&lt;br /&gt;
&lt;br /&gt;
* To make your life with Osiris easier, wrap your rule blocks in regions with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//REGION MY_REGION_NAME&lt;br /&gt;
&lt;br /&gt;
//END_REGION&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the story editor, right click inside your script sections (INIT, KB, or EXIT) and &amp;quot;Expand All&amp;quot; or &amp;quot;Collapse All&amp;quot; to expand/collapse all regions, respectively.&lt;br /&gt;
&lt;br /&gt;
* Procedures can be called from the EXIT and INIT section of scripts.&lt;br /&gt;
&lt;br /&gt;
* Use the INIT section of your scripts as a way to store commented references to your databases. As an example from our previous script, placing this inside your INIT section is a good way to remember such a database exists (since we don't initialize it in the INIT section):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//DB_WikiTutorial_FirstStory_ConsumeHandles(_Character, _Handle, _Potion)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, when you wish to use this database, you have a quick way to copy/paste that code into other sections of your script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Osiris]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Talk:Osiris_Tips&amp;diff=5281</id>
		<title>Talk:Osiris Tips</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Talk:Osiris_Tips&amp;diff=5281"/>
		<updated>2017-12-21T11:14:44Z</updated>

		<summary type="html">&lt;p&gt;LaughingLeader: LaughingLeader moved page Talk:Osiris Tips to Talk:Osiris Tips and Examples: Pairing Osiris tips with practical examples is really the main purpose of this page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Osiris Tips and Examples]]&lt;/div&gt;</summary>
		<author><name>LaughingLeader</name></author>
	</entry>
</feed>