Skip to content

functions

Jan Boon edited this page Mar 12, 2023 · 288 revisions

title: AI Script Function Reference description: published: true date: 2023-03-12T14:17:34.449Z tags: editor: markdown dateCreated: 2023-03-12T09:18:34.306Z

AI Script Functions

Quick reference list of native functions

NPC Group Functions

Spawn

spawn__ despawn_f_

Event Handlers

Function Documentation Description
()addHpUpTrigger(f, f)
()addHpUpTrigger(f, s)
Add HP Up Trigger Register a user event or script function to trigger when a bot's HP level increases and crosses a threshold
()delHpUpTrigger(f, f)
()delHpUpTrigger(f, s)
Delete HP Up Trigger Unregister a previously registered HP increase trigger
()addHpDownTrigger(f, f)
()addHpDownTrigger(f, s)
Add HP Down Trigger Register a user event or script function to trigger on HP decreases that cross a threshold

delHpDownTrigger_fs_ delHpDownTrigger_ff_

addNamedEntityListener_ssf_ addNamedEntityListener_sss_

delNamedEntityListener_ssf_ delNamedEntityListener_sss_

Actions

setEvent_f_ getEventParam_f_f getEventParam_f_s setTimer_ff_ timerSetRyzomDaytime_fff_ timerDisable_f_ timerSuspend_f_ timerResume_f_ timerAdd_ff_ timerIsEnabled_f_f timerIsSuspended_f_f dssStartAct_ff_ postNextState_s_ moveToZone_ss_ waitInZone_s_ stopMoving__ wander__ downScaleHP_f_ upScaleHP_f_ scaleHP_f_ setHPLevel_f_ addHP_f_ aiAction_s_ aiActionSelf_s_ setPlayerController_ss_ clearPlayerController_s_ activateEasterEgg_fffsfff_ deactivateEasterEgg_fff_ receiveMissionItems_ssc_ giveMissionItems_ssc_ talkTo_sc_ giveRewardTo_sc_ giveReward_ssssc_

startWander_f_ startMoving_fff_ followPlayer_sf_

sitDown__ standUp__

emote_css_ emote_ss_ emote_s_

rename_s_ vpx_s_

npcSay_css_ npcSay_ss_

dssMessage_fsss_ despawnBotByAlias_s_

teleportNear_fffc_

isAlived__f setMaxHP_ff_ setBotHPScaleByAlias_fs_ setConditionSuccess_f_

Function Documentation Description
()facing(f)
()facing(c, s, c, s)
Facing Make an NPC face a given direction or another NPC
()setUrl(s, s) Set URL Sets the name and URL of an action in the bot's right-click context menu

NPC Group Creation

newNpcChildGroup_sss_c newNpcChildGroup_sss_ newNpcChildGroup_sssf_c newNpcChildGroup_sssf_ newNpcChildGroupPos_ssff_c newNpcChildGroupPos_ssff_ newNpcChildGroupPos_ssfff_c newNpcChildGroupPos_ssfff_ newNpcChildGroupMl_sssf_c newNpcChildGroupMl_sssf_ newNpcChildGroupMl_sssff_c newNpcChildGroupMl_sssff_ newNpcChildGroupPosMl_ssfff_c newNpcChildGroupPosMl_ssfff_ newNpcChildGroupPosMl_ssffff_c newNpcChildGroupPosMl_ssffff_

Primitive Lookup

getGroupTemplateWithFlags_ss_s getGroupTemplateWithFlags_sss_s getZoneWithFlags_sss_s getZoneWithFlags_ssss_s getNeighbourZoneWithFlags_sss_s getNeighbourZoneWithFlags_ssss_s getNearestZoneWithFlags_ffss_s getNearestZoneWithFlags_ffsss_s getNearestZoneWithFlagsStrict_ffsss_s getNearestZoneWithFlagsStrict_ffss_s

NPC Group Parameters

getMidPos__ff getStateName__s setActivity_s_

