Divinity Banner
Previous Thread
Next Thread
Print Thread
List of script commands #506800
03/07/14 01:33 PM
03/07/14 01:33 PM
Joined: May 2014
Posts: 27
dubiouschicken Offline OP
apprentice
dubiouschicken  Offline OP
apprentice

Joined: May 2014
Posts: 27
Here are lists of all commands used in the official Larian scripts. Typing them in the script editor will give you a tooltip with their arguments.

ALPHABETICAL LIST OF COMMANDS
Commands used in charscripts
Click to reveal..

Add()
AddStatusInfluence()
CallFunction()
Cast()
CharacterAddSkill()
CharacterAddToInventory()
CharacterAppearOnTrailOutOfSightTo()
CharacterApplyStatus()
CharacterAttack()
CharacterAttackWithoutMove()
CharacterCanCast()
CharacterCanCastFromItem()
CharacterCanDrinkPotion()
CharacterCanSee()
CharacterCheckRelation()
CharacterConsume()
CharacterCount()
CharacterDestroy()
CharacterDie()
CharacterDisappear()
CharacterDrinkPotion()
CharacterEndTurn()
CharacterEvent()
CharacterFleeFrom()
CharacterFleeFromDangerousSurface()
CharacterFollow()
CharacterFollowOwnerOrLeader()
CharacterForceUpdate()
CharacterGet()
CharacterGetAbility()
CharacterGetEnemy()
CharacterGetFaction()
CharacterGetFollow()
CharacterGetHostileCount()
CharacterGetItemFromInventory()
CharacterGetOwner()
CharacterGetSightRange()
CharacterGetSkillImpactRange()
CharacterGetSkillRange()
CharacterGetStat()
CharacterGetTemplate()
CharacterGetTouchRange()
CharacterGetWeaponRange()
CharacterHasBeenHitBy()
CharacterHasCastedSpellLastTurn()
CharacterHasHadStatus()
CharacterHasStatus()
CharacterHasTalent()
CharacterHasWeaponType()
CharacterHeal()
CharacterInCreation()
CharacterInTouchRange()
CharacterInWeaponRange()
CharacterIsAlly()
CharacterIsBetterOrEqualClass()
CharacterIsDead()
CharacterIsEnemy()
CharacterIsInActiveTurn()
CharacterIsInGroup()
CharacterIsInParty()
CharacterIsInTrigger()
CharacterIsPlayer()
CharacterIsStoryGlobal()
CharacterIsSummon()
CharacterItemEvent()
CharacterLookAt()
CharacterLookFrom()
CharacterMoveInRange()
CharacterMoveItem()
CharacterMoveTo()
CharacterPickUpItem()
CharacterPlayAnimation()
CharacterPlayEffect()
CharacterPlayLoopEffect()
CharacterRemoveStatus()
CharacterResetCombatTimeout()
CharacterSetAnimationOverride()
CharacterSetAttackOfOpportunity()
CharacterSetCanFight()
CharacterSetCanSpotSneakers()
CharacterSetCombatTimeout()
CharacterSetEnemy()
CharacterSetFaction()
CharacterSetImmortal()
CharacterSetOffStage()
CharacterSetOnStage()
CharacterStopAnimation()
CharacterSwitchWeaponType()
CharacterTeleportTo()
CharacterUseItem()
CharacterUseSkill()
CharacterUseSkillFromItem()
CharacterWander()
Check()
CombatLogText()
ContainsSurface()
CreateSurfaceAt()
DebugText()
DelayReaction()
DialogRequestStop()
DialogStart()
DisplayCombatInfoText()
DisplayText()
Divide()
ExplodeAt()
FindCover()
FindPosition()
FindSurface()
FindValidPosition()
GetClosestPlayer()
GetDirection()
GetDistance()
GetElement()
GetForwardDirection()
GetInnerDistance()
GetPosition()
GetRandom()
GetRandomBetween()
GetVar()
GetWeightedRandom()
GetX()
GetZ()
GlobalClearEvent()
GlobalSetEvent()
Goto()
GotoIfEqual()
GotoRand()
Interrupt()
IsEqual()
IsGreaterThen()
IsInDangerousSurface()
IsInDialog()
IsInSurface()
IsLessThen()
IsRandom()
IsRound()
IsSurface()
ItemClose()
ItemDestroy()
ItemEvent()
ItemGet()
ItemGetFromInventory()
ItemGetSkillId()
ItemHasStatus()
ItemIsMoving()
ItemLock()
ItemOpen()
ItemPlayLoopEffect()
ItemSetOnStage()
ItemTeleportTo()
IterateCharacters()
IterateCharactersInCombat()
IterateCharactersNear()
IterateParty()
Label()
Multiply()
OnAttackOfOpportunity()
OnBlock()
OnCharacterClassChanged()
OnCharacterCreationStarted()
OnCharacterCreationStopped()
OnCharacterEvent()
OnCharacterItemEvent()
OnCharacterStatus()
OnCharacterStatusRemoved()
OnCombatEnded()
OnCombatStarted()
OnDamage()
OnDie()
OnEnterSurface()
OnExitSurface()
OnFunction()
OnGlobalEventSet()
OnInit()
OnItemEvent()
OnItemStatusRemoved()
OnIterateCharacter()
OnManualInterrupt()
OnMiss()
OnMovementFailed()
OnShutdown()
OnSight()
OnStoryOverride()
OnTimer()
OnTriggerEnter()
OnTriggerLeave()
OnTurn()
OnTurnEnded()
OnVitalityChanged()
PlayEffectAt()
Range()
RemoveStatusInfluence()
Reset()
RotateY()
Set()
SetHealth()
SetMaterial()
SetPriority()
SetVar()
SetX()
SetZ()
ShootLocalProjectileAt()
Sleep()
SpawnCharacter()
SpawnItem()
StartTimer()
StatusText()
StopLoopEffect()
StopTimer()
Subtract()
testInt()


Commands used in itemscripts
Click to reveal..

Add()
AddTemporaryStatusInfluence()
CanSee()
CharacterAvoidsTraps()
CharacterCanSee()
CharacterConsume()
CharacterDie()
CharacterEvent()
CharacterGet()
CharacterGetStat()
CharacterGetTemplate()
CharacterHasStatus()
CharacterIsDead()
CharacterIsEnemy()
CharacterIsFloating()
CharacterIsInParty()
CharacterIsPlayer()
CharacterItemEvent()
CharacterPlayEffect()
CharacterRemoveStatus()
CharacterResurrect()
Check()
Clamp()
CombatLogText()
ContainsSurface()
CreateSurfaceAt()
DebugText()
DialogStart()
DisplayText()
Divide()
ExplodeAt()
GetClosestPlayer()
GetDistance()
GetForwardDirection()
GetPosition()
GetRandom()
GetRandomBetween()
GetVar()
GlobalClearEvent()
GlobalSetEvent()
Goto()
Interrupt()
IsEqual()
IsGreaterThen()
IsInSurface()
IsLessThen()
IsSurface()
IsVisible()
ItemApplyStatus()
ItemClose()
ItemDestroy()
ItemDie()
ItemEvent()
ItemGetStat()
ItemHasStatus()
ItemIsDestroyed()
ItemIsFalling()
ItemIsMoving()
ItemLookAt()
ItemOpen()
ItemPlayAnimation()
ItemPlayAnimationTo()
ItemPlayEffect()
ItemPlayLoopEffect()
ItemRemoveStatus()
ItemSetOnStage()
IterateCharactersNear()
IterateCharactersOnObject()
IterateItemsOnObject()
IterateParty()
Label()
Multiply()
OnCharacterEvent()
OnCharacterItemEvent()
OnDamage()
OnDie()
OnGlobalEventSet()
OnInit()
OnItemEvent()
OnItemStatus()
OnItemStatusRemoved()
OnIterateCharacter()
OnIterateItem()
OnLoaded()
OnShutdown()
OnStatusCreateVisuals()
OnStatusDestroyVisuals()
OnTimer()
OnUseItem()
PlayEffectAt()
PlaySound()
Reset()
RotateY()
Set()
SetMaterial()
SetPriority()
SetVar()
SetVisible()
ShootLocalCone()
ShootLocalProjectile()
ShootLocalProjectileAt()
ShootWorldProjectileAt()
Sleep()
SpawnCharacter()
StartTimer()
StopLoopEffect()
StopTimer()
Subtract()


