Page 1 of 1

Fix for crash with triggered tiles in long levels

Posted: 12 Dec 2014, 03:47
by TurretBot
The error was being given from some variable that should exist but doesn't, so I just commented out that part of the code
I suppose that code was there for a reason so tell me if anything behaves weirdly

Download
Or if you prefer to do it yourself: Replace line 98, in animatedquad.lua with "if self.triggered and x and y and animatedtimers[x] and animatedtimers[x][y] then"

HugoBDesigner wrote:After a lot of investigation, I found out that, for some reason, it is trying to get an item of the table that doesn't really exists, so here's a quick fix:

if self.triggered and x and y and animatedtimers[x] and animatedtimers[x][y] then

Replace line 98 by this. It keeps the properties, but still needs testing though (even though it most likely fixes the bug as a whole).
For the lazy ones:

https://www.dropbox.com/s/f13hpan12ukvg ... d.lua?dl=0

Re: Fix for crash with triggered tiles in long levels

Posted: 12 Dec 2014, 04:13
by FuriousTH
TurretBot wrote:The error was being given from some variable that should exist but doesn't, so I just commented out that part of the code
I suppose that code was there for a reason so tell me if anything behaves weirdly

Download
Or if you prefer to do it yourself: comment out lines 98, 99, 100, and mm102 in animatedquad.lua
this lua is for
mari0 SE or alesan entities?

Re: Fix for crash with triggered tiles in long levels

Posted: 12 Dec 2014, 04:16
by TurretBot
Mari0: SE

Re: Fix for crash with triggered tiles in long levels

Posted: 12 Dec 2014, 06:10
by FuriousTH
TurretBot wrote:Mari0: SE
ok
thanks

Re: Fix for crash with triggered tiles in long levels

Posted: 14 Dec 2014, 19:59
by HansAgain
Thanks Turret, but i have found an inconvenient situation caused by your fix:
Image
Now the properties related portals doesn't change (just follow the first frame's property).
So, since the first frame of this animated tile isn't solid, when activated is solid but portals can pass throught it.

Re: Fix for crash with triggered tiles in long levels

Posted: 15 Dec 2014, 03:23
by HugoBDesigner
Turret, if you're gonna post a fix, make sure it fixes stuff.
Hans requested me to fix it. After a lot of investigation, I found out that, for some reason, it is trying to get an item of the table that doesn't really exists, so here's a quick fix:

if self.triggered and x and y and animatedtimers[x] and animatedtimers[x][y] then

Replace line 98 by this. It keeps the properties, but still needs testing though (even though it most likely fixes the bug as a whole).
For the lazy ones:

https://www.dropbox.com/s/f13hpan12ukvg ... d.lua?dl=0

Edit: No line should be commented. By the way, commenting doesn't fix anything; it just "masks" the error.

Re: Fix for crash with triggered tiles in long levels

Posted: 15 Dec 2014, 17:33
by TurretBot
HugoBDesigner wrote:Turret, if you're gonna post a fix, make sure it fixes stuff.
Well, it did fix it. Did it crash using my fix? No.
It's a fix, and it fixes things. It created a new problem as well. I didn't even expect what I did to work, but it did.
HugoBDesigner wrote:Hans requested me to fix it.
Wow, what a coincidence! He asked me as well!
And I would have asked you too, but I assumed you wouldn't know about SE from when I asked you about linking, so I didn't.
In fact, I assumed nobody on this forum could help with this. I'm the only one modding SE iirc.
HugoBDesigner wrote:Edit: No line should be commented. By the way, commenting doesn't fix anything; it just "masks" the error.
Yeah, I knew commenting it out wasn't the actual solution.
I knew more about the crash than I said because of what I said earlier: Even if I did say everything, I'm the only modder of SE. Nobody would know what to do anyway.
For example I knew the nil value was animatedtimers[x][y]. I don't know how to fix it, or why it's nil in the first place. I know it was that one specifically from getting rid of each variable individually, but again I didn't (and still don't) know anything about that variable so this knowledge was useless.

Well, that was my train of though at the time, from now on I'll just ask you.

Re: Fix for crash with triggered tiles in long levels

Posted: 15 Dec 2014, 20:19
by HansAgain
Thanks, Hugo! The fix works alright.
But i think you shouldn't have been so harsh to Turret about it.
I know what he did wasn't really a fix, but at least it prevented the crash and make animated tiles work (but completely, but something is something).

Also, Turret, not because you're the only one modding SE, you're the only who knows how to fix it.

Re: Fix for crash with triggered tiles in long levels

Posted: 15 Dec 2014, 20:57
by HugoBDesigner
I'm sorry if it sounded like I was being harsh, it wasn't my intention. Also, I was not saying Turret's mod didn't work, it just didn't fix the problem. But anyway, it worked and I'm okay with that. Again, not trying to be harsh here, sorry...

Also, Turret, I'm pretty sure most modders here could mod SE since it's not SOOOO different from 1.6. Also, I never modded SE but I just needed to read a bit of it's code to understand. Plus, I'm pretty sure Alesan knows very well SE (since he was doing the enemies thing). Either way, just letting you know that if you need some help you can ask me :)

Re: Fix for crash with triggered tiles in long levels

Posted: 16 Dec 2014, 22:34
by TurretBot
Probable fix to this similar bug: http://i.imgur.com/2qFdPpL.png
Change the line in question (animatedtiletrigger.lua line 64) to this:

Code: Select all

			if animatedtimers[x] and animatedtimers[x][y] then
too lazy to make a download sorry

Re: Fix for crash with triggered tiles in long levels

Posted: 16 Dec 2014, 23:32
by Wary
Don't forget that I LOVE LUA already made a SE mod.