daid / EmptyEpsilon

Open source bridge simulator. Build with the SeriousProton engine.
https://daid.github.io/EmptyEpsilon/
GNU General Public License v2.0
529 stars 180 forks source link

Borderline Fever scenario error: attempt to call a number value (local '_') #2015

Open Xansta opened 1 year ago

Xansta commented 1 year ago

Borderline Fever gives this error: attempt to call a number value (local '_'), which comes from line 16449

Reported to me on Discord. This is a fallout from adding translation functions to the scenario. In many places, I used underscore as a looping index variable since that's the Lua convention (see this post). However, the translation function is the underscore and this conflicts with this "throw away" variable. I noticed this in other scenario scripts where translation was added. I've started getting rid of the underscore as a "throw away" variable and have gone back to using i as a somewhat generic variable for loops. I understand that integrated development environments (IDEs) warn against unused variables. Using i will trip this warning multiple times. Anyone editing this code in one of these IDEs will get these warnings. They will just have to be aware and ignore those warnings.

I have updated Borderline Fever in my EEScenarios github repository. I have not created a pull request here yet because I don't want to overwhelm the reviewers here with more than one scenario script change at a time.

TemporalClepsydra commented 1 year ago

the same error occurs in the planet devourer. it is an easy fix, just replace for _, x in xyz with for __ in xyz or something similar

Xansta commented 1 year ago

Devourer updated in my scenario repository @TemporalClepsydra