Difference between revisions of "WDL Scripting Changes"
From Nomad DB
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Page_WDL}} | {{Page_WDL}} | ||
− | [[WDL ScriptHook|Watch Dogs Legion ScriptHook]] uses the same framework as WD2 & MDE ScriptHook. However, there are notable Lua changes compared to their old counterparts. | + | [[WDL ScriptHook|Watch Dogs Legion ScriptHook]] uses the same framework as WD2 & MDE ScriptHook. However, there are notable Lua changes compared to their old counterparts, which are documented in ''1.0'' section. Additionally, this page documents all Lua scripting changes throughout ScriptHook releases. |
− | === | + | == 2.0.0 == |
− | * | + | === ImGui === |
− | * | + | * [[Event: Script:OnRenderImGui]] |
+ | * [[Lua: ImGui]] for more information | ||
− | + | === Map Editor === | |
− | + | * [[ScriptHook.IsMapEditorEnabled]], [[ScriptHook.SetMapEditorEnabled]] | |
+ | * [[ScriptHook.LoadMap]], [[ScriptHook.ResetMap]] | ||
+ | * [[ScriptHook.GetAvailableMaps]] | ||
+ | * [[ScriptHook.GetMapEntityById]], [[ScriptHook.GetMapEntityByName]], [[ScriptHook.GetMapEntitiesByName]] | ||
− | * [[ | + | === Character Creator === |
− | * [[ | + | * [[ScriptHook.IsLocalPlayerCharacterCreatorEnabled]], [[ScriptHook.SetLocalPlayerCharacterCreation]] |
+ | * [[ScriptHook.GetSavedCharacterCreationsList]], [[ScriptHook.LoadSavedCharacterCreation]] | ||
+ | * [[ScriptHook.SetLocalPlayerCharacterCreation]] | ||
− | === | + | == 1.1.0 == |
− | + | === Scripts === | |
− | * | + | Two new Script events were added: |
− | * | + | * [[Event: Script:OnInputKey|Script:OnInputKey]] |
+ | * [[Event: Script:OnInputMouseButton|Script:OnInputMouseButton]] | ||
=== Rendering === | === Rendering === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
* [[d3d.DrawOutlinedRect]] | * [[d3d.DrawOutlinedRect]] | ||
* [[d3d.World2Screen]] | * [[d3d.World2Screen]] | ||
=== Lua Functions === | === Lua Functions === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* [[ScriptHook.SetFelonySystemEnabled]], [[ScriptHook.IsFelonySystemEnabled]] | * [[ScriptHook.SetFelonySystemEnabled]], [[ScriptHook.IsFelonySystemEnabled]] | ||
* [[ScriptHook.StartFelonySearch]] | * [[ScriptHook.StartFelonySearch]] | ||
Line 46: | Line 41: | ||
==== Entity ==== | ==== Entity ==== | ||
− | |||
− | |||
− | |||
− | |||
− | |||
* [[ScriptHook.GetEntityAABB]], [[ScriptHook.GetEntityLocalAABB]], [[ScriptHook.HasEntityUserLocalBBox]] | * [[ScriptHook.GetEntityAABB]], [[ScriptHook.GetEntityLocalAABB]], [[ScriptHook.HasEntityUserLocalBBox]] | ||
* [[ScriptHook.RemoteEntity]] | * [[ScriptHook.RemoteEntity]] | ||
Line 60: | Line 50: | ||
* [[ScriptHook.IsEntitySleeping]], [[ScriptHook.SetEntitySleep]] | * [[ScriptHook.IsEntitySleeping]], [[ScriptHook.SetEntitySleep]] | ||
* [[ScriptHook.SetEntityIsVisible]], [[ScriptHook.IsEntityVisible]] | * [[ScriptHook.SetEntityIsVisible]], [[ScriptHook.IsEntityVisible]] | ||
+ | |||
+ | == 1.0.0 == | ||
+ | === Scripts === | ||
+ | * '''manifest.json: ''' Keybinds from Scripts can now be modified in the StartupMenu, as long as they have a Text configured. ([[ScriptHook: Script|Documented here]]) | ||
+ | * '''Config Values:''' It is now possible to store and load persistent data (e.g. for configuration). For example, the Trainer stores the noclip & freecam speeds using this method. ([[ScriptHook: Script Config]]). | ||
+ | |||
+ | === UI === | ||
+ | * '''SimpleMenu:''' Updated design for Checkboxes | ||
+ | * '''SimpleMenu:''' Added Text & List entry types ([[UI.SimpleMenu|Documented here]]) | ||
+ | * UI uses a new configuration system, which allows for fully configurable design using JSON files. These JSON files are located in ''data/ui'' and once modified, the UI style will update instantly. | ||
+ | |||
+ | === Rendering === | ||
+ | This feature isn't exactly new, but hasn't been used in past ScriptHook versions. | ||
+ | * '''d3d:''' Render (outlined) rectangles, lines & text using Lua ([[ScriptHook: Rendering|Documented here]]) | ||
+ | * '''OnRender:''' Event callback in which rendering takes place ([[Event: Script:OnRender|Documented here]]) | ||
+ | |||
+ | === Lua Functions === | ||
+ | * Added [[ScriptHook.SetNoclipSpeeds]] | ||
+ | * Added [[ScriptHook.SetFreeCameraSpeeds]] | ||
+ | * Added [[ScriptHook.SetLondonEyeRotationSpeed]] and [[ScriptHook.GetLondonEyeRotationSpeed]] | ||
+ | * Renamed [[ScriptHook.ToggleWorldSpawner]] to [[ScriptHook.SetWorldSpawnerEnabled]] | ||
+ | * Renamed [[ScriptHook.ToggleWorldImpostor]] to [[ScriptHook.SetWorldImpostorEnabled]] | ||
+ | |||
+ | ==== Entity ==== | ||
+ | * Added [[ScriptHook.SetEntityIsStatic]], [[ScriptHook.SetEntityIsPersistent]] | ||
+ | * Added [[ScriptHook.SetEntityPoolClearOnUnused]], [[ScriptHook.SetEntityIsPoolable]] | ||
+ | * Added [[ScriptHook.SetEntityPhysicsEnabled]], [[ScriptHook.SetEntityIsVisible]] | ||
Entity functions from WD2 were also ported to Legion: | Entity functions from WD2 were also ported to Legion: |
Latest revision as of 19:06, 19 December 2021
Watch Dogs Legion ScriptHook uses the same framework as WD2 & MDE ScriptHook. However, there are notable Lua changes compared to their old counterparts, which are documented in 1.0 section. Additionally, this page documents all Lua scripting changes throughout ScriptHook releases.
Contents
2.0.0
ImGui
- Event: Script:OnRenderImGui
- Lua: ImGui for more information
Map Editor
- ScriptHook.IsMapEditorEnabled, ScriptHook.SetMapEditorEnabled
- ScriptHook.LoadMap, ScriptHook.ResetMap
- ScriptHook.GetAvailableMaps
- ScriptHook.GetMapEntityById, ScriptHook.GetMapEntityByName, ScriptHook.GetMapEntitiesByName
Character Creator
- ScriptHook.IsLocalPlayerCharacterCreatorEnabled, ScriptHook.SetLocalPlayerCharacterCreation
- ScriptHook.GetSavedCharacterCreationsList, ScriptHook.LoadSavedCharacterCreation
- ScriptHook.SetLocalPlayerCharacterCreation
1.1.0
Scripts
Two new Script events were added:
Rendering
Lua Functions
- ScriptHook.SetFelonySystemEnabled, ScriptHook.IsFelonySystemEnabled
- ScriptHook.StartFelonySearch
- ScriptHook.SetFelonyHeatLevel, ScriptHook.ClearFelonyHeatLevel
- ScriptHook.GetTimeShiftTargetTime, ScriptHook.StartTimeShiftTransition
- ScriptHook.SetVehicleMaterialOverride
Entity
- ScriptHook.GetEntityAABB, ScriptHook.GetEntityLocalAABB, ScriptHook.HasEntityUserLocalBBox
- ScriptHook.RemoteEntity
- ScriptHook.IsEntityLoaded
- ScriptHook.IsEntityInitialized
- ScriptHook.IsEntityAddedToWorld
- ScriptHook.IsEntityMoving
- ScriptHook.IsEntityShuttingDown,
- ScriptHook.IsEntitySleeping, ScriptHook.SetEntitySleep
- ScriptHook.SetEntityIsVisible, ScriptHook.IsEntityVisible
1.0.0
Scripts
- manifest.json: Keybinds from Scripts can now be modified in the StartupMenu, as long as they have a Text configured. (Documented here)
- Config Values: It is now possible to store and load persistent data (e.g. for configuration). For example, the Trainer stores the noclip & freecam speeds using this method. (ScriptHook: Script Config).
UI
- SimpleMenu: Updated design for Checkboxes
- SimpleMenu: Added Text & List entry types (Documented here)
- UI uses a new configuration system, which allows for fully configurable design using JSON files. These JSON files are located in data/ui and once modified, the UI style will update instantly.
Rendering
This feature isn't exactly new, but hasn't been used in past ScriptHook versions.
- d3d: Render (outlined) rectangles, lines & text using Lua (Documented here)
- OnRender: Event callback in which rendering takes place (Documented here)
Lua Functions
- Added ScriptHook.SetNoclipSpeeds
- Added ScriptHook.SetFreeCameraSpeeds
- Added ScriptHook.SetLondonEyeRotationSpeed and ScriptHook.GetLondonEyeRotationSpeed
- Renamed ScriptHook.ToggleWorldSpawner to ScriptHook.SetWorldSpawnerEnabled
- Renamed ScriptHook.ToggleWorldImpostor to ScriptHook.SetWorldImpostorEnabled
Entity
- Added ScriptHook.SetEntityIsStatic, ScriptHook.SetEntityIsPersistent
- Added ScriptHook.SetEntityPoolClearOnUnused, ScriptHook.SetEntityIsPoolable
- Added ScriptHook.SetEntityPhysicsEnabled, ScriptHook.SetEntityIsVisible
Entity functions from WD2 were also ported to Legion:
- ScriptHook.GetAllEntities, ScriptHook.GetEntitiesInRange, ScriptHook.GetEntitiesWithComponent
- ScriptHook.GetEntityComponents, ScriptHook.EntityHasComponent, ScriptHook.GetEntityClassName