From cf1515c1c8e57f67cf1d84a86abef6c180222324 Mon Sep 17 00:00:00 2001
From: Cooldude2606
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Configs
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
- Control
-
-
-
-
Guis
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
+ Control
+
+
+
+
Addons
+ Guis
+
+
+
+
Commands
- Control
-
-
-
-
- Guis
-
-
-
-
Modules
Control Module - Tasks - - Stores tasks for each force.
+- Stores tasks for each force. @@ -235,25 +235,10 @@
- -- import the module from the control modules
- local Tasks = require 'modules.control.tasks' --- @dep modules.control.tasks
-
- -- To create a new task all you need is the name of the force you want to add the task to
- -- you can give a place to add it but this is optional
- Tasks.new_task('player')
+ -- Making and then editing a new task
+local task_id = Tasks.add_task(game.player.force.name,nil,game.player.name)
- -- You can then update this task to what ever value that you want
- -- the task id is returned by new_task, or within an update handler
- -- if a player name is not given that it will assume '<server>'
- Tasks.update_task(task_id,'My number one task!','Cooldude2606')
-
- -- You can then remove the task and all data linked with it
- Tasks.remove_task(task_id)
-
- -- set_editing and is_editing may be used to block other or provide warnings
- -- none of this is enforced by this module and so you must do so in your own module
- Tasks.set_editing(task_id,'Cooldude2606',true)
+Tasks.update_task(task_id,'We need more iron!',game.player.name)
@@ -284,19 +269,15 @@
Gets the task stored at this id
- - - - Parameters: - -Gets the task details stored at this id
+Gets the task information that is linked with this id
@@ -514,7 +438,7 @@-- Getting task information outside of on_update
+local task = Tasks.get_task(task_id)
Gets the task ids for a force
+Gets all the task ids that a force has
@@ -557,7 +484,7 @@ (string) - the name of the force that you want the ids for + the name of the force that you want the task ids for @@ -581,20 +508,23 @@ + Usage: +-- Getting the task ids for a force
+local task_ids = Tasks.get_force_task_ids(game.player.force.name)
Gets if a player is currently editing this task
+Gets the editing state for a player
@@ -654,6 +584,9 @@ + Usage: +-- Check if a player is editing a task or not
+local editing = Tasks.get_editing(task_id,game.player.name)
@@ -663,71 +596,14 @@
Adds a new handler for when a task is updated
- - - - Parameters: - -Adds a new task for a force, with option to place it in a certain order
+Add a new task for a force, the task can be placed into a certain position for that force
@@ -763,7 +639,7 @@ (number) - the order place to add the task to, adds to end if omited + the order place to add the task to, appends to end if omited (optional) @@ -780,7 +656,7 @@ (string) - when given this player will be added to the editing list + the player who added this task, will cause them to be listed under editing (optional) @@ -805,6 +681,9 @@ + Usage: +-- Adding a new task for your force
+local task_id = Tasks.add_task(game.player.force.name,nil,game.player.name)
@@ -818,7 +697,7 @@
Removes a task and all data linked with it
+Removes a task and any data that is linked with it
@@ -855,6 +734,9 @@ + Usage: +-- Removing a task
+Tasks.remove_task(task_id)
@@ -862,13 +744,13 @@
Updates a task message
+Update the message and last edited information for a task
@@ -898,13 +780,13 @@-- Updating the message for on a task
+Task.update_task(task_id,'We need more iron!',game.player.name)
@@ -945,13 +830,13 @@
Sets a player to be editing this task, used with is_editing
+Set the editing state for a player, can be used as a warning or to display a text field
@@ -971,7 +856,7 @@ (string) - the uid of the task that you want to editing for + the uid of the task that you want to effect @@ -987,7 +872,7 @@ (string) - the name of the player you want to set editing for + the name of the player you want to set the state for @@ -1005,7 +890,6 @@ the new state to set editing to - (optional) @@ -1021,6 +905,64 @@ + Usage: +-- Setting your editing state to true
+Tasks.set_editing(task_id,game.player.name,true)
+
+
+
+ Adds an update handler for when a task is added, removed, or updated
+ + + + Parameters: + +-- Add a game print when a task is updated
+Tasks.on_update(function(task)
+ game.print(task.force_name..' now has the task: '..task.message)
+end)
@@ -1039,7 +981,7 @@
generated by LDoc
-- Require the module and add a store with no keys
+-- Store with no keys does not need a serializer
+local Store = require 'expcore.store' --- @dep expcore.store
+local scenario_diffculty = Store.register()
+
+-- When the store is changed this function will trigger
+Store.watch(scenario_diffculty,function(value)
+ game.print('The scenario diffculty has been set to '..value)
+end)
+
+Store.set(scenario_diffculty,'hard') -- Set the value stored to 'hard'
+Store.get(scenario_diffculty) -- Returns 'hard'
+Store.update(scenario_diffculty,function(value) -- Will set value to 'normal' if no value is present
+ return not value and 'normal'
+end)
+ -- Require the module and add a store with keys
+-- Store with keys does not require a serializer but it can be helpful
+local Store = require 'expcore.store' --- @dep expcore.store
+local player_scores = Store.register(function(player) -- Use player name as the key
+ return player.name
+end)
+
+-- When any key in the store is changed this function will trigger
+Store.watch(player_scores,function(value,key)
+ game.print(key..' now has a score of '..value)
+end)
+
+Store.set(player_scores,game.player,10) -- Set your score to 10
+Store.get(scenario_diffculty,game.player) -- Returns 10
+Store.update(scenario_diffculty,game.player,function(value) -- Add 1 to your score
+ return value + 1
+end)
@@ -262,9 +295,11 @@
array of the serializers that stores are using, key is store uids
+An array of the serializers that stores are using, key is store uids
+ @@ -403,8 +439,8 @@array of watchers that stores will trigger, key is store uids
+An array of watchers that stores will trigger, key is store uids
+ @@ -433,6 +469,8 @@The current highest uid that is being used, will not increase during runtime
+ @@ -446,10 +484,9 @@ uid - : - the current highest uid that is being used, will not increase during runtime + @@ -1318,7 +1355,7 @@ generated by LDoc| Jail | +Control Module - Jail + - Adds a way to jail players and temp ban players. | +
| Production | +Control Module - Production + - Common functions used to track production of items | +
| Reports | +Control Module - Reports + - Adds a way to report players and store report messages. | +
| Rockets | +Control Module - Rockets + - Stores rocket stats for each force. | +
| Tasks | +Control Module - Tasks +- Stores tasks for each force. | +
| Warnings | +Control Module - Warnings + - Adds a way to give and remove warnings to players. | +
| Warps | +Control Module - Warps + - Stores warps for each force. | +
| Adds a custom spawn area with chests and afk turrets |
| Player-List | +Gui Module - Player List + - Adds a player list to show names and play time; also includes action buttons which can apply to players | +
| Rocket-Info | +Gui Module - Rocket Info + - Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets | +
| Science-Info | +Gui Module - Science Info + - Adds a science info gui that shows production usage and net for the different science packs as well as an eta | +
| Task-List | +Gui Module - Task List + - Adds a task list to the game which players can add remove and edit items on | +
| Warps-List | +Gui Module - Warp List + - Adds a warp list gui which allows players to add and remove warp points | +
| Jail | -Control Module - Jail - - Adds a way to jail players and temp ban players. | -
| Production | -Control Module - Production - - Common functions used to track production of items | -
| Reports | -Control Module - Reports - - Adds a way to report players and store report messages. | -
| Rockets | -Control Module - Rockets - - Stores rocket stats for each force. | -
| Tasks | -Control Module - Tasks - - Stores tasks for each force. | -
| Warnings | -Control Module - Warnings - - Adds a way to give and remove warnings to players. | -
| Warps | -Control Module - Warps - - Stores warps for each force. | -
| Player-List | -Gui Module - Player List - - Adds a player list to show names and play time; also includes action buttons which can apply to players | -
| Rocket-Info | -Gui Module - Rocket Info - - Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets | -
| Science-Info | -Gui Module - Science Info - - Adds a science info gui that shows production usage and net for the different science packs as well as an eta | -
| Task-List | -Gui Module - Task List - - Adds a task list to the game which players can add remove and edit items on | -
| Warps-List | -Gui Module - Warp List - - Adds a warp list gui which allows players to add and remove warp points | -