A Lua coded drone in the game From the Depths (FTD) with no attitude control that seeks out enemies while tumbling through the air.
If you want to skip the maths and the ideas the coding starts at 5:12. Though the background is useful for understanding what the hell is going on ;)
This video assumes that you already have some knowledge of Lua or programming knowledge.
In this video, the basic shell of the code is created. The final version has PID control and greatly increased functionality.
Part 2: https://www.youtube.com/watch?v=OP3DBQRjASs&feature=youtu.be
Steam workshop link:
https://steamcommunity.com/sharedfiles/filedetails/?id=2274369558
Code:
https://github.com/MathFWizardry/TT/blob/main/Tumbling_code
Fun fact: Lua means moon in Portuguese.
0:00 But what does it do?
0:55 The plan and what you need to know to use it
1:47 The fundamental mathematical idea of the code
4:43 Essential first goal of the code
5:12 Coding 1: Initialising variables in a multidimensional array
6:54 Coding 2: Sorting the thrusters/assigning valid values to the array
9:50 Coding 3: Assigning power to thrusters
11:30 Coding 4: Calling the functions and final tweaks
13:41 Success
