Jump to content

Little error with energy


Go to solution Solved by Alina,

Recommended Posts

Hey guys,

I've some problems with this quest about energy_system (spoiler after).

The problem is:

energy_system.lua:98:syntax error : [string "make"]:5: `)' expected (to close `(' at line 4) near `return'

I tried everything, I can't see the problem. Any1 can see it? Quest is after:

 

#solved #questremoved

 

Thanks for help & kind regards,

Dimmi.

Link to comment
Share on other sites

Segmentation fault is due to an error with accessing memory. E. g. the program wants to access memory it shouldn't access.

It happens when you're corrupting it, causing memory leaks etc... Did you check those functions like item.get_level_limit

Some have bad error handling (especially some posted in forums etc... Note: Only some!^^)

Better check them. Also make sure you know when the error occurs. I mean, does it occur on booting or on login? What do you have to do to cause the error?

Link to comment
Share on other sites

Segmentation fault is due to an error with accessing memory. E. g. the program wants to access memory it shouldn't access.

It happens when you're corrupting it, causing memory leaks etc... Did you check those functions like item.get_level_limit

Some have bad error handling (especially some posted in forums etc... Note: Only some!^^)

Better check them. Also make sure you know when the error occurs. I mean, does it occur on booting or on login? What do you have to do to cause the error?

 

I just copied the translation from translate.lua, because I want to remove the translate.lua from server. If I want to compile quest without translation (with file read from translate.lua), it works fine. 

 

#edit:

 

I removed 

item.get_level_limit

and I made it like this:

function get_item_level (vnum) return mysql_query ("SELECT limitvalue0 FROM player.item_proto WHERE vnum = '"..vnum.."'") end 

now I get this:

energy_system.lua:98:syntax error : [string "make"]:5: `)' expected (to close `(' at line 4) near `return'

Any solution? :D

First message was updated with actual quest

Link to comment
Share on other sites

  • Solution

The problem isn't the function ;)

 

It's a mistake you made in line 39.

Backtrace:

look at the rror. It tells you to look at line 98. This is an end. What does it end? Your when-instruction. So the compiler tells you that the error is within this when-part. Soooooooo... The next hint is line 5 and "at line 4)". So he expects at 5 a ) to close an ( at line 4.

What's that?

say(string.format("Esti prea slab, inca nu poti stapani aceasta Energie.[ENTER]Vino cand ai nivelul %d. ", minLevel)

You're missing a ) there :)

  • Love 1
Link to comment
Share on other sites

The problem isn't the function ;)

 

It's a mistake you made in line 39.

Backtrace:

look at the rror. It tells you to look at line 98. This is an end. What does it end? Your when-instruction. So the compiler tells you that the error is within this when-part. Soooooooo... The next hint is line 5 and "at line 4)". So he expects at 5 a ) to close an ( at line 4.

What's that?

say(string.format("Esti prea slab, inca nu poti stapani aceasta Energie.[ENTER]Vino cand ai nivelul %d. ", minLevel)

You're missing a ) there :)

 

Yep, I finally understand how to solve those erros. Thanks you a lot, I solved.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.