Have simple probleam
Moderator: Moderators
Re: Have simple probleam
Good luck with whatever endeavor you pursue. Sorry for my shitty advice early on.
Re: Have simple probleam
That kind of error halts gadgetHandler, IIRC, and can basically crash the whole Lua state for Gadgets.error = 2, LuaRules/draw.lua, error = 2, LuaGadgets/gadgets.lua, [string "LuaGadgets/actions.lua"]:54: attempt to index local 'g' (a function value)
IOW, if you have an error that bad (usually comes up with people attempting to port CA Gadgets, hmm) then you probably needed something from CA's Gadget files in the LuaRules directory (action.lua, system.lua, etc.) before it will operate.
So, removing that thing basically removed the conflict and allowed zwswg's code to operate.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Have simple probleam
Yeah, morph has bricked evo gadgets before. Once you actually know what's going on the fix is fairly simple, but when you're staring at infolog going "OMGWTF?!?!?! GHEY!"... yeah.
Re: Have simple probleam
It's a RegExp. Don't even try to understand that now.Voidranaut wrote:hay one last question
local MsgForMe=string.match(msg,message_identifier.."(.*)")
what significance is the red syntax?
Regular Expresions are very powerful, but very hard to come up with or even decode. Leave them to the Wizards.
The whole line though put into "MsgForMe" the part of the string "msg" that follows the identifier (or nil if there is no identifier).
Re: Have simple probleam
Specifically, () means "output the part inside the ()" and .* means "everything from here to the end".
But if you want a simpler method (which won't fail if the gadget name has certain weird things in it):
But if you want a simpler method (which won't fail if the gadget name has certain weird things in it):
Code: Select all
if msg:sub(1,#message_identifier) == message_identifier then
local MsgForMe = msg:sub(#message_identifier + 1)
--stuff
end