[GUIDE] How to install + configure Eclipse for modding

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

[GUIDE] How to install + configure Eclipse for modding

Post by BlueWulv »

Hi everyone

as I am using Eclipse for some Mod development [ aiscript + md ] I wanted to give you a small guide howto install and configure Eclipse.

This is not the most ultimate guide, probably it is not even the best and fastest way to do it.
I am looking forward to every advice, tip, improvement :)

==== FAQ ====

1) What is Eclipse?
Eclipse is an IDE (Integrated Development Environment).
It is open source, free of charge and absolutely not lightweight and does not run without some installation and configuration.

http://www.eclipse.org/

2) Why Eclipse?
There are probably better tools out there but it is able to validate your mod files with X Rebirt's XSD files and supports auto completion.

And well, I am just using it for Rebirth because I am used to it [my first contact with Eclipse was about 10 years ago ;)]


3) I just want to start modding, quick give me something
Just use your favorite IDE / Tools or

http://notepad-plus-plus.org/

http://www.pnotepad.org/





==== GUIDE ====

Click on the images to see a larger version!


1) Download + install the Java Runtime Environment

Eclipse needs Java to run. If you already have a JRE installed, skip this step.

1.1 JRE Offline Installer

http://java.com/en/download/manual.jsp

Windows Offline 32bit


1.2 execute the installer
If you are asked to install the "Ask Toolbar" uncheck it: don't install the Ask Toolbar




2) Download Eclipse

http://www.eclipse.org/downloads/

Choose
Eclipse Standard, Windows 32 bit




3) Install Eclipse

You should have downloaded a zip file, just unzip it.
Tip:
If you do have a SSD unzip it to a folder on the SSD. Eclipse will run a lot faster on a SSD.




4) Start Eclipse

4.1) Eclipse will ask you for a workspace

All your projects will be saved there. Do not use X Rebirth's program (or extension) directory!

Check "Use this as the default and do not ask again"

4.2) There is a "Welcome Page", just close it
[ will always be accessible by Help -> Welcome ]




5) Install XML Plugin

Help -> Install New Software

This will open a new dialog.
Be warned: this thing is slow! Enter the details as stated below, Eclipse will seem to hung in betweeen, just wait then.

[ external image ]

5.1) Work with:
Select " --All available Sites--"

5.2) type filter text
enter XML

wait...wait some more until the window reacts again, it will show you the results

5.3) select "Eclipse XML Editors and Tools"

[ external image ]

5.4) Next, Next, "I accept..."

5.5) Finish, wait until finished

5.6) After the installation is done, restart Eclipse




6) Configure Eclipse

6.1) Check XML Validation
Window => Preferences => Validation

These should be enabled:
DTD Validator
XML Schema Validator
XML Validator

6.2) enable Task Tags

Window -> Preferences
- enter "task" in the top left (without quotation marks)
- there should be: General -> Editors -> Structured Edit Text -> Task Tags
- check "Enable searching for Task Tags"

These are also used by Egosoft to mark areas of code where not everything is implemented (or fixed) yet

<!-- TODO implement error handling for trades -->
<!-- FIXME trade ships get stuck because of something within the next lines -->
<!-- XXX should be blue -->


6.X) (optional) Disable spell checking
I just don't like the spell checking feature, it is an IDE not Word

Window -> Preferences
- enter "spelling" in the top left (without quotation marks)
- uncheck "Enable spell checking"



7) Begin your X Rebirth Mod

7.1) New Project

7.1.1) On the left you will see the "Package Explorer".
Right click => New => Project...

7.1.2) A new dialog will appear, the New Project Wizard.
Select Geneal -> Project and click Next.

[ external image ]

7.1.3) Enter a project name [ let's name it XRebirth ] and click Finish

You will now have an empty project, we need some resources next.


7.2) Add the xsd, dtd, xml files for auto completion and validation

7.2.1) Create a "resource" folder in your new project

Right Click the project => New => Folder

name it resources

7.2.2) xsd/dtd/xml resource files

If you always want to be up to date, you will have to extract these files from your X Rebirth folder with a Cat extractor.

But UniTrader has made a package ready to go a few days ago.

That's his link:
http://ubuntuone.com/23zTOAse4OkgAjk2ZPIcLL

It's a 7zip file, extract and copy all files from "extdev" to your resources folder.


7.3) Create a folder with your mod's name (for example Skillex ; )

Right Click the project => New => Folder

