Page 2 of 2

Re: Annotations in Script Engine

Posted: Thu Aug 09, 2012 2:56 pm
by powerful0guardian
jurchiks wrote:
it calls recrusive same function what using scripts.cfg so must work
I see, then it should be fine.
nothing more than junks.
Rin4a would strongly disagree with you :D
He's the guy who made the python scheme buffer and has made better ones aswell (not publicly available though), all in python.
They certainly are outdated, but the "junk" part depends entirely on the author.
they're good for keeping them for a skretch for the further PY->java translate
And this is where I would disagree with you. They are outdated and badly written, thus they make a very bad base to port. The Freya AI is out there and it is a MUCH MUCH better base. Obviously you need to understand it, but if you don't, you probably won't be able to write the quest script in Java as good as a person who does.
1. well I was not speaking about Rina's customs, I was speaking about the quests not touched since C4 :D... So many methods and constructors reworked in Java and PY scripts updated only partially. So I think the 30-40-60% of PY scripts may not work, or not work properly.
2. about PY scripts are not good for base, well if you say so, maybe you're right... I did not do the PY->Java translate for more than 3 years or more...

My opinion is PY is quick as alone and Java too, but together it's a nightmare for performance and for everything... + I think for Java developers Java Quests, Scripts, Etc are more optional. So I would not use PY scripts anymore. (For me the nothing is better than the PY scripts, but please forgive me that opinion xDDD :D)

Re: Annotations in Script Engine

Posted: Thu Aug 09, 2012 3:10 pm
by UnAfraid
We currently support directory loading as well check com.l2jserver.gameserver.scripting.L2ScriptEngineManager.executeAllScriptsInDirectory(File)
Recursievly load is good idea if all scripts was in java but the jython thingy may remain in scripts.cfg until they get reworked to java.
But there must be implemented some annotations to skip loading some files because i have dp scripts with no main methods because they are just DTO's and they shouldn't be loaded.

Re: Annotations in Script Engine

Posted: Thu Aug 09, 2012 3:53 pm
by jurchiks
well then the loader should just check for a main() method and execute the script only if the method exists.

Re: Annotations in Script Engine

Posted: Thu Aug 09, 2012 7:13 pm
by powerful0guardian
jurchiks wrote:well then the loader should just check for a main() method and execute the script only if the method exists.
I have the parser (but I know not hard to make one) to add main() method to all files..
about recrusive load... not hard to check if file name ends with .java and ends with .py.. :)