LISTS INCLUDING ARGUMENTS AND EXPLANATIONS
courtesy of Norbyte
Functions: https://dl.dropboxusercontent.com/u/32263228/dos/scriptcommands_1.0.47.txt
Triggers: https://dl.dropboxusercontent.com/u/32263228/dos/triggers_1.0.47.txt
Behavior triggers: https://dl.dropboxusercontent.com/u/32263228/dos/behavior_triggers_1.0.47.txt

EXAMPLES OF CALLS AS USED IN OFFICIAL SCRIPTS
Commands used in charscripts, with unique argument lists
Commands used in itemscripts, with unique argument lists

Last edited by dubiouschicken; 03/07/14 04:34 PM.
Re: List of script commands [Re: dubiouschicken] #506857
03/07/14 02:15 PM
03/07/14 02:15 PM
Joined: Jun 2013
Posts: 655
Cromcrom Offline
addict
Cromcrom  Offline
addict

Joined: Jun 2013
Posts: 655
Amazing, thanks a lot hehe

Any chance for a simple scripting "hello world" tut ?


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Re: List of script commands [Re: dubiouschicken] #506887
03/07/14 02:39 PM
03/07/14 02:39 PM
Joined: May 2014
Posts: 27
dubiouschicken Offline OP
apprentice
dubiouschicken  Offline OP
apprentice

Joined: May 2014
Posts: 27
I've managed to replace a Larian script but not make a new one. It's not enough to add it in the script editor, you need to add it and its parameters to a .lsb file. I assume Larian has a tool for this instead of changing the .lsb manually every time they make a new script. If this tool has been released then I haven't found it yet.

Re: List of script commands [Re: dubiouschicken] #507061
03/07/14 04:16 PM
03/07/14 04:16 PM
Joined: Apr 2013
Posts: 465
N
Norbyte Offline
addict
Norbyte  Offline
addict
N

Joined: Apr 2013
Posts: 465

Re: List of script commands [Re: dubiouschicken] #507066
03/07/14 04:17 PM
03/07/14 04:17 PM
Joined: Jun 2014
Posts: 871
Dark_Ansem Offline

old hand
Dark_Ansem  Offline

old hand

Joined: Jun 2014
Posts: 871
Norbyte, i want to hug you laugh


In-Development: Turn-Based cRPG, late backing OPEN!
[Linked Image]
Re: List of script commands [Re: dubiouschicken] #507070
03/07/14 04:22 PM
03/07/14 04:22 PM
Joined: Mar 2014
Posts: 13
Alabama, USA
Woverdude Offline

stranger
Woverdude  Offline

stranger

Joined: Mar 2014
Posts: 13
Alabama, USA
Thanks! We really need a wiki for all of this stuff.

Re: List of script commands [Re: dubiouschicken] #511632
07/07/14 11:19 AM
07/07/14 11:19 AM
Joined: Jul 2014
Posts: 38
Magic Missile Offline
apprentice
Magic Missile  Offline
apprentice

Joined: Jul 2014
Posts: 38
Dubious, Would you happen to know the command for granting a player character skill/ability/trait points?

Can only find the commands for granting specific increases and specific skills/traits, For a quest i'm working on i need points that player can spend freely


*EDIT
Attributes; CharacterGetAbility(_AbilityWillpower, _Char, Willpower)
I'm assuming i should replace _char with _player# , and, both instances of willpower with another attribute's name(will this command also grant like an increase to Geomancer for example?)

Spells/skills; CharacterAddSkill
Need list of skills

Traits; CharacterHasTalent
Need list of traits

Where oh where can i find the code names of Skills and Traits, would you happen to have a list somewhere?

Last edited by Magic Missile; 07/07/14 11:29 AM.
Re: List of script commands [Re: dubiouschicken] #511670
07/07/14 11:48 AM
07/07/14 11:48 AM
Joined: Jul 2014
Posts: 3
R
ryukra Offline
stranger
ryukra  Offline
stranger
R

Joined: Jul 2014
Posts: 3
CharacterGetAbility sounds more like that it gives you the current Willpower ability score there needs to be a SetAbility or ChangeAbility to increase the ability.

CharacterAddSkill.. you can use it in a script you assign to chars, if you look at the sidebar when you click on npc or player modes you can assign scripts to it. But there are already scripts which give you the skills.

