I’d like to know if has anyone that knows how to use correctly this command according to certain situations on scripting.
If has one tutorial, please give me a link.
The Accum command on scripting.
I too have been curious regarding the accum command. If I could use it properly, then my maps could have better quality. :o
tramdesign writes this: (http://www.planetwolfenstein.com/tramdesign/tutorials/tut_scriptdefs.html)
accum <buffer_index> <command> <paramater>
Accum is used for “what if” statements. Accums store integers which are used
to trigger scripts.
accum <n> inc <m>
This is used to “increase”/add to value already stored in the accum.
accum <n> abort_if_less_than <m>
This is used to abort the script if the value of accum <n> is less than <m>.
accum <n> abort_if_greater_than <m>
This is used to abort the script if the value of accum <n> is greater than <m>.
accum <n> abort_if_equal <m>
This is used to abort the script if accum <n> is equal to <m>.
accum <n> abort_if_not_equal <m>
This is used to abort the script if accum <n> is not equal to <m>.
accum <n> set <m>
This is used to set the value of accum <n> to <m>.
accum <n> bitset <m>
This will set accum n’s bitset of 0-31 to ON or 1, whichever you prefer.
accum <n> bitreset <m>
This will set accum n’s biteset of 0-31 to OFF or 0, whichever you prefer.
accum <n> abort_if_bitset <m>
This will abort if the bitset is ON or 1. So, the bitset needs to be OFF or 0.
accum <n> abort_if_not_bitset <m>
This will abort if the bitset is OFF or 0. So, the bitset needs to be ON or 1.
accum <n> random <m>
This is used so that accum <n> will randomly choose a number.
What are the certain situations? Accums are very easy to and fun to use once you understand the basics. Are you lacking the basics? Hope this helps a bit.
Every scriptblock has it’s own 10 accums (0-9) !!! So you have to keep the whole script in one scriptblock eg. the player scriptblock! 2 parts in using the accum.
- First part is you define the accum:
accum N set/inc M
N is the “name” of the accum (0-9). M is the value of the name (almost limitless). Then you can SET the value (m) into something you want, or you can INC -x or x (eg. count how many flags a team has captured).
- Use the accum you have defined:
accum N abort_function M
This part does the actual magic. You can for example here trigger a script after team has captured x amount of flags.
So an example. Team has 3 flags. how to trigger something once the team has captured every flag. Trigger the following trigger once a flag is captured. Once this trigger is triggered 3 times, the yay_3_flags_captured is triggered.
trigger flag_check
{
accum 0 inc 1 //A flag is captured, ANY of the 3 flags
accum 0 abort_if_less_than 3 //Abort the script if less than 3 flags are captured
trigger player yay_3_flags_captured
}
(Tip. if you are not very good at accums, forget bitset/bitreset for a while, you probably won’t need it unless you make something really complex, like plane script )
Now once you get the hang of this, you can do a lot more things with your scripts.