Difference between revisions of "LUA:ZoneScripts"
John Adams (talk | contribs) (New page: == The LUA Scripting System: ZoneScripts == Describe purpose, examples, our chosen folder structure for script storage. Back to LUA) |
|||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{PageHeaderChild|LUA|Zone Scripts}} | |
| − | + | Zone scripts are used for events within the zone, there are 6 events that will make a call to the zone script, dawn, dusk, enter location, init zone, leave location, and player entry. | |
| − | + | {{Header|Dawn|BackgroundColor=3d78b4|FontColor=ffffff}} | |
| + | Dawn is called when the game time passes dawn time, which is set in rules | ||
| + | |||
| + | <pre> | ||
| + | function dawn(Zone, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Dusk|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Dusk is called when the game time passes dusk time, which is set in rules | ||
| + | |||
| + | <pre> | ||
| + | function dusk(Zone, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Enter Location|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Enter Location is called when the player enters a new grid, the new grid id is passes as the third parameter | ||
| + | |||
| + | <pre> | ||
| + | function enter_location(Zone, Spawn, int32) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Init Zone Script|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Init Zone Script is called when the zone first starts up, this is where you would set up any proximity functions | ||
| + | |||
| + | <pre> | ||
| + | function init_zone_script(Zone) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Leave Location|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Leave Location is called when the player leaves a grid, the grid id that the player is leaving is passed as the third parameter | ||
| + | |||
| + | <pre> | ||
| + | function leave_location(Zone, Spawn, int32) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Player Entry|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Player Entry is called when a players enters the zone | ||
| + | |||
| + | <pre> | ||
| + | function player_entry(Zone, Spawn) | ||
| + | end | ||
| + | </pre> | ||
Latest revision as of 16:36, 14 June 2016
LUA - Zone Scripts
Return to: LUA | Tutorials | Portal | Forum | Project Manager | Bug Tracker
Zone scripts are used for events within the zone, there are 6 events that will make a call to the zone script, dawn, dusk, enter location, init zone, leave location, and player entry.
Dawn is called when the game time passes dawn time, which is set in rules
function dawn(Zone, Spawn) end
Dusk is called when the game time passes dusk time, which is set in rules
function dusk(Zone, Spawn) end
Enter Location is called when the player enters a new grid, the new grid id is passes as the third parameter
function enter_location(Zone, Spawn, int32) end
Init Zone Script is called when the zone first starts up, this is where you would set up any proximity functions
function init_zone_script(Zone) end
Leave Location is called when the player leaves a grid, the grid id that the player is leaving is passed as the third parameter
function leave_location(Zone, Spawn, int32) end
Player Entry is called when a players enters the zone
function player_entry(Zone, Spawn) end