Build own Rate.Properties

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
KingSton
Posts: 43
Joined: Mon Apr 16, 2012 1:57 pm
Location: Lithuania

Build own Rate.Properties

Post by KingSton »

Hello,

for some time I read information about Eclipse, source files, java files... ( that you can configurate your game by your own). And now I have a question, is it hard to creat your own rate.properties ( modificate something and add some rate ). I know that is posible, but I don't know to start. Do anybody know any guild in internet or just can explain in simple words (for short maybe), how I can do this.

This idea is not only for fun ( that I don't have anything to do ), but in the newest L2j Interlude server pack rate.properties file have changed, many rates disappear and now there is some problems.

So, looking for ideas.
Everybody is special, but not everyone can find his specific skills.
User avatar
Asmodaius
Posts: 170
Joined: Sun Jul 16, 2006 9:43 am

Re: Build own Rate.Properties

Post by Asmodaius »

All configuration properties are inside :

Code: Select all

<<Project_name>>/java/com/l2jserver/Config.java
In order to see how it works, find an existent property in your rate configuration and then use it in eclipse's search to find the references in the config.java class.

Usually, in order to define a new property you must : (Using Rates 's xp property as example)

Define a new variable :

Code: Select all

public static float RATE_XP;
Tell to the new variable from where to get its value :

Code: Select all

RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
Set the new value

Code: Select all

case "ratexp":                RATE_XP = Float.parseFloat(pValue);                break;
That's the easy part.

The hard part, for someone who is not a developer ( including me :lol: ), is to find the classes and the procedures, that are using the values that you have now define as a property.

I guess you will need plenty of time, but when you will have finaly managed it, you will have a better perception of L2J's structure.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Build own Rate.Properties

Post by jurchiks »

In order to see how it works, find an existent property in your rate configuration and then use it in eclipse's search to find the references in the config.java class.
Right-click the property and choose "Open Call Hierarchy".
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
KingSton
Posts: 43
Joined: Mon Apr 16, 2012 1:57 pm
Location: Lithuania

Re: Build own Rate.Properties

Post by KingSton »

At procedures and functions ( I think that this is called ) I am just a begginer, just need to practice with Java program language. But if I take procedures from other pack ( where is that config ) and just add/modify them to L2j config, will it work? Or I just need to study and create it by my own?
Everybody is special, but not everyone can find his specific skills.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Build own Rate.Properties

Post by jurchiks »

Don't copy code from other forks, there's a good chance it won't work without some adapting.
You'd do better just opening Config.java and reading how it reads the configs from the property files. Then you can just copy a part of that code and change the configs/property file.
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.
Post Reply