Jump to content

Recommended Posts

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.txt

nick.lua

@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 function

2. Store that function inside a new, local variable

3. 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."

@Ealish,

 

either

local master_postinit = function(inst)

or

local 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

@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... >.<

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...