Difference between revisions of "Expression Evaluator Documentation"

From Nexus Mods Wiki
Jump to: navigation, search
 
Line 41: Line 41:
  
 
[[Category:Documentation]] [[Category:Kingdom Come Deliverance]]
 
[[Category:Documentation]] [[Category:Kingdom Come Deliverance]]
 +
{{KCDNavigation}}

Latest revision as of 13:33, 14 February 2020

Documentation of existing expression function which can be evaluated by Expression evaluator.

Expression functions are used in dialog entry conditions, and Quest Flowgraph conditions.

Some function demand context specification. Syntax for such situations is:

functionName(parameters)[contextNumberOrEntityName]

examples:

GetActorMoney()[0] ... returns the number of groshen held by NPC that is considered first in the context of one dialog.

GetActorMoney()['Dude'] ... returns the number of groshen held by player

EngineFunctions.cpp

float HourOfDay()
float DistanceToEntity('entityName') //distance from entityName to entity by context
bool UsingPipe('pipeName')
float CallScriptFunction('functionName')
float CallScriptFunctionWithParam('functionName', 'functionParam')
float CallScriptFunctionInTable('tableName', 'functionName')
float CallScriptFunctionInTableWithParam('tableName', 'functionName', 'functionParam')
bool IsActorInside('entityName') //true if actor (by context) is inside bounding box of the entity, proximity query is called on the entity

RPGExpressions.cpp
bool IsActor('soulName')
float GetActorMoney()  //50 groshen = 50.0
bool IsSelling()
bool IsShopping()
uint CountOfActorItems('itemClassId')
bool HasBehaviorTag('tagName')
bool HasSoulTag('tagName')

//Functions to get soul properties
int GetRaceId()
int GetSoulClassId()
int GetSocialClassId()
int GetSocialClassWealth()
int GetGenderId()

//For every RPG stat, skill and state, there is a getter function of the form get_xx_yy. The functions thus do not adhere to the naming conventions of the other functions. They respect the naming conventions of RPG stats instead (lower case + underscore). This is intentional and should never be changed so that RPG stats are called exactly the same throughout whole game.
float get_health()
float get_str()
float get_bard()
float get_weapon_sword()
...

//Functions to get derived stats (they don't have an universal form like skills and stats)
float GetDirtiness()
float GetBloodiness()
float GetArmorRating()
float GetMorale()
float GetBleeding()
float GetPlayerCharisma('reasonName') //player stamina against given soul

//Angriness and reputation
GetTrueRelationship() //player's reputation for actor (by context)
GetFactionReputation (factionID) //player's reputation for faction defined by ID
GetSuperfactionReputation (superfactionID) //player's reputation for superfaction defined by ID

GetActorAngriness() //actor's angriness (by context)
GetFactionAngriness (factionID) //angriness of faction defined by ID
LookLikeSuperfaction(superfactionID)

 

QuestExpressions.cpp

bool IsQuestUnchanged('questName')
bool IsQuestActivated('questName')
bool IsQuestAvailable('questName')
bool IsQuestStarted('questName')
bool IsQuestCompleted('questName')
bool IsQuestCanceled('questName')
bool CanRepeatQuest('questName')
bool IsObjectiveUnchanged('questName', 'objectiveName')
bool IsObjectiveStarted('questName', 'objectiveName')
bool IsObjectiveTrackedCompleted('questName', 'objectiveName')
bool IsObjectiveCompleted('questName', 'objectiveName')
bool IsObjectiveCanceled('questName', 'objectiveName')

Dialogs
bool IsSeqAvailable(sequenceId) //returns true in case sequence is not on cooldown

Alchemy
int IngredientCount('itemclass') //returns count of ingredient of that type
int IngredientPos('itemclass')  //return position of first ingredient
bool IsMilled('itemclass')  //return true if all item of that class are in milled state
bool IsDistilled('itemclass') //return true if all item of that class are in distilled state
bool BoilingTime('itemclass', time)  //return true if average boiling time for all items of that class is same as time defined
bool HeatingTime('itemclass', time)  //return true if average heatingtime for all items of that class is same as time defined
bool BoilingTimeRange('itemclass', time, range) //return true if average boiling time for all items of that class is within a range of time defined
bool HeatingTimeRange('itemclass', time, range)  //return true if average boiling time for all items of that class is within a range of time defined

Kingdom Come: Deliverance: Forum | Before you start | Tutorials & Instructions | Basic Mods | Tools | Documentation | Glossary | EULA