Does somebody know how to use the scripteditor? D:

Re: List of script commands [Re: Norbyte] #547741
24/08/14 02:46 PM
24/08/14 02:46 PM
Joined: Dec 2013
Posts: 22
Sunjammer Offline

stranger
Sunjammer  Offline

stranger

Joined: Dec 2013
Posts: 22

I was parsing through these (to generate pages for the wiki) and I noticed some of them are malformed so I thought I should list them somewhere in case Larian are interested in fixing their intellisense:

Code:
// trailing ", ..."
GetWeightedRandom (OUT OBJECT variable, OBJECT value, INT|FLOAT weight, ...)

// trailing ", ..."
Log (STRING text, ...)

// trailing ","
ContainsSurface (GAMEOBJECT|FLOAT3 source, FLOAT radius, SURFACE type,)

// trailing ","
IsSurface (GAMEOBJECT|FLOAT3 source, FLOAT radius, SURFACE type,)

// "to follow" is not a valid identifier
CharacterGetFollow (OUT CHARACTER to follow, CHARACTER source)

// "current enemy" is not a valid identifier
CharacterGetEnemy (OUT CHARACTER current enemy, CHARACTER source)

Is there a process for submitting toolset bugs?


Sunjammer
Code Monkey
Divinity Engine Wiki
Re: List of script commands [Re: dubiouschicken] #547754
24/08/14 03:38 PM
24/08/14 03:38 PM
Joined: Apr 2013
Posts: 465
N
Norbyte Offline
addict
Norbyte  Offline
addict
N

Joined: Apr 2013
Posts: 465
Those may not be toolset issues, but bugs in my function extraction methods smile
I think I got those signatures by using some IDA scripts and lots of regex magic to put everything where it should be, but I might have broke something in the process.

EDIT: Scratch that, the original signatures are broken:
Code:
.text:102E3C12 lea     ecx, [esp+0B64h+var_57C]
.text:102E3C19 call    esi ; ls::STDString::STDString(char const * const)
.text:102E3C1B push    offset aOutCharacterCu ; "OUT CHARACTER:current enemy, CHARACTER:source"

Last edited by Norbyte; 24/08/14 03:40 PM.
Re: List of script commands [Re: dubiouschicken] #547775
24/08/14 04:53 PM
24/08/14 04:53 PM
Joined: Dec 2013
Posts: 22
Sunjammer Offline

stranger
Sunjammer  Offline

stranger

Joined: Dec 2013
Posts: 22
You need to have more faith in your magic!


Sunjammer
Code Monkey
Divinity Engine Wiki
Re: List of script commands [Re: dubiouschicken] #557611
28/10/14 04:54 PM
28/10/14 04:54 PM
Joined: Apr 2013
Posts: 28
Karlsruhe, Germany
K
Koveras Offline

apprentice
Koveras  Offline

apprentice
K

Joined: Apr 2013
Posts: 28
Karlsruhe, Germany
Originally Posted By: dubiouschicken
I've managed to replace a Larian script but not make a new one. It's not enough to add it in the script editor, you need to add it and its parameters to a .lsb file. I assume Larian has a tool for this instead of changing the .lsb manually every time they make a new script. If this tool has been released then I haven't found it yet.


Have you been able to find a way to add new custom scripts since then?

Last edited by Koveras; 28/10/14 04:56 PM.
Re: List of script commands [Re: Koveras] #557619
28/10/14 07:10 PM
28/10/14 07:10 PM
Joined: Jul 2014
Posts: 459
R
Rhidian Offline
addict
Rhidian  Offline
addict
R

Joined: Jul 2014
Posts: 459
Originally Posted By: Koveras
Originally Posted By: dubiouschicken
I've managed to replace a Larian script but not make a new one. It's not enough to add it in the script editor, you need to add it and its parameters to a .lsb file. I assume Larian has a tool for this instead of changing the .lsb manually every time they make a new script. If this tool has been released then I haven't found it yet.


Have you been able to find a way to add new custom scripts since then?


Adding custom character/item scripts involves "Importing" the script file as a Resource via the Resource manager in addition to actually creating it yourself. Only after it is imported can you select it as a script for an object.


Powered by UBB.threads™ PHP Forum Software 7.6.2