I haven’t gotten to experiment with the new features, so any examples, common instances, qol, or clarifications that I could use with subroutines?
1 Like
I dont have an example for you, but subroutines are used whenever you have the same type of code in multiple rules. E.g. you have a for-loop that changes each element in an array in some way and you have this loop in 3 different rules.
You can then put this loop into a subroutine and call the subroutine in each of the rules instead, wich saves coding time and code size.
Of course, sometimes you want to do stuff a little different in each of the rules. But as the “event player” gets carried over to the subroutine, you can simply store some data in a player variable just before you call the subroutine, wich makes the subrouztine behave differently.