# The Dromesday Book

### Site Tools

public_scripts:trapmissionqvar

# Differences

This shows you the differences between two versions of the page.

 public_scripts:trapmissionqvar [2009/04/10 18:49]127.0.0.1 external edit public_scripts:trapmissionqvar [2010/11/23 00:06] (current) 2009/08/10 23:49 telliamed op table2009/04/10 18:49 external edit Next revision Previous revision 2009/08/10 23:49 telliamed op table2009/04/10 18:49 external edit Line 1: Line 1: ====== TrapMissionQVar ====== ====== TrapMissionQVar ====== - Trap for setting a quest variable for a single mission. + Trap for setting a quest variable for a single mission. ​The ``[[dromed:​property:​TrapQVar|Trap->​Quest Var]]`` property describes the name and how to change the variable value. The first character is an operator. Immediately following the operator is a numerical argument, which may be negative. After the number is a colon ("'':''"​) then the name of the quest variable. There should not be any spaces between the parts of the property. When turned on, the trap will modify the quest variable using the operator and argument. A complementary operation is done when the trap is turned off. + + ^ Op ^ On Result ^ Off Result ^ + | ''​=''​ | Set the variable to the number. ​ | Set the variable to 0.  | + | ''​+''​ | Add the number to the variable. ​ | Subtract the number from the variable. ​ | + | ''​*''​ | Multiply the variable by the number. ​ | Divide the variable by the number. ​ | + | ''/''​ | Divide the variable by the number, rounding towards 0.  | Multiply the variable by the number. ​ | + | ''​%''​ | Set the variable to the remainder of the variable divided by the number. ​ | Multiply the variable by the number. ​ | + | ''​!''​ or ''​%%|%%''​ | Set the bits in the variable thar are set in the number. ​ | Clear the bits in the variable that are set in the number. ​ | + | ''​{''​ | Shift the bits in the variable left by the number of bits.  | Shift the bits in the variable to the right. ​ | + | ''​}''​ | Shift the bits in the variable right by the number of bits.  | Shift the bits in the variable to the left.  | + | ''​%%"​%%''​ | Multiply the variable by 10, then add the "​ones"​ digit of the number. ​ | Divide the variable by 10.  | + | ''#''​ | Like ''​%%"​%%'',​ but the variable will never be more than 4 digits long.  | Same as above. ​ | + | ''?''​ | Add a random value between 0 and the number, inclusive. ​ | Subtract a random number. ​ | + | ''​d''​ | Add a random value between 1 and the number. ​ | Subtract a random number. ​ | ^Inherits | [[traps|BaseTrap]],​ BaseQuestVariable ​ | ^Inherits | [[traps|BaseTrap]],​ BaseQuestVariable ​ | ^Properties | ``[[dromed:​property:​TrapQVar|Trap\Quest Var]]``, ``[[dromed:​property:​QBName|Script\QB Name]]`` ​ | ^Properties | ``[[dromed:​property:​TrapQVar|Trap\Quest Var]]``, ``[[dromed:​property:​QBName|Script\QB Name]]`` ​ | - ^Parameters | \$\$initqv\$\$ //​(integer)// ​ | Set the quest variable when the mission starts. ​ | + ^Parameters | \$\$initqv\$\$ //​(integer)// ​ | Set the quest variable ​to this value when the mission starts. ​ | - ~~DISCUSSION~~
public_scripts/trapmissionqvar.1239389356.txt.gz · Last modified: 2009/08/10 23:49 (external edit)