Function Documentation Description
()setDynEnergy(s, f, f) Set Dyn Energy Set energy values on an index, on all groups matching the specified request
()copyDynEnergy(s, f, f) Copy Dyn Energy Copy energy values from one index to another on groups that match a specified request
setAggro_ff_
setCanAggro_f_
clearAggroList_f_
clearAggroList__
setAttackable_f_
setPlayerAttackable_f_
setBotAttackable_f_
setFactionAttackableAbove_sff_
setFactionAttackableBelow_sff_
setMode_s_
setDespawnTime_f_
setRespawnTime_f_
setAutoSpawn_f_
setFactionProp_ss_
addProfileParameter_s_
addProfileParameter_ss_
addProfileParameter_sf_
removeProfileParameter_s_
addBotChat_s_
clearBotChat__

addPersistentProfileParameter_s_ addPersistentProfileParameter_ss_ addPersistentProfileParameter_sf_ removePersistentProfileParameter_s_

setSheet_s_ setClientSheet_s_ setHealer_f_

ignoreOffensiveActions_f_ maxHitRange_f_

Phrase management

setSimplePhrase_ss_

Persistency Functions

dataGetVar_s_s dataGetVar_s_f dataSetVar_ss_ dataSetVar_sf_ dataSave__

Boss Functions

Custom Phrases

phraseBegin__ phrasePushValue_sf_ phrasePushString_ss_ phraseEndNpcMsg_fss_ phraseEndSystemMsg_fss_ phraseEndEmoteMsg_fs_

Time and Date

getServerTimeStr__s getServerTime__s getRyzomDateStr__s getRyzomDate__s

Player Info

isPlayerAlived_s_f getPlayerStat_ss_f getPlayerDistance_fs_f getCurrentPlayerEid__s queryEgs_sscfs_ queryEgs_ssscfs_

Bot Info

getBotIndex_s_f getBotEid_f_s getCurrentSpeakerEid__s getBotIndexByName_s_f isGroupAlived__f isBotAlived_f_f

Aggro Functions

getCurrentPlayerAggroListTarget_f_s getRandomPlayerAggroListTarget_f_s getAggroListElement_ff_s getAggroListSize_f_f setAggroListTarget_fs_ setGroupAggroListTarget_s_ setManagerAggroListTarget_ss_

setAggro_ff_ setCanAggro_f_ clearAggroList__

Teleport Functions

teleportPlayer_sffff_ summonPlayer_fs_

Misc Function

Functions which do not relate to the current NPC group context.

Math Functions

Function Documentation Description
(f)clamp(f, f, f) Clamp Restricts a value between two limits and returns the clamped value
(f)min(f, f) Min Returns the lowest of two values
(f)max(f, f) Max Returns the highest of two values
(f)rndm(f, f) Random Generates a random float value within the specified inclusive min and exclusive max bounds
floor_f_f
ceil_f_f
round_f_f
abs_f_f
sin_f_f
asin_f_f
sinh_f_f
cos_f_f
acos_f_f
cosh_f_f
tan_f_f
atan_f_f
tanh_f_f
sqrt_f_f
exp_f_f
pow_ff_f

String Functions

strlen_s_f substr_sff_s

Function Documentation Description
(f)strtof(s)
(f, f)strtof(s)
(f, f, f)strtof(s)
String to Float Convert a string to a float
import_s_

NeL Variables

setNelVar_sf_ getNelVar_s_f delNelVar_sf_ setNelVar_ss_ getNelVar_s_s delNelVar_ss_

Named Entities

Function Documentation Description
()createNamedEntity(s) Create Named Entity Creates a named entity in the current AI service
()setNamedEntityProp(s, s, s)
()setNamedEntityPropCb(s, s, s)
Set Named Entity Prop Set a property of an existing named entity
(s)getNamedEntityProp(s, s) Get Named Entity Prop Returns the content of a named entity property
()destroyNamedEntity(s) Destroy Named Entity Destroy a named entity

Foreign NPC Managers

spawnManager_s_ despawnManager_s_

Other

Other

setZoneState_sf_ break__ getName_c_s context__c warning_s_ info_s_ debug_s_ warning_f_ info_f_ debug_f_

Outpost

getOutpostStateName__s isOutpostTribeOwner__f isOutpostGuildOwner__f setOupostMode_ss_

Scenario

setScenarioPoints_ff_ startScenarioTiming_f_ endScenarioTiming_f_

Clone this wiki locally