AI Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
<!-- This file is auto generated, please don't edit manually! -->
<!-- This file is auto generated, please don't edit manually! -->
= AI =
= AI Gestures =
== Description ==
== Description ==
API to control the logic of AI in the mission
The enums on this page can be used by AI agent definitions to play an animation when an action is taken. These enums map directly on to states in the character animator, which is shared by all characters. Make sure you type the name exactly as it appears here, it's case sensitive.
== Functions ==
== Fields ==
=== Pause ===
=== LookAround ===
<syntaxhighlight source lang="lua">AI.Pause(characterName)</syntaxhighlight>
Looks from side to side.
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|}
'''Description''': Pauses the agent, and stops it from doing anything.


'''Returns''': Nothing
=== LookAtPhone ===
Retrieves phone from pocket, has a look at it, then puts it away.


'''Notes''': The AI will be hidden from networks, meaning it will no longer interact with devices or send/receive messages.
=== StandingTypingCalm ===
=== Unpause ===
Typing from a standing position, in a fairly normal manner.
<syntaxhighlight source lang="lua">AI.Unpause(characterName)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|}
'''Description''': Unpauses a hidden agent, resuming standard behaviour.


'''Returns''': Nothing
=== StandingTypingStealth ===
Typing from a standing position, in a sneaky manner.


=== IsPaused ===
=== StandingFilingCabinetSearch ===
<syntaxhighlight source lang="lua">AI.IsPaused(characterName)</syntaxhighlight>
Searches a filing cabinet.
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|}
'''Description''': Returns a bool based on if a character is currently paused or not


'''Returns''': bool
=== StandingLookAtHipHeight ===
Not sure.


=== AddTemporaryGoal ===
=== StandingAmokDeviceHit ===
<syntaxhighlight source lang="lua">AI.AddTemporaryGoal(characterName, goal)</syntaxhighlight>
Hits a device that's in front of the character.
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| goal || Lua Table
|}
'''Description''': Adds a goal, taking top priority, to the named AI


'''Returns''': Nothing
=== UseSodaMachine ===
Press button, retrieve soda, drink it, discard can.


'''Notes''': This goal will be removed from the AI once complete. If it isn't achievable it will be removed immediately.
=== UseSodaMachineHacked ===
=== AlterNPCMotivation ===
Press button, get hit by can, keel over.
<syntaxhighlight source lang="lua">AI.AlterNPCMotivation(characterName, motivationDelta)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| motivationDelta || number
|}
'''Description''': Alters an NPCS motivation state


'''Returns''': Nothing
=== UseCoffeeMachine ===
Press button, retrieve coffee cup, drink.


'''Notes''': When an NPCs motivation hits 0, they're no longer motivated and will attempt to take a break
=== UseCoffeeMachineHacked ===
=== AlterNPCWorldState ===
Press button, get hit by steam, panic and writhe in pain.
<syntaxhighlight source lang="lua">AI.AlterNPCWorldState(characterName, state, value)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| state || string
|-
| value || Lua Type
|}
'''Description''': Change the World State of an NPC.


'''Returns''': Nothing
=== DanceHipHop ===
Hip hop dancing.


=== FavourInterest ===
=== DanceGuitar ===
<syntaxhighlight source lang="lua">AI.FavourInterest(characterName, device, permanent)</syntaxhighlight>
Air guitar!
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| device || string
|-
| permanent || bool
|}
'''Description''': Reduce the cost of an AI using a particular Interest


'''Returns''': Nothing
=== DanceSalsa ===
Strictly come Off Grid.


'''Notes''': If permanent is false, the cost will revert to normal the next time this is successfully used
=== Yawn ===
=== AvoidInterest ===
Yawn, with arms outstretched.
<syntaxhighlight source lang="lua">AI.AvoidInterest(characterName, device, permanent)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| device || string
|-
| permanent || bool
|}
'''Description''': Increase the cost of an AI using a particular Interest


'''Returns''': Nothing
=== StandingTalkingCalmly ===
Standing talking calmly with hands near waist.


'''Notes''': If permanent is false, the cost will revert to normal the next time this is successfully used
=== StandingTalkingAngrily ===
=== ChangeSubject ===
Standing talking angrily with hand gestures.
<syntaxhighlight source lang="lua">AI.ChangeSubject(characterName, subject, value)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| subject || string
|-
| value || string
|}
'''Description''': Set the value of a particular subject, enabling Actions with Personality requirements


'''Returns''': Nothing
=== StandingUseTazer ===
Standing raises right arm in front.


