Ealish Posted April 20, 2015 Share Posted April 20, 2015 So I'm usually OK at decoding the log file, but I can't make head or tail of this one - any help would be greatly appreciated! (I think it's a syntax error, but I just can't find it...!). This mod was working perfectly fine a few weeks ago; I don't remember making any changes since then, but it's decided it doesn't like it any more. I've attached the log file and the .lua it seems to be getting hung up about.log.txtnick.lua Link to comment Share on other sites More sharing options...
Corrosive Posted April 20, 2015 Share Posted April 20, 2015 @Ealish,local master_postinit(inst) = function(inst)()s tell Lua to execute whatever function is being stored in the variable they're adjacent to. (With the one exception of when you're defining a function ala somevar = function(arg) or function somevar(arg) The way that Lua interprets that code is effectively: 1. Create a new function2. Store that function inside a new, local variable3. name that variable EXECUTE THE MASTER_POSTINIT FUNCTION At which point Lua goes "whoa, whoa, say what now? I was just trying to name a variable, calm down." Link to comment Share on other sites More sharing options...
Ealish Posted April 20, 2015 Author Share Posted April 20, 2015 Ah, OK - this code worked fine previously, so I'm not sure how that was going through!What would you suggest I change it to? Link to comment Share on other sites More sharing options...
Corrosive Posted April 20, 2015 Share Posted April 20, 2015 @Ealish, eitherlocal master_postinit = function(inst)orlocal function master_postinit(inst)They both do the exact same thing. Look toward the top of the file to see how your other postinit function was defined:local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "nick.tex" )end Link to comment Share on other sites More sharing options...
Ealish Posted April 21, 2015 Author Share Posted April 21, 2015 @Corrosive That worked perfectly - thank you very much!Looking at my Guide to Beards, it turns out I was initially using the correct syntax - I have no idea how or why I changed it, I guess I should learn to follow my own guides... >.< Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.