Editing Expressions

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
You can use expressions as input parameter to reduce the amount of logic entities used. Expressions in input parameter start with $$=
You can use expressions as input parameter to reduce the amount of logic entities used. Expressions in input parameter start with $$=


For example, using this as input parameter: $$='Health: ('..!activator.m_iHealth..'/'..!activator.m_iMaxHealth..')' will set health information as input parameter.
For example, using this as input parameter: $$='Health: ('..!activator.m_iHealth..'/'..!activator.m_iMaxHealth..')' will set health information as input parameter


Expressions are calculated during input execution.
Expressions are calculated during input execution .


Do not put double quote (i.e. " ) inside expression, but you are allowed to use commas (i.e. , ).
Do not put double quote " inside expression, but you are allowed to use comma , .


As an admin, sig_expression "expression" command in console can be used to test expressions. (i.e: sig_expression "2+2" echoes Result: 4)
As an admin, sig_expression_test "expression" command can be used to test expressions. Example: sig_expression_test "2+2"


== Syntax ==
== Syntax ==
Line 78: Line 78:
Values are automatically converted when types of left and right sides of operators differ.
Values are automatically converted when types of left and right sides of operators differ.


For example, [1 4 5] + 4 will automatically convert 4 to [4 4 4] vector.
For example, [1 4 5] + 4 will automatically convert 4 to [4 4 4] vector


\' escapes single quotes inside literal string.
\' escapes single quotes inside literal string


== Functions ==
== Functions ==
Line 105: Line 105:


=== Entity ===
=== Entity ===
<syntaxhighlight lang="c">
<syntaxhighlight>
playeratindex( index )
playeratindex( index )
entityindex( entity )
entityindex( entity )
playeritematslot( entity, slot )
playeritematslot( entity, slot )
attribute( player or item, 'attribute name' ) // attribute name must be in single quotes
attribute( player or item, attribute name )
</syntaxhighlight>
</syntaxhighlight>


Please note that all contributions to SigMod are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see SigMod:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)