That is your Mod folder as it would be copied to "X Rebirth/extensions/".


7.4) Important!
Your aiscript / md files have to point to the proper xsd file!

<mdscript name="Skillex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../resources/libraries/md.xsd" >

Download my Skillex mod as an example.

http://xrebirth.nexusmods.com/mods/289/?


How it will look like.

[ external image ]



8 ) Use: Auto Complete

Press CTRL + SPACE to trigger the auto complete feature.

[ external image ]




9) Use: Validation

Eclipse will analyze your files on the fly.
[ external image ]
Last edited by BlueWulv on Sun, 1. Dec 13, 14:13, edited 6 times in total.
BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

Post by BlueWulv »

*reserved*
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

thx for this guide, was not sure how to set up Eclipse for this :)

btw: i think will re-structure my moddev-Extension to be better suited for this: extdev folder will contain all xsds dtds etc. and i will additionally make an empty mod folder to copy which contains linking xsds so you just say "use aiscript.xsd" instead of "use ../../extdev/libraries/aiscript.xsd" - so for starting a new project you just have to copy this Folder ^^

and hint: in my Archive there are some more xsds, for content.xml and t-files currently, Map xsds and Savegame xsds are planned if i find the time ^^

EDIT: just found an rfc5261.xsd for diff-xmls - will be included in next Version ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

Post by BlueWulv »

Sorry I did not ask you for permission to link to your files. Wanted to ask you but totally forgot to do so :(
Thank you for the additional XSD files :)

I was thinking to write an alternative way for the guide to integrate your files, something like "just copy all files from resources to your new mod folder and if you want to release the mod, copy it and execute the remove.bat".

But the linking XSDs is a nice idea too.


If I am in the mood I will maybe create an ant script for release builds or something like that. ;)


EDIT:
rfc5261.xsd?
Nice one, haven't found one yesterday :D
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

no problem for me since this file is just of interest for a few people ;) btw i have just updated it to Version 1.03, changes:
- updated "stolen" files from current game files :D
- added rfc5261.xsd
- now split into "moddev" folder and "COPY FOR NEW PROJECT"-folder
-> moddev contains all xsds, dtds and files necesary by scriptproperties.html
-> COPY... contains example content.xml and all necesary xsds in their respective folder which include (link) their content from the extdev/libraries-folder, so in case of an update you just have to update the libraries ;)
- changed "RemoveModdevFiles.bat" - now just deletes the xsds and dtds in the respective Mod Project Folder, extdev folder remains untouched ^^

link is the same ;)

PS anyone knows hot to include/link dtd files? just copied them for now...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

Post by BlueWulv »

UniTrader wrote:
link is the same ;)

PS anyone knows hot to include/link dtd files? just copied them for now...
Should be possible like this:

Code: Select all

<!ENTITY % ref SYSTEM "../../resources/libraries/Animation_Sequences.dtd">
%ref;
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

no idea whats going wrong, but autocomplete does not seem to work with <xs:include ... > in the xsd in eclipse (validation and displaying of the xsd works though) - i have to pass the relative path directly...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

Post by BlueWulv »

Just tested it with a md file and it seems to work.

Have you tried to refresh your project? Press F5 if project is selected.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

tried that, didnt work.. still get only a comment (and your example up there is a bit too empty, too since the aiscript.xsd does not contain everything, it includes the common.xsd too from which you miss the entries)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
BlueWulv
Posts: 238
Joined: Sat, 7. Feb 04, 17:06
x4

Post by BlueWulv »

I just put up a project with your folder structure,
copied the COPY FOR... as TestProject
and added:
TestProject/aiscripts/trade.station
TestProject/md/AssignToCommander.xml

Everything seems to work fine.
I additionally changed project settings, to override eclipse global settings.

Uploaded it here:
http://home.arcor.de/bluewulv/XR/XRebirth_test.7z

Could you give it a try please?
Create a Project named XRebirth_test in eclipse and extrat the files to it.
mrowka
Posts: 128
Joined: Tue, 30. Jun 09, 19:50
x4

Post by mrowka »

Hmm it might be just easier than using notepad :D
MK3 Optimization "If you get stinky rich its his fault"
IEX - Sector Visual Enhancement "Dont enjoy the view navigating thrugh asteroid field, Seriously!"
Marine Repair 2 "Tip 19: Modern coffie cup`s are made of hull plating, beware"

Return to “X Rebirth - Scripts and Modding”