Annotations in Script Engine

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
powerful0guardian
Posts: 63
Joined: Tue Jun 26, 2012 11:16 am

Re: Annotations in Script Engine

Post 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)
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Annotations in Script Engine

Post 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.
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Annotations in Script Engine

Post by jurchiks »

well then the loader should just check for a main() method and execute the script only if the method exists.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
powerful0guardian
Posts: 63
Joined: Tue Jun 26, 2012 11:16 am

Re: Annotations in Script Engine

Post 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.. :)
Post Reply