AI Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
API to control the logic of AI in the mission
API to control the logic of AI in the mission
== Functions ==
== Functions ==
=== AddTemporaryGoal ===
<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
'''Returns''': Nothing
'''Notes''': This goal will be removed from the AI once complete. If it isn't achievable it will be removed immediately.
=== AlterNPCMotivation ===
=== AlterNPCMotivation ===
<syntaxhighlight source lang="lua">AI.AlterNPCMotivation(characterName, motivationDelta)</syntaxhighlight>
<syntaxhighlight source lang="lua">AI.AlterNPCMotivation(characterName, motivationDelta)</syntaxhighlight>
Line 20: Line 36:


'''Notes''': When an NPCs motivation hits 0, they're no longer motivated and will attempt to take a break
'''Notes''': When an NPCs motivation hits 0, they're no longer motivated and will attempt to take a break
=== AlterNPCWorldState ===
<syntaxhighlight source lang="lua">AI.AlterNPCWorldState(characterName, state, value)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| characterName || string
|-
| state || string
|-
| value || bool
|}
'''Description''': Change the World State of an NPC.
'''Returns''': Nothing
=== CreateReactable ===
=== CreateReactable ===
<syntaxhighlight source lang="lua">AI.CreateReactable(actionType, attraction, targetObject)</syntaxhighlight>
<syntaxhighlight source lang="lua">AI.CreateReactable(actionType, attraction, targetObject)</syntaxhighlight>
Line 56: Line 89:
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''': 06/09/2018 14:53
'''Docs last hacked together on''': 11/10/2018 12:53
[[Category:Modding]][[Category:LuaAPI]]
[[Category:Modding]][[Category:LuaAPI]]

Revision as of 09:47, 12 October 2018

AI

Description

API to control the logic of AI in the mission

Functions

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 bool

Description: Change the World State of an NPC.

Returns: Nothing

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: 11/10/2018 12:53