Page 1 of 1

Build own Rate.Properties

Posted: Fri Aug 03, 2012 6:56 am
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.

Re: Build own Rate.Properties

Posted: Fri Aug 03, 2012 8:05 am
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.

Re: Build own Rate.Properties

Posted: Fri Aug 03, 2012 8:09 am
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".

Re: Build own Rate.Properties

Posted: Fri Aug 03, 2012 2:18 pm
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?

Re: Build own Rate.Properties

Posted: Fri Aug 03, 2012 2:52 pm
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.