Jump to content

Can't fix problem unexpected symbol near ')' line 48


Recommended Posts

I've been trying to fix this problem trying everything I can and it SHOUld work and its pretty identical to my other code but just won't work, apparently there's an unexpected symbol near my ')' at line 48 that I can't find the source of.

Any help is appreicated!

BCE50AD8BAD454E19B183920AB8217C3E039C990

modmain.lua

modinfo.lua

Edited by Omaremad74
fixed some things
Link to comment
Share on other sites

18 minutes ago, Omaremad74 said:

I've been trying to fix this problem trying everything I can and it SHOUld work and its pretty identical to my other code but just won't work, apparently there's an unexpected symbol near my ')' at line 48 that I can't find the source of.

 

It looks like you're missing an "end" to the local function here. I've added it in where it should go in the example. Try that out.

AddPrefabPostInit("tentacle_pillar_arm", function(inst)
  local function retargetfn(inst)
   return FindEntity(inst,
        TUNING.TENTACLE_PILLAR_ARM_ATTACK_DIST,
        IsAlive,
        { "_combat", "_health" },-- see entityscript.lua
        { "tentacle_pillar_arm", "tentacle_pillar", "prey", "INLIMBO", "tentacle" },
        { "character", "monster", "animal" } )
	end -- <right here!		
 
end)

 

Are you using notepadd++ to edit the code? Here's a tip that I found helped me a lot early on. the little red/grey lines on the left show the "beginning and end" of the functions it detects. if you ever see that the grey line comes to an end at some random blank white space at the very bottom of the page, that means you're missing an "end" or a " ) " somewhere

image.png.70ed413e068f3fca1f59884ed9b7e971.png

 

Link to comment
Share on other sites

1 minute ago, bizziboi said:

I think you're missing an 'end'?

One to close the retargetfunction and one to close the prefabpostinit.


        { "character", "monster", "animal" } )
    end     <<-- that one
 
end)

 

 

1 minute ago, pickleplayer said:

 

It looks like you're missing an "end" to the local function here. I've added it in where it should go in the example. Try that out.


AddPrefabPostInit("tentacle_pillar_arm", function(inst)
  local function retargetfn(inst)
   return FindEntity(inst,
        TUNING.TENTACLE_PILLAR_ARM_ATTACK_DIST,
        IsAlive,
        { "_combat", "_health" },-- see entityscript.lua
        { "tentacle_pillar_arm", "tentacle_pillar", "prey", "INLIMBO", "tentacle" },
        { "character", "monster", "animal" } )
	end -- <right here!		
 
end)

 

Are you using notepadd++ to edit the code? Here's a tip that I found helped me a lot early on. the little red/grey lines on the left show the "beginning and end" of the functions it detects. if you ever see that the grey line comes to an end at some random blank white space at the very bottom of the page, that means you're missing an "end" or a " ) " somewhere

image.png.70ed413e068f3fca1f59884ed9b7e971.png

 

Thank you both so much! Also pickleplayer I do use Notepad ++ But I never knew the little grey and red lines helped show the end of a function , Thanks for that tip!

Link to comment
Share on other sites

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
 Share

×
  • Create New...