I hate to nitpick on details, but you're a good scripter, and you deserve to get better.
And this applies to every scripter, not just you. I'm just using your script as an example.
I'm just going to give cleanup tips for future reference.
- Every 'begin' command in that script is unnecessary. (begin) is only needed if you need more than one command to execute within
one argument of an (if) check. In the script, there's only one command under each 'begin' call. They can safely be removed.
If you ever find yourself placing 'begin' and then sticking only one command under it, then you'll know you can get rid of the 'begin'.
And for other scripters, if your 'begin' is anywhere outside a command, it is most likely completely unnecessary, i.e.:
(script continuous example
(begin
(set useless_begins 1)
)
)
- This is something that even some of the best scripters do. Every time they refer to the player, they
always put
(unit (list_get (players) #)
).
The 'unit' around the 'list_get' command is only needed if the argument for that command is 'unit'. If the argument is 'object', then you can refer to the player just with (list_get (players) #), because list_get returns an object. 'unit' just converts an object to a unit.
The same goes for any reference using (ai_actors). Only wrap it with (unit) if the argument there is 'unit'.
I put in bold everything that can be removed.
(global boolean plyrnum 0)
(script continuous loop
(if
(= plyrnum 15)
(begin
(set plyrnum 0)
)
(begin
(set plyrnum (+ plyrnum 1))
)
)
)
(script continuous copy_n_paste_1
(if
(volume_test_object [TRIGGER VOLUME] (unit (list_Get (players) plyrnum)))
(begin
(damage_object [DAMAGE EFFECT] (unit (list_Get (players) Plyrnum)))
)
)
)