Author: lotherk
Author Website:

Requirements: No addons required

Version: 0.5.1 beta

Short description: This tool converts missions made in the 2D editor to sqf scripts to be able to dynaically load it when needed.

Date: 2012-11-13 09:55


Comments: (0)
Rating:



 

Arma2MapConverter (A2MC)

by
lotherk


Description:
Since me and part of my clan AvD (located in Germany) started writing our own mission type, we had the need of converting units/objects/markers and stuff placed in the 2D editor into sqf scripts to dynamically load these while playing our upcoming mission "AvD World" (shall be something between a RPG, Domination and CTI style mission type.)

We searched the net a lot but only found out that there are some 3D to 2D converters but not the other way around. So I decided to write my own converter.

I want to announce my first public beta release that has the features of converting units, groups and more. It is not yet stable because I now actually start using this tool in a productive way and there might cover up some bugs and the lack of features.

Features:
- Returns an multidimensional array containing all created units, markers and triggers. (For you to later delete them after mission is finished for example.)

Working conversions:
- Units
- Groups
- Triggers
- Waypoints
- Markers

Might work:
- Conversion of objects since they are basically empty vehicles. I didn't tested these yet (why?!) but I can imaging that they might cause problems because of the converter's writing code to set a rank. Tell me if you have success on this (if I didn't test it before by myself ;>)

Actually not working:
- Triggers grouped with units
- Any type of synchronization
- Modules
- Any mission settings like time and date, weather and stuff. (I don't really know if it will support these types in the future at all.)
- Intro/Outro (same consideration here if they will be supported in the future, let me know what you think)


Usage:
Simple open the a2mc.exe and select the mission.sqm. After doing this, a second file selector window will pop up to ask you for a location to save the generated sqf code to. You can also call the a2mc.exe on the command line and pass input and output source as parameter. I have further plans to improve (well, even create one) the gui.

The converter will not notify you about success or failures. It will just show the 2 file selections and exit. If you start a2mc.exe from command line, you will see much more output. Do not believe in the counts of units, triggers and waypoints created. They are just wrong and I didn't fixed this yet.

To include the resulting file into your mission, you can simply "run" the script by execVM.

# _myMissionReturns select 0 will contain every units created
# _myMissionReturns select 1 will contain every markers created
# _myMissionReturns select 2 will contain every triggers created
_myMission = compile preprocessFile "convertedMission.sqf";
_myMissionReturns = [] call _myMission;

Attention:
Return values do only work if you call the script by "call". execVM or spawn will create a parallel executing of the script without waiting for return values.


Example mission:
The download comes with an example mission "a2mc.Utes" where mission.sqm basically just has the player set and test.sqf that is the conversion of the original mission.sqm (not yet added to the download archive, sorry). It's testing waypoint, trigger, unit, group, vehicle and marker conversion.

The resulting code should be well-formatted and if you find logical failures or something else I should change, just let me know. See https://github.com/lotherk/Arma2MapConverter/blob/master/output.sqf

To follow the releases, visit https://sourceforge.net/projects/a2mc/files/beta-releases/
I will also place them here on the Armaholic forums.

You can also check out the source code (Java) or track the development by yourself on github.com or read the commit log here.


Author notes:
I hope this is useful for someone and I'm happy to finally give something back to the community. If you find bugs (and I bet you will) or have features requests, ideas, improvements or whatever, please let me know or post it in the release thread.
I'm "very" new to SQF scripting but am writing code since years so it's not that difficult for me to understand technical things. I'm also just discovering when and why you have to respect when isServer is needed... I think you know what I mean.


Credits & Thanks:
This is my very first posting to the ArmA Community although I'm enjoying Scripts, AddOns, Modules and more stuff from you guys since years. First of all, I want to thank all the great modders and scripters out there that made playing ArmA for me and my friends more than just a
"game". Big up and lots of respect for your work!


Known issues:
Nothing to see in arma2oa.rpt, so it seems to work without errors. logical errors might exist. I also updated the forum thread.
Thank you for giving me a place for a2mc and have a nice weekend! :-) lotherk


Changelog:
v0.5.1
fixes:
- dedicated server crash due to wrong set waypoints.
- trigger statements has to be "this" by default, was "true".
- empty vehicles are now (really) beeing created.
- units beeing created are now using "NONE" as special for default, was "CAN_COLLIDE" before. This will be a selectable option in a2mc 1.0 (with a nice gui)


Forums topic:
- Armaholic forums




Enable javascript to be able to download from Armaholic please!



Tags: No tags