Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#506800 03/07/14 01:33 PM
Joined: May 2014
apprentice
OP Offline
apprentice
Joined: May 2014
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

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

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.
Joined: Jun 2013
addict
Offline
addict
Joined: Jun 2013
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
Joined: May 2014
apprentice
OP Offline
apprentice
Joined: May 2014
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.

Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013

Joined: Jun 2014
veteran
Offline
veteran
Joined: Jun 2014
Norbyte, i want to hug you laugh

Joined: Mar 2014
stranger
Offline
stranger
Joined: Mar 2014
Thanks! We really need a wiki for all of this stuff.

Joined: Jul 2014
apprentice
Offline
apprentice
Joined: Jul 2014
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.
Joined: Jul 2014
R
stranger
Offline
stranger
R
Joined: Jul 2014
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:

Joined: Dec 2013
stranger
Offline
stranger
Joined: Dec 2013

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
Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
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.
Joined: Dec 2013
stranger
Offline
stranger
Joined: Dec 2013
You need to have more faith in your magic!


Sunjammer
Code Monkey
Divinity Engine Wiki
Joined: Apr 2013
K
apprentice
Offline
apprentice
K
Joined: Apr 2013
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.
Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
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.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5