22.04.2014, 15:59
(
Последний раз редактировалось 123marvin123; 26.05.2014 в 19:17.
)
First: This tutorial refers to the Java Api for SA -MP ( click)
Server part:
Step 1 ( Required files to download ) :
- Download and install JDK8 and JRE8 . It is important that you choose the 32 bit version . (JDK8 , JRE8)
- Download and unzip Shoebillserver to a place you like ( click )
Step 2 (Java Setup ) :
- Set JAVA_HOME variable. If you don't know how to get to the menu, you can look here
- In the " System Variables" Tab , you press " New ..." and give the name: " JAVA_HOME " and the value the install path of JDK8 ( Image )
Step 3 ( Preparing the Server & start ) :
- You go to the server folder and change the server.cfg .
- To start the server properly , use the " startup.bat "
- Once the server has started , you can already join .
- At this point, the next step would be, to develop your own gamemode.
Step 4 (understand the folder structure) :
- There are multiple files and folders in the " Shoebill " folder of the server.
- In the " resources.yml " are the most important settings .
- There you can change the gamemode , the plugins, the Maven repository and the runtime version .
- The "data" folder is your new "scriptfiles" folder.
- Each Gamemode / Plugin has his own area for files , logs , and other things.
- The needed folder is created automatically by the server when you first start it.
- In the " libraries" folder you can get your required third-party libraries such as the mysql-connector .
- However, if you load your gamemode from a Maven repository , you do not need to worry because everything will be downloaded automatically.
scripting part :
Step 1 ( Download Eclipse) :
- You download Eclipse for Java Developers (http://www.eclipse.org/downloads/)
- Unzip the downloaded files to a location of your choice .
Step 2 ( Start Eclipse and set up ) :
- To start Eclipse start the " eclipse.exe ".
- When you first start Eclipse, you will be asked where you workspace should be.
- After Eclipse starts, you press go to " Window " -> " Preferences" and put into the search box the following: "Content Assist"
- When you see these three entrys("Ant ", " Java" and " xml " ), you click in Java on "Content Assist" .
- On the lower right side , you see "Auto Activation ". If the checkbox is not clicked, activate it.
- Write into the "Auto activation delay (ms)" how long it should take, until the Autocompletion will show.
- I'll take 5 milliseconds
- Write into "Auto activation triggers for Java" what characters should enable autocompletion .
- Because I want the autocomplete should always jump in , I write in the textbox ".abcdefghijklmnopqrstuvwxyz".
- If this is now finished, it should look like this .
- Now we press "Apply" .
- Next, we delete the search textbox and press on Java, and then on "Installed JREs "
- Next you press on " Add ..." and choose " Standard VM " and press " Next>"
- In " JRE home" you press " Directory" and selects the JDK8 package. (Mostly in C: \ Program Files ( x86) \ Java \ jdk1.8.0 " ) Here is a picture : . click
- Click on " Finish" , and take out the check in " jre7 " and put it in " jdk1.8.0 " .
- At the end we press "OK " to apply the settings.
Step 3 (Install Java 8 patch) :
- You press up on "Help " -> " Eclipse Marketplace" and search for "Java 8" .
- Your install now "Java 8 support for Eclipse Kepler SR2 " , and scroll down and also install "Java 8 support for m2e for Eclipse Kepler SR2 " (picture : click ) .
- Now everything is set up so far that you can begin .
Step 4 (Create the project) :
- Now, to create a Shoebill Game Mode , you press File -> New , and then at the bottom press "Other " .
- In the menu you select under " Maven " the " Maven Project " and press " Next>" . You now press " Next>" until you see that .
- For Group Id you choose something, that will identify you. I will use e.g. " me.marvin "
- In the Artifact Id you put the name of the project in. I will use e.g. " breadfishgm "
- You can pick a version. I will stay with "0.0.1 -SNAPSHOT "
- Write into the Groupid your groupId + your artifactId. For me, it would then mean " me.marvin.breadfishgm "
- You press on the button " Finish" and should now have a project .
Step 5 (Edit the project):
- First you go into the pom.xml file , and press at the bottom to " pom.xml " .
- Now it should look like this: click
- You have to insert under " <version> .. < / version> " this: pastebin
- There, underneath, you now have to add the dependency : pastebin
- At the bottom , before " </ project > " you now have to add the following: pastebin
- If you use the <outputDirectory> (which is optional) then you need to adjust it.
- When everything is done , it should look like this: click
- You will now save everything, and right-click on your game mode -> Maven -> Update Project , and click OK
- To start properly now , you go into the " App.java " and adds behind the " public class App" a "extends Gamemode" .
- Now you have to implement the methods . At the end, it should look like this -> click
Step 6 ( Prepare the project for building ) :
- The last big step to do is to add a "gamemode.yml" file.
- With this file, the server will know what class he should use to start the gamemode.
- You have to create a folder with the name "resources " in the " src / main / " folder.
- Now make a right click on the folder you just created , and select " New " -> " File" and input " gamemode.yml " .
- In this file you will now write the following: pastebin
- At the end it should look like this: click
Step 7 ( The build process ) :
- In order to build the project , you push on the round green play button -> click and select " Maven build".
- At the end you simply presses OK, and the jar file of the game modes should be there , wherever you have specified the location in the pom.xml file.
Sorry for my bad english.
Server part:
Step 1 ( Required files to download ) :
- Download and install JDK8 and JRE8 . It is important that you choose the 32 bit version . (JDK8 , JRE8)
- Download and unzip Shoebillserver to a place you like ( click )
Step 2 (Java Setup ) :
- Set JAVA_HOME variable. If you don't know how to get to the menu, you can look here
- In the " System Variables" Tab , you press " New ..." and give the name: " JAVA_HOME " and the value the install path of JDK8 ( Image )
Step 3 ( Preparing the Server & start ) :
- You go to the server folder and change the server.cfg .
- To start the server properly , use the " startup.bat "
- Once the server has started , you can already join .
- At this point, the next step would be, to develop your own gamemode.
Step 4 (understand the folder structure) :
- There are multiple files and folders in the " Shoebill " folder of the server.
- In the " resources.yml " are the most important settings .
- There you can change the gamemode , the plugins, the Maven repository and the runtime version .
- The "data" folder is your new "scriptfiles" folder.
- Each Gamemode / Plugin has his own area for files , logs , and other things.
- The needed folder is created automatically by the server when you first start it.
- In the " libraries" folder you can get your required third-party libraries such as the mysql-connector .
- However, if you load your gamemode from a Maven repository , you do not need to worry because everything will be downloaded automatically.
scripting part :
Step 1 ( Download Eclipse) :
- You download Eclipse for Java Developers (http://www.eclipse.org/downloads/)
- Unzip the downloaded files to a location of your choice .
Step 2 ( Start Eclipse and set up ) :
- To start Eclipse start the " eclipse.exe ".
- When you first start Eclipse, you will be asked where you workspace should be.
- After Eclipse starts, you press go to " Window " -> " Preferences" and put into the search box the following: "Content Assist"
- When you see these three entrys("Ant ", " Java" and " xml " ), you click in Java on "Content Assist" .
- On the lower right side , you see "Auto Activation ". If the checkbox is not clicked, activate it.
- Write into the "Auto activation delay (ms)" how long it should take, until the Autocompletion will show.
- I'll take 5 milliseconds
- Write into "Auto activation triggers for Java" what characters should enable autocompletion .
- Because I want the autocomplete should always jump in , I write in the textbox ".abcdefghijklmnopqrstuvwxyz".
- If this is now finished, it should look like this .
- Now we press "Apply" .
- Next, we delete the search textbox and press on Java, and then on "Installed JREs "
- Next you press on " Add ..." and choose " Standard VM " and press " Next>"
- In " JRE home" you press " Directory" and selects the JDK8 package. (Mostly in C: \ Program Files ( x86) \ Java \ jdk1.8.0 " ) Here is a picture : . click
- Click on " Finish" , and take out the check in " jre7 " and put it in " jdk1.8.0 " .
- At the end we press "OK " to apply the settings.
Step 3 (Install Java 8 patch) :
- You press up on "Help " -> " Eclipse Marketplace" and search for "Java 8" .
- Your install now "Java 8 support for Eclipse Kepler SR2 " , and scroll down and also install "Java 8 support for m2e for Eclipse Kepler SR2 " (picture : click ) .
- Now everything is set up so far that you can begin .
Step 4 (Create the project) :
- Now, to create a Shoebill Game Mode , you press File -> New , and then at the bottom press "Other " .
- In the menu you select under " Maven " the " Maven Project " and press " Next>" . You now press " Next>" until you see that .
- For Group Id you choose something, that will identify you. I will use e.g. " me.marvin "
- In the Artifact Id you put the name of the project in. I will use e.g. " breadfishgm "
- You can pick a version. I will stay with "0.0.1 -SNAPSHOT "
- Write into the Groupid your groupId + your artifactId. For me, it would then mean " me.marvin.breadfishgm "
- You press on the button " Finish" and should now have a project .
Step 5 (Edit the project):
- First you go into the pom.xml file , and press at the bottom to " pom.xml " .
- Now it should look like this: click
- You have to insert under " <version> .. < / version> " this: pastebin
- There, underneath, you now have to add the dependency : pastebin
- At the bottom , before " </ project > " you now have to add the following: pastebin
- If you use the <outputDirectory> (which is optional) then you need to adjust it.
- When everything is done , it should look like this: click
- You will now save everything, and right-click on your game mode -> Maven -> Update Project , and click OK
- To start properly now , you go into the " App.java " and adds behind the " public class App" a "extends Gamemode" .
- Now you have to implement the methods . At the end, it should look like this -> click
Step 6 ( Prepare the project for building ) :
- The last big step to do is to add a "gamemode.yml" file.
- With this file, the server will know what class he should use to start the gamemode.
- You have to create a folder with the name "resources " in the " src / main / " folder.
- Now make a right click on the folder you just created , and select " New " -> " File" and input " gamemode.yml " .
- In this file you will now write the following: pastebin
- At the end it should look like this: click
Step 7 ( The build process ) :
- In order to build the project , you push on the round green play button -> click and select " Maven build".
- At the end you simply presses OK, and the jar file of the game modes should be there , wherever you have specified the location in the pom.xml file.
Sorry for my bad english.