diff --git a/config/defaults.cfg b/config/defaults.cfg index 0e37c245..02e3a790 100644 --- a/config/defaults.cfg +++ b/config/defaults.cfg @@ -37,4 +37,6 @@ if (! (checkalias ofc_gamma_list)) [ loop ogl (listlen $defaultmaps) [ add2list ofc_gamma_list $gamma ] -] \ No newline at end of file +] + +if (! (checkalias dyngamma)) [ dyngamma = 0 ] \ No newline at end of file diff --git a/config/docs.cfg b/config/docs.cfg index c0c38a95..f63cbf4b 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -132,6 +132,9 @@ docident [result] [sets the result value of a CubeScript block]; docargument [R] [the result] [] [0]; docident [rnd] [Random value]; docargument [A] [The upper limit of the random value] [] [0]; +docident [rrnd] [Ranged random value]; +docargument [A] [the lowest value to return] [] [0]; +docargument [B] [the upper limit of the random value] [] [0]; docident [sleep] [Executes a command after specified time period.]; docargument [N] [the amount of milliseconds] [] [0]; docargument [C] [the command to execute] [] [0]; @@ -861,6 +864,11 @@ docident [wpsave] []; docident [wpvisible] []; docargument [V] [visible] [0||1] [0]; docident [checkmapdependencies] [Find what media the map depends on, this is used for mediapack providers.]; +docident [genhex] [Randomly generates a valid hexadecimal color value.]; +docexample [fogcolour (genhex)] [Example output: Trying hexadecimal color: 0x2FCAF1]; +docident [genwc] [Randomly generates a valid watercolour value.]; +docremark [You must be in edit-mode for this command to function.]; +docexample [genwc] [Example output: Trying water color: 2 17 29]; docsection [Menus] docident [chmenumdl] [Changes the menu model of a specified menu.]; docargument [N] [the name of the menu] [] [0]; @@ -1434,8 +1442,6 @@ docargument [N] [The fog distance] [64...1024, default is 180] [0]; docremark [You can do this for tweaking the visual effect of the fog, or if you are on a slow machine, setting the fog to a low value can also be a very effective way to increase fps (if you are geometry limited). Try out different values on big maps / maps which give you low fps. It is also good for aesthetic features of maps especially when combined with "fogcolour".]; docident [fogcolour] [Sets the fog and clearing colour.]; docargument [C] [The colour] [Hexadecimal colour, default is 0x8099B3] [0]; -docident [genhex] [Randomly generates a valid hexadecimal color value.]; -docexample [fogcolour (genhex)] [Example output: Trying hexadecimal color: 0x2FCAF1]; docident [isolatecontext] [Isolates the given context. This disables access from this context to identifiers located in other contexts, also it removes all aliases created in this context once the running context changes]; docargument [C] [the context] [] [0]; docident [loadnotexture] [Binds a texture to be used if a slot couldn't be loaded with a given textures path.]; diff --git a/config/scripts.cfg b/config/scripts.cfg index 1365064d..42dd4d18 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -262,6 +262,9 @@ addOnQuit = [ add2alias onQuit $arg1 ] // add2list - Quickly append an element to a list without add2alias'es ";" add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ] +// rrnd - Returns a ranged rangom integer. +rrnd = [ + (rnd (- $arg2 $arg1)) $arg1 ] + // copyent & pasteent - Quickly copy/paste the current closest entity. ent_type = none @@ -300,6 +303,18 @@ genhex = [ result $tmp_hex ] +// genwc - Randomly generates a valid watercolour value (e.g. 2 17 29) - useful for finding watercolours. +genwc = [ + if $editing [ + tmp_wc = "" + loop gwl 3 [ + add2list tmp_wc (rrnd 1 256) + ] + echo (c 3)Trying water color: (c 5) $tmp_wc + watercolour (at $tmp_wc 0) (at $tmp_wc 1) (at $tmp_wc 2) + ] +] + // megabind - Binds a key to many different actions depending on the current game state. megabind = [ if (= $numargs 6) [ diff --git a/docs/reference.xml b/docs/reference.xml index e58bdbc4..c81ef853 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -341,6 +341,15 @@ + + + Ranged random value + + + + + + Determines if two strings are equal. @@ -3396,6 +3405,37 @@ Output: Find what media the map depends on, this is used for mediapack providers. + + + Randomly generates a valid hexadecimal color value. + + + + Example output: Trying hexadecimal color: 0x2FCAF1 + + + + + + + + + + Randomly generates a valid watercolour value. + + + + Example output: Trying water color: 2 17 29 + + + + You must be in edit-mode for this command to function. + + + + + + @@ -5459,20 +5499,6 @@ Output: - - - Randomly generates a valid hexadecimal color value. - - - - Example output: Trying hexadecimal color: 0x2FCAF1 - - - - - - - Binds a texture to be used if a slot couldn't be loaded with a given textures path.