scripting:reference:system_functions:worldmapfunctions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:reference:system_functions:worldmapfunctions [2020/01/29 06:24] – mit | scripting: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 (' | ||
+ | - 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 | | ||
// | // | ||
Line 16: | Line 19: | ||
</ | </ | ||
==== 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 ' | //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 ' | ||
+ | |||
==== 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( | + | ^ 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 | | ||
// | // | ||
Line 60: | Line 61: | ||
==== sysGetNearestForest ==== | ==== sysGetNearestForest ==== | ||
+ | |||
+ | ==== sysGetNearestPlayer ==== | ||
+ | ^ Format | sysGetNearestPlayer( WorldX, WorldY )| | ||
+ | ^ Description | Returns the ID of the player closest to the specified world coordinate | | ||
+ | ^ Returns | Player ID | | ||
+ | // | ||
+ | < | ||
+ | $kSpecialBuildingRecordNum = 10 | ||
+ | |||
+ | Event( " | ||
+ | { | ||
+ | SetBuildingContext( $kSpecialBuildingRecordNum ) | ||
+ | $posX = $gBuildingWorldX | ||
+ | $posY = $gBuildingWorldY | ||
+ | | ||
+ | $targetPlayerID = sysGetNearestPlayer( $posX, $posY ) | ||
+ | $targetPlayerName = sysGetPlayerName( $targetPlayerID ) | ||
+ | *say %PLAYER% used the plunger. The person closest to the special building was $targetPlayerName | ||
+ | *explodebuilding $kSpecialBuildingRecordNum | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | |||
==== sysActivateBuildingProximityEvent ==== | ==== sysActivateBuildingProximityEvent ==== | ||
- | ==== sysActivateLocalProximityEvent ==== | + | '' |
- | ==== sysActivateRangeEvent ==== | + | Used to trigger 4 different events:\\ |
+ | Event( " | ||
+ | Event( " | ||
+ | and the reverse..\\ | ||
+ | Event( " | ||
+ | Event( " | ||
==== sysDeactivateBuildingProximityEvent ==== | ==== sysDeactivateBuildingProximityEvent ==== | ||
- | ==== sysDeactivateLocalProximityEvent | + | '' |
+ | |||
+ | ==== sysActivateRangeEvent | ||
+ | '' | ||
+ | mm, atm seems to only triggers the event " | ||
==== sysDeactivateRangeEvent ==== | ==== sysDeactivateRangeEvent ==== | ||
+ | ==== sysIsInScriptZone ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | ==== sysNumPlayersInBuildZone ==== | ||
+ | ==== sysNumPlayersInRCMode ==== | ||
+ | ==== sysNumPlayersInScriptZone ==== | ||
+ | '' | ||
+ | |||
+ | \\ | ||
+ | Not yet functional: | ||
+ | === sysActivateLocalProximityEvent === | ||
+ | === sysDeactivateLocalProximityEvent === | ||
scripting/reference/system_functions/worldmapfunctions.1580300658.txt.gz · Last modified: 2020/01/29 06:24 by mit