Page 1 of 1

Got problems over naming function "PlaySound"

Posted: Wed Feb 14, 2018 2:46 am
by Daviex
Hello

I'm trying to upgrade my server to last version of POL099 (awesome work guys, really!) and I got a problem over a script.

While trying to compile, it gave me this error:

Code: Select all

Error reading function declaration in module uo
After alot of analysis over my code I found my bug:
I had a function called "PlaySound" and, somehow, it seem to collide with module uo.em function "PlaySoundEffect" or "SendOverallSeason" (this last one has a parameters that is called *playsound*).

I don't know if this should be a normal behavior for ecompile, but I don't think so...

Thanks again for your work!

Re: Got problems over naming function "PlaySound"

Posted: Wed Feb 14, 2018 9:30 am
by Yukiko
Funny you should have that problem. I recently had that same issue with the same name. Hehe we must have the same script :) I think my problem was a variable of the same name.

Yes it is an issue with the way eCompile parses identifiers. You cannot have more than one function or variable with the same name. There will likely not be any way to resolve duplicate function names but hopefully the Core developers will find a way to resolve variables having the same names as functions.

Re: Got problems over naming function "PlaySound"

Posted: Wed Feb 14, 2018 11:04 am
by Daviex
Yukiko wrote:
Wed Feb 14, 2018 9:30 am
Funny you should have that problem. I recently had that same issue with the same name. Hehe we must have the same script :) I think my problem was a variable of the same name.

Yes it is an issue with the way eCompile parses identifiers. You cannot have more than one function or variable with the same name. There will likely not be any way to resolve duplicate function names but hopefully the Core developers will find a way to resolve variables having the same names as functions.
Ahahah probably :D
Well, let's hope they will fix this out! Is not a so annoying problem when you find out, but when you need to do an upgrade and it gives you this error without any advice of what function is giving this problem is really bad!

Re: Got problems over naming function "PlaySound"

Posted: Wed Feb 14, 2018 11:11 am
by Yukiko
Yes. ECompile can definitely use an improved error regarding upgrade in a lot of places. If it reported both function locations that would be a good solution. Then you would have a clue where to look for the problem.