Difference between revisions of "ScriptHook: Script"
m (Administrator moved page WD2 ScriptHook: Script to ScriptHook: Script: MDE+WD2) |
|||
Line 1: | Line 1: | ||
− | A Script is a collection of Lua scripts that are loaded by [[WD2 ScriptHook]]. Scripts are loaded upon starting the game with ScriptHook installed. | + | A Script is a collection of Lua scripts that are loaded by [[WD2 ScriptHook]] or [[MDE ScriptHook]]. Scripts are loaded upon starting the game with ScriptHook installed. |
'''This guide will give you an overview of the structure behind those Scripts.''' | '''This guide will give you an overview of the structure behind those Scripts.''' | ||
Line 5: | Line 5: | ||
==Guides== | ==Guides== | ||
− | *[[ | + | *[[ScriptHook: Key Binds]] |
− | *[[ | + | *[[ScriptHook: Console Commands]] |
− | *[[ | + | *[[ScriptHook: Script Table]] |
− | *[[ | + | *[[ScriptHook: UI]] |
− | *[[ | + | *[[ScriptHook: Rendering]] |
− | *[[WD2 ScriptHook: Events]] | + | *[[WD2 ScriptHook: Events|WD2 Events]] or [[MDE ScriptHook: Events|MDE Events]] |
==Directory Structure== | ==Directory Structure== | ||
Line 38: | Line 38: | ||
==Concepts== | ==Concepts== | ||
===Script Table=== | ===Script Table=== | ||
− | {{ | + | {{ScriptHook: Script Table}} |
− | '''For more information, check out [[ | + | '''For more information, check out [[ScriptHook: Script Table]].''' |
===Key Bindings=== | ===Key Bindings=== | ||
You can bind Keys to Lua functions. Key Bindings are configured within the ''manifest.json'' section. | You can bind Keys to Lua functions. Key Bindings are configured within the ''manifest.json'' section. | ||
− | '''Check out [[ | + | '''Check out [[ScriptHook: Key Binds]].''' |
===Console Commands=== | ===Console Commands=== | ||
Scripts can register custom Console Commands. These commands are registered directly within Lua. | Scripts can register custom Console Commands. These commands are registered directly within Lua. | ||
− | '''Read more about [[ | + | '''Read more about [[ScriptHook: Console Commands]].''' |
===ScriptHook Lua Functions=== | ===ScriptHook Lua Functions=== | ||
− | In addition to the | + | In addition to the built-in Lua functions, ScriptHook registers custom Lua functions that you can use. Those functions are used for Menus, Console Commands, and some alter the Game's world. |
− | + | [[Category:ScriptHook]] | |
− | |||
− | [[Category: |
Revision as of 12:18, 6 October 2020
A Script is a collection of Lua scripts that are loaded by WD2 ScriptHook or MDE ScriptHook. Scripts are loaded upon starting the game with ScriptHook installed.
This guide will give you an overview of the structure behind those Scripts.
Contents
Guides
- ScriptHook: Key Binds
- ScriptHook: Console Commands
- ScriptHook: Script Table
- ScriptHook: UI
- ScriptHook: Rendering
- WD2 Events or MDE Events
Directory Structure
data/scripts data/scripts/[name] data/scripts/[name]/manifest.json data/scripts/[name]/[...].lua
manifest.json
The manifest holds information about a Script. Name, Author & Version can be specified here. The "entrypoint" is the Lua script that is loaded. The example below shows the manifest.json for the ScriptHook Trainer.
{
"name": "Simple Trainer",
"author": "Nomad Group",
"version": "1.0",
"entrypoint": "main.lua",
"keyBinds": {
"menu": "F4"
}
}
Concepts
Script Table
Template:ScriptHook: Script Table
For more information, check out ScriptHook: Script Table.
Key Bindings
You can bind Keys to Lua functions. Key Bindings are configured within the manifest.json section.
Check out ScriptHook: Key Binds.
Console Commands
Scripts can register custom Console Commands. These commands are registered directly within Lua.
Read more about ScriptHook: Console Commands.
ScriptHook Lua Functions
In addition to the built-in Lua functions, ScriptHook registers custom Lua functions that you can use. Those functions are used for Menus, Console Commands, and some alter the Game's world.