Have simple probleam - Page 2

Have simple probleam

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Have simple probleam

Post by smoth »

Good luck with whatever endeavor you pursue. Sorry for my shitty advice early on.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Have simple probleam

Post by Argh »

error = 2, LuaRules/draw.lua, error = 2, LuaGadgets/gadgets.lua, [string "LuaGadgets/actions.lua"]:54: attempt to index local 'g' (a function value)
That kind of error halts gadgetHandler, IIRC, and can basically crash the whole Lua state for Gadgets.

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Have simple probleam

Post by Forboding Angel »

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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Have simple probleam

Post by zwzsg »

Voidranaut wrote:hay one last question

local MsgForMe=string.match(msg,message_identifier.."(.*)")

what significance is the red syntax?
It's a RegExp. Don't even try to understand that now.

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).
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Have simple probleam

Post by lurker »

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):

Code: Select all

if msg:sub(1,#message_identifier) == message_identifier then
    local MsgForMe = msg:sub(#message_identifier + 1)
    --stuff
end
Post Reply

Return to “Game Development”