2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-04-02 17:42:19 +00:00
|
|
|
-- `openmw.world` is an interface to the game world for global scripts.
|
|
|
|
-- Can not be used from local scripts.
|
|
|
|
-- @module world
|
|
|
|
-- @usage local world = require('openmw.world')
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-04-02 17:42:19 +00:00
|
|
|
-- List of currently active actors.
|
|
|
|
-- @field [parent=#world] openmw.core#ObjectList activeActors
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-04-02 17:42:19 +00:00
|
|
|
-- Loads a named cell
|
|
|
|
-- @function [parent=#world] getCellByName
|
|
|
|
-- @param #string cellName
|
|
|
|
-- @return openmw.core#Cell
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-04-02 17:42:19 +00:00
|
|
|
-- Loads an exterior cell by grid indices
|
|
|
|
-- @function [parent=#world] getExteriorCell
|
|
|
|
-- @param #number gridX
|
|
|
|
-- @param #number gridY
|
|
|
|
-- @return openmw.core#Cell
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- Simulation time in seconds.
|
|
|
|
-- The number of simulation seconds passed in the game world since starting a new game.
|
2022-06-04 13:28:04 +00:00
|
|
|
-- @function [parent=#world] getSimulationTime
|
2021-12-01 20:28:05 +00:00
|
|
|
-- @return #number
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- The scale of simulation time relative to real time.
|
2022-06-04 13:28:04 +00:00
|
|
|
-- @function [parent=#world] getSimulationTimeScale
|
2021-12-01 20:28:05 +00:00
|
|
|
-- @return #number
|
|
|
|
|
2022-07-03 12:51:28 +00:00
|
|
|
---
|
|
|
|
-- Set the simulation time scale.
|
|
|
|
-- @function [parent=#world] setSimulationTimeScale
|
|
|
|
-- @param #number scale
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- Game time in seconds.
|
2022-06-04 13:28:04 +00:00
|
|
|
-- @function [parent=#world] getGameTime
|
2021-12-01 20:28:05 +00:00
|
|
|
-- @return #number
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- The scale of game time relative to simulation time.
|
2022-06-04 13:28:04 +00:00
|
|
|
-- @function [parent=#world] getGameTimeScale
|
2021-12-01 20:28:05 +00:00
|
|
|
-- @return #number
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- Set the ratio of game time speed to simulation time speed.
|
|
|
|
-- @function [parent=#world] setGameTimeScale
|
|
|
|
-- @param #number ratio
|
|
|
|
|
2022-02-23 21:08:50 +00:00
|
|
|
---
|
2021-12-01 20:28:05 +00:00
|
|
|
-- Whether the world is paused (onUpdate doesn't work when the world is paused).
|
|
|
|
-- @function [parent=#world] isWorldPaused
|
|
|
|
-- @return #boolean
|
2021-04-02 17:42:19 +00:00
|
|
|
|
2023-01-16 00:28:21 +00:00
|
|
|
---
|
|
|
|
-- Create a new instance of the given record.
|
|
|
|
-- After creation the object is in the disabled state. Use :teleport to place to the world or :moveInto to put it into a container or an inventory.
|
|
|
|
-- @function [parent=#world] createObject
|
|
|
|
-- @param #string recordId Record ID in lowercase
|
|
|
|
-- @param #number count (optional, 1 by default) The number of objects in stack
|
|
|
|
-- @return openmw.core#GameObject
|
|
|
|
-- @usage -- put 100 gold on the ground at the position of `actor`
|
|
|
|
-- money = world.createObject('gold_001', 100)
|
|
|
|
-- money:teleport(actor.cell.name, actor.position)
|
|
|
|
-- @usage -- put 50 gold into the actor's inventory
|
|
|
|
-- money = world.createObject('gold_001', 50)
|
|
|
|
-- money:moveInto(types.Actor.inventory(actor))
|
|
|
|
|
2021-04-02 17:42:19 +00:00
|
|
|
return nil
|
|
|
|
|