The Java crowd hasn't been getting much love recently, so I thought I would put together a simple "Java Tech Demo" to give people not familiar with Java an idea what will hopefully be in store for us down the road.
I call this a tech demo because I cover too much ground and don't have time to fully explain everything. However, people should be able to follow along without too much difficulty. I was originally just going to write an article, but that quickly turned into a wall of text that most people would likely find hard to follow. So instead I've make a short (11 minutes) screencast.
Acknowledgements
I would like to thank the following people/organizations.
- BIS for giving me permission to put the jniscripting.jar on my Maven repository.
- [EVO] Dan for permission to use his Convoy Attack as the basis for this demo.
- OFPEC for allowing people to use the ofpec.com domain for Java packages (If you have a tag registered at OFPEC). Since I have registered the tag "SLAP" at OFPEC I am permitted to use com.ofpec.slap when naming Java packages, modules etc.
The Video
Download the video: Java Tech Demo (101MB)
Notes
Here is the information you see me enter into the dialog boxes, etc in the video. This won't make any sense until you watch the video, but instead of trying to write down everything I type I've included the information below.
To download the settings.xml file
- Go to http://maven.suderman.com
- Right click on the settings.xml file and select Save Link as... (or whatever is appropriate for your browser).
- Close your browser.
- Open a command prompt.
- mkdir .m2
- copy Downloads\settings.xml .m2
- Close the command prompt.
Maven archetype information
- Archetype Group Id: com.ofpec.slap.maven
- Archetype Artifact Id: tkoh-archetype
- Archetype version: 1.0.0
- Repository URL: http://maven.suderman.com/release
The Reaper module:
- Group Id: com.ofpec.slap
- Artifact Id: reaper
- Version: 1.0.0
The Vehicle Respawner module:
- Group Id: com.ofpec.slap
- Artifact Id: respawner
- Version: 1.0.0
Modifying the mission
Remove all SQF code from the init fields of the four helicopter.
Give each helicopter a variable name (I used helo1, helo2, helo3, helo4).
The init.sqf script
Comment out the line that calls cly_removedead.sqs
Add the following two lines:
ConclusionCode:GameManager = jLoad "com.ofpec.slap.examples.convoy.GameManager"; GameManager jCall ["init", [helo1, helo2, helo3, helo4]];
I have not tested this mission or the Java code. The mission may not work as advertised and may cause frequent CTDs. The intent is not to provide working code, but to give an overview of some the features available during Java development. In particular we use Maven to build our source code and handle dependency management. We don't have to edit a single line of XML, and we automagically have the source code and documentation avaiable for the "third party" modules (reaper and respawner) that we use.
Enjoy!
HOME
Reply With Quote



