scripting:reference:system_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:reference:system_functions [2020/01/29 04:43] – mit | scripting:reference:system_functions [2020/02/17 19:10] (current) – mit | ||
---|---|---|---|
Line 14: | Line 14: | ||
[[Scripting: | [[Scripting: | ||
[[Scripting: | [[Scripting: | ||
+ | [[Scripting: | ||
+ | [[Scripting: | ||
[[Scripting: | [[Scripting: | ||
+ | For a full(ish) alphabetical list of script functions : [[Scripting: | ||
+ | [[Scripting: | ||
+ | [[Scripting: | ||
+ | [[Scripting: | ||
+ | Add items and wealth to the player \\ | ||
+ | [[Scripting: | ||
+ | [[Scripting: | ||
+ | [[Scripting: | ||
+ | For construction of buildings and other permanent or transient items on the world \\ | ||
+ | [[Scripting: | ||
+ | System for creating and controlling subgames which groups of players can participate in \\ | ||
+ | [[Scripting: | ||
+ | Querying and controlling the ownership status of buildings \\ | ||
+ | [[Scripting: | ||
+ | Info about towns and functions to modify the status of town buildings \\ | ||
+ | [[Scripting: | ||
+ | Maths functions such as rand, sin, cos etc \\ | ||
+ | [[Scripting: | ||
+ | System for creating ' | ||
+ | [[Scripting: | ||
+ | General other uncategorised bits | ||
- | ===== Battle game Functions ===== | ||
- | ==== BattleSetPreludeTime ==== | ||
- | |||
- | ==== BattleSetNumRounds ==== | ||
- | |||
- | ==== BattleSetRoundTime ==== | ||
- | |||
- | ==== BattleSetRoundScore ==== | ||
- | |||
- | ==== BattleSendChallenge ==== | ||
- | |||
- | |||
- | ===== Maths Functions ===== | ||
- | |||
- | ==== sysRand ==== | ||
- | ^ Format | sysRand ( [MAX_NUM] )| | ||
- | ^ Description | Returns a random number between 1 and the value specified | | ||
- | ^ Example | '' | ||
- | |||
- | ==== sysSin ==== | ||
- | ^ Format | sysSin ( [ANGLE], [SCALE] )| | ||
- | ^ Description | Returns a sine value| | ||
- | ^ Parameters | Angle - 0 to 360 degrees | | ||
- | ^ | Scale - Scale applied to the result from the sine function (which normally returns a value from -1 to 1 | | ||
- | ^ Returns | Scaled sine value | | ||
- | // | ||
- | < | ||
- | { | ||
- | $angle = 0 | ||
- | while ( $angle < 360 ) | ||
- | { | ||
- | $posX = sysSin( $angle, 100 ) | ||
- | $posY = sysCos( $angle, 100 ) | ||
- | $posX += $gPlayerWorldX | ||
- | $posY += $gPlayerWorldY | ||
- | *addtree 1, | ||
- | $angle += 36 | ||
- | } | ||
- | } | ||
- | </ | ||
- | </ | ||
- | |||
- | ==== sysCos ==== | ||
- | ^ Format | sysCos ( [ANGLE], [SCALE] )| | ||
- | ^ Description | Returns a cosine value| | ||
- | ^ Parameters | Angle - 0 to 360 degrees | | ||
- | ^ | Scale - Scale applied to the result from the cosine function (which normally returns a value from -1 to 1 | | ||
- | ^ Returns | Scaled cosine value | | ||
- | // | ||
- | \\ | ||
- | |||
- | ==== sysGetDist ==== | ||
- | ^ Format | sysGetDist ( [X1], [Y1], [X2], [Y2] )| | ||
- | ^ Description | Calculates the distance between two points| | ||
- | ^ Parameters | Point 1 X,Y | | ||
- | ^ | Point 2 X,Y | | ||
- | ^ Returns | Distance | | ||
- | // | ||
- | < | ||
- | { | ||
- | $dist = sysGetDist( $gPlayerWorldX, | ||
- | *msg %PLAYER% You accessed the building from $dist cm away | ||
- | } | ||
- | </ | ||
- | </ | ||
- | |||
- | ===== Misc other functions ===== | ||
- | |||
- | ==== sysRealTime ==== | ||
- | ^ Format | sysRealTime ( [Type] )| | ||
- | ^ Description | Returns details of the current real time (according to the server clock)| | ||
- | ^ Parameters | Type field specifying the date or time to fetch | | ||
- | ^ Returns | Depending on the type field: | | ||
- | ^ | **Year** - returns the current year (e.g. 2014) | | ||
- | ^ | **Month** - returns the current month number (1 to 12) | | ||
- | ^ | **Day** - returns the current day number (1 to 31) | | ||
- | ^ | **Hour** - returns the current hour (0 to 23) | | ||
- | ^ | **Minute** - returns the current minute (0 to 59) | | ||
- | ^ | **Second** - returns the current second (0 to 59) | | ||
- | ^ | **UnixTime** - number of seconds passed since 1st Jan, 1970 | | ||
- | // | ||
- | < | ||
- | { | ||
- | $hour = sysRealTime( " | ||
- | if ( $hour < 18 ) | ||
- | { | ||
- | *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm) | ||
- | } | ||
- | else if ( $hour >= 20 ) | ||
- | { | ||
- | *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm) | ||
- | } | ||
- | else | ||
- | { | ||
- | *notifylarge %PLAYER% Tea-time! | ||
- | } | ||
- | } | ||
- | </ | ||
- | </ | ||
- | |||
- | ==== sysRaceIsActive ==== | ||
- | TBD \\ | ||
- | \\ |
scripting/reference/system_functions.1580294586.txt.gz · Last modified: 2020/01/29 04:43 by mit