User Tools

Site Tools


scripting:reference:system_functions:worldmapfunctions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:reference:system_functions:worldmapfunctions [2020/01/29 06:43] mitscripting:reference:system_functions:worldmapfunctions [2020/02/07 19:00] (current) – [sysNumPlayersInScriptZone] mit
Line 1: Line 1:
 ===== World / Map Functions ===== ===== World / Map Functions =====
 +This group collects a few different sets of functions relating to the world -
 +  - Functions for converting co-ordinates from map ('tile') to world scale
 +  - Functions for finding out how much of a particular object can be found in specified locations
 +  - Functions for controlling proximity ranges, where events are triggered when a player enters a particular region of the world
  
 ==== sysGetTileCenter ==== ==== sysGetTileCenter ====
-^ Format | sysGetTileCenter ( [World X or Y] )|+^ Format | sysGetTileCenter ( World_X_or_Y )|
 ^ Description | Returns the world coordinate value for the center of the map tile nearest to the specified position| ^ Description | Returns the world coordinate value for the center of the map tile nearest to the specified position|
-^ Parameters | **[World X or Y]** - World coordinate value | 
 ^ Returns | World coordinate of tile center | ^ Returns | World coordinate of tile center |
 //Example//: <note> //Example//: <note>
Line 16: Line 19:
 </note> </note>
 ==== sysMapToWorld ==== ==== sysMapToWorld ====
-^ Format | sysMapToWorld ( [Map X or Y] )|+^ Format | sysMapToWorld ( Map_X_or_Y )|
 ^ Description | Converts a map coordinate to a world coordinate| ^ Description | Converts a map coordinate to a world coordinate|
-^ Parameters | **[Map X or Y]** - Map coordinate value | 
 ^ Returns | World coordinate | ^ Returns | World coordinate |
 //Notes//: There are 2 coordinate systems used in the game ; Map Coordinates range from 0 to 255 (for the default map size), 0 to 511 or 0 to 1023 (if using a larger map size) and they correspond to the 'tiles' that make up the landscape. World coordinates are in centimeters. //Notes//: There are 2 coordinate systems used in the game ; Map Coordinates range from 0 to 255 (for the default map size), 0 to 511 or 0 to 1023 (if using a larger map size) and they correspond to the 'tiles' that make up the landscape. World coordinates are in centimeters.
 +
 ==== sysWorldToMap ==== ==== sysWorldToMap ====
-^ Format | sysWorldToMap ( [Map X or Y] )|+^ Format | sysWorldToMap ( Map_X_or_Y )|
 ^ Description | Converts a world coordinate to a map coordinate| ^ Description | Converts a world coordinate to a map coordinate|
-^ Parameters | **[World X or Y]** - World coordinate value | 
 ^ Returns | Nearest map coordinate value | ^ Returns | Nearest map coordinate value |
 ==== sysGetBuildingAtWorldPos ==== ==== sysGetBuildingAtWorldPos ====
Line 30: Line 32:
  
 ==== sysWorldGetNumBuildingsOfType ==== ==== sysWorldGetNumBuildingsOfType ====
-^ Format | sysWorldGetNumBuildingsOfType( [BuildingType)|+^ Format | sysWorldGetNumBuildingsOfType( BuildingType )|
 ^ Description | Returns the number of buildings of this type currently existing within the world. Useful for when you want to script a system that limits the number of a particular type of building | ^ Description | Returns the number of buildings of this type currently existing within the world. Useful for when you want to script a system that limits the number of a particular type of building |
-^ Parameters | Type number of the building to check | 
 ^ Returns | Number of this type of building currently in the world | ^ Returns | Number of this type of building currently in the world |
 //Example//: <note> //Example//: <note>
Line 62: Line 63:
  
 ==== sysGetNearestPlayer ==== ==== sysGetNearestPlayer ====
-^ Format | sysGetNearestPlayer( [WorldX][WorldY)|+^ Format | sysGetNearestPlayer( WorldX, WorldY )|
 ^ Description | Returns the ID of the player closest to the specified world coordinate | ^ Description | Returns the ID of the player closest to the specified world coordinate |
-^ Parameters | World Coordinate X,Y | 
 ^ Returns | Player ID | ^ Returns | Player ID |
 //Example//: <note> //Example//: <note>
Line 86: Line 86:
  
 ==== sysActivateBuildingProximityEvent ====  ==== sysActivateBuildingProximityEvent ==== 
-==== sysActivateLocalProximityEvent ====  +''**sysActivateBuildingProximityEvent( buildingID, range )**'' - Activates a proximity trigger for the current player on the specified buildingID. \\ 
-==== sysActivateRangeEvent ==== +Used to trigger 4 different events:\\ 
 +Event( "BuildingIDProxEnter", "BuildingID" and if that doesnt exist..\\ 
 +Event( "BuildingProxEnter", "")\\ 
 +and the reverse..\\ 
 +Event( "BuildingIDProxLeave", "BuildingID" and if that doesnt  exist..\\ 
 +Event( "BuildingProxLeave", "")\\ 
 ==== sysDeactivateBuildingProximityEvent ====  ==== sysDeactivateBuildingProximityEvent ==== 
-==== sysDeactivateLocalProximityEvent ==== +''**sysDeactivateBuildingProximityEvent( buildingID )**'' 
 + 
 +==== sysActivateRangeEvent ====  
 +''**sysActivateRangeEvent( eventID, worldX, worldY, range )**'' - Activates a proximity trigger for the current player using a world coordinate. Atm, eventID is not used, only one range event can be active for the player at any one time. 
 +mm, atm seems to only triggers the event "RangeLeave" when a player leaves the range. curious. 
 ==== sysDeactivateRangeEvent ====  ==== sysDeactivateRangeEvent ==== 
  
 +==== sysIsInScriptZone ====
 +
 +''**sysIsInScriptZone( MapX, MapY, ZoneIDNum )**'' used to query if the specified map coord is within the specified 'ScriptZone'. Script zones are added via the F10 world editor.
 +
 +==== sysNumPlayersInBuildZone ==== 
 +==== sysNumPlayersInRCMode ==== 
 +==== sysNumPlayersInScriptZone ==== 
 +''**sysNumPlayersInScriptZone( ScriptZoneIDNum )**'' returns the number of players currently within the specified ScriptZone.
 +
 +\\
  
  
 +Not yet functional:
 +=== sysActivateLocalProximityEvent ===
 +=== sysDeactivateLocalProximityEvent ===
  
scripting/reference/system_functions/worldmapfunctions.1580301829.txt.gz · Last modified: 2020/01/29 06:43 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki