Difference between revisions of "LUA:ZoneScripts"

 
(One intermediate revision by the same user 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.
 
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 ==
+
{{Header|Dawn|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Dawn is called when the game time passes dawn time, which is set in rules
 
Dawn is called when the game time passes dawn time, which is set in rules
  
Line 8: Line 9:
 
end
 
end
 
</pre>
 
</pre>
== Dusk ==
+
{{Header|Dusk|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Dusk is called when the game time passes dusk time, which is set in rules
 
Dusk is called when the game time passes dusk time, which is set in rules
  
Line 15: Line 16:
 
end
 
end
 
</pre>
 
</pre>
== Enter Location ==
+
{{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
 
Enter Location is called when the player enters a new grid, the new grid id is passes as the third parameter
  
Line 22: Line 23:
 
end
 
end
 
</pre>
 
</pre>
== Init Zone Script ==
+
{{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
 
Init Zone Script is called when the zone first starts up, this is where you would set up any proximity functions
  
Line 29: Line 30:
 
end
 
end
 
</pre>
 
</pre>
== Leave Location ==
+
{{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
 
Leave Location is called when the player leaves a grid, the grid id that the player is leaving is passed as the third parameter
  
Line 36: Line 37:
 
end
 
end
 
</pre>
 
</pre>
== Player Entry ==
+
{{Header|Player Entry|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Player Entry is called when a players enters the zone
 
Player Entry is called when a players enters the zone
  
Line 43: Line 44:
 
end
 
end
 
</pre>
 
</pre>
 
 
[[LUA|Back to LUA]]
 

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

Dawn is called when the game time passes dawn time, which is set in rules

function dawn(Zone, Spawn)
end
Dusk

Dusk is called when the game time passes dusk time, which is set in rules

function dusk(Zone, Spawn)
end
Enter Location

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

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

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

Player Entry is called when a players enters the zone

function player_entry(Zone, Spawn)
end