Topic: lua: if statement do not work
kaputtnik Topic Opener |
Posted at: 2018-01-09, 16:45
I want to check if a field has an immovable and if it has one, the loop has to break. This example do not work:
I put a print statements before the
What is the difference? Why does the first example do not work? In the first example i have also tried to enclose the if-condition in braces, but this does not work also... it drives me crazy Edited: 2018-01-09, 16:48
Fight simulator for Widelands: |
SirVer |
Posted at: 2018-01-09, 18:55
Both examples should work just fine. I am skeptical if this is indeed the full code. For example, if Can you make the full code available somewhere for investigation? Top Quote |
kaputtnik Topic Opener |
Posted at: 2018-01-09, 20:28
You can find a scenario map here: https://c.1und1.de/@520176427140645159/g-IjyQ6VRx2p-QeiQXSmvw The function showing the problem is in scripting/story_script and is called wobble_field() Thanks for looking into this issue Fight simulator for Widelands: |
hessenfarmer |
Posted at: 2018-01-10, 12:38
Perhaps the problem might be that it should read f.immovable instead of f.immmovable like in your script. BTW: Really looking foraward for the scenario sounds funny and remembers me of something hihihihi. gngngngngn hahahahah Edited by kaputtnik: Make this post visible Edited: 2018-01-10, 15:29
Top Quote |
hessenfarmer |
Posted at: 2018-01-10, 12:39
Since when the comments have to be moderated? I just sent a comment explaining the issue and used some funny strings could this be the problem? Edited: 2018-01-10, 12:40
Top Quote |
hessenfarmer |
Posted at: 2018-01-10, 12:42
Okay then again the solution for you kaputtnik without any sense of humour. the error might be just a typo just remove one "m" from immmovable. Really looking forward to the scenario though Edited: 2018-01-10, 12:47
Top Quote |
kaputtnik Topic Opener |
Posted at: 2018-01-10, 15:29
Sometimes they have to ...
No, the problem was quoting my post, which triggered our spam checker to hide the post. Sorry for inconvenience Fight simulator for Widelands: |
kaputtnik Topic Opener |
Posted at: 2018-01-10, 15:45
Oh... i didn't saw that, really... and strange that no error was triggered... Many thanks for clearing this up I think i have to set a bigger font size in my editor... These kind of failures could make one spend hours to find the failure, at least me May i need your help with this scenario, i have some ideas but i am not sure if they could be implemented. But i see creating a scenario is a huge work, and i have big respect regarding your work on the empire 4 scenario! Fight simulator for Widelands: |
hessenfarmer |
Posted at: 2018-01-10, 21:47
you are welcome If I could help I will do so, although I have already some ideas for Empire 05 Top Quote |
GunChleoc |
Posted at: 2018-01-17, 13:56
The reason that this will not crash that Lua interprets Busy indexing nil values Top Quote |