Start Learning java

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
User avatar
Gries
Posts: 307
Joined: Fri Jun 17, 2011 9:45 am

Start Learning java

Post by Gries »

Hello, from what i could start to learn java language? I heard creating voice commands or so.


P.S Never studied it before or anything like, i have totally no experience with it.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Start Learning java

Post by jurchiks »

Read core code, try to understand it.
Watch some java intro videos like this for some explanations, google other stuff: http://www.youtube.com/watch?v=Cfd9DOnuF9w
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.
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: Start Learning java

Post by DrHouse »

Gries wrote:Hello, from what i could start to learn java language? I heard creating voice commands or so.


P.S Never studied it before or anything like, i have totally no experience with it.
Yes, voice commands it is a good start, but assuming you don't have any experience on coding you should spend some time previously on understanding how object-oriented programming languages work and getting familiar to java sintaxis. I would recommend following official java tutorial, it is quite enough for the beginning. You can also get almost any java book and read those chapters about java essentials.

Following this path you will get the required knowledge to understand the basic stuff of our sources, plus you will be able to tweak and modify what is written and also to create some scripts based on what you have seen: command handlers in the beginning, SQL queries, npc and skill/effect handlers later on.

After mastering the basics, your next logical step would be to start reading about more advanced stuff belonging to the high level programming layer typical features, like threading and I/O (specially networking). You will then understand a rather considerable percentage of our source and you will have also a decent understanding of the java language itself. I would recommend Dough Lea's book on threading ("Concurrent programming in Java") and almost any paper on basic and advanced networking patterns.
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
User avatar
Gries
Posts: 307
Joined: Fri Jun 17, 2011 9:45 am

Re: Start Learning java

Post by Gries »

Thx all, started making something:

Code: Select all

            else if (player.isInOlympiadMode())            {                mpRegenMultiplier *= 1.5; // Olympiad Mode            }            else if (player.isInCombat())            {                mpRegenMultiplier *= 2.5; // Combat Mode            }
Any error/or another way to do it better?
Also have tried to search something while player is flagged, but couldn't find anything :|
User avatar
St3eT
Posts: 961
Joined: Sun Mar 07, 2010 6:50 pm

Re: Start Learning java

Post by St3eT »

For check flag you can use:

Code: Select all

                     if (player.getPvpFlag() != 0)                    {                        player.sendMessage("Ugly and bad boy! you are flagged :( again kill any newbie, eh? NOOOOB!");                    } 
If i should be black sheep for sure no as punishment
Image
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: Start Learning java

Post by xban1x »

Maybe try simpler voice commands like: ".title <STRING>"
User avatar
Gries
Posts: 307
Joined: Fri Jun 17, 2011 9:45 am

Re: Start Learning java

Post by Gries »

xban1x wrote:Maybe try simpler voice commands like: ".title <STRING>"
Like this?

http://pastebin.com/AQ9PTLtJ
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Start Learning java

Post by Sdw »

The title is sent through params
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: Start Learning java

Post by xban1x »

Sdw wrote:The title is sent through params
Exactly, other then that Gries it is perfectly fine.
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Start Learning java

Post by Sdw »

No, Its still missing a little something :)
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: Start Learning java

Post by xban1x »

Sdw wrote:No, Its still missing a little something :)
He didn't register it in MasterHandler.java yes. But other then that command itself works fine.
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Start Learning java

Post by Sdw »

Broadcast something maybe ?
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: Start Learning java

Post by xban1x »

Sdw wrote:Broadcast something maybe ?
I usually don't add broadcast for things like this. It will be updated when he relogs or at some other occassion. No need for spamming.
User avatar
Gries
Posts: 307
Joined: Fri Jun 17, 2011 9:45 am

Re: Start Learning java

Post by Gries »

xban1x wrote:
Sdw wrote:The title is sent through params
Exactly, other then that Gries it is perfectly fine.
What you mean?
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Start Learning java

Post by Sdw »

xban1x wrote:
Sdw wrote:Broadcast something maybe ?
I usually don't add broadcast for things like this. It will be updated when he relogs or at some other occassion. No need for spamming.
My players expect it asap. A broadcasttitleinfo wont do any harm once in a while.
Post Reply