genwc (watercolour), rrnd (ranged random int), docs/fixes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6211 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-04-04 00:54:45 +00:00
parent 1b2d99c93c
commit a10dd9f097
4 changed files with 66 additions and 17 deletions
+3 -1
View File
@@ -37,4 +37,6 @@ if (! (checkalias ofc_gamma_list)) [
loop ogl (listlen $defaultmaps) [
add2list ofc_gamma_list $gamma
]
]
]
if (! (checkalias dyngamma)) [ dyngamma = 0 ]
+8 -2
View File
@@ -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.];
+15
View File
@@ -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) [
+40 -14
View File
@@ -341,6 +341,15 @@
</arguments>
<return token="R" description="The random value" valueNotes="larger or equal 0 and smaller than A"/>
</command>
<command name="rrnd">
<description>Ranged random value</description>
<arguments>
<argument token="A" description="the lowest value to return" valueNotes=""/>
<argument token="B" description="the upper limit of the random value" valueNotes=""/>
</arguments>
<return token="R" description="The random value" valueNotes="larger or equal to A and smaller than B"/>
</command>
<command name="strcmp">
<description>Determines if two strings are equal.</description>
@@ -3396,6 +3405,37 @@ Output:
<command name="checkmapdependencies">
<description>Find what media the map depends on, this is used for mediapack providers.</description>
</command>
<command name="genhex">
<description>Randomly generates a valid hexadecimal color value.</description>
<examples>
<example>
<code><![CDATA[fogcolour (genhex)]]></code>
<explanation>Example output: Trying hexadecimal color: 0x2FCAF1</explanation>
</example>
</examples>
<references>
<identifierReference identifier="fog"/>
<identifierReference identifier="fogcolour"/>
</references>
</command>
<command name="genwc">
<description>Randomly generates a valid watercolour value.</description>
<examples>
<example>
<code><![CDATA[genwc]]></code>
<explanation>Example output: Trying water color: 2 17 29</explanation>
</example>
</examples>
<remarks>
<remark>You must be in edit-mode for this command to function.</remark>
</remarks>
<references>
<identifierReference identifier="genhex"/>
<identifierReference identifier="watercolour"/>
</references>
</command>
</identifiers>
</section>
@@ -5459,20 +5499,6 @@ Output:
<argument token="C" description="The colour" valueNotes="Hexadecimal colour, default is 0x8099B3"/>
</arguments>
</command>
<command name="genhex">
<description>Randomly generates a valid hexadecimal color value.</description>
<examples>
<example>
<code><![CDATA[fogcolour (genhex)]]></code>
<explanation>Example output: Trying hexadecimal color: 0x2FCAF1</explanation>
</example>
</examples>
<references>
<identifierReference identifier="fog"/>
<identifierReference identifier="fogcolour"/>
</references>
</command>
<command name="loadnotexture">
<description>Binds a texture to be used if a slot couldn't be loaded with a given textures path.</description>