|
member
|
OP
member
Joined: Dec 2016
|
Hi everyone, I was wondering if anyone (I know Fraublake probably does :P) knew the process to adding new recipe books to the game--those that reveal recipes once read. I understand that the process has to do with recipes_prototypes.lsx, but adding new entries herein didn't seem to be enough. Is there story code involved with this?
Thanks for your help!
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
I've never implemented recipes, but from a quick look into the story files you need the '__GLOBAL_ItemInteraction' script which unlocks recipes (using the ID from 'recipes_prototypes.lsx') when the recipe book template is used by the player:
IF
CharacterUsedItemTemplate(_Player, _Template, _)
AND
_Player.DB_IsPlayer()
AND
DB_RecipeBook(_Template, _ID)
THEN
UnlockJournalRecipe(_ID);
NOT DB_RecipeBook(_Template, _ID);
Database example:
DB_RecipeBook("BOOK_RCP_Magic8_b0c1c9b5-10af-4919-b600-e5a21b4edc83", "RCP_Magic8");
|
|
|
|
member
|
OP
member
Joined: Dec 2016
|
I see, that's unfortunate then; thank you for your help Abraxas
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
Always at your service. A bit unfortunate that you can't add new recipe books to running games, but maybe you should collect all non-save-game-compatible features and consider a version 2, if you don't already.
|
|
|
|
enthusiast
|
enthusiast
Joined: Jun 2015
|
After the release of XC_Bags I realized that it would have been a good idea to install 'hooks' into the story code that allow at least the setting of databases after the game has been started through some item or character event, to enable some bug fixes at least.
But I did not follow this idea very much further ;-)
|
|
|
|
member
|
OP
member
Joined: Dec 2016
|
I had much the same thought actually. I did this for a few things but I quickly realized that creating hooks for story-code-only functionality would have been quite useful. I suppose we can carry this lesson forward for DoS 2, if the same structure is used (I sincerely hope not).
|
|
|
|
enthusiast
|
enthusiast
Joined: Jun 2015
|
The structure is not that bad, but the API is for sure. We do not have access to calls Larian must have or how else would they be able to apply patches. And as one might hardly believe, they did release patches for the game in the pre-historic days ;-)
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
The engine _does_ have at least some patching capability. It seems to load "Story/story_generated.div.osi", "Story/story.div.osi" and "Story/StoryPatch.dat" on startup, the last of which is loaded via a function called "COsiris::ApplyPatchFile". So it is (at least theoretically) possible to patch existing save files. I have no idea how to generate a patch file though.
|
|
|
|
enthusiast
|
enthusiast
Joined: Jun 2015
|
Ah, good to see the 'Father of EE modding' in a thread of mortals ;-)
It's nice to know that such a thing exists, but it does not help modders very much when there is no exposed interface they can use in their mods, does it ;-) Even if we had an exposed interface, we can be sure that we would not have any documentation, so probably version 3 of the game would be out by the time we had figured out how to 'Osiris-patch' version 1 ;-)
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
The info above was ascertained from the D:OS 2 exe btw. The exact same thing can be found in D:OS 1 and EE as well.
Based on the changes I've seen so far, the scripting engine hasn't changed much at all. The changes I've seen so far consist of the new INTEGER64 and GUID data types. as well as separate type id-s for Trigger, Character and Item names (they are not STRING-s anymore, they have their own TRIGGERGUID, CHARACTERGUID and ITEMGUID types, that are actually aliases of the builtin type GUID).
I'll summarize the changes in Osiris functions (quite a lot of changes there!) in a follow-up post.
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
SUMMARY OF FUNCTION CHANGESDisclaimer: Some of what is described here is conjecture, based on incomplete information from changes to the osiris code. Therefore some of the conclusions I've reached may be incorrect or may change before release. I've tried to identify "families" of changes and group the functions into these families, as otherwise the list would be quite cluttered. Simplification / generalization of Item/Character/Trigger functions:Previously, there were separate functions for doing certain operations (like teleport or vision checks) on characters, triggers and items. These functions were merged into one function that works all object types. This generalization also allows certain operations that were not possible before, like creating surfaces under characters. To find out the type of the new UUID-s, two new functions were added: ObjectIsCharacter(STRING Object, OUT INT Bool) ObjectIsItem(STRING Object, OUT INT Bool)The object type-specific "CharacterTeleportToItem", "CharacterTeleportToTrigger", "CharacterTeleportToCharacter" etc. functions were merged into two universal "TeleportTo" and "TeleportToPosition" functions. Specifically, these were removed:CharacterTeleportToPosition(CHARACTER Character, REAL X, REAL Y, REAL Z, STRING Event) CharacterTeleportToCharacter(CHARACTER Character, CHARACTER ToCharacter, STRING Event) CharacterTeleportToTrigger(CHARACTER Character, TRIGGER Trigger, STRING Event) CharacterMoveToCharacter(CHARACTER Character, CHARACTER ToCharacter, INT Running, STRING Event) CharacterMoveToTrigger(CHARACTER Character, TRIGGER Trigger, INT Running, STRING Event) CharacterMoveToItem(CHARACTER Character, ITEM Item, INT Running, STRING Event) CharacterMoveToItemHandle(CHARACTER Character, INT ItemHandle, INT Running, STRING Event) CharacterAppearAtCharacter(CHARACTER Character, CHARACTER Target, INT PlaySpawn) CharacterAppearOutOfSightTo(CHARACTER Character, CHARACTER Target, INT Angle, INT PlaySpawn, STRING Event) CharacterAppearAtTriggerOutOfSightTo(CHARACTER Character, TRIGGER Target, INT Angle, INT PlaySpawn, STRING Event) ItemTeleportToTrigger(ITEM Item, TRIGGER Trigger) ItemTeleportToPosition(ITEM Item, REAL X, REAL Y, REAL Z)... and these are the replacements:TeleportToPosition(STRING SourceObject, REAL X, REAL Y, REAL Z, STRING Event, INT TeleportLinkedCharacters) TeleportTo(STRING SourceObject, STRING TargetObject, STRING Event, INT TeleportLinkedCharacters) CharacterAppearAt(CHARACTER Character, STRING Target, INT PlaySpawn, STRING Event) CharacterAppearOutOfSightTo(CHARACTER Character, STRING Target, INT Angle, INT PlaySpawn, STRING Event)
Similarly, the "CanSee" function changed as well. These were deleted: CharacterCanSeeCharacter(CHARACTER Character, CHARACTER OtherCharacter, OUT INT Bool) CharacterCanSeeItem(CHARACTER Character, ITEM Item, OUT INT Bool)... replaced by the universal CharacterCanSee(CHARACTER Character, STRING Target, OUT INT Bool)Same for the "XXXGetClosestYYY" functions: ItemGetClosestPlayer(ITEM Item, OUT CHARACTER Player) TriggerGetClosestPlayer(TRIGGER Trigger, OUT CHARACTER Player) CharacterGetClosestPlayer(CHARACTER Character, OUT CHARACTER Player) CharacterGetClosestPlayerWithTalent(CHARACTER Character, STRING Talent, OUT CHARACTER Player) CharacterGetClosestAlivePlayer(CHARACTER Character, OUT CHARACTER Player) CharacterGetClosestAllyWhoSeesMeAndMyAttackerAndCanFight(CHARACTER Source, CHARACTER Attacker, OUT CHARACTER ClosestAllyWhoSeesMe) GetClosestPlayerToPosition(REAL X, REAL Y, REAL Z, OUT CHARACTER Player)--> GetClosestPlayer(STRING Target, OUT CHARACTER Player) GetClosestPlayerWithTalent(STRING Target, STRING Talent, OUT CHARACTER Player) GetClosestAlivePlayer(STRING Target, OUT CHARACTER Player) GetClosestAliveUserPlayer(STRING Target, INT UserID, OUT CHARACTER Player) GetClosestPlayerToPosition(REAL X, REAL Y, REAL Z, OUT CHARACTER Player)Basic attribute manipulation functions were also replaced: CharacterDebugText(CHARACTER Character, STRING Text) CharacterDisplayText(CHARACTER Character, STRING Text) CharacterSetOnStage(CHARACTER Character, INT Bool) CharacterSetVisible(CHARACTER Character, INT Bool) CharacterGetRegion(CHARACTER Character, OUT STRING Region) CharacterGetPosition(CHARACTER Character, OUT REAL X, OUT REAL Y, OUT REAL Z) CharacterGetUUID(CHARACTER Character, OUT STRING UUID) ItemSetOnstage(ITEM Item, INT Bool) ItemSetVisible(ITEM Item, INT Bool) ItemGetRegion(ITEM Item, OUT STRING Region) ItemGetPosition(ITEM Item, OUT REAL X, OUT REAL Y, OUT REAL Z) ItemGetUUID(ITEM Item, OUT STRING UUID) TriggerGetPosition(TRIGGER Trigger, OUT REAL X, OUT REAL Y, OUT REAL Z) TriggerGetUUID(TRIGGER Trigger, OUT STRING UUID)--> DebugText(STRING Object, STRING Text) DisplayText(STRING Object, STRING Text) SetOnStage(STRING Object, INT Bool) SetVisible(STRING Object, INT Bool) GetRegion(STRING Object, OUT STRING Region) GetPosition(STRING Target, OUT REAL X, OUT REAL Y, OUT REAL Z) GetUUID(STRING Target, OUT STRING UUID)CharacterAttackCharacter/Item/PartyMember was merged into one function: CharacterAttack(CHARACTER Character, STRING Target)CharacterLookAtCharacter/Item merged into CharacterLookAt(CHARACTER Character, STRING Target, INT SnapToTarget). CharacterUsedSkillOnTarget now also triggers if a skill is used on an item; the second CHARACTER TargetCharacter parameter was changed to the more generic STRING Target. The " Item(Handle)ToXXX" family of functions was greatly simplified. The old functions were removed: ItemToCharacter(ITEM Item, CHARACTER Character) ItemHandleToCharacter(INT ItemHandle, CHARACTER Character, INT Amount) ItemHandleToContainer(INT ItemHandle, ITEM Item, INT Amount) ItemHandleToTransform(INT ItemHandle, REAL X, REAL Y, REAL Z, REAL Pitch, REAL Yaw, REAL Roll, INT Amount, CHARACTER OwnerCharacter) ItemToContainer(ITEM Item, ITEM Container, INT Amount) ItemToContainerHandle(ITEM Item, INT Container, INT Amount) ItemHandleToContainerHandle(INT ItemHandle, INT Container, INT Amount)... and replaced by two functions: ItemToTransform(STRING UUID, REAL X, REAL Y, REAL Z, REAL Pitch, REAL Yaw, REAL Roll, INT Amount, CHARACTER OwnerCharacter) ItemTo(ITEM Item, STRING TargetObject, INT Amount)ItemTemplateRemoveFromCharacter and ItemTemplateRemoveFromContainer were merged into ItemTemplateRemoveFrom(STRING ItemTemplate, STRING Object, INT Count). Similarly, ItemTemplateAddToCharacter was changed to ItemTemplateAddTo(STRING ItemTemplate, STRING Object, INT Count). Since the ItemTemplateAddToContainer function didn't exist before, it is reasonable to assume that the new ItemTemplateAddTo function can add stuff to containers too. The "XXXMoveAllItemsToYYY" set of functions was replaced. These were removed: CharacterMoveAllItemsToCharacter(CHARACTER FromCharacter, CHARACTER ToCharacter, INT ResetUnsoldItems) ContainerMoveAllItemsToContainer(ITEM FromContainer, ITEM ToContainer, INT ResetUnsoldItems) CharacterMoveAllItemsToContainer(CHARACTER FromCharacter, ITEM ToContainer, INT ResetUnsoldItems) ContainerMoveAllItemsToCharacter(ITEM FromContainer, CHARACTER ToCharacter, INT ResetUnsoldItems)... this was added as their replacement: MoveAllItemsTo(STRING FromObject, STRING ToObject, INT ResetUnsoldItems)The TriggerCreateSurface and TriggerCreatePoodle functions were generalized and now (theoretically) allow creating surfaces under any object: CreateSurface(STRING Source, STRING SurfaceType, REAL Radius, REAL Lifetime) CreatePuddle(STRING Source, STRING SurfaceType, INT CellAmountMin, INT CellAmountMax, INT GrowAmountMin, INT GrowAmountMax, REAL GrowTime)A new XYZ position-based function was also added for creating surfaces: CreateSurfaceAtPosition(REAL x, REAL Y, REAL Z, STRING SurfaceType, REAL Radius, REAL Lifetime)CreateExplosion was generalized and expanded in the same way: CreateExplosion(STRING Target, STRING SkillID, INT CasterLevel) CreateExplosionAtPosition(REAL X, REAL Y, REAL Z, STRING SkillID, INT CasterLevel)The "CharacterXXXStatus" API-s were also generalized: RemoveStatus(STRING Target, STRING Status) RemoveStatuses(STRING Target) HasStatus(STRING Target, STRING Status, OUT INT Bool) ApplyStatus(STRING Object, STRING Status, REAL Duration, INT Force)The "Get/SetXXXVar" API-s were generalized, and reworked a bit. The old functions were removed: CharacterClearVar(CHARACTER Character, STRING VarName) CharacterSetVarInteger(CHARACTER Character, STRING VarName, INT VarValue) CharacterSetVarFloat(CHARACTER Character, STRING VarName, REAL VarValue) CharacterSetVarString(CHARACTER Character, STRING VarName, STRING VarValue) CharacterSetVarFixedString(CHARACTER Character, STRING VarName, STRING VarValue) CharacterSetVarCharacter(CHARACTER Character, STRING VarName, CHARACTER VarValue) CharacterSetVarItem(CHARACTER Character, STRING VarName, ITEM VarValue) CharacterSetVarTrigger(CHARACTER Character, STRING VarName, TRIGGER VarValue) CharacterGetVarInteger(CHARACTER Character, STRING VarName, OUT INT VarValue) CharacterGetVarFloat(CHARACTER Character, STRING VarName, OUT REAL VarValue) CharacterGetVarString(CHARACTER Character, STRING VarName, OUT STRING VarValue) CharacterGetVarFixedString(CHARACTER Character, STRING VarName, OUT STRING VarValue) CharacterGetVarCharacter(CHARACTER Character, STRING VarName, OUT CHARACTER VarValue) CharacterGetVarItem(CHARACTER Character, STRING VarName, OUT ITEM VarValue) CharacterGetVarTrigger(CHARACTER Character, STRING VarName, OUT TRIGGER VarValue) ItemSetVarInteger(ITEM Item, STRING VarName, INT VarValue) ItemSetVarFloat(ITEM Item, STRING VarName, REAL VarValue) ItemSetVarString(ITEM Item, STRING VarName, STRING VarValue) ItemSetVarFixedString(ITEM Item, STRING VarName, STRING VarValue) ItemSetVarCharacter(ITEM Item, STRING VarName, CHARACTER VarValue) ItemSetVarItem(ITEM Item, STRING VarName, ITEM VarValue) ItemSetVarTrigger(ITEM Item, STRING VarName, TRIGGER VarValue) ItemGetVarInteger(ITEM Item, STRING VarName, OUT INT VarValue) ItemGetVarFloat(ITEM Item, STRING VarName, OUT REAL VarValue) ItemGetVarString(ITEM Item, STRING VarName, OUT STRING VarValue) ItemGetVarFixedString(ITEM Item, STRING VarName, OUT STRING VarValue) ItemGetVarCharacter(ITEM Item, STRING VarName, OUT CHARACTER VarValue) ItemGetVarItem(ITEM Item, STRING VarName, OUT ITEM VarValue) ItemGetVarTrigger(ITEM Item, STRING VarName, OUT TRIGGER VarValue)... replaced by a universal one: GetVarInteger(STRING Source, STRING VarName, OUT INT VarValue) GetVarFloat(STRING Source, STRING VarName, OUT REAL VarValue) GetVarString(STRING Source, STRING VarName, OUT STRING VarValue) GetVarFixedString(STRING Source, STRING VarName, OUT STRING VarValue) SetVarInteger(STRING Target, STRING VarName, INT VarValue) SetVarFloat(STRING Target, STRING VarName, REAL VarValue) SetVarString(STRING Target, STRING VarName, STRING VarValue) SetVarFixedString(STRING Target, STRING VarName, STRING VarValue) SetVarFloat3(STRING Target, STRING VarName, REAL X, REAL Y, REAL Z) GetVarFloat3(STRING Target, STRING VarName, OUT REAL X, OUT REAL Y, OUT REAL Z) GetVarObject(STRING Source, STRING VarName, OUT STRING UUID) SetVarObject(STRING Source, STRING VarName, STRING Object) ClearVarObject(STRING Source, STRING VarName)Some noteworthy changes were made to the Get/SetVar family of functions: - A new SetVarFloat3 function was introduced for setting XYZ coordinates as variables. - Character/Item/trigger functions were merged into SetObject. - Objects vars can now be removed via ClearVarObject. Same story for effects. Old functions out: CharacterPlayAnimation(CHARACTER Character, STRING Animation, STRING Event) CharacterPlayEffect(CHARACTER Character, STRING FxName) CharacterPlayLoopEffect(CHARACTER Character, STRING FxName, STRING BoneName, OUT INT FxHandle) CharacterPlayBeamEffect(CHARACTER Character, CHARACTER Target, STRING FxName, STRING SourceBone, STRING TargetBone) CharacterPlayBeamEffectToItem(CHARACTER Character, ITEM Target, STRING FxName, STRING SourceBone, STRING TargetBone) CharacterPlayLoopBeamEffect(CHARACTER Character, CHARACTER Target, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) CharacterPlayLoopBeamEffectToItem(CHARACTER Character, ITEM Target, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) CharacterPlaySound(CHARACTER Character, STRING SoundEvent) PlayEffectAtCharacter(STRING FxName, CHARACTER Target) PlayEffectAtItem(STRING FxName, ITEM Target) PlayEffectAtTrigger(STRING FxName, TRIGGER Target) PlayLoopEffectAtTrigger(STRING FxName, TRIGGER Target, OUT INT FxHandle) ItemPlayAnimation(ITEM Item, STRING Animation) ItemPlayEffect(ITEM Item, STRING FxName) ItemPlayLoopEffect(ITEM Item, STRING FxName, OUT INT FxHandle) ItemPlayBeamEffect(ITEM Item, CHARACTER Character, STRING FxName, STRING SourceBone, STRING TargetBone) ItemPlayBeamEffectToItem(ITEM Item, ITEM Item, STRING FxName, STRING SourceBone, STRING TargetBone) ItemPlayLoopBeamEffect(ITEM Item, CHARACTER Character, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) ItemPlayLoopBeamEffectToItem(ITEM Item, ITEM Item, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) ItemHandlePlayLoopBeamEffect(INT ItemHandle, CHARACTER Character, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) ItemHandlePlayLoopBeamEffectToItem(INT ItemHandle, ITEM Item, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT FxHandle) ItemPlaySound(ITEM Item, STRING SoundEvent)
... new functions in: PlayAnimation(STRING SourceObject, STRING Animation, STRING Event) PlayEffect(STRING Object, STRING FxName) PlayLoopEffect(STRING Object, STRING FxName, STRING BoneName, OUT INT64 FxHandle) PlayBeamEffect(STRING Object, STRING Target, STRING FxName, STRING SourceBone, STRING TargetBone) PlayLoopBeamEffect(STRING Object, STRING Target, STRING FxName, STRING SourceBone, STRING TargetBone, OUT INT64 FxHandle) PlaySound(STRING Object, STRING SoundEvent)Similarly to puddles, effects can now also be played at arbitrary positions: PlayEffectAtPosition(STRING FxName, REAL X, REAL Y, REAL Z) PlayScaledEffectAtPosition(STRING FxName, REAL Scale, REAL X, REAL Y, REAL Z)Laundry-list of other functions affected by this change: - CharacterSetCanFight -> SetCanFight(STRING Target, INT Enabled) - ItemTransformIntoTemplate -> TransformIntoTemplate(STRING Object, STRING ObjectTemplate, INT ReplaceScripts) - CharacterSetIsBoss -> SetIsBoss(STRING Target, INT Enabled) - CharacterIsBoss -> IsBoss(STRING Target, OUT INT Bool) - CharacterSetHasDialog -> SetHasDialog(STRING Speaker, INT Dialog) - CharacterSetCanFight -> SetCanFight(STRING Target, INT Enabled) - CharacterEnteredCombat -> ObjectEnteredCombat(STRING Object, INT CombatID) - CharacterSwitchedCombat -> ObjectSwitchedCombat(STRING Object, INT OldCombatID, INT NewCombatID) - CharacterLeftCombat -> ObjectLeftCombat(STRING Object, INT CombatID) - CharacterTurnStarted -> ObjectTurnStarted(STRING Object) - CharacterTurnEnded -> ObjectTurnEnded(STRING Object) - ItemTransformIntoItemTemplate -> TransformIntoTemplate(STRING Object, STRING ObjectTemplate, INT ReplaceScripts) - CharacterSetHasDialog -> SetHasDialog(STRING Speaker, INT Dialog)Item handle changes:It seems that in most cases, the item handles were removed and replaced by ITEMGUID-s. The few ones that remained now use INT64 instead of INT; this is most likely done to fix for the "out of item handles" crash that affected D:OS 1 and EE. With a 64-bit handle, I don't believe the game can ever run out of handles now. These handle-based functions were removed without any replacement: ItemGetHandle(ITEM Item, OUT INT Handle) ItemHandleDrop(INT ItemHandle) ItemHandleIsInCharacterInventory(INT ItemHandle, CHARACTER Character, OUT INT Bool) ItemHandleIsLocked(INT ItemHandle, OUT INT Locked) ItemHandleDelete(INT ItemHandle) ItemHandleGetHealthPoints(INT ItemHandle, OUT INT HP) ItemHandleDestroyed(INT ItemHandle) ItemHandleDropped(INT ItemHandle) ItemHandleSetEvent(INT ItemHandle, STRING EventName) ItemHandleSetCanInteract(INT ItemHandle, INT bool) ItemHandleSetOwner(INT ItemHandle, CHARACTER NewOwner) ItemHandleSetOnStage(INT ItemHandle, INT Bool) ItemEvent(ITEM Item, STRING Event) ItemHandleAttackedByCharacter(INT ItemHandle, CHARACTER Source, STRING DamageType) ItemHandleGetVarString(INT ItemHandle, STRING VarName, OUT STRING VarValue) ItemHandleGetPosition(INT ItemHandle, OUT REAL X, OUT REAL Y, OUT REAL Z) ItemHandleGetProperty(INT Handle, STRING Property, OUT STRING Value) CharacterItemHandleEvent(CHARACTER Character, INT ItemHandle, STRING Event)These handle-based functions were replaced: ItemHandleIsContainer(INT ItemHandle, OUT INT IsContainer) GetItemhandleForItemTemplateInInventory(CHARACTER Character, STRING Template, OUT INT Itemhandle) ItemHandleMovedFromCharacterToCharacter(INT ItemHandle, CHARACTER FromCharacter, CHARACTER ToCharacter, INT Value)... by these item guid-based functions: ItemIsContainer(ITEM Item, OUT INT IsContainer) GetItemForItemTemplateInInventory(CHARACTER Character, STRING Template, OUT ITEM Item) ItemMovedFromCharacterToCharacter(ITEM Item, CHARACTER FromCharacter, CHARACTER ToCharacter, INT Value)These receive an INT64 handle now: CharacterConsume(CHARACTER Character, STRING Potion, OUT INT ConsumeHandle) CharacterUnconsume(CHARACTER Character, INT ConsumeHandle) StopLoopEffect(INT64 FxHandle)These functions use an ITEMGUID instead of the INT ItemHandle now: CharacterGetEquippedWeapon(CHARACTER Character, OUT INT ItemHandle) CharacterGetEquippedShield(CHARACTER Character, OUT INT ItemHandle) CreateItemTemplateAtPosition(STRING ItemTemplate, REAL X, REAL Y, REAL Z, OUT INT ItemHandle) ItemSetDurability(INT ItemHandle, INT Durability) ItemGetDurability(INT ItemHandle, OUT INT Durability) ItemTemplateOpening(STRING ItemTemplate, INT ItemHandle, CHARACTER Character) ItemTemplateDestroyed(STRING TemplateID, INT ItemHandle) ItemCreatedAtTrigger(TRIGGER Trigger, STRING TemplateID, INT ItemHandle) ItemTemplateEnteredTrigger(STRING ItemTemplate, INT Item, TRIGGER Trigger, CHARACTER Owner, CHARACTER Mover) ItemTemplateLeftTrigger(STRING ItemTemplate, INT Item, TRIGGER Trigger, CHARACTER Owner, CHARACTER Mover) ItemTemplateAddedToCharacter(STRING ItemTemplate, INT ItemHandle, CHARACTER Character) ItemTemplateAddedToContainer(STRING ItemTemplate, INT ItemHandle, ITEM Container) ItemTemplateRemovedFromCharacter(STRING ItemTemplate, INT ItemHandle, CHARACTER Character) ItemTemplateRemovedFromContainer(STRING ItemTemplate, INT ItemHandle, ITEM Container) ItemTemplateMoved(STRING ItemTemplate, INT ItemHandle) ItemStackedWith(INT ItemHandle, INT StackedWithHandle)Dialog changes:I'm not quite able to grasp the changes yet, but the main ones seem to be: - Simplification of the dialog start functions - Removal of all levels of dialog events (local/item/character); their replacement is (probably) the XXXSetFlag set of functions. - Removal of default dialogs Complete list of removed functions: DialogStartOneSpeakerDialog(STRING Dialog, CHARACTER Character) DialogStartTwoSpeakerDialog(STRING Dialog, CHARACTER Character, CHARACTER Character2) DialogStartThreeSpeakerDialog(STRING Dialog, CHARACTER Character, CHARACTER Character2, CHARACTER Character3) DialogStartFourSpeakerDialog(STRING Dialog, CHARACTER Character, CHARACTER Character2, CHARACTER Character3, CHARACTER Character4) DialogStartFiveSpeakerDialog(STRING Dialog, CHARACTER Character, CHARACTER Character2, CHARACTER Character3, CHARACTER Character4, CHARACTER Character5) DialogStartOneSpeakerItemDialog(STRING Dialog, ITEM Item) DialogStartTwoSpeakerItemDialog(STRING Dialog, ITEM Item, CHARACTER Character) DialogStartThreeSpeakerItemDialog(STRING Dialog, CHARACTER Character, CHARACTER Character2, ITEM Item) DialogRequestStop(STRING Dialog, CHARACTER Character) DialogRequestStopForItem(STRING Dialog, ITEM Item) DialogRequestStopForCharacter(CHARACTER Character) DialogIsRunning(OUT INT Bool) DialogIsInvolvedNPCInGroup(INT InstanceID, INT Index, STRING Group, OUT INT Bool) DialogHasRun(STRING Dialog, OUT INT Bool) DialogSetNodeFlag(INT DialogInstance, STRING Node, STRING Flag) StartDialogConflict(CHARACTER Character1, STRING SelectedStat, INT SituationBonus, CHARACTER Character2, STRING SelectedStat2, INT SituationBonus2, INT InstanceID) DialogStartKickstarterDualDialog(CHARACTER Character, CHARACTER Character2) DialogStartRequested(CHARACTER Character, CHARACTER Character)
CharacterSetHasDefaultDialog(CHARACTER Character, INT Dialog) CharacterHasDefaultDialog(CHARACTER Character, OUT INT Bool) StartDefaultDialog(CHARACTER Character, CHARACTER Player)
DialogGetLocalEventString(INT DialogInstance, STRING LocalEvent, OUT STRING Value) DialogGetLocalEvent(INT DialogInstance, STRING LocalEvent, OUT INT Value) DialogSetItemEvent(STRING Flag, ITEM Item, INT DialogInstance) DialogClearItemEvent(STRING Flag, ITEM Item, INT DialogInstance) DialogItemEventSet(STRING FlagName, ITEM Item, INT DialogInstance) DialogItemEventCleared(STRING FlagName, ITEM Item, INT DialogInstance) DialogSetCharacterEvent(STRING Flag, CHARACTER Character, INT DialogInstance) DialogClearCharacterEvent(STRING Flag, CHARACTER Character, INT DialogInstance) DialogCharacterEventSet(STRING FlagName, CHARACTER Character, INT DialogInstance) DialogCharacterEventCleared(STRING FlagName, CHARACTER Character, INT DialogInstance)The new functions are: StartDialog_Internal(STRING Dialog, INT MarkForInteractiveDialog, STRING Speaker1, STRING Speaker2, STRING Speaker3, STRING Speaker4, STRING Speaker5, OUT INT success) DialogStartPartyDialog(STRING Dialog, INT ParentInstanceID, INT NewInstanceID, CHARACTER Player1, CHARACTER Player2, CHARACTER Player3, CHARACTER Player4, OUT INT success) DialogResume(INT InstanceID) IsSpeakerReserved(STRING Speaker, OUT INT success) DialogStartRequested(STRING Target, STRING Player) DualDialogRequested(STRING Dialog, INT InstanceID, INT TargetInstanceID) DialogRequestFailed(STRING Dialog, INT InstanceID) AutomatedDialogRequestFailed(STRING Dialog, INT InstanceID) StartVoiceBark(STRING Bark, CHARACTER Source) VoiceBarkStarted(STRING Bark, INT InstanceID) VoiceBarkFailed(STRING Bark)Tags:Objects can now be tagged with custom string tags. SetTag(STRING Source, STRING Tag) ClearTag(STRING Source, STRING Tag) IsTagged(STRING Target, STRING Tag, OUT INT Bool) ObjectWasTagged(STRING Object, STRING Tag) ObjectLostTag(STRING Object, STRING Tag) ItemTagIsInCharacterInventory(CHARACTER Character, STRING Tag, OUT INT Count) CharacterFindTaggedItem(CHARACTER Character, STRING Tag, OUT ITEM Item)Flags:A new flag system was introduced where "flags" (tags would probably be a better name for them) can be attached globally, or on a per-user/object/party/dialog basis. (Note: "User" here probably means "player" in multiplayer games. In single player there is only one "user".) This is presumably also the replacement for the GlobalXXXEvent/CharacterXXXEvent/ItemXXXEvent set of functions (which didn't actually set "events" as their name implied, so the new naming is IMHO more sensible). GlobalSetFlag(STRING Flag) GlobalClearFlag(STRING Flag) GlobalGetFlag(STRING Flag, OUT INT FlagState) GlobalFlagSet(STRING FlagName) GlobalFlagCleared(STRING FlagName) ObjectSetFlag(STRING Target, STRING Flag, INT DialogInstance) ObjectClearFlag(STRING Target, STRING Flag, INT DialogInstance) ObjectGetFlag(STRING Target, STRING Flag, OUT INT FlagState) ObjectFlagSet(STRING FlagName, STRING Speaker, INT DialogInstance) ObjectFlagCleared(STRING FlagName, STRING Speaker, INT DialogInstance) UserSetFlag(CHARACTER Character, STRING Flag, INT DialogInstance) UserClearFlag(CHARACTER Character, STRING Flag, INT DialogInstance) UserGetFlag(CHARACTER Character, STRING Flag, OUT INT FlagState) PartySetFlag(CHARACTER Character, STRING Flag, INT DialogInstance) PartyClearFlag(CHARACTER Character, STRING Flag, INT DialogInstance) PartyGetFlag(CHARACTER Character, STRING Flag, OUT INT FlagState) DialogGetLocalFlag(INT DialogInstance, STRING LocalEvent, OUT INT Value) Distinction of characters in party-based APIs:Previously party-based functions now receive the individual character that is affected via the first parameter. XP: PartyAddExperience/ExplorationExperience/CharismaExperience now has a first parameter specifying the character receiving the experience. A new function, PartyAddActualExperience(CHARACTER Character, INT XP) presumably adds XP directly for that character, instead of yielding xp via Act/ActPart/Gain. CharacterSetCanTrade(CHARACTER Character, CHARACTER Trader, INT Bool) can now set the trade flag for each player character separately. The quest and secret functions also take into account the individual characters now: QuestUpdate(STRING Quest, STRING Status) QuestAdd(STRING Quest) QuestClose(STRING Quest) AddSecret(STRING Secret)was changed to: QuestUpdate(CHARACTER Character, STRING Quest, STRING Status) QuestAdd(CHARACTER Character, STRING Quest) QuestClose(CHARACTER Character, STRING Quest) AddSecret(CHARACTER Character, STRING Secret)The helper functions QuestUpdateAll(STRING Quest, STRING Status) and QuestCloseAll(STRING Quest)[/i] to update/close a quest for all characters. Party functions were expanded a bit: CharacterAddToParty(CHARACTER Character) -> CharacterAddToParty(CHARACTER Character, CHARACTER Character) CharacterIsInPartyWith(CHARACTER Character, CHARACTER Target, OUT INT Bool) ItemIsInPartyInventory(ITEM Item, CHARACTER Character, INT MoveAndReport, OUT INT Bool) PartyAddGold(CHARACTER Character, INT Count) Text events can now be parameterized:GetTextEventParamString(INT Number, OUT STRING Value) GetTextEventParamInteger(INT Number, OUT INT Value) GetTextEventParamReal(INT Number, OUT REAL Value) GetTextEventParamUUID(INT Number, OUT STRING Value)New Crime API-s:A new set of functions were introduced for the D:OS 2 version of crime. CharacterRegisterCrime(CHARACTER Player, STRING CrimeType, STRING Evidence, CHARACTER Witness, INT CrimeID) CharacterRegisterCrimeWithPosition(CHARACTER Player, STRING CrimeType, STRING Evidence, CHARACTER Witness, REAL X, REAL Y, REAL Z, INT CrimeID) CharacterStopCrime(CHARACTER Player, STRING CrimeType, STRING Evidence) CharacterDisableCrime(CHARACTER Character, STRING Crime) CharacterIsCrimeEnabled(CHARACTER Character, STRING Crime, OUT INT Bool) CharacterGetCrimeRegion(CHARACTER Character, OUT STRING Region) CharacterEnableCrime(CHARACTER Character, STRING Crime) CharacterDisableAllCrimes(CHARACTER Character) CharacterEnableAllCrimes(CHARACTER Character) CharacterEnableCrimeWarnings(CHARACTER Character, INT Enable) CharacterOnCrimeSensibleActionNotification(CHARACTER Character, STRING RegionID, INT CrimeID, STRING PriortiyName, STRING PrimaryDialog, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4) CrimeGetType(INT CrimeID, OUT STRING Type) CrimeGetTension(INT CrimeID, OUT INT Tension) CrimeGetNewID(OUT INT CrimeID) CrimeIsTensionOverWarningTreshold(CHARACTER Character, OUT INT Bool) CrimeFindEvidence(INT CrimeID, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4, OUT INT EvidenceFoundForCurrentCrime, OUT INT EvidenceFound, OUT INT GuiltyFound) CrimeInterrogationDone(INT CrimeID, CHARACTER Interrogator, INT FoundEvidence, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4) CrimeWarningDone(INT CrimeID, CHARACTER Interrogator) CrimeAreaSetTensionModifier(TRIGGER CrimeArea, INT Modifier) CrimeAreaResetTensionModifier(TRIGGER CrimeArea) CrimeIgnoreCrime(INT CrimeID, STRING NPC) CrimeInterrogationRequest(STRING CrimeRegion, INT CrimeID, CHARACTER Interrogator, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4, STRING InterrogateDialog) CrimeWarningRequest(STRING CrimeRegion, INT CrimeID, CHARACTER Interrogator, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4, STRING WarningDialog) OnCrimeResolved(INT CrimeID, CHARACTER Victim, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4) OnCrimeRemoved(INT CrimeID, CHARACTER Victim, CHARACTER Criminal1, CHARACTER Criminal2, CHARACTER Criminal3, CHARACTER Criminal4) OnCrimeMergedWith(INT OldCrimeID, INT NewCrimeID) OnCrimeSawCriminalInCombat(INT CrimeID, CHARACTER Character, CHARACTER Criminal1) DialogStartCrimeDialog(INT CrimeID, STRING Dialog, INT MarkForInteractiveDialog, STRING NPC, STRING Criminal1, STRING Criminal2, STRING Criminal3, STRING Criminal4, OUT INT success)The old (admittedly quite cluttered) API-s were removed: CharacterSpottedItemUsed_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT crimeID) CharacterSpottedItemTemplateUsed_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT crimeID) CharacterSpottedItemMoved_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT crimeID) CharacterSpottedItemTemplateMoved_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT crimeID) CharacterSpottedItemTheft_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT Value, INT Handle, INT CrimeID, REAL X, REAL Y, REAL Z, REAL Pitch, REAL Yaw, REAL Roll, INT ContainerHandle) CharacterSpottedItemTemplateTheft_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT Amount, INT Value, INT LocalHandle, INT CrimeID, REAL X, REAL Y, REAL Z, REAL Pitch, REAL Yaw, REAL Roll, INT ContainerHandle) CharacterSpottedItemDestroyed_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT Value, INT CrimeID) CharacterSpottedItemTemplateDestroyed_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT Amount, INT Value, INT crimeID) CharacterSpottedItemAttacked_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT Value, STRING DamageType, INT CrimeID) CharacterSpottedItemTemplateAttacked_Redhanded(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT Amount, INT Value, STRING DamageType, INT crimeID, INT Handle) CharacterSpottedItemTheft_ByEvidence(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, ITEM Item, INT Value, INT Handle) CharacterSpottedItemTemplateTheft_ByEvidence(CHARACTER Offender, CHARACTER Spotter, CHARACTER Owner, STRING ItemTemplate, INT Amount) ItemHandleTheft(CHARACTER Offender, CHARACTER Owner, INT Value, INT Handle)The reputation mechanism was also removed: CharacterGetRepAttitudeTowardsPlayer(CHARACTER Character, CHARACTER Player, OUT INT RepAttitude) CharacterEnableReputationEffects(CHARACTER Character, INT Bool) CharacterAddReputation(CHARACTER Character, INT Delta) CharacterGetReputation(CHARACTER Character, OUT INT Reputation)New combat functions and events:EnterCombat(STRING Source, STRING Target) LeaveCombat(STRING Target) EndTurn(STRING Target) SetCanJoinCombat(STRING Target, INT Enabled) SetCombatGroupID(STRING Target, STRING GroupID) CharacterSendGlobalCombatCounter(CHARACTER Character, INT Turn)
CharacterBlockedCharacter(CHARACTER Character, CHARACTER Source) CharacterMissedCharacter(CHARACTER Character, CHARACTER Source) CharacterCriticalHitCharacter(CHARACTER Character, CHARACTER Source) CharacterVitalityChanged(CHARACTER Character, INT Percentage) SkillCast(CHARACTER Character, STRING Skill, STRING SkillElement) CharacterLootedCharacterCorpse(CHARACTER Player, CHARACTER Corpse)Trade modifiers:Modifiers can now be applied at shops for various character interactions (identify, repair, etc.). PartySetIdentifyPriceModifier(CHARACTER Character, CHARACTER PartyMember, INT Modifier) PartySetRepairPriceModifier(CHARACTER Character, CHARACTER PartyMember, INT Modifier) PartySetShopPriceModifier(CHARACTER Character, CHARACTER PartyMember, INT Modifier)"Posessed" mechanic:I'm not quite sure what this does. One possibility is that these check if the player is currently controlling a character. CharacterPossessed(CHARACTER Character) CharacterReleased(CHARACTER Character) CharacterIsPossessed(CHARACTER Character, OUT INT Bool)Physical / magic armor functions:CharacterGetArmorPercentage(CHARACTER Character, OUT INT Percentage) CharacterSetArmorPercentage(CHARACTER Character, INT Percentage) CharacterGetMagicArmorPercentage(CHARACTER Character, OUT INT Percentage) CharacterSetMagicArmorPercentage(CHARACTER Character, INT Percentage)"Ghost" mechanic:I have no idea what these do. CharacterTurnedToGhost(CHARACTER Character, CHARACTER Ghost) CharacterGhostDestroyed(CHARACTER Character, CHARACTER Ghost) CharacterLinkGhost(CHARACTER Character, CHARACTER Ghost)Group APIs:CharacterAddedToGroup(CHARACTER Character) CharacterDetachedFromGroup(CHARACTER Character) CharactersAreGrouped(CHARACTER Character1, CHARACTER Character2, OUT INT Bool)New functions for the arena:CharacterSetInArena(CHARACTER Character, INT InArena) CharacterSetSpectating(CHARACTER Character, INT Spectating) CharacterIsInArena(CHARACTER Character, OUT INT Bool) CharacterIsSpectating(CHARACTER Character, OUT INT Bool) OnArenaRoundStarted(INT ArenaMode) CharacterCreatedInArena(CHARACTER Character, INT Team) ShowArenaResult(INT WinnerTeamId)Character management API-s:These seem to be used for assigning characters to players. GetCurrentCharacter(INT User, OUT CHARACTER Character) CharacterIsControlled(CHARACTER Character, OUT INT IsControlled) CharacterAssign(INT UserID) CharacterAssignToUser(INT UserID, CHARACTER Character)New user API-s:These were presumably introduced for arena mode. IterateUsers(STRING Event) GetUserName(INT UserId, OUT STRING UserName) GetUserProfileID(INT UserId, OUT STRING UserProfileID) LeaveParty(INT UserId) AddToParty(INT Source, INT Target) UserConnected(INT UserID, STRING UserName, STRING UserProfileID) UserDisconnected(INT UserID, STRING UserName, STRING UserProfileID) UserEvent(INT UserID, STRING UserEvent) UserMakeWar(INT SourceUserID, INT TargetUserID, INT War) GetUserCount(OUT INT UserCount) CharacterReservedUserIDChanged(CHARACTER Character, INT UserID)Miscellaneous changes:The first CHARACTER parameter from " CharacterTeleportPartyToTrigger(TRIGGER Trigger, STRING Event)" was removed. The Player parameter from " CharacterGenerateCustomTradeTreasure(CHARACTER Character, STRING Treasure)" was removed, and the function was renamed to " CharacterSetCustomTradeTreasure". " CharacterDie(CHARACTER Character, INT ScatterLoot, STRING DeathType)" now has an additional DeathType parameter. " CharacterGetReservedPeerID(CHARACTER Character, OUT INT Count)" renamed to " CharacterGetReservedUserID". I'm not even sure what this function even does, it probably returns the network peer ID in multiplayer? The GameStarted(STRING LevelName, INT IsEditorMode) can now run trigger code paths in the editor and in the actual game. Interesting additions:CharacterSelectedInCharCreation(CHARACTER Character, INT UserID)This seems to be added for multiplayer / whole-party character creation, not sure how it is used yet. CharacterUseSkill(CHARACTER Character, STRING SkillID, STRING Target)Allows a character to use an arbitrary skill. CharacterUnlockRecipe(CHARACTER Character, STRING RecipeID, INT ShowNotification)I've seen a thread where someone requested this feature, here it is CharacterUnequipItem(CHARACTER Character, ITEM Item)AFAIK this was not possible before. CharacterGiveReward(CHARACTER Player, STRING Treasure)Seems to give items directly to the character based on the treasure table name? ItemScatterAt(ITEM Item, REAL X, REAL Y, REAL Z)"Drop" an item at the given location? LoadGame(STRING Savegame)Not sure why this belongs to story scripts, but interesting nevertheless. Miscellaneous additions 2:This section contains a mishmash of less important functions that I could not categorize. CharacterGuarded(CHARACTER Character) CharacterWentOnStage(CHARACTER Character, INT Bool) CharacterStartLockpickingItem(CHARACTER Character, ITEM Item)
CharacterSetAnimationSetOverride(CHARACTER Character, STRING AnimationSetResource) CharacterResetCooldowns(CHARACTER Character) CharacterRemoveSummons(CHARACTER Character, INT Die) CharacterGetSourcePoints(CHARACTER Character, OUT INT Amount) CharacterResurrectCustom(CHARACTER Character, STRING ResurrectAnimation) CharacterSetCustomName(CHARACTER Character, STRING Text) CharacterGetBaseAbility(CHARACTER Character, STRING Ability, OUT INT Value) CharacterHasSkill(CHARACTER Character, STRING Skill, OUT INT Bool) GenerateTreasure(ITEM Item, STRING TreasureID, INT Level, CHARACTER Character)
ContainerIdentifyAll(ITEM FromContainer) ItemTemplateIsInPartyInventory(CHARACTER Character, STRING Template, INT MoveAndReport, OUT INT Count) ItemHasOnUse(ITEM Item, STRING OnUse, OUT INT Bool) ItemLockUnEquip(ITEM Item, INT lock) ItemIsEquipable(ITEM Item, OUT INT Bool) ItemGetOwner(ITEM Item, OUT CHARACTER Character) SetTransferItemsOnPartyRemove(INT Enable) TriggerSetItemOwner(TRIGGER AreaTrigger, CHARACTER Owner) TriggerClearItemOwner(TRIGGER AreaTrigger) TriggerClearItemTemplateOwners(TRIGGER Trigger, STRING ItemTemplate)
SetCameraDistanceOverride(REAL Distance) IsHardcoreMode(OUT INT Bool)
CharacterShowStoryElementUI(CHARACTER Character, INT Type, STRING CloseAction, STRING Action1, STRING Action2, STRING Action3, STRING Action4, STRING Action5, STRING Action6, STRING Action7, STRING Action8, STRING Action9) CharacterPlayHUDSound(CHARACTER Character, STRING Sound) NotifyGameProgress(REAL Progress) ShowTutorial(CHARACTER Character, STRING Text, INT ButtonID, STRING Category) --> ShowTutorial(CHARACTER Character, STRING Text, INT ButtonID, STRING Category, STRING Title, INT ControllerType, INT ModalType, INT Duration, INT Priority, INT Flags) CompleteTutorial(CHARACTER Character, STRING Text) ProgressAchievement(CHARACTER Character, STRING AchievementID, INT Progress) GameModeStarted(STRING GameMode) DLCUnlocked(INT DLCId)
SetStoryEvent(STRING Object, STRING Event) StoryEvent(STRING Object, STRING Event)
IntegertoString(INT Integer, OUT STRING Result)Function removals: -- Homestead functions CharacterRequestsHomestead(CHARACTER Character) ItemHandleSendToHomestead(CHARACTER FromCharacter, INT ItemHandle) SetHomesteadKeyState(INT State)
-- Traits CharacterHasTrait(CHARACTER Character, STRING Trait, OUT INT Bool) CharacterGetTrait(CHARACTER Character, STRING Trait, OUT INT Lvl)) CharacterAddTrait(CHARACTER Character, STRING TraitType, INT TraitValue)
-- Misc functions CameraLockOnNpc(CHARACTER Trigger) CharacterFlee(CHARACTER Character) CharacterGetOtherPlayer(CHARACTER Character, OUT CHARACTER OtherCharacter) CharacterIsInGroup(CHARACTER Character, STRING Group, OUT INT Bool) CharacterLockGroup(CHARACTER Character, INT Bool) CharacterDispelMagic(CHARACTER Character) CharacterShowCoords(CHARACTER Character) CharacterGetByName(STRING Name, OUT CHARACTER Character)
TradeBalance(CHARACTER Player, CHARACTER Trader, OUT INT Balance) ItemGetProperty(ITEM Item, STRING Property, OUT STRING Value) ItemGetByName(STRING Name, OUT ITEM Item)
ShroudSetInTrigger(TRIGGER Trigger, INT Enable) TriggerKillEnemies(TRIGGER AreaTrigger) TriggerSetItemOwner(TRIGGER AreaTrigger, CHARACTER Owner) TriggerClearItemOwner(TRIGGER AreaTrigger)
LaunchCallbackEvent(STRING Event) CallbackEvent(STRING Event) HenchManHiredFinished(CHARACTER Character, INT Hired) ToggledTacticalCamera(CHARACTER Character, INT Enabled) KickstarterTreeUsed(CHARACTER Character)
|
|
|
|
member
|
OP
member
Joined: Dec 2016
|
Wow, thanks for this work Norbyte! Sounds like lots of code will be pretty simple to re-use, then. - Objects vars can now be removed via ClearVarObject. I don't quite understand; this would remove a variable from the object? If so, would the object regenerate the variable on future inits or not? The few ones that remained now use INT64 instead of INT; this is most likely done to fix for the "out of item handles" crash that affected D:OS 1 and EE. With a 64-bit handle, I don't believe the game can ever run out of handles now. This is wonderful news. Objects can now be tagged with custom string tags. Very positive implications from this, nice! EnterCombat(STRING Source, STRING Target) LeaveCombat(STRING Target) EndTurn(STRING Target) SetCanJoinCombat(STRING Target, INT Enabled) SetCombatGroupID(STRING Target, STRING GroupID) CharacterSendGlobalCombatCounter(CHARACTER Character, INT Turn)
This stuff is fantastic. CharacterUnlockRecipe(CHARACTER Character, STRING RecipeID, INT ShowNotification)I've seen a thread where someone requested this feature, here it is Woop! GenerateTreasure(ITEM Item, STRING TreasureID, INT Level, CHARACTER Character) Very useful, could be used to replace the loot system with one weighted based on party composition. SetCameraDistanceOverride(REAL Distance) Oh, baby....
Last edited by Ameranth; 24/04/17 05:08 AM.
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
Indeed, some nice changes and additions, especially the tagging of objects which I absolutely missed in D:OS 1. But I wonder what this means in consequence: The "Item(Handle)ToXXX" family of functions was greatly simplified. The old functions were removed: [...] ... and replaced by two functions: ItemToTransform(STRING UUID, REAL X, REAL Y, REAL Z, REAL Pitch, REAL Yaw, REAL Roll, INT Amount, CHARACTER OwnerCharacter) ItemTo(ITEM Item, STRING TargetObject, INT Amount)
[...]
GetItemForItemTemplateInInventory(CHARACTER Character, STRING Template, OUT ITEM Item) Is the distinction of global and non-global items removed then? And would this last mentioned call be able to output several items for several stacks of an item template in inventory? 'GetItemhandleForItemTemplateInInventory(CHARACTER Character, STRING Template, OUT INT Itemhandle)' always returned the handle of one stack and therefore required to move the item handle out of inventory to return the handle of another stack. Originally Posted By: Norbyte The few ones that remained now use INT64 instead of INT; this is most likely done to fix for the "out of item handles" crash that affected D:OS 1 and EE. With a 64-bit handle, I don't believe the game can ever run out of handles now.
Originally Posted By: Ameranth This is wonderful news.
Relieving! Though since I'm still working on D:OS 1 EE, my fears, similar to FrauBlake's who's my Brother in Paranoia, have returned in regard to FX and potion handles (there are status handles, too?). Speaking of D:OS 1 EE: Is it possible to run out of handles here as well? I mean: what if I double or triple the amount of used effects, potions and statuses for an average playthrough through scripting, would I introduce a ticking bomb into the game? And thanks for the great pool of information, Norbyte!
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
- Objects vars can now be removed via ClearVarObject. I don't quite understand; this would remove a variable from the object? If so, would the object regenerate the variable on future inits or not? This would remove an object type variable from an object. You can set int values to 0, or some other value to indicate "emptiness", however there is no "NULL" object UUID (although that would be a good idea), so the "reset to initial value" or "reset to null" function for objects is ClearVarObject. But I wonder what this means in consequence I believe what they did is instead of assigning it a "local" handle that is invalidated when the item is moved, dropped, transferred, etc., they gave each item a unique UUID that persists even when the item is manipulated or moved. And would this last mentioned call be able to output several items for several stacks of an item template in inventory? 'GetItemhandleForItemTemplateInInventory(CHARACTER Character, STRING Template, OUT INT Itemhandle)' always returned the handle of one stack and therefore required to move the item handle out of inventory to return the handle of another stack. I'm not sure, it depends on how they translated the old function call. Theoretically it can return multiple rows. Though since I'm still working on D:OS 1 EE, my fears, similar to FrauBlake's who's my Brother in Paranoia, have returned in regard to FX and potion handles (there are status handles, too?). Effects use the same global handle pool as far as I know. About statuses I'm not sure, the old savegames didn't assign an ID to them as they weren't "entities", so I think statuses don't count towards the limit. But since effects do, sooner or later you'll run out of them Speaking of D:OS 1 EE: Is it possible to run out of handles here as well? I mean: what if I double or triple the amount of used effects, potions and statuses for an average playthrough through scripting, would I introduce a ticking bomb into the game? Some attempts were made to reduce the number of handles used in the EE, but they wouldn't have converted everything to a 64-bit system if it wasn't really necessary, so I believe that it is still a very real problem in the EE, yes. Although a 32-bit ID would theoretically allow 4 billion items to exist, in practice many of these 32 bits are reserved for other purposes, and depending on their usage the actual maximum item count may be as low as 65k or such. Also it is my impression that the handles function like a counter, not like a pool, so creating an item with ID 1234 and later destroying that item won't allow the engine to re-use that ID later. Also I'd like to correct my previous post a bit: I used the "old" (D:OS and EE) types for the D:OS 2 function signatures because that was the best way to compare them against the old signatures; the actual signatures have more specific types. To give you an example, the SetVarObject(STRING Source, STRING VarName, STRING Object) function mentioned above in fact looks like this: SetVarObject(GUIDSTRING Source, STRING VarName, GUIDSTRING Object). Basically, GUIDSTRING is the new umbrella type for all "entity-like" objects, and the ITEMGUID / CHARACTERGUID / TRIGGERGUID are its aliases. This means that it is legal to pass an ITEMGUID as a parameter to a function that expects a GUIDSTRING. I'm not sure if the reverse is true. Random musings: I was thinking about how I would explain Osiris scripting to someone who hasn't seen it before, and I believe the best analogue would be relational databases (SQL). "Events" (in Osi terms) would be triggers, each "query" and "database" would be a relational join. For example the following rule: IF
StoryEvent(CHARACTERGUID_S_FTJ_AlcoveChild_001,"JoinCombatWithUnnis")
AND
DB_CombatCharacters(CHARACTERGUID_S_FTJ_AlcoveChild_001,_ID)
AND
DB_CombatObjects(_Char,_ID)
AND
_Char != CHARACTERGUID_S_FTJ_AlcoveChild_001
THEN
EndTurn(_Char); ... could be expressed in SQL like this*:
SELECT EndTurn(_Char)
FROM StoryEvent('CHARACTERGUID_S_FTJ_AlcoveChild_001', 'JoinCombatWithUnnis') AS SE
CROSS JOIN DB_CombatCharacters AS DB_CC
INNER JOIN DB_CombatObjects AS DB_CO ON (DB_CC._ID = DB_CO._ID)
WHERE DB_CC._Char = 'CHARACTERGUID_S_FTJ_AlcoveChild_001'
AND DB_CO._Char <> 'CHARACTERGUID_S_FTJ_AlcoveChild_001'
* technically this wouldn't work as StoryEvent is a trigger, but I'll ignore that to demonstrate the concept. Each "AND" in Osiris is basically an implicit join. Is the distinction of global and non-global items removed then? I don't think so. They're still stored in a separate folder ( Mods\DivinityOrigins_1301db3d-1f54-4e98-9be5-5094030916e4\Globals) and seem to be handled differently from local objects. Globals were probably introduced for performance reasons (accessing any game object from any part of the game would mean that either all game objects should be loaded all the time, or they could be loaded on-demand, which would cause script functions to stall the game engine while the load is ongoing, effectively lagging the game), and I think those reasons are still valid today, so I believe globals are here to stay. I don't think I have seen any game where this problem was solved in a painless way. Bethesda games have "global-lite" objects; they are kinda global, but have many weird restrictions around them and scripting is anything but fast. (Go search for "skyrim script lag" to see what I mean.) Infinity Engine games used global variables for passing data between different maps, and area enter/exit scripts to execute the needed changes based on the globals. Ultima games went even further and needed "enterFastArea/leaveFastArea" scripts when characters left the player's immediate vicinity, to have bearable performance. (They also had a nifty scripting engine that used cooperative multitasking and x86-like bytecode; quite advanced for its time.)
Last edited by Norbyte; 24/04/17 07:24 PM.
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
Thanks for the insight! I guess I have to start a request to Raze/Larian in terms of handles for potions and effects. I've worked on a weather system the last three weeks, and considering the amount of potions characters will consume till the end of the game, I'm quite worried the handles might not suffice...
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
Patch v3.0.76.796!This patch is quite large, quite interesting, and adds about 180 new functions! Since almost all changes are additions, I've put the changes/deletions to the end of the list. ItemsGettersSome useful functions for retrieving additional information that was not available before. query ItemGetAmount([in](ITEMGUID)_Item, [out](INTEGER)_Amount) query ItemGetGoldValue([in](ITEMGUID)_Item, [out](INTEGER)_Value) query ItemIsInInventory([in](ITEMGUID)_Item, [out](INTEGER)_Bool) query ItemIsInUserInventory([in](ITEMGUID)_Item, [in](CHARACTERGUID)_Character, [in](INTEGER)_MoveAndReport, [out](INTEGER)_Bool) query ItemIsLadder([in](ITEMGUID)_Item, [out](INTEGER)_Bool) query GetItemForItemTemplateInPartyInventory([in](CHARACTERGUID)_Character, [in](STRING)_Template, [out](ITEMGUID)_Item) query ItemTemplateIsInUserInventory([in](CHARACTERGUID)_Character, [in](STRING)_Template, [in](INTEGER)_MoveAndReport, [out](INTEGER)_Count) event CanLockpickItem((CHARACTERGUID)_Character, (ITEMGUID)_Item, (INTEGER)_RequestID) event CanMoveItem((CHARACTERGUID)_Character, (ITEMGUID)_Item, (INTEGER)_RequestID) event CanPickupItem((CHARACTERGUID)_Character, (ITEMGUID)_Item, (INTEGER)_RequestID) event CanUseItem((CHARACTERGUID)_Character, (ITEMGUID)_Item, (INTEGER)_RequestID) IteratorsThis one allows the script to iterate over all items in the player's inventory. call InventoryLaunchIterator((GUIDSTRING)_InventoryHolder, (STRING)_Event, (STRING)_CompletionEvent) Usage example:
InventoryLaunchIterator(_Player, "EVENT NAME", "COMPLETION EVENT NAME");
IF
StoryEvent(_Item, "EVENT NAME")
THEN
// Do something with the _Item
Movementcall ItemMoveToPositionEvent((ITEMGUID)_Item, (REAL)_X, (REAL)_Y, (REAL)_Z, (REAL)_Speed, (REAL)_Acceleration, (STRING)_Event) call ItemMoveToTriggerEvent((ITEMGUID)_Item, (TRIGGERGUID)_Trigger, (REAL)_Speed, (REAL)_Acceleration, (INTEGER)_UseRotation, (STRING)_Event) call ItemRotateToAngleY((ITEMGUID)_Item, (REAL)_Angle, (REAL)_Speed) Item transfercall ItemToInventory((ITEMGUID)_Item, (GUIDSTRING)_TargetObject, (INTEGER)_Amount) call ItemTemplateRemoveFromUser((STRING)_ItemTemplate, (CHARACTERGUID)_Character, (INTEGER)_Count) call TransferItemsToCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_ToCharacter) call TransferItemsToParty((CHARACTERGUID)_Character) call TransferItemsToUser((CHARACTERGUID)_Character) Goldcall UserAddGold((CHARACTERGUID)_Character, (INTEGER)_Count) query PartyGetGold([in](CHARACTERGUID)_Character, [out](INTEGER)_Gold) query UserGetGold([in](CHARACTERGUID)_Character, [out](INTEGER)_Gold) CraftingThe prototype for crafting functions/callbacks was changed, the new system allows the player to combine up to 5 ingredients! event ItemTemplateCombinedWithItemTemplate((STRING)_FirstItemTemplate, (STRING)_SecondItemTemplate, (STRING)_ThirdItemTemplate, (STRING)_ForthItemTemplate, (STRING)_FifthItemTemplate, (CHARACTERGUID)_Character, (ITEMGUID)_NewItem) event CanCombineItem((CHARACTERGUID)_Character, (ITEMGUID)_ItemA, (ITEMGUID)_ItemB, (ITEMGUID)_ItemC, (ITEMGUID)_ItemD, (ITEMGUID)_ItemE, (INTEGER)_RequestID) event CharacterStoppedCombiningItems((CHARACTERGUID)_Character, (ITEMGUID)_ItemA, (ITEMGUID)_ItemB, (ITEMGUID)_ItemC, (ITEMGUID)_ItemD, (ITEMGUID)_ItemE) ChargesItems can store charges now. call ItemAddCharges((ITEMGUID)_Item, (INTEGER)_Charges) call ItemResetChargesToMax((ITEMGUID)_Item) query ItemGetCharges([in](ITEMGUID)_Item, [out](INTEGER)_Charges) query ItemGetMaxCharges([in](ITEMGUID)_Item, [out](INTEGER)_InitialCharges) OwnershipIt seems that the original owner of items is now more closely tracked. call ItemSetOriginalOwner((ITEMGUID)_Item, (CHARACTERGUID)_NewOwner) query GetInventoryOwner([in](ITEMGUID)_Item, [out](GUIDSTRING)_Owner) query ItemGetOriginalOwner([in](ITEMGUID)_Item, [out](CHARACTERGUID)_Character) Item taggingSome helper functions were added to make item tagging more useful: query ItemTemplateTagIsInCharacterInventory([in](CHARACTERGUID)_Character, [in](STRING)_Template, [in](STRING)_Tag, [out](INTEGER)_Count) query PartyFindTaggedItem([in](CHARACTERGUID)_Character, [in](STRING)_Tag, [in](INTEGER)_MoveAndReport, [out](ITEMGUID)_Item) query PartyRemoveTaggedLocalItems([in](CHARACTERGUID)_Character, [in](STRING)_Tag, [in](INTEGER)_Amount, [out](INTEGER)_AmountRemoved) query UserFindTaggedItem([in](CHARACTERGUID)_Character, [in](STRING)_Tag, [in](INTEGER)_MoveAndReport, [out](ITEMGUID)_Item) query UserRemoveTaggedLocalItems([in](CHARACTERGUID)_Character, [in](STRING)_Tag, [in](INTEGER)_Amount, [out](INTEGER)_AmountRemoved) query UserTransferTaggedLocalItems([in](CHARACTERGUID)_Character, [in](GUIDSTRING)_ToObject, [in](STRING)_Tag, [in](INTEGER)_Amount, [out](INTEGER)_AmountTransfered) Miscevent ItemStatusAttempt((ITEMGUID)_Item, (STRING)_Status, (GUIDSTRING)_Causee) event ItemWentOnStage((GUIDSTRING)_Item, (INTEGER)_Bool) CharactersGettersquery CharacterGetEquippedItem([in](CHARACTERGUID)_Character, [in](STRING)_Slotname, [out](GUIDSTRING)_ItemGUID) query CharacterHasLinkedGhost([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterIsMoving([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterIsPartyFollower([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterIsPlayer([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterIsSummon([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) "Move and talk"call CharacterMoveToAndTalk((CHARACTERGUID)_Character, (GUIDSTRING)_Target, (STRING)_DialogID, (INTEGER)_IsAutomated, (STRING)_MoveID, (INTEGER)_Running, (REAL)_Timeout) call CharacterMoveToAndTalkRequestDialogFailed((CHARACTERGUID)_Character, (GUIDSTRING)_Target) event CharacterMoveToAndTalkFailed((CHARACTERGUID)_Character, (GUIDSTRING)_Target, (STRING)_MoveID) event CharacterMoveToAndTalkRequestDialog((CHARACTERGUID)_Character, (GUIDSTRING)_Target, (STRING)_DialogID, (INTEGER)_IsAutomated, (STRING)_MoveID) event CharacterMoveToAndTalkRequestDialogFailedEvent((CHARACTERGUID)_Character, (GUIDSTRING)_Target) Skillskill use can ignore cooldown and fire the skill even if the character doesn't have said skill. call CharacterUseSkill((CHARACTERGUID)_Character, (STRING)_SkillID, (GUIDSTRING)_Target, (INTEGER)_ForceResetCooldown, (INTEGER)_IgnoreHasSkill) GetClosest*The "GetClosest*" functions now also return the distance of the player from the target: query GetClosestAlivePlayer([in](GUIDSTRING)_Target, [out](CHARACTERGUID)_Player, [out](REAL)_Distance) query GetClosestAliveUserPlayer([in](GUIDSTRING)_Target, [in](INTEGER)_UserID, [out](CHARACTERGUID)_Player, [out](REAL)_Distance) query GetClosestPlayer([in](GUIDSTRING)_Target, [out](CHARACTERGUID)_Player, [out](REAL)_Distance) query GetClosestPlayerToPosition([in](REAL)_X, [in](REAL)_Y, [in](REAL)_Z, [out](CHARACTERGUID)_Player, [out](REAL)_Distance) query GetClosestPlayerWithTalent([in](GUIDSTRING)_Target, [in](STRING)_Talent, [out](CHARACTERGUID)_Player, [out](REAL)_Distance) event CharacterTeleportToPyramid((CHARACTERGUID)_Character, (ITEMGUID)_Pyramid) event CharacterTeleported((CHARACTERGUID)_Target, (CHARACTERGUID)_Cause, (REAL)_OldX, (REAL)_OldY, (REAL)_OldZ, (REAL)_NewX, (REAL)_NewY, (REAL)_NewZ, (STRING)_Skill) Movementcall CharacterAppearAtPositionOutOfSightToObject((CHARACTERGUID)_Character, (REAL)_X, (REAL)_Y, (REAL)_Z, (GUIDSTRING)_Object, (INTEGER)_PlaySpawn, (STRING)_Event) call CharacterAppearOnTrailOutOfSightToObject((CHARACTERGUID)_Character, (CHARACTERGUID)_Target, (GUIDSTRING)_Object, (INTEGER)_PlaySpawn, (STRING)_Event) call CharacterAppearOutOfSightToObject((CHARACTERGUID)_Character, (GUIDSTRING)_Target, (GUIDSTRING)_Object, (INTEGER)_PlaySpawn, (STRING)_Event) call CharacterDisappearOutOfSightToObject((CHARACTERGUID)_Character, (GUIDSTRING)_Object, (INTEGER)_Running, (STRING)_Event, (INTEGER)_IncreaseSpeed) DialogsDialogs can now be "embedded into" each other, i.e. child dialogs can now be created on top of a parent dialog. The max number of dialog participants was also increased to 6. query DialogStartChildDialog([in](STRING)_Dialog, [in](INTEGER)_ParentInstanceID, [in](INTEGER)_NewInstanceID, [in](CHARACTERGUID)_Player1, [in](CHARACTERGUID)_Player2, [in](CHARACTERGUID)_Player3, [in](CHARACTERGUID)_Player4, [out](INTEGER)_success) event ChildDialogRequested((STRING)_Dialog, (INTEGER)_InstanceID, (INTEGER)_TargetInstanceID) Source pointsSource point/skill control functions are now exposed via Osiris: call CharacterAddSourcePoints((CHARACTERGUID)_Character, (INTEGER)_Amount) call CharacterOverrideMaxSourcePoints((CHARACTERGUID)_Character, (INTEGER)_Amount) call CharacterRemoveMaxSourcePointsOverride((CHARACTERGUID)_Character) event CharacterUsedSourcePoint((CHARACTERGUID)_Character) query CharacterGetMaxSourcePoints([in](CHARACTERGUID)_Character, [out](INTEGER)_Amount) query IsSourceSkill([in](STRING)_SkillID, [out](INTEGER)_Bool) Partyevent CharacterJoinedParty((CHARACTERGUID)_Character) event CharacterLeftParty((CHARACTERGUID)_Character) Peace/warHostile/neutral/peaceful character relations -- I'm not quite sure what they do or how they work: call MakePeace((CHARACTERGUID)_Source, (CHARACTERGUID)_Target, (INTEGER)_IgnoreVote) call MakeWar((CHARACTERGUID)_Source, (CHARACTERGUID)_Target, (INTEGER)_IgnoreVote) query CharacterIsAlly([in](CHARACTERGUID)_Character, [in](CHARACTERGUID)_OtherCharacter, [out](INTEGER)_Bool) query CharacterIsEnemy([in](CHARACTERGUID)_Character, [in](CHARACTERGUID)_OtherCharacter, [out](INTEGER)_Bool) query CharacterIsNeutral([in](CHARACTERGUID)_Character, [in](CHARACTERGUID)_OtherCharacter, [out](INTEGER)_Bool) Polymorphcall CharacterReservePolymorphShape((CHARACTERGUID)_Character, (STRING)_Race) event CharacterPolymorphedInto((CHARACTERGUID)_Character, (STRING)_Race) event CharacterStoppedPolymorph((CHARACTERGUID)_Character) query CharacterIsPolymorphInteractionDisabled([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterIsPolymorphedInto([in](CHARACTERGUID)_Character, [in](STRING)_TargetRace, [out](INTEGER)_Bool) Misccall CharacterAddExplorationExperience((CHARACTERGUID)_Character, (INTEGER)_Act, (INTEGER)_ActPart, (INTEGER)_Gain) call CharacterAddToPlayerCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_Owner) call CharacterCharacterSetEvent((CHARACTERGUID)_Character, (CHARACTERGUID)_Character, (STRING)_Event) call CharacterEnableWaypointUsage((CHARACTERGUID)_Character, (INTEGER)_Bool) call CharacterLevelUpTo((CHARACTERGUID)_Character, (INTEGER)_Level) call CharacterRecruitCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_Character) call CharacterRemoveFromPlayerCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_Owner) call CharacterSetForceSynch((CHARACTERGUID)_Character, (INTEGER)_Bool) call CharacterUnlinkGhost((CHARACTERGUID)_Character, (CHARACTERGUID)_Ghost) query CharacterCanSeeGhost([in](CHARACTERGUID)_Character, [in](GUIDSTRING)_Ghost, [out](INTEGER)_Bool) query CharacterCanUseWaypoints([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) query CharacterCreateAtPosition([in](REAL)_X, [in](REAL)_Y, [in](REAL)_Z, [in](STRING)_TemplateId, [in](INTEGER)_PlaySpawn, [out](CHARACTERGUID)_Created) query CharacterCreateAtPositionOutOfSightTo([in](REAL)_X, [in](REAL)_Y, [in](REAL)_Z, [in](STRING)_TemplateId, [in](INTEGER)_Angle, [in](INTEGER)_PlaySpawn, [in](STRING)_Event, [out](CHARACTERGUID)_Created) query CharacterCreateOutOfSightToObject([in](STRING)_TemplateId, [in](CHARACTERGUID)_ToTarget, [in](GUIDSTRING)_FromObject, [in](INTEGER)_PlaySpawn, [in](STRING)_Event, [out](CHARACTERGUID)_Created) event CharacterCharacterEvent((CHARACTERGUID)_Character1, (CHARACTERGUID)_Character2, (STRING)_Event) event CharacterGhostRevealed((CHARACTERGUID)_Character, (CHARACTERGUID)_Ghost) event CharacterMadePlayer((CHARACTERGUID)_Character) call CharacterRemoveTension((CHARACTERGUID)_Player) event CharacterStoppedUsingItem((CHARACTERGUID)_Character, (ITEMGUID)_Item) Objectscall ObjectClearDialogFlag((GUIDSTRING)_Target, (STRING)_Flag, (INTEGER)_DialogInstance) call ObjectSetDialogFlag((GUIDSTRING)_Target, (STRING)_Flag, (INTEGER)_DialogInstance) call ObjectShareFlag((GUIDSTRING)_Target, (STRING)_Flag) event ObjectFlagShared((STRING)_FlagName, (GUIDSTRING)_Speaker, (INTEGER)_NewValue) query ObjectExists([in](GUIDSTRING)_Object, [out](INTEGER)_Exists) query ObjectGetDialogFlag([in](GUIDSTRING)_Target, [in](STRING)_Flag, [out](INTEGER)_FlagState) query ObjectIsOnStage([in](GUIDSTRING)_Object, [out](INTEGER)_Bool) query GetTemplate([in](GUIDSTRING)_Target, [out](STRING)_Template) PositioningFunctions for retrieving additional position/rotation data. query GetRotation([in](GUIDSTRING)_Target, [out](REAL)_X, [out](REAL)_Y, [out](REAL)_Z) query GetAngleTo([in](REAL)_x0, [in](REAL)_z0, [in](REAL)_x1, [in](REAL)_z1, [out](INTEGER)_Angle) query GetDistanceTo([in](GUIDSTRING)_object1, [in](GUIDSTRING)_object2, [out](REAL)_Dist) query GetDistanceToPosition([in](GUIDSTRING)_Object, [in](REAL)_X, [in](REAL)_Y, [in](REAL)_Z, [out](REAL)_Dist) VisualsThese allow you to attach/detach an object to the specified bone of a character. call AttachVisualTo((GUIDSTRING)_Child, (GUIDSTRING)_Parent, (STRING)_BoneName) call DetachVisualFrom((GUIDSTRING)_Child, (GUIDSTRING)_Parent) Game masterquery GameMasterAddToCharacterCreation([in](CHARACTERGUID)_Character, [in](INTEGER)_Respec, [out](INTEGER)_Success) query CharacterGameMaster([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool) event GMCampaignModeStarted((STRING)_CampaignMode) Presetsevent CharacterLoadedInPreset((CHARACTERGUID)_Character) call CharacterApplyPreset((CHARACTERGUID)_Character, (STRING)_Preset) call CharacterApplyRacePreset((CHARACTERGUID)_Character, (STRING)_RacePreset) call LoadPartyPreset((STRING)_Preset, (GUIDSTRING)_TeleportToTarget) event PartyPresetLoaded((STRING)_PartyPreset) Camera movementThe camera can be scripted to move via a predefined line (most likely created in the editor): call StartCameraSpline((SPLINEGUID)_Spline, (INTEGER)_UIVisible, (INTEGER)_StartIndex) call StopCameraSpline((SPLINEGUID)_Spline, (INTEGER)_UIVisible) MusicThe old "MusicPlay((ventName)" function was removed, and player-specific variations were added instead: call MusicPlayForPeer((CHARACTERGUID)_Character, (STRING)_EventName) call MusicPlayForPeerWithInstrument((CHARACTERGUID)_Character, (CHARACTERGUID)_Character, (STRING)_EventName) call MusicPlayGeneral((STRING)_EventName) call MusicPlayOnCharacter((CHARACTERGUID)_Character, (STRING)_EventName) CombatThere were a number of interesting combat functions added in this patch as well. The most notable are: call CharacterAddActionPoints((CHARACTERGUID)_Character, (INTEGER)_Amount) call CharacterDieImmediate((CHARACTERGUID)_Character, (INTEGER)_GenerateTreasure, (STRING)_DeathType) call JumpToTurn((GUIDSTRING)_Target) query CombatGetActiveEntity([in](INTEGER)_CombatID, [out](GUIDSTRING)_CurrentEntity) query IsCombatActive([in](INTEGER)_CombatID, [out](INTEGER)_Active) query IsSkillActive([in](GUIDSTRING)_Character, [in](STRING)_SkillID, [out](INTEGER)_Bool) event CombatEnded((INTEGER)_CombatID) event CombatStarted((INTEGER)_CombatID) event ItemReceivedDamage((ITEMGUID)_Item) event CharacterStatusApplied((CHARACTERGUID)_Character, (STRING)_Status, (GUIDSTRING)_Causee) event CharacterStatusAttempt((CHARACTERGUID)_Character, (STRING)_Status, (GUIDSTRING)_Causee) Quest sharingA query sharing mechanic was added. (I'm not sure how this works exactly.) call QuestReceiveSharedUpdate((CHARACTERGUID)_SrcCharacter, (CHARACTERGUID)_Character, (STRING)_Quest, (STRING)_Status) event QuestShared((CHARACTERGUID)_Character, (STRING)_Quest, (INTEGER)_IsShared) query QuestAccepted([in](CHARACTERGUID)_Character, [in](STRING)_Quest, [out](INTEGER)_Bool) query QuestGetBroadcastLevel([in](STRING)_Quest, [out](STRING)_Level) query QuestIsClosed([in](CHARACTERGUID)_Character, [in](STRING)_Quest, [out](INTEGER)_Bool) query QuestIsShared([in](CHARACTERGUID)_Character, [in](STRING)_Quest, [out](INTEGER)_Bool) query QuestUpdateExists([in](STRING)_Quest, [in](STRING)_Status, [out](INTEGER)_Result) SkillsA couple of events were added for tracking skill usage. event SkillActivated((CHARACTERGUID)_Character, (STRING)_Skill) event SkillAdded((CHARACTERGUID)_Character, (STRING)_Skill, (INTEGER)_Learned) event SkillDeactivated((CHARACTERGUID)_Character, (STRING)_Skill) Crimecall CharacterIgnoreCharacterActiveCrimes((CHARACTERGUID)_Character, (CHARACTERGUID)_Player, (REAL)_Timer) call CrimeClearAll() call CrimeConfrontationDone((INTEGER)_CrimeID, (CHARACTERGUID)_Interrogator) call CrimeTransferEvidenceTo((INTEGER)_CrimeID, (GUIDSTRING)_Target) call ShutdownCrimeSystem() event CrimeDisabled((CHARACTERGUID)_Character, (STRING)_Crime) event CrimeEnabled((CHARACTERGUID)_Character, (STRING)_Crime) event CharacterStoleItem((CHARACTERGUID)_Character, (ITEMGUID)_Item, (REAL)_X, (REAL)_Y, (REAL)_Z, (CHARACTERGUID)_OldOwner, (ITEMGUID)_SrcContainer, (INTEGER)_Amount) event CharacterSelectedAsBestUnavailableFallbackLead((CHARACTERGUID)_Character, (STRING)_CrimeRegion, (INTEGER)_UnavailableForCrimeID, (INTEGER)_BusyCrimeID, (CHARACTERGUID)_Criminal1, (CHARACTERGUID)_Criminal2, (CHARACTERGUID)_Criminal3, (CHARACTERGUID)_Criminal4) event CrimeIsRegistered((CHARACTERGUID)_Victim, (STRING)_CrimeType, (INTEGER)_CrimeID, (GUIDSTRING)_Evidence, (CHARACTERGUID)_Criminal1, (CHARACTERGUID)_Criminal2, (CHARACTERGUID)_Criminal3, (CHARACTERGUID)_Criminal4) event OnCrimeConfrontationDone((INTEGER)_CrimeID, (CHARACTERGUID)_Investigator, (INTEGER)_WasLead, (CHARACTERGUID)_Criminal1, (CHARACTERGUID)_Criminal2, (CHARACTERGUID)_Criminal3, (CHARACTERGUID)_Criminal4) query CharacterGetCrimeDialog([in](CHARACTERGUID)_Character, [out](INTEGER)_InstanceID) query CrimeAreaGetTensionModifier([in](TRIGGERGUID)_CrimeArea, [out](INTEGER)_Modifier) query CrimeGetCriminals([in](INTEGER)_CrimeID, [out](CHARACTERGUID)_Criminal1, [out](CHARACTERGUID)_Criminal2, [out](CHARACTERGUID)_Criminal3, [out](CHARACTERGUID)_Criminal4) query CrimeGetDetectionRange([in](INTEGER)_CrimeID, [out](REAL)_Range) query CrimeGetEvidence([in](INTEGER)_CrimeID, [in](INTEGER)_Index, [out](GUIDSTRING)_Evidence) query CrimeGetNumberOfEvidence([in](INTEGER)_CrimeID, [out](INTEGER)_NumEvidence) query CrimeGetVictim([in](INTEGER)_CrimeID, [out](CHARACTERGUID)_CrimeVictim) query CrimeIsAnyNPCGoingToReact([in](GUIDSTRING)_Criminal, [in](STRING)_CrimeType, [in](REAL)_X, [in](REAL)_Y, [in](REAL)_Z, [out](INTEGER)_Bool) query CrimeIsContinuous([in](INTEGER)_CrimeID, [out](INTEGER)_Bool) Removed functions: call CrimeWarningDone((INTEGER)_CrimeID, (CHARACTERGUID)_Interrogator) event CrimeWarningRequest((STRING)_CrimeRegion, (INTEGER)_CrimeID, (CHARACTERGUID)_Interrogator, (CHARACTERGUID)_Criminal1, (CHARACTERGUID)_Criminal2, (CHARACTERGUID)_Criminal3, (CHARACTERGUID)_Criminal4, (STRING)_WarningDialog) Miscelleaneous additions:call UserRest((CHARACTERGUID)_Character, (STRING)_Restconsumable, (REAL)_PartyRadius, (REAL)_MinSafeDistance) call SetTagPriceModifier((CHARACTERGUID)_Character, (STRING)_Tag, (INTEGER)_Modifier call TransformSurface((GUIDSTRING)_Source, (STRING)_TransformType, (STRING)_TransformLayer, (REAL)_Radius, (REAL)_Lifetime, (GUIDSTRING)_Owner) call TransformSurfaceAtPosition((REAL)_X, (REAL)_Y, (REAL)_Z, (STRING)_TransformType, (STRING)_TransformLayer, (REAL)_Radius, (REAL)_Lifetime, (GUIDSTRING)_Owner) call ActivatePersistentLevelTemplate((LEVELTEMPLATEGUID)_LevelTemplate) call FireOsirisEvents() call NotifyCharacterCreationFinished() call RequestProcessed((CHARACTERGUID)_Character, (INTEGER)_RequestId, (INTEGER)_RequestAccepted) query GetHealStat([in](STRING)_StatusID, [out](STRING)_HealStat) query GetRandomPositionInTrigger([in](TRIGGERGUID)_Trigger, [out](REAL)_X, [out](REAL)_Y, [out](REAL)_Z) query GetStatString([in](GUIDSTRING)_Object, [out](STRING)_Statname) query GetStatusType([in](STRING)_StatusID, [out](STRING)_StatusType) query String([in](GUIDSTRING)_GUIDstring, [out](STRING)_Result) call OpenCraftUI((CHARACTERGUID)_Character, (ITEMGUID)_Item) call CloseUI((CHARACTERGUID)_Character, (STRING)_UIName) call FadeToBlack((CHARACTERGUID)_Character, (REAL)_Seconds, (INTEGER)_ToBlack, (STRING)_FadeID) event ClearFadeDone((INTEGER)_UserID, (STRING)_FadeID) event FadeDone((INTEGER)_UserID, (STRING)_FadeID) call ReadyCheckStart((GUIDSTRING)_Player, (STRING)_Id) event ReadyCheckFailed((STRING)_Id) event ReadyCheckPassed((STRING)_Id) event OnArenaRoundForceEnded() event VoiceBarkEnded((STRING)_Bark, (INTEGER)_InstanceID) The following functions were renamed:These functions work for all object types now, not only characters/items: CharacterApplyDamage --> ApplyDamage CharacterAttackedByCharacter, CharacterAttackedByItem --> AttackedByObject CharacterGetDistanceToCharacter, CharacterGetDistanceToItem --> GetDistanceTo CharacterSetFaction --> SetFaction CharacterSetInvulnerable --> SetInvulnerable CharacterGetFaction --> GetFaction ItemMovedFromCharacterToCharacter --> ItemMovedFromTo ItemIsInTrigger --> ObjectIsInTrigger ItemTo --> ItemToInventory TransformIntoTemplate --> Transform The following functions were removed:call CharacterInjectScriptframe((CHARACTERGUID)_Character, (STRING)_Scriptframe) call CharacterAddToCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_Owner) call CharacterRemoveFromCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_Owner) call SetTransferItemsOnPartyRemove((INTEGER)_Enable) event CharacterIsPlayer((CHARACTERGUID)_Character) event CharacterPossessed((CHARACTERGUID)_Character) event CharacterReleased((CHARACTERGUID)_Character) event CharacterStatusChange((CHARACTERGUID)_Character, (STRING)_Status, (GUIDSTRING)_Causee) query CharacterIsPossessed([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool)
|
|
|
|
enthusiast
|
enthusiast
Joined: Jun 2015
|
The Great Norbyte strikes again ;-)
I haven't read the whole post but the inventory iterator immediately caught my attention ...
Last edited by FrauBlake; 27/05/17 08:37 AM.
|
|
|
|
addict
|
addict
Joined: Apr 2013
|
Since this thread is already becoming a place for dumping D:OS2 info, I'll shamelessly put this here :P
CharScript/ItemScript Functions
Set(OUT OBJECT:variable, OBJECT:value) Set the value of a variable
SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value) Set the value of a global variable
Cast(OUT OBJECT variable, OBJECT value) Casts the value to the variable
Print(OUT STRING:output, STRING:text) Prints the text to the output with possible parameters: [1], [2], ...
Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value) Adds both values and stores it in the first variable
Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value) Subtracts both values and stores it in the first variable
Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value) Multiplies both values and stores it in the first variable
Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value) Divides both values and stores it in the first variable
Abs(INOUT INT|FLOAT:variable) Takes the absolute value of a variable
Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max) Clamps a variable between min and max
GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value) Fills in the variable with random one of the values.
GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...) Gets a weighted random of the given values!
GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max) Gets a random value between min and max (both included)
GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger) Get a random position in a trigger area
GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value) Fills in the variable with the index one of the values (starting from 0)
SetPriority(FIXEDSTRING:reactionName, INT:priority) Changes the priority of a reaction. Priority 0 and below are not executed!
DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds) The reaction will not be chosen for the specified time
SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame) Sets the scriptframe on the character.
ClearScriptFrame(CHARACTER:character) Clears the scriptframe on the character.
Goto(FIXEDSTRING:labelName) Jumps to the label
GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName) Jumps to the label if the 2 objects are equal
GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName) Jumps to a random label in the list
CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, ) Spawn a puddle at the target's position for a certain lifetime (in turns)
CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner]) Spawn a surface at the target's position for a certain lifetime (in turns)
CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...) Spawn a polygon surface at the target's position. Grows <growStep> every <growTimer>.
CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger) Spawn a surface within <areaTrigger>. Grows <growStep> every <growTimer>.
CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration) Spawn a Cone surface at the target's position
PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName) Plays an effect at the target's position
PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName) Plays an effect at the target's position
ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause]) 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
DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds) Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext
DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds) Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext
StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text) Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts
DebugText(CHARACTER|ITEM:target, STRING:text) Adds debugtext above the character/item for a short amount of time.
CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID) 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)
Log(STRING:text, ...) Log's the the scriptlog. (for debugging purposes)
Output(STRING:text, ...) Pass text with optional parameters to the output panel (e.g. Output("An int [1]", INT:10))
Assert(STRING:text, ...) Pass text with optional parameters to display as an assert message (e.g. Assert("This number is wrong: [1]", INT:666))
Label(FIXEDSTRING:name) Marks this line as a label where Goto actions can jump to
StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount) Start a timer which will throw the timer event. Set repeatcount < 0 for a permanent timer.
StopTimer(FIXEDSTRING:timerName) Stop a timer which will throw the timer event
DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target) Start a dialog between the targets
DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog) Stops a certain dialog on a certain speaker
Check(-) Reevaluate the conditions in the CHECK section of this reaction
Reset(-) Resets the current reaction. It will start from the beginning again
Interrupt(FIXEDSTRING:reactionName) Interrupt the reaction.
GlobalSetEvent(FIXEDSTRING:eventName) Sets a global event. Scripts and Story can catch it.
GlobalClearEvent(FIXEDSTRING:eventName) Clears a global event. Scripts and Story can catch it.
StopLoopEffect(INT64:fxHandle) Stops a looping effect
IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag]) Launch iterate event for each item. If you pass a tag, it has to have that tag.
IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag]) Launch iterate event for each item in range. If you pass a tag, it has to have that tag.
IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag]) Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.
IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag]) 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.
IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) 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.
IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) 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.
IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) 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.
IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) 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.
IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) 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.
SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1]) Spawns a character
SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result) Spawns an item
ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster]) Spawns a projectile at the source (with offset, can be null) shooting at the target
ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster]) Spawns a projectile at the source (with offset, can be null) shooting at the target
ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel]) Spawns a projectile at worldPos shooting at the target. Source can be null.
ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel]) Spawns a projectile at worldPos shooting at the target. Source can be null.
ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster]) Shoots a cone from source (with offset, can be null) in a direction
ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster]) Shoots a cone from source (with offset, can be null) at the target
ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel]) Shoots a cone from worldPos in a direction. Source can be null.
ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel]) Shoots a cone from worldPos at the target. Source can be null.
SetVisible(CHARACTER|ITEM:object, INT:visible) Sets a character or item visible or not.
GetPosition(GAMEOBJECT:object,OUT FLOAT3:src) Get the current position of an object
GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction) Get the current forward direction of an object
GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction) Get the current right direction of an object
GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction) Get the current up direction of an object
GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance]) Get the direction from src to target (optional: returns the distance between the objects as well)
GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector) Get the rotation of an object
RotateY(INOUT FLOAT3:vector, FLOAT:degrees) Rotate the vector around the Y-axis for a certain angle (in degrees)
SetHealth(CHARACTER|ITEM:target, FLOAT:procent) Set a characters or items health on the given percentage. (percentage between 0 and 1)
PlaySound(CHARACTER|ITEM:target, STRING:soundEvent) Plays a sound event at the target
PlayMusicForEveryone(STRING:musicEvent) Plays a music event on all the clients
PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent) Plays a music event on a character for all peers (3D)
PlayMusicForPeer(CHARACTER:target, STRING:musicEvent) Plays a music event on the peer of the character
PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent) Plays a music event on the peer of the character concated with _INSTRUMENT
SetX(INOUT FLOAT3:vector, FLOAT|INT:value) Sets the X component of the FLOAT3
SetY(INOUT FLOAT3:vector, FLOAT|INT:value) Sets the Y component of the FLOAT3
SetZ(INOUT FLOAT3:vector, FLOAT|INT:value) Sets the Z component of the FLOAT3
SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere) Changes the atmosphere of the trigger
ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID) Resets the atmosphere of the trigger
AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1], [INT:force=1]) Adds the status influence strength on the object.
RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1]) Removes the status influence strength on the object.
AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1]) Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again
CallFunction(FIXEDSTRING:functionName) Calls a function with the ID
SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWeapon[) Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map
TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0]) Teleport object to or near the target
Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP]) Transforms <object> using <root>, returns <currentHP>, plays <fx>.
SaveGame(FIXEDSTRING:saveGameName) Save the savegame with name <saveGameName>
LoadGame(FIXEDSTRING:saveGameName) Load the savegame with name <saveGameName>
LoadLevel(FIXEDSTRING:levelName) Load the level with name <levelName>
KillCombat(CHARACTER:character) Kill all the enemies in the combat which contains <character>
SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag) Sets the Tag on the Object
ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag) Clears the Tag on the Object
SetGlobalFlag(FIXEDSTRING:flagname) Sets the Global Flag
ClearGlobalFlag(FIXEDSTRING:flagname) Clears the Global Flag
SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname) Sets the Flag on the Object
ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname) Clears the Flag on the Object
SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname) Sets the Flag on the user's characters
ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname) Clears the Flag on the user's characters
SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname) Sets the Flag on the party's characters
ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname) Clears the Flag on the party's characters
StartVoiceBark(STRING:barkName, CHARACTER:character) Start a voicebark on character
ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...) Resolve the crime with id CrimeID for the specified criminals
CrimesceneInvestigationDone(CHARACTER:investigator) Crimescene is considered investigated by this NPC, start looking for culprits
ListAdd(LIST<OBJECT>:list, OBJECT:entry) Add <entry> at the back of <list>
ListRemove(LIST<OBJECT>:list, INT:index) Remove the entry at <index> of <list>
ListSet(LIST<OBJECT>:list, INT:index, OBJECT:entry) Set the entry at <index> of <list> to <entry>
ListClear(LIST<OBJECT>:list) Remove all entries of <list>
EndTurn(CHARACTER|ITEM:Target) Ends the object's current turn
SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0]) Enables/Disables the fact if the entity can fight. Optional for the whole group
SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0]) Enables/Disables the fact if the entity can join combats. Optional for the whole group
SetIsBoss(CHARACTER|ITEM:entity, INT:enabled) Enables/Disables the fact if the entity is a boss.
GetAIHintTriggers(OUT LIST<TRIGGER>:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1) Returns all AIHintAreaTriggers in <triggers>. Uses contraints if set.
SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer) Overwrites the entity's combat timeout check.
ResetCombatTimeout(CHARACTER|ITEM:entity) Resets the entity's combat timeout check.
EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target) Enters combat with target
LeaveCombat(CHARACTER|ITEM:source) Leaves the combat
SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction) Changes the faction of a character or item
SetInvulnerable(CHARACTER|ITEM:target, INT:bool) Makes the character or item invulnerable or not. (Allow damage)
JumpToTurn(CHARACTER|ITEM:Target) Jumps to targets turn (ends the current turn)
Sleep(FLOAT:timeInSeconds) Sleeps for a certain amount of time
CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit]) Moves in weapon range and attacks the target
CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit]) Attacks the target without checking weaponranges and without moving
CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5]) Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail)
CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem) Moves to the target, calculated by the AI. Should only be used with results from the AI!
CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0]) Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.
CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0]) Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.
CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0]) Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.
CharacterMoveOutOfSight(FLOAT:angle) Move out of screen
CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1]) Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still)
CharacterStopAnimation(-) Stops all animations.
CharacterPickUpItem(ITEM:item) Moves close enough to the item if necessary and picks it up
CharacterUseItem(ITEM:item [, INTEGER:LongPath]) Moves close enough to the item if necessary and uses it
CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination]) Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.
CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0]) Adds <skill> to <character>
CharacterRemoveSkill(CHARACTER:character, SKILL:skill) Removes <skill> from <character>
CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0]) Cast a skill
CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn) Appear at the target
CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn) Appears out of sight to the players from a certain angle while being able to reach target
CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn) Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target
CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0]) Move out of screen and go of stage, will run if <isRunning> is not 0
CharacterSetOffStage(-) Set Off Stage
CharacterSetOnStage(-) Set On Stage
CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0]) Rotates the character to look at the target (Closest spline point in case of a spline).
CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0]) Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).
CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run) Follow the target for a certain time
CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run) Follow the leader or owner for a certain time
CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor]) Wander around for a certain time
CharacterSwitchWeaponType(WEAPON:type) If necessary switch to the new weapon type
CharacterFleeFrom(RELATION:relation, FLOAT:range) Run away from certain characters if necessary
CharacterFleeFromSurface(SURFACE:surface) Run away from a certain surface if necessary
CharacterFleeFromDangerousSurface(-) Run away from a dangerous surfaces if necessary
CharacterAddSourcePoints(CHARACTER:character, INT:amount) Adds x source points (x can be negative to substract)
CharacterDie(CHARACTER:character[, DEATH:type=DoT]) Kills the character
CharacterHeal(CHARACTER:character, FLOAT:percentage) Heals the character
CharacterConsume(CHARACTER:character, POTION:potion) Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.
CharacterDisableAllCrimes(CHARACTER:target) Disables all generic behaviours for <target>.
CharacterEnableAllCrimes(CHARACTER:target) Enables all generic behaviours for <target>.
CharacterEnableCrime(CHARACTER:target, STRING:crime, ...) Enables the specified generic behaviours for <target>.
CharacterDisableCrime(CHARACTER:target, STRING:crime, ...) Disables the specified generic behaviours for <target>.
CharacterSetLongInvestigationDuration(CHARACTER:target) Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.
CharacterAiCalculate(-) Calculate the AI of the character
CharacterAiStopCalculate(-) Stop the calculation of the AI of the character
CharacterAiFinishMoveSkill(-) Finish the current MoveSkill.
CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item) Make it interesting for the AI to destroy that Item
CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item) Make it no longer interesting for the AI to destroy that Item
CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype) Sets the archetype of the character, used in AI calculations
CharacterSetStoryNPC(CHARACTER:character, INT:bool) Makes the character storyNPC or not.
CharacterAddActionPoints(CHARACTER:character, INT:amount) Give character some action points
CharacterSetImmortal(CHARACTER:character, INT:bool) Makes the character immortal or not. (Allow dying)
CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName]) Plays an effect on the character and it follows the character
CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName]) Plays a looping effect on the character and it follows the character
CharacterEvent(CHARACTER:character, STRING:eventName) Throw a character event which you can catch in scripts and story
CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName) Throw a character/item event which you can catch in scripts and story
CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName) Throw a character/character event which you can catch in scripts and story
CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation) Changes the relationship between 2 characters.
CharacterForceUpdate(INT:forceUpdate) Makes sure the attached character is always being update or not.
CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy) Sets the current enemy of character
CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0]) 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)
CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null]) Removes the status from the character
CharacterDestroy(CHARACTER:character) Destroys the character
CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled) Enables/Disables the fact if the character can spot sneaking characters.
CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled) Enables/Disables the fact if the character can do attack of opportunities.
CharacterResurrect(CHARACTER:character [, INT:Percentage = 100]) Resurrects the character at [2]% health.
CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1]) Add the item to the character
CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount]) Remove the item from the character. If Amount is -1, then all are removed
CharacterDrinkPotion(FIXEDSTRING:statID) Makes the character drink a potion from the inventory.
CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation) Sets an animation override, only walk/run/die animations can override it.
CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded]) Uses x action points
CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable) Adds <treasureTable> to the treasure list of <character>
CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable) Removes <treasureTable> from the treasure list of <character>
CharacterClearTreasureTables(CHARACTER:character) Removes all treasure tables from <character>
CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter) Creates a temporary hostile relation between the 2 characters!
CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0]) Set the character in sheath/unsheated mode.
CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP]) Applies <statsEntry> from character.xlsm to <character>, returns <currentHP>.
CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed]) Sets walk speed override of <character>, removes it if <override> is 0
CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed]) Sets run speed override of <character>, removes it if <override> is 0
CharacterSetHasDialog(CHARACTER:character, INTEGER:bool) Enables/Disables the dialog of the character
CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running) Start patroling from the given index along the given spline with the given character.
CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running) Start patroling from the given index along the given spline with the given character.
CharacterStopPatrol(-) Let the character stop patrolling whatever spline he's on!
CharacterInterruptPatrol(-) 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.
CharacterGetTargetSpline(INT: SplineIndex) Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.
CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override) Sets an animation set override for a character. Empty fixedstring clears the override.
CharacterSetFloating(CHARACTER:target, INTEGER:isFloating) Sets <target> floating if <isFloating> is not 0
CharacterResetCooldowns(CHARACTER:target) Resets the skill cooldowns for <target>
ItemEvent(ITEM:item, STRING:eventName) Throw an item event which you can catch in scripts and story
ItemPlayAnimation(FIXEDSTRING:animation) Plays an animation on the item
ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed]) Plays an animation on the item to the target time (percentage of the total duration)
ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName]) Plays an effect on the item and it follows the item
ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName]) Plays a looping effect on the item and it follows the item
ItemSetOnStage(ITEM:item, INTEGER:bool) Sets an item on or offstage
ItemSetCanInteract(ITEM:item, INTEGER:bool) Sets an item (not) interactible
ItemClose(ITEM:item) Close an item
ItemOpen(ITEM:item) Open an item
ItemDrop(ITEM:item) Drop an item
ItemLock(ITEM:item, FIXEDSTRING:key) Lock an item
ItemUnlock(ITEM:item) Unlock an item
ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0]) 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)
ItemRemoveStatus(ITEM:item, STATUS:statusId) Removes the status from the item
ItemDie(ITEM:item) Kills the item
ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation) Moves the item to the target
ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1]) Moves the item to the target's inventory
ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond) Rotates the item to look at the target
ItemDestroy(ITEM:item) Destroys the item
ItemSetAmount(ITEM:item, INT:amount) Change the amount of the item
IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag]) Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.
ItemAddCharges(ITEM:TargetItem, INT:charges) Add/subtract charges from an item
ItemResetChargesToInitial(ITEM:TargetItem) Resets charges from item to initial state
MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1]) Make peace between users of the characters
MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1]) Make war between users of the characters
IsEqual(OBJECT:variable, OBJECT:variable) Compares both objects and see if they are equal.
IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable) Compares both objects and see if the first one is smaller.
IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable) Compares both objects and see if the first one is bigger.
IsRandom(FLOAT:percentage) Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)
IsRound(INT:roundNumber) Checks if we are currently in combat in round x
IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius]) Check if the character, item, trigger or position is currently within the specific surface.
IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius]) Check if <target> is currently in on a dangerous surface. Uses <character> for path influences if provided (is necessary with non-character targets)
IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0]) Check if the character or item is currently in a dialog, optionally ignoring automated dialogs
IsInAutomatedDialog(CHARACTER|ITEM:target) Check if the character or item is currently in an automated dialog
GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target) Returns the distance between 2 positions
GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target) Returns the 2D distance between 2 positions (ignores height)
GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target) Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.
GetPosition(GAMEOBJECT:object, OUT FLOAT3:position) Returns the position of a gameobject (character, item, trigger, ...)
GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName) Gets a global variable from the target
GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source) Gets the closest player near the source, default being being the object itself
GetPlayerCount(OUT INT:playerCount) Gets the number of players in the party
GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex) Gets a player from the party by index
GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0]) Gets a random character in the current level
ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,) Checks if there is any surface of the type within a radius of the source
IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,) Checks if the whole radius around the source is the specified surface type
IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target) Checks if the source is standing on the target
GetX(FLOAT3:vector, OUT FLOAT:value) Returns the X component of the vector
GetY(FLOAT3:vector, OUT FLOAT:value) Returns the Y component of the vector
GetZ(FLOAT3:vector, OUT FLOAT:value) Returns the Z component of the vector
FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount]) Finds the closest surface of a specific type.
FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null]) Finds the closest valid position (where the object can stand.)
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]) Finds the closest position from the source (within radius) where the conditions are matched.
CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0]) Check if the sight is blocked between 2 points.
IsVisible(CHARACTER|ITEM:object) Check if the object is set invisible or not with SetVisible.
GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration) Gets how long a text needs to be displayed
IsCasual(-) Returns if the current game mode is Casual
IsHardcore(-) Returns if the current game mode is Hardcore
IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag) Check if the object is tagged.
TranslatedStringKeyExists(FIXEDSTRING:key) Check if the TranslatedString key exists.
IsInCombat(CHARACTER|ITEM:object) Returns true if the object is in combat.
IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object) Returns true if the objects are in combat with each other.
IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90]) Returns true if the object is facing the position within the given angle.
GameIsSaving(-) Returns true if the game is saving.
GameIsLoading(-) Returns true if the game is loading.
GetUserCount(OUT INT:userCount) Returns the user count.
GetCurrentCharacter(OUT CHARACTER:character, INT:user) Returns the character currently being controlled by the specified user.
GetCurrentLevel(OUT FIXEDSTRING:currentLevel) Returns the current levelname
GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds) Returns AI bounds of <source> in <bounds>
HasGlobalFlag(FIXEDSTRING:flagName) Returns if the Global Flag is set
HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName) Returns if the Flag is set on the Object
HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName) Returns if the Flag is set on the user's characters
HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName) Returns if the Flag is set on the party's characters
DialogExists(STRING:dialogue) Returns true if the dialogue exists.
IsActive(CHARACTER|ITEM:Object) Returns if the character or item is currently active.
ListGetSize(LIST<OBJECT>:list, out INT:size) Returns the number of elements in <list>
ListGet(LIST<OBJECT>:list, INT:index, out OBJECT:entry) Returns <entry> at <index> of <list>
ListGetRandom(LIST<OBJECT>:list, out OBJECT:entry) Returns a random <entry> of <list>
IsBoss(CHARACTER|ITEM:Object) Returns true if the entity is tagged as a boss
IsProjectileSkill(SKILL:skill) Returns true if the skill is a ranged skill (uses a projectile)
IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0]) Checks whether <target> is a valid target for <skill> at <source>
GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character) Returns the faction of the provided character or item
IsInActiveTurn(CHARACTER|ITEM:target) Returns true if it's the character's or item's turn in combat.
IsSkillActive(CHARACTER:character, SKILL:skillId) Returns true if <character> has <skillId> active (in memory).
HasSkillAi(SKILLID:skillId) Returns true if the skill is using the new Ai system
IsInArena(CHARACTER::character) Returns true if the character is in an arena fight
CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType) Returns the type of the crime with this id.
CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4) Returns the criminals of that crime. They might all be null.
Cast(OUT OBJECT variable, OBJECT value) Casts the value to the variable.
StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString) Appends stringB to stringA. Resulting string is stored in the third parameter.
IsSourceSkill(SKILL:skill) Returns true if the skill is a source skill.
IsInGameMasterMode(-) Returns true if the game in game master mode.
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]) Get a character within a certain range conforming to the filled in restraints.
CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf]) Counts the characters within a certain range conforming to the filled in restraints.
CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source) Get the character's owner
CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source) Get the character to follow
CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source) Get current enemy of character
CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0]) Check if the character source can cast the skill: will check cooldown, actionpoints
CharacterCanSitOnItem(CHARACTER:source, ITEM:item) Check if the character source can sit or lie on an item.
CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0]) Check if the character source can drink the potion: will check inv and actionpoints
CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0]) Check if the character source can use the item in the world
CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0]) Check if the character source can use the item in his inventory
CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0]) Check if character has target in his line of sight.
CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target) Check if the character can shoot the target.
CharacterIsPlayer(CHARACTER:character) Check if the character is a player
CharacterIsInParty(CHARACTER:character) Check if the character is in the party
CharacterIsEnemy(CHARACTER:source, CHARACTER:target) Check if target is enemy of source
CharacterIsAlly(CHARACTER:source, CHARACTER:target) Check if target is ally of source
CharacterIsNeutral(CHARACTER:source, CHARACTER:target) Check if target is neutral of source
CharacterIsDead(CHARACTER:character) Check if character is dead
CharacterIsMoving(CHARACTER:character) Check if character is moving (speed > 0)
CharacterIsSummon(CHARACTER:character) Check if character is a summon
CharacterIsPartyFollower(CHARACTER:character) Check if character is a party follower
CharacterIsStoryNPC(CHARACTER:character) Check if character is a story NPC
CharacterInWeaponRange(CHARACTER:character, CHARACTER:target) Check if target is in the current's weapon range
CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar) Check if target is in the character's touch range
CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData]) 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
CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData]) Get the source character of a status
CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData]) Get the source item of a status
CharacterHasTalent(CHARACTER:character, TALENT:talent) Check if character currently has the talent
CharacterHasSkill(CHARACTER:character, SKILL:skillId) Check if character currently has the skill
CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped]) Check if character currently has a weapon of this type in his inventory or equipped
CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType) Returns the current value of the stat (Vitality, ...)
CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character) Returns the character's sight range
CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character) Returns the character's current weapon range
CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character) Returns the character's current touch range
CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId) Returns the character's skill range
CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId) Returns the character's skill range
CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger) Check if character is in given trigger
CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability) Returns the character's value of the specified ability
CharacterGetHostileCount(OUT INT:value, CHARACTER:character) Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.
CharacterCanFight(CHARACTER:character) Returns true if the character can fight.
CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root) Returns the roottemplate of the character.
CharacterCanSpotSneakers(CHARACTER:character) Returns true if the character can spot sneaking characters
CharacterIsFloating(CHARACTER:character) Check if character is a floating character
CharacterInCreation(CHARACTER:character) Returns true if the character is in character creation
CharacterAvoidsTraps(CHARACTER:character) Returns true if the character avoids traps
CharacterCheckRelation(CHARACTER:character, RELATION:relation) Returns true if relation check succeeds
CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore) Returns true if score is higher or equal than the current score
CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType) Returns true if the character was hit by this type.
CharacterHasCastedSpellLastTurn(CHARACTER:character) Returns true if the character has casted a spell in his last turn.
CharacterHasHadStatus(CHARACTER:character, STATUS:status) Returns true if the character has had a specific status this combat.
CharacterHasAnimationOverride(CHARACTER:character) Returns true if the character has an animation override.
CharacterCanUnlock(CHARACTER:character, ITEM:item) Returns true if the character can unlock the item (if the item is already unlocked it returns true!)
CharacterGetReservedUserID(OUT INT:user, CHARACTER:character) Returns the character's reserved User id.
CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race) Returns the <character>'s race in <race>.
CharacterIsRace(CHARACTER:character, FIXEDSTRING:race) Returns true if <character>'s race is <race>.
CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination]) Returns true + <destination> if <character> can move <item> somewhere between <minRadius> and <maxRadius>.
CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType) Returns death type of <character> in <deathType>.
CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation) Returns the still animation to play
CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...]) Try and transfer the leadership of this crime to someone else.
CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID) Returns the lead investigator for the crime.
CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null]) Returns true if <source> can hit <target> with currently equipped ranged weapon. Will use <skill> instead of equipped weapon if provided.
CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0]) Returns true if <character> has has ranged weapon. Checks for non-wielded weapons if <checkInventory> is 1
CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target) Returns true if <character> could interact with <target>. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.
CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount) Returns the amount of sourcepoints of <character>.
CharacterAiIsCalculating(-) Returns if the character is still calculating the AI.
CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target) Returns if the character has a Move Skill command to execute according to the AI.
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) Returns if the character has a Skill command to execute according to the AI.
CharacterAiFetchConsumeCommand(OUT ITEM:item) Returns if the character has a Consume command to execute according to the AI.
CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target) Returns if the character has a Attack command to execute according to the AI.
CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition) Returns if the character has a Fallback command to execute according to the AI.
CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype) Returns the archetype of the character.
CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race) Returns true if <character> is polymorphed into <race>. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).
CharacterIsPolymorphInteractionDisabled(CHARACTER:character) Returns true if <character> has his interaction disabled because of a polymorph.
ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag]) Get an item within a certain range conforming to the filled in restraints.
ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped]) Returns the first item in the inventory conforming to the filled in restraints.
ItemIsInCharacterInventory(ITEM:item, CHARACTER:object) Returns if the item is in the inventory of the character
ItemIsInTrigger(ITEM:item, TRIGGER:trigger) Check if item is in given trigger
ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType) Returns the current value of the stat (Weight, ...)
ItemIsMoving(ITEM:item) Returns if the item is moving or not.
ItemIsFalling(ITEM:item) Returns if the item is falling or not. (after teleport)
ItemIsOpening(ITEM:item) Returns if the item is opening or not.
ItemIsClosing(ITEM:item) Returns if the item is closing or not.
ItemIsLocked(ITEM:item) Returns if the item is locked or not.
ItemIsMovable(ITEM:item) Returns if the item is movable or not.
ItemCanBeLockPicked(ITEM:item) Returns if the item is can be opened by lockpicking.
ItemIsOpen(ITEM:item) Returns if the item is open or not.
IsStoryItem(ITEM:item) Returns if the item is a story item.
ItemHasStatus(ITEM:item, STATUS:statusId) Returns if the item has the status.
ItemIsDestroyed(ITEM:item) Returns if the item is destroyed.
ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root) Returns the roottemplate of the item.
ItemGetSkillId(ITEM:item, OUT SKILL:root) Returns the skillid of the item if it has one.
ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType) Returns the itemtype of the item: common, unique, rare, ...
ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source) Get the source character of a status
ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source) Get the source item of a status
ItemCanBeMoved(ITEM:item) Returns if the item can be moved.
CharScript/ItemScript Events
OnCharacterEvent(CHARACTER:character, STRING:eventName) Thrown from scripts or story
OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName) Thrown from scripts or story
OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName) Thrown from scripts or story
OnItemEvent(ITEM:item, STRING:eventName) Thrown from scripts or story
OnItemDestroyed(ITEM:item) Thrown when an item is destroyed
OnItemDestroying(ITEM:item) Thrown when an item is being destroyed
OnItemOpened(ITEM:item) Thrown when an item is opened
OnItemClosed(ITEM:item) Thrown when an item is closed
OnItemDropped(ITEM:item, STRING:itemTemplate) Thrown when an item is dropped
OnGlobalFlagSet(FIXEDSTRING:eventName) Thrown when a global event is set
OnGlobalFlagCleared(FIXEDSTRING:eventName) Thrown when a global event is cleared
OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character) Thrown when a dialog event is set on a character
OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character) Thrown when a dialog event is cleared on a character
OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item) Thrown when a dialog event is set on an item
OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item) Thrown when a dialog event is cleared on an item
OnTimer(FIXEDSTRING:timerName) Thrown when a timer has ended
OnInit(-) Thrown when the script is set
OnLoaded(INT:major, INT:minor, INT:revision, INT:build) Thrown when the script is loaded from the savegame
OnShutdown(-) Thrown when the character's script is removed
OnVariableCleared(FIXEDSTRING:varName) Thrown when this object's script variable is cleared from Osiris with ClearVarObject
OnCombatStarted(CHARACTER:source, ITEM:source) Thrown when the character entered a combat
OnCombatSwitched(CHARACTER:source, ITEM:source) Thrown when the character switch from one combat to another
OnCombatEnded(CHARACTER:source, ITEM:source) Thrown when the character left the combat
OnTurn(CHARACTER:source, ITEM:source) Thrown when the character's turn starts
OnTurnEnded(CHARACTER:source, ITEM:source) Thrown when the character's turn ended
OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage) Thrown when the characters's vitality changed
OnItemVitalityChanged(ITEM:item, FLOAT:percentage) Thrown when the item's vitality changed
OnAttackOfOpportunity(CHARACTER:target) Thrown when the characters gets an attack of opportunity on an enemy
OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source) Thrown when the object receives damage
OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target) Thrown when the character dodges something
OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target) Thrown when the character is critical hit
OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target) Thrown when the character blocks something
OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source) Thrown when the character dies
OnCharacterStatusAttempt(CHARACTER:character, STATUS:status) Thrown when the character attempts to gain a status
OnCharacterStatusApplied(CHARACTER:character, STATUS:status) Thrown when the character gains a status
OnCharacterStatusRemoved(CHARACTER:character, STATUS:status) Thrown when the character loses a status
OnItemStatusAttempt(ITEM:item, STATUS:status) Thrown when the item attempts to gain a status
OnItemStatus(ITEM:item, STATUS:status) Thrown when the item gains a status
OnItemStatusRemoved(ITEM:item, STATUS:status) Thrown when the item loses a status
OnStatusCreateVisuals(STATUS:status) Thrown when the item should create the visuals for this status
OnStatusDestroyVisuals(STATUS:status) Thrown when the item should destroy the visuals for this status
OnSight(CHARACTER:character) Thrown when the character sees another character
OnLostSight(CHARACTER:character) Thrown when the character doesn't see another character anymore
OnUseItem(CHARACTER:source, ITEM:item) Thrown when a character uses an item
OnPickupItem(CHARACTER:source, ITEM:item) Thrown when a character picks up an item
OnCharacterMovedItem(CHARACTER:source, ITEM:item) Thrown when a character moved an item
OnItemEquipped(CHARACTER:source, ITEM:item) Thrown when a character equips an item
OnItemUnequipped(CHARACTER:source, ITEM:item) Thrown when a character unequips an item
OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId) Thrown by iterators
OnIterateItem(ITEM:source, FIXEDSTRING:eventId) Thrown by iterators
OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count) Thrown by iterators after all iterations to inform you of the count.
OnStoryOverride(-) Throw when story overrides what the character was doing: teleport, movement, on/offstage
OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId) Thrown by a character or item entering an EventTrigger
OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId) Thrown by a character or item leaving an EventTrigger
OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy) Thrown when the character's currentenemy changes
OnTalentUnlocked(CHARACTER:character, TALENT:newTalent) Thrown when the character unlocks a new talent
OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class) Thrown when the character changes class in the character creation screen
OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint) Thrown when the character creation has started, and gives where the character should walk to
OnCharacterCreationStopped(CHARACTER:character) Thrown when the character creation has stopped
OnFunction(FIXEDSTRING:functionName) Throws an event on itself with the functionName. This is to fake function calls
OnSkillCast(CHARACTER:character, SKILL_ID:skillID) Thrown when the character casts a skill
OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID) Thrown when the character needs to make a comment
OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID) Thrown when you are hit by a skill from a character
OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key) Thrown when an item gets unlocked by a character.
OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID) Thrown when a automated dialog is ended for this speaker
OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID) Thrown when a automated dialog is started for this speaker
OnDialogEnded(STRING:dialogName, INT:instanceID) Thrown when a dialog is ended for this speaker
OnCrimeSensibleAction(INT:IsPrimary; FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4) Thrown when a character needs to perform a sensible action against criminals
OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4) Thrown when a character needs to perform an interrogation against criminals
OnCrimeInvestigate(INT:crimeID; FLOAT3:CrimePosition) One NPC investigates a crimescene
OnCrimeAlarmed(INT:crimeID; FLOAT3:CrimePosition) All NPCs in a crimearea start looking around.
OnCrimeReturnToNormal(-) Investigation or Alarm timed out.
OnCrimeAborted(-) The game interrupted the sensible action of this NPC.
OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString) Thrown when a character reached a spline node.
OnFinishCalculationAi(-) Thrown when the calculation of the AI is finished.
OnGrenadeLand(INT:hitObstacle, CHARACTER:caster) Thrown when the grenades lands
FetchCharacterApplyStatusData(LIST<STATUS>:removeStatuses, STATUS:applyStatus, INT:turns; CHARACTER:character, STATUS:status) Fetch from script which statuses to remove and apply.
FetchItemApplyStatusData(LIST<STATUS>:removeStatuses, STATUS:applyStatus, INT:turns; ITEM:item, STATUS:status) Fetch from script which statuses to remove and apply.
FetchItemSkillOnDamage(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel; INT:damage, DAMAGE_TYPE:damageType) Fetch from script what skill to execute on damage.
OnActivate(-) Thrown when a character/item activates
OnDeactivate(-) Thrown when a character/item deactivates
OnCharacterUsedSourcePoint(CHARACTER:character) Thrown when a character uses a source point
OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned) Thrown when a character learns a skill
OnSkillActivated(CHARACTER:character, SKILL_ID:skillId) Thrown when a character activates (=adds to memory) a skill
OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId) Thrown when a character deactivates (=removes from memory) a skill
OnBetterReactionFound(FIXEDSTRING:reactionName) Thrown when the reaction is interrupted by another reaction
OnNoReactionFound(-) Thrown when the reaction is interrupted because no reaction is valid
OnScriptDisabled(-) Thrown when the reaction is interrupted because the scriptcontroller is disabled
OnManualInterrupt(FIXEDSTRING:reactionName) Thrown when the reaction is interrupted using the interrupt action
OnException(-) Thrown when the reaction is interrupted by an exception
OnMovementFailed(FLOAT3:targetPos) Thrown when the reaction is interrupted by a move action failing
OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue) Thrown when a dialog event is shared with an item
OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue) Thrown when a dialog event is shared with a character
OnItemOffStageChanged(CHARACTER:character) Thrown when a character is set on/off stage
OnCharacterOffStageChanged(ITEM:item) Thrown when a item is set on/off stage
OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId) Thrown when a character gets teleported with a teleport skill
OnCombatTick(-) Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.
|
|
|
|
old hand
|
old hand
Joined: Aug 2014
|
Thanks Norbyte! Was hoping you'd post the char/item script stuff. Not that many changes, but some useful new stuff.
|
|
|
Moderated by Bvs, ForkTong, gbnf, Issh, Kurnster, Larian_QA, LarSeb, Lar_q, Lynn, Monodon, Raze, Stephen_Larian
|
|