Quote from: Crimson Wizard on Fri 06/12/2024 09:56:07Make sure you are using the new v4 script compiler. There's a Script compiler selection in General Settings -> Compiler.
That was the solution, thank you very much! And now I can just call Character.Energy, what a superbly useful feature this is!
Quote from: Snarky on Fri 06/12/2024 10:41:17Does this example have anything to do with the (very cool) lightning arc effect?
I did this one with a for loop, but was planning on writing another effect today which is a little more difficult for me to conceptualise because I'm not very good at planning things around modular arithmetic. Though I was very grateful earlier today when I was setting sprites in a loop based on a calculation and found that AGS supports the % remainder operator. But I figured I should investigate what other options there are before I start trying to build the effect!
I have heard of recursion in code but knew absolutely nothing about it, that's fascinating! This in particular sounds incredibly empowering:
"it would check the distance and decide whether to split it up into sections, calling itself to generate each section, until the sections are short enough to just draw a line"
Time for me to do some more study. I am learning so much lately.
Quote from: Crimson Wizard on Fri 06/12/2024 10:47:50Note that with the linked list you do not have to do recursion, you may do a classic loop over linked list; pseudo-code:
This is a new concept to me, and it seems very useful. Thank you!