-
Notifications
You must be signed in to change notification settings - Fork 115
functions
title: AI Script Function Reference description: published: true date: 2023-03-12T13:34:41.179Z tags: editor: markdown dateCreated: 2023-03-12T09:18:34.306Z
Quick reference list of native functions
spawn__ despawn_f_
| 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 crosses a threshold |
| ()delHpUpTrigger(f, f) ()delHpUpTrigger(f, s) |
Delete HP Up Trigger |
addHpDownTrigger_ff_ addHpDownTrigger_fs_
delHpDownTrigger_fs_ delHpDownTrigger_ff_
addNamedEntityListener_ssf_ addNamedEntityListener_sss_
delNamedEntityListener_ssf_ delNamedEntityListener_sss_
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_
newNpcChildGroup_sss_ newNpcChildGroup_sssf_ newNpcChildGroupPos_ssff_ newNpcChildGroupPos_ssfff_ newNpcChildGroupMl_sssf_ newNpcChildGroupMl_sssff_ newNpcChildGroupPosMl_ssfff_ newNpcChildGroupPosMl_ssffff_
getGroupTemplateWithFlags_ss_s getGroupTemplateWithFlags_sss_s getZoneWithFlags_sss_s getZoneWithFlags_ssss_s getNeighbourZoneWithFlags_sss_s getNeighbourZoneWithFlags_ssss_s getNearestZoneWithFlags_ffss_s getNearestZoneWithFlags_ffsss_s
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__ |
setSimplePhrase_ss_
dataGetVar_s_s dataGetVar_s_f dataSetVar_ss_ dataSetVar_sf_ dataSave__
phraseBegin__ phrasePushValue_sf_ phrasePushString_ss_ phraseEndNpcMsg_fss_ phraseEndSystemMsg_fss_ phraseEndEmoteMsg_fs_
getServerTimeStr__s getServerTime__s getRyzomDateStr__s getRyzomDate__s
isPlayerAlived_s_f getPlayerStat_ss_f getPlayerDistance_fs_f getCurrentPlayerEid__s queryEgs_sscfs_ queryEgs_ssscfs_ Infos on bot getBotIndex_s_f getBotEid_f_s getCurrentSpeakerEid__s getBotIndexByName_s_f isGroupAlived__f isBotAlived_f_f
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_
Functions which do not relate to the current NPC group context.
| 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 |
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_ |
setNelVar_sf_ getNelVar_s_f delNelVar_sf_ setNelVar_ss_ getNelVar_s_s delNelVar_ss_
| 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 |
spawnManager_s_ despawnManager_s_
setZoneState_sf_ break__ getName_c_s context__c warning_s_ info_s_ debug_s_ warning_f_ info_f_ debug_f_