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 https://forums.kleientertainment.com/forums/topic/52978-mod-crashing-due-to-syntax-error-please-help/ 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 https://forums.kleientertainment.com/forums/topic/52978-mod-crashing-due-to-syntax-error-please-help/#findComment-630632 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 https://forums.kleientertainment.com/forums/topic/52978-mod-crashing-due-to-syntax-error-please-help/#findComment-630654 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 https://forums.kleientertainment.com/forums/topic/52978-mod-crashing-due-to-syntax-error-please-help/#findComment-630720 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 https://forums.kleientertainment.com/forums/topic/52978-mod-crashing-due-to-syntax-error-please-help/#findComment-630952 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now