Expose Wander option values to the Lua API (#7916)

This commit is contained in:
Hristos N. Triantafillou 2024-05-03 09:40:30 +00:00 committed by psi29a
parent a57c350c08
commit 63a27bbf99
7 changed files with 137 additions and 18 deletions

View file

@ -99,6 +99,18 @@ Follow another actor.
* - target
- `GameObject <openmw_core.html##(GameObject)>`_ [required]
- the actor to follow
* - destCell
- Cell [optional]
- the destination cell
* - duration
- number [optional]
- duration in game time (will be rounded up to the next hour)
* - destPosition
- `3d vector <openmw_util.html##(Vector3)>`_ [optional]
- the destination point
* - isRepeat
- boolean [optional]
- Will the package repeat (true or false)
Escort
------
@ -126,6 +138,9 @@ Escort another actor to the given location.
* - duration
- number [optional]
- duration in game time (will be rounded up to the next hour)
* - isRepeat
- boolean [optional]
- Will the package repeat (true or false)
**Example**
@ -136,6 +151,7 @@ Escort another actor to the given location.
target = object.self,
destPosition = util.vector3(x, y, z),
duration = 3 * time.hour,
isRepeat = true
})
Wander
@ -158,6 +174,34 @@ Wander nearby current position.
* - duration
- number [optional]
- duration in game time (will be rounded up to the next hour)
* - idle
- table [optional]
- Idle chance values, up to 8
* - isRepeat
- boolean [optional]
- Will the package repeat (true or false)
**Example**
.. code-block:: Lua
local idleTable = {
idle2 = 60,
idle3 = 50,
idle4 = 40,
idle5 = 30,
idle6 = 20,
idle7 = 10,
idle8 = 0,
idle9 = 25
}
actor:sendEvent('StartAIPackage', {
type = 'Wander',
distance = 5000,
duration = 5 * time.hour,
idle = idleTable,
isRepeat = true
})
Travel
------
@ -176,4 +220,6 @@ Go to given location.
* - destPosition
- `3d vector <openmw_util.html##(Vector3)>`_ [required]
- the point to travel to
* - isRepeat
- boolean [optional]
- Will the package repeat (true or false)