'''Notes''': value can be null or empty (to unset/reset the subject)
=== StandingPhoneMalfunctioning ===
=== ReactTo ===
Gets phone out, swipes frantically, puts phone away and looks around.
<syntaxhighlight source lang="lua">AI.ReactTo(characterName, subject, value)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| subject || string
|-
| value || string
|}
'''Description''': Much like ChangeSubject, but instead of enabling Actions, this will alter stats within the Agent, modifying its WorldState (and as a result, enabling Actions)


'''Returns''': Nothing
=== StandingLookingHunched ===
Standing, almost crouches down and peers around.


'''Notes''': value can be null or empty (to unset/reset the subject)
=== StandingLookingSideToSide ===
=== CreateReactable ===
Standing, looks side to side.
<syntaxhighlight source lang="lua">AI.CreateReactable(actionType, attraction, targetObject)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| actionType || AIReaction+Type
|-
| attraction || number
|-
| targetObject || MissionObject
|}
'''Description''': Create a new distraction that AI can pick up on


'''Returns''': Nothing
=== StandingHitFace ===
Standing, quickly brings hands to face.


=== SetNPCFavouredComputer ===
=== PickupLow ===
<syntaxhighlight source lang="lua">AI.SetNPCFavouredComputer(characterName, computer)</syntaxhighlight>
Standing pick up from ankle hight.
'''Expected parameter types'''
 
{| class="wikitable"
=== PickupMed ===
|-
Standing pick up from waist hight.
! Name !! Type
 
|-
=== PickupHigh ===
| characterName || string
Standing pick up from head hight.
|-
 
| computer || MissionObject
=== LockedDoor ===
|}
Standing, puts hand on handle, struggles.
'''Description''': Set NPC's computer, this will be used for a variety of actions
 
=== WashingDryingHands ===
Standing, hands out in front rubbing together.
 
=== WaitingHandsOnHips ===
Standing with hands on hips.
 
=== WashFace ===
Standing washing face.
 
=== UseSnackMachine ===
 
 
=== UseSnackMachineHacked ===


'''Returns''': Nothing




Line 201: Line 101:
This file is auto generated, please don't edit manually!
This file is auto generated, please don't edit manually!


'''Docs last hacked together on''': 15/11/2019 14:59
'''Docs last hacked together on''': 23/07/2020 11:58
[[Category:Modding]][[Category:LuaAPI]]
[[Category:Modding]][[Category:LuaAPI]]

Revision as of 12:18, 23 July 2020

AI Gestures

Description

The enums on this page can be used by AI agent definitions to play an animation when an action is taken. These enums map directly on to states in the character animator, which is shared by all characters. Make sure you type the name exactly as it appears here, it's case sensitive.

Fields

LookAround

Looks from side to side.

LookAtPhone

Retrieves phone from pocket, has a look at it, then puts it away.

StandingTypingCalm

Typing from a standing position, in a fairly normal manner.

StandingTypingStealth

Typing from a standing position, in a sneaky manner.

StandingFilingCabinetSearch

Searches a filing cabinet.

StandingLookAtHipHeight

Not sure.

StandingAmokDeviceHit

Hits a device that's in front of the character.

UseSodaMachine

Press button, retrieve soda, drink it, discard can.

UseSodaMachineHacked

Press button, get hit by can, keel over.

UseCoffeeMachine

Press button, retrieve coffee cup, drink.

UseCoffeeMachineHacked

Press button, get hit by steam, panic and writhe in pain.

DanceHipHop

Hip hop dancing.

DanceGuitar

Air guitar!

DanceSalsa

Strictly come Off Grid.

Yawn

Yawn, with arms outstretched.

StandingTalkingCalmly

Standing talking calmly with hands near waist.

StandingTalkingAngrily

Standing talking angrily with hand gestures.

StandingUseTazer

Standing raises right arm in front.

StandingPhoneMalfunctioning

Gets phone out, swipes frantically, puts phone away and looks around.

StandingLookingHunched

Standing, almost crouches down and peers around.

StandingLookingSideToSide

Standing, looks side to side.

StandingHitFace

Standing, quickly brings hands to face.

PickupLow

Standing pick up from ankle hight.

PickupMed

Standing pick up from waist hight.

PickupHigh

Standing pick up from head hight.

LockedDoor

Standing, puts hand on handle, struggles.

WashingDryingHands

Standing, hands out in front rubbing together.

WaitingHandsOnHips

Standing with hands on hips.

WashFace

Standing washing face.

UseSnackMachine

UseSnackMachineHacked

This file is auto generated, please don't edit manually!

Docs last hacked together on: 23/07/2020 11:58