Need help with updating gadgethandler

Need help with updating gadgethandler

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Need help with updating gadgethandler

Post 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.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Need help with updating gadgethandler

Post 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.
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Need help with updating gadgethandler

Post by hokomoko »

probably just adding RenderUnitDestroyed to the gadgethandler should solve the issues.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Need help with updating gadgethandler

Post 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?
Post Reply

Return to “Help & Bugs”