AI Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
mNo 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 Gestures =
= AI =
== Description ==
== 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.
API to control the logic of AI in the mission
== Fields ==
== Functions ==
=== LookAround ===
=== Pause ===
Looks from side to side.
<syntaxhighlight source lang="lua">AI.Pause(characterName)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|}
'''Description''': Pauses the agent, and stops it from doing anything.


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


=== StandingTypingCalm ===
'''Notes''': The AI will be hidden from networks, meaning it will no longer interact with devices or send/receive messages.
Typing from a standing position, in a fairly normal manner.
=== Unpause ===
<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.


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


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


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


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


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


=== UseSodaMachineHacked ===
'''Notes''': This goal will be removed from the AI once complete. If it isn't achievable it will be removed immediately.
Press button, get hit by can, keel over.
=== AlterNPCMotivation ===
<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


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


=== UseCoffeeMachineHacked ===
'''Notes''': When an NPCs motivation hits 0, they're no longer motivated and will attempt to take a break
Press button, get hit by steam, panic and writhe in pain.
=== AlterNPCWorldState ===
<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.


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


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


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


=== Yawn ===
'''Notes''': If permanent is false, the cost will revert to normal the next time this is successfully used
Yawn, with arms outstretched.
=== AvoidInterest ===
<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


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


=== StandingTalkingAngrily ===
'''Notes''': If permanent is false, the cost will revert to normal the next time this is successfully used
Standing talking angrily with hand gestures.
=== ChangeSubject ===
<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


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


=== StandingPhoneMalfunctioning ===
'''Notes''': value can be null or empty (to unset/reset the subject)
Gets phone out, swipes frantically, puts phone away and looks around.
=== ReactTo ===
<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)


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


=== StandingLookingSideToSide ===
'''Notes''': value can be null or empty (to unset/reset the subject)
Standing, looks side to side.
=== CreateReactable ===
<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


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


=== PickupLow ===
=== SetNPCFavouredComputer ===
Standing pick up from ankle hight.
<syntaxhighlight source lang="lua">AI.SetNPCFavouredComputer(characterName, computer)</syntaxhighlight>
 
'''Expected parameter types'''
=== PickupMed ===
{| class="wikitable"
Standing pick up from waist hight.
|-
 
! Name !! Type
=== PickupHigh ===
|-
Standing pick up from head hight.
| characterName || string
 
|-
=== LockedDoor ===
| computer || MissionObject
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





Revision as of 12:18, 23 July 2020

AI

Description

API to control the logic of AI in the mission

Functions

Pause

AI.Pause(characterName)

Expected parameter types

Name Type
characterName string

Description: Pauses the agent, and stops it from doing anything.

Returns: Nothing

Notes: The AI will be hidden from networks, meaning it will no longer interact with devices or send/receive messages.

Unpause

AI.Unpause(characterName)

Expected parameter types

Name Type
characterName string

Description: Unpauses a hidden agent, resuming standard behaviour.

Returns: Nothing

IsPaused

AI.IsPaused(characterName)

Expected parameter types

Name Type
characterName string

Description: Returns a bool based on if a character is currently paused or not

Returns: bool

AddTemporaryGoal

AI.AddTemporaryGoal(characterName, goal)

Expected parameter types

Name Type
characterName string
goal Lua Table

Description: Adds a goal, taking top priority, to the named AI

Returns: Nothing

Notes: This goal will be removed from the AI once complete. If it isn't achievable it will be removed immediately.

AlterNPCMotivation

AI.AlterNPCMotivation(characterName, motivationDelta)

Expected parameter types

Name Type
characterName string
motivationDelta number

Description: Alters an NPCS motivation state

Returns: Nothing

Notes: When an NPCs motivation hits 0, they're no longer motivated and will attempt to take a break

AlterNPCWorldState

AI.AlterNPCWorldState(characterName, state, value)

Expected parameter types

Name Type
characterName string
state string
value Lua Type

Description: Change the World State of an NPC.

Returns: Nothing

FavourInterest

AI.FavourInterest(characterName, device, permanent)

Expected parameter types

Name Type
characterName string
device string
permanent bool

Description: Reduce the cost of an AI using a particular Interest

Returns: Nothing

Notes: If permanent is false, the cost will revert to normal the next time this is successfully used

AvoidInterest

AI.AvoidInterest(characterName, device, permanent)

Expected parameter types

Name Type
characterName string
device string
permanent bool

Description: Increase the cost of an AI using a particular Interest

Returns: Nothing

Notes: If permanent is false, the cost will revert to normal the next time this is successfully used

ChangeSubject

AI.ChangeSubject(characterName, subject, value)

Expected parameter types

Name Type
characterName string
subject string
value string

Description: Set the value of a particular subject, enabling Actions with Personality requirements

Returns: Nothing

Notes: value can be null or empty (to unset/reset the subject)

ReactTo

AI.ReactTo(characterName, subject, value)

Expected parameter types

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

Notes: value can be null or empty (to unset/reset the subject)

CreateReactable

AI.CreateReactable(actionType, attraction, targetObject)

Expected parameter types

Name Type
actionType AIReaction+Type
attraction number
targetObject MissionObject

Description: Create a new distraction that AI can pick up on

Returns: Nothing

SetNPCFavouredComputer

AI.SetNPCFavouredComputer(characterName, computer)

Expected parameter types

Name Type
characterName string
computer MissionObject

Description: Set NPC's computer, this will be used for a variety of actions

Returns: Nothing


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

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