Page 1 of 1

Need help with updating gadgethandler

Posted: 01 Apr 2016, 10:17
by Forboding Angel
Using this branch:

https://github.com/EvolutionRTS/Evolution-RTS/tree/101

The issue is that I have implemented the custom unit shader. Everything works initially, but when a unit dies, so does the gadget handler.

E.G.:

Code: Select all

[f=0002028] Error: LuaRules::RunCallIn: error = 2, RenderUnitDestroyed, [Internal Lua error: Call failure] [string "LuaRules/gadgets.lua"]:523: attempt to call upvalue 'selffunc' (a nil value)
stack traceback:
	[string "LuaRules/gadgets.lua"]:523: in function <[string "LuaRules/gadgets.lua"]:522>
Additionally, when a unit cloaks and then decloaks, they lose their normalmap.

I've been at this for days trying to fix it. Hoko tells me that my gadget handler is out of date, but updating with the one in base (102-rc1) just makes matters worse.

Need some help mere because in the past few days I have exhausted my knowledge of what might be going on.

Re: Need help with updating gadgethandler

Posted: 03 Apr 2016, 07:18
by Google_Frog
Your problem is with RenderUnitDestroyed. I do not know whether that function is defined in 101.0 so that is the first thing you should figure out. Perhaps you need to replace them with UnitDestroyed.

Also, here is a bug in the so most official version of custom unit shaders. UnitDestroyed is not defined because it was replaced with RenderUnitDestroyed.

Re: Need help with updating gadgethandler

Posted: 03 Apr 2016, 13:00
by hokomoko
probably just adding RenderUnitDestroyed to the gadgethandler should solve the issues.

Re: Need help with updating gadgethandler

Posted: 03 Apr 2016, 23:07
by Forboding Angel
Ok so after doing a diff on the gadget handlers and going through 1000+ lines, I concluded that as far as I could see there is no reason why the new gadget handler could not be modified so that it would work perfectly.

Turns out is was even easier than that, I just needed to include utilities and declare SCRIPT_DIR.

I had tried this before but it failed on script_dir and I couldn't figure out why, due to the fact that script dir was already in vfs include. Apparently it has to be declared beforehand so vfs knows wtf is going on. It makes sense now that I see it, but before I was somewhat mystified.

Ok, so EVERYTHING is good now, except when units cloak, when they uncloak, they have lost their normalmap.

Do I need to start a new thread on this?