Control Module - Warps - Stores warps for each force.
-- import the module from the control modules
local Warps = require 'modules.control.warps' --- @dep modules.control.warps
-- Adding a warp require a force, surface and postion, and the option to set this as the spawn
-- this function will also create the warp area unless set other wise
Warps.new_warp('player',surface,{x=0,y=0})
-- You can then update the warp information, name and icon, with the update function
Warps.update_warp(warp_id,'Best Warp','iron-plate')
-- Removeing a warp will restore the land that as under it, and remove any data linked with it
Warps.remove_warp(warp_id)
-- You can get the deatils for a warp which include last edit and postion
Warps.get_details(warp_id)
-- You can teleport a player to a warp, note that there is no limit on this action
Warps.teleport_player(warp_id,player)
expcore.store |
utils.global |
utils.token |
config.warps |
expcore.common |
get_warp_name(warp_id) | Gets the name of a warp |
get_warp_icon(warp_id) | Gets the icon of a warp |
get_details(warp_id) | Gets the task details stored at this id |
get_warps(force_name) | Gets all warps for a force |
get_all_warps() | Gets all warps from all forces |
is_editing(warp_id, player_name) | Gets if a player is currently editing this warp |
teleport_player(warp_id, player) | Teleports a player to a warp point |
add_handler(callback) | Adds a new handler for when a warp is updated |
set_editing(warp_id, player_name[, state]) | Sets a player to be editing this warp, used with is_editing |
update_warp(warp_id, name, icon[, player_name='server']) | Updates a warp to a differecnt name and icon, both must be given |
make_chart_tag(warp_id) | Adds or updates the chart tag for a warp |
new_warp(force_name, surface, position[, player_name='server'][, warp_name='New warp'][, block_generation=false][, set_spawn=false]) | Adds a new warp to a force and makes the in game warp area |
remove_warp(warp_id) | Removes a warp and clears the area where it was added |
Gets the name of a warp
Parameters:Gets the icon of a warp
Parameters:Gets the task details stored at this id
Parameters:Gets all warps for a force
Parameters:Gets all warps from all forces
Returns:Gets if a player is currently editing this warp
Parameters:Teleports a player to a warp point
Parameters:Adds a new handler for when a warp is updated
Parameters:Sets a player to be editing this warp, used with is_editing
Parameters:Updates a warp to a differecnt name and icon, both must be given
Parameters:Adds or updates the chart tag for a warp
Parameters:Adds a new warp to a force and makes the in game warp area
Parameters:Removes a warp and clears the area where it was added
Parameters: