project-navigation
Personal tools

Author Topic: Requesting help from Java programmer  (Read 30947 times)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Requesting help from Java programmer
« on: December 22, 2009, 07:48:52 pm »
Hi,

if you are a java programmer and want to contribute to our little nice project - now you have the chance. We could really need an eclipse plugin that is able to read our UFO-scripts. The first step would be an outline, that would already help a lot to navigate in the scripts. The next step would be syntax error checks. The last big step would be searching for references or completion help.

If you are interested in helping out with writing an eclipse editor plugin, please let me know.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
« Last Edit: December 22, 2009, 08:16:48 pm by Mattn »

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Requesting help from Java programmer
« Reply #2 on: December 23, 2009, 06:46:45 am »
I've written in Java before - I took a class for it a while back, and used a freeware IDE called JCreator - but it was a couple years ago since I've touched it.  I've got other things to work on at the moment though, so you might be able to consider me a backup if no one else is available for the job.

I'm honestly not familiar with what eclipse is or much about it, I'll have to Google it later at some point...

Ah! It's an open-source IDE - Sometime soon I'll download a copy and compare it with C::B.
« Last Edit: December 23, 2009, 07:06:14 am by Destructavator »

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: Requesting help from Java programmer
« Reply #3 on: December 23, 2009, 08:36:48 pm »
One problem is "our UFO-scripts" have not a real syntax consistency. Common code for script only provide a low level of lexer, but each part of the code use the syntax it want. Then, for the syntax coloring, i think it need to implement something very generic (something we can update if it is need). Anyway, even a low level of coloring will be very usefull.
« Last Edit: December 23, 2009, 08:38:26 pm by bayo »

Ain Soph Aur

  • Guest
Re: Requesting help from Java programmer
« Reply #4 on: December 23, 2009, 11:15:05 pm »
i am programming in java and working with eclipse right now. so maybe i could help. but one thing is that i never wrote a plugin for eclipse, so i absolutely dont know how to do that at this time and the second thing is, i am studying right now and my tests will come at the end of january.

so i could maybe look into that but not before the tests are over... if you can wait that long, i could look into that

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Requesting help from Java programmer
« Reply #5 on: December 23, 2009, 11:29:32 pm »
@Ain Soph Aur:
I think that's a mid-range task anyway. At least 'not before 2.3' (TM).

@bayo:
Good point. Maybe it's time to consolidate the script syntax, making the plugin code easier and the usage of the scripts easier/more consistent ? From my perception only few (if any) users change the scripts, so it's a devteam thing only ?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Requesting help from Java programmer
« Reply #6 on: December 24, 2009, 09:41:02 am »
indeed, what i want is a plugin that handles "the new syntax" (at least for the menu) and creates a warning if it doesn't match. If this is the case we can fix things a lot faster and easier. i've already started to write such a plugin, but it does not do a lot but just adding an ufo icon to ufo script files.

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Requesting help from Java programmer
« Reply #7 on: December 28, 2009, 10:00:13 am »
In my study time I've seen a presentation of some eclipse plugin/project which was used to generate editor, syntax highlighting and outline just from defining the language that should be used.
I'll try to find out which project this was and how to use. Perhaps it is very easy to use this.

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Requesting help from Java programmer
« Reply #8 on: December 28, 2009, 10:24:17 am »
http://www.emftext.org/index.php?title=EMFText
completely developed at my university (at the chair where I wrote my diploma and where a friend of mine still works)

it is a competitor to xtext, don't know which is easier to use.
I'l try to play around with it, should be easy to use it (and the plugins will be standalone so no need to add something to eclipse besides the plugins generated there).

[Edit] I played around a bit and defined the syntax for two parts of ufo code: messagecategory and messageoptions. Attached are the plugins (requires java 1.5) for eclipse that do outline and (basic) syntax coloring. In Eclipse settings some highlighting settings can be changed, this could also be done directly in syntax file, did not play with that. File name must have extension "ufogui" to be recognized, don't know why it ignores "ufo" as extension, but this is something which probably could be fixed with some investigation. Icon for ufo files uses a default ecore icon, could also be changed probably.
Putting this together was work for some hours, I did not use that EMFText before. I don't know why it ignores the "there must be a linebreak" setting in my syntax.
Code assist is working for msgoptions -> there it helps you to add either a new optionname or pause|sound|notify if optionname is specified.
« Last Edit: December 28, 2009, 01:55:05 pm by RudolfoWood »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Requesting help from Java programmer
« Reply #9 on: December 28, 2009, 02:43:54 pm »
how can i install these plugins? just add them to the dropins?

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Requesting help from Java programmer
« Reply #10 on: December 28, 2009, 03:09:46 pm »
for installing: these plugins must be located next to other plugins (should be inside plugins subdirectory from eclipse)

Here a quick step by step what I did:
http://www.emftext.org/index.php/EMFText_Installation_Screencast
- Install EMFText from http://reuseware.org/update updatesite

http://reuseware.org/screencasts/screencast-EMFTextEdit-simple-gui.htm
- create a new java project
- create a model subdirectory
- create an ecore model
- Create classes that represent different objects, link appropriate
-- container attributes (e.g. list of content) must set the correct boolean
- Create a genmodel for ecore model
- declare default package for code generation
- generate model code (from genmodel context menu)
- create a cs file for syntax
- fill in some syntax rules, keywords in "", content fields...

- the tricky part (I did not figure out what the next step was for some time as the wink source is somehow broken in the end):
on the cs file generate text resource (from context menu), this will create a second plugin project next to the one

- create a new launch configuration (new eclipse) which uses the newly created plugins.
- create a file with appropriate extension, be glad to see syntax highlighting and content assist

another example with audio, perhaps easier to understand:
http://www.emftext.org/index.php/EMFText_Getting_Started_Screencast

some things I noticed:
- if you change the underlying model, you have to generate the model and ressource code new, clean out the old (java) files before, otherwise there could be compile errors (e.g. for renamed/missing classes)
- root node of genmodel supports "reload model", so no need to throw away the genmodel file if you changed the ecore file.

my syntax and ecore model is in ufo_gui.jar/model, jar can be renamed to zip to extract.
I tried to move the definitions into a subpackages, so different script parts may be defined in different syntax files, these may be imported into one file for all (so that we have one editor supporting all ufo files)

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Requesting help from Java programmer
« Reply #11 on: December 30, 2009, 11:37:30 am »
for completeness I also looked into Xtext (without playing through an example, only reading through http://www.eclipse.org/Xtext/documentation/latest/xtext.html#getting-started )

XText takes an almost similar approach, but uses own definition files.
you have to create a xtext file which defines the syntax and model (imo mixing the (data) model and the concrete text syntax)
the easier part: to generate the plugins you only have to start one action "run as WME Workflow" which does all (opposite to generate model, generate text ressource)

I did not find hints how to change the highlighting/syntax coloring.
I found, that internally they also use the ecore model somewhere.

Imo ecore models can also be edited with emf visual editor, but I did not try it yet.

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Requesting help from Java programmer
« Reply #12 on: January 08, 2010, 10:01:00 pm »
I will meet the EMFText developers next thursday to get some help with my desired model plans, hopefully get some answers that help me to fix some of my current problems with it. If so, I'll prepare a commit for these.

Offline wishper

  • Cannon Fodder
  • **
  • Posts: 2
    • View Profile
Re: Requesting help from Java programmer
« Reply #13 on: February 15, 2010, 10:45:45 am »
Hi to everyone! This is my first post here :)

Now I'll tell you a funny story:
I really enjoyed this game (I completed the 2.2.1 version about a week ago, and now trying the 2.3...). I looked at the changelog in the home page and noticed that the coding activity is really strong around this project, and was really amused of that. Then I came in this forum to see how the things were going (and to see if someone had a working binary to let me try 2.3 (there are not on the home site...).

Today, I asked myself a question: could I contribute to this marvelous project? I guessed I could not,since I'm not a C++ programmer (I'm a java one). Then I came in this forum: a sticky note calling for java programmers! I couldn't believe, requiring eclipse pluginning :) (my current work, though I'm not an expert...).....

A suggestion: from my knowledge, xText looks far better, but if you can get expertize from EMF better to get that one...

Now a question: assume I don't know anything about UFO:AI, beside having played standard campaign in 2.2.1. What are you looking for?  I think it is something related to scripting. Where can I know more? In the wiki?

thanks.
« Last Edit: February 15, 2010, 12:19:20 pm by wishper »

Offline wishper

  • Cannon Fodder
  • **
  • Posts: 2
    • View Profile
Re: Requesting help from Java programmer
« Reply #14 on: February 15, 2010, 12:55:51 pm »
Never mind, I found everything in the wiki  ;D
Now I could start experimenting. I actually have atm very few spare time, but if I make progress I'll post them here. A question: since the semantics look like very different from script to script, I think that a dedicated editor is a better choice.

Is there an order of preference (I guess so) for the editors to be written?