Jump to content
SilentSpike

Silent Map Converter

Recommended Posts

Overview

A simple tool I wrote with python 2.7.9 that will convert SQM files into working SQF code.

Originally written to help convert missions into headless client compatible missions, but I imagine it might be useful to easily set up general AI spawning within a mission.

Usage

  1. Place SMC in the same directory as the SQM file(s) to be converted.
  2. Run SMC.
  3. SQF file(s) with the same respective name(s) will be created in the directory.
  4. Open the file(s) to check that there were no errors in conversion (SMC will create error messages with the prefix "// Error:" ).

For further information on usage and capabilities please see the readme on the github page. It will be up to date and is by no means a wall of text.

If you have any issues then feel free to report them either here or as github issues.

Download / Source Code / Readme:

Please note that if you have python installed then you can just run the script file itself. It behaves exactly the same as the executable.

Source Code

Releases Page

Edited by SilentSpike
  • Like 3

Share this post


Link to post
Share on other sites

I like your SMC!! The Code seems much cleaner! But i have the bug that all empty objects spawning in 10 Meters and falling down.

Can you please check? :)

I really like your scripts, seems more stable then the A2MC.

Share this post


Link to post
Share on other sites

Thanks, I appreciate the praise. I'll look into that issue for you

---------- Post added at 18:53 ---------- Previous post was at 18:40 ----------

I see the issue you're talking about, thanks for reporting that. Can't believe I missed it.

---------- Post added at 19:22 ---------- Previous post was at 18:53 ----------

Fix should be out within the hour, the issue is that I assumed createVehicle/createUnit would use ASL coordinates, but it seems they just use ATL. So I need to replace the z-coordinate with 0.

Edit: I'm also working on some minor improvements to init field extraction so that's why I'm not pushing it straight away.

Edited by SilentSpike

Share this post


Link to post
Share on other sites

Init field extraction sounds important for me, too. Thats the big problem with A2MC :)

Thank you for your fast response!

Share this post


Link to post
Share on other sites

New release is live :) Includes the fixed spawning height and init field stuff.

To expand on the init field improvements:

Because I wanted to make this compatible with both A2 & 3 I couldn't use the setVehicleInit command. So I need to convert the string in the SQM file into SQF that isn't malformed and doesn't use magic variable "this". I already largely covered that, but the improvements in this new version are as follows:

  • Replacement of the substring "this" now only takes place if it isn't immediately preceded or proceeded by anything other than a semicolon, the start/end of the string or a space.
  • Trailing spaces in the init field are now stripped away before checking that it ends with a semi-colon.

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. Soon we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

i downloaded this but when i try run the EXE nothing happens? am i doing something wrong?

thanks

Share this post


Link to post
Share on other sites

Did you read the notes on how to use it? You have to run the exe in the same folder as the SQM file you want to convert (there's no installation or interface).

Edited by SilentSpike

Share this post


Link to post
Share on other sites

Ah right lol cheers.

got it working, but unfortunately it hasnt fixed my issue. the reason i tried ur script out is because a2mc could not set the init of the unit correctly when i include this into the group leaders init.

[this,this, 300, 7, "MOVE", "LIMITED", "YELLOW", "LIMITED", "STAG COLUMN", "", [3,6,9]] call CBA_fnc_taskPatrol;

when i try spawn the units when using ur script, the script error shows undifined variable 'this'.

i understand why the error occurs, i guess ill have to give them waypoints manually. let me know if u manage to fix this coz it would be good to be able to use 'this' in a units init.

looks much better than a2mc btw

Edited by Azer1234

Share this post


Link to post
Share on other sites

i understand why the error occurs, i guess ill have to give them waypoints manually. let me know if u manage to fix this coz it would be good to be able to use 'this' in a units init.

Ah, this is related to the recent change I made to init field stuff. Need to expand my regex to include parentheses and commas.

Will fix that asap. Thank you for bringing it to my attention.

Edited by SilentSpike

Share this post


Link to post
Share on other sites

That sounds great, thanks for sharing. Probably a good thing for compositions and detailed bases (less copypasting).

Share this post


Link to post
Share on other sites

Fix for that issue has now been pushed as version 2.0.2. Thanks again for catching it for me Azer.

---------- Post added at 14:47 ---------- Previous post was at 14:45 ----------

Pete: An update was just pushed to fix a small issue with init fields. You'll want to grab that if you missed it :)

Share this post


Link to post
Share on other sites

Haven't downloaded it yet, it's just bookmarked for when I need it. ;)

Share this post


Link to post
Share on other sites

New version frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. Soon we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

It sounds great.

Does it works for waypoints synchronised with triggers or waypoints synchronized with other waypoints ? (In order to be used with headless client).

Share this post


Link to post
Share on other sites
It sounds great.

Does it works for waypoints synchronised with triggers or waypoints synchronized with other waypoints ? (In order to be used with headless client).

Both :)

Edit: Assuming synchronizeTrigger and synchronizeWaypoint both work as detailed on the biki :p

Edited by SilentSpike

Share this post


Link to post
Share on other sites

I think I will be dropping Arma 2 support from SMC soon since the unit I play with has moved on to Arma 3 exclusively now and it would allow me to improve the readability/performance of the output code using some of the new A3 features.

The current versions of SMC will still be available to download though (and I've got one last update on the way to add some minor improvements/fixes) so if anyone out there is still working with Arma 2 then that will be available to use (I might also split it into a separate tool altogether since it can then make use of some of the depreciated features from A2).

Share this post


Link to post
Share on other sites

Found a much cleaner solution. Today I added optional command line parameter -a2, which will output code compatible with arma 2 rather than arma 3.

Probably going to push an update in a minute or two, just need to check I haven't missed anything.

Also super excited to try out X-cam later! For the unaware:

http://forums.bistudio.com/showthread.php?190508-X-Cam-1-0-for-Arma-3-released

---------- Post added at 20:37 ---------- Previous post was at 20:12 ----------

New release 2.1.3 published :)

Share this post


Link to post
Share on other sites

New version frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. Soon we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

ok so i got your program to try.. its the only one i can find.. but i dont have arma 3.. and cant figure out how to add the argument (-a2) or where to add it.. this info is not at all in your read me, it just tells you what the argument is, expecting you to know how to impliment it.. im sorry but im new to this whole scripting thing and i cant figure out how to do this.... Id gladly like to make a how to video for youtube cuz their isnt one.. easy enough to use for arma 3: put .sqm file into the compile folder hit the SMC icon let it do its thing and vwala... but yeah its always in arma 3 format... havnt tried yet but i dont think arma 2 can read the arma 3 files. Ill bookmark this page so i can find an awnser hopefully soon. thanks tho the whole idea of the program is fantasic!

Share this post


Link to post
Share on other sites

The clue is in the name  :D:

 

command line parameter

 

There are a few ways you can run a program using a command line parameter:

  • Using a shortcut:
    • Right click on your shortcut
    • Go to properties
    • In the "target" field append the parameter onto the end like so:

      C:\Users\Example\Desktop\SilentMapConverter.exe -a2
  • Open the command line and run the program using the desired parameter

    SilentMapConverter.exe -a2
  • If using the .py file, open the command line and (assuming you've got the python path variable set up) execute

    python SilentMapConverter.py -a2
Thanks for pointing that out though, I'll update the OP with this information.

Share this post


Link to post
Share on other sites

Every time I run SMC I get a ton of unwanted text with my sqf.  Here is a example.

// --Vehicles/Objects--
_veh0 = createVehicle ["Logic",[0.46875,0.46875,0],[],0,"CAN_COLLIDE"];
	_veh0 setPosATL [0.46875,0.46875,51.9431];
_veh1 = createVehicle ["Logic",[0.46875,0.46875,0],[],0,"CAN_COLLIDE"];
	_veh1 setPosATL [0.46875,0.46875,51.9431];
_veh2 = createVehicle ["Logic",[0.46875,0.46875,0],[],0,"CAN_COLLIDE"];
	_veh2 setPosATL [0.46875,0.46875,51.9431];
_veh3 = createVehicle ["Logic",[0.46875,0.46875,0],[],0,"CAN_COLLIDE"];
	_veh3 setPosATL [0.46875,0.46875,51.9431];
_veh4 = createVehicle ["Land_PipeWall_concretel_8m_F",[13362.4,4138,0],[],0,"CAN_COLLIDE"];
	_veh4 setPosATL [13362.4,4138,-7.72476e-005];
_veh5 = createVehicle ["Land_PipeWall_concretel_8m_F",[13367.7,4130.67,0],[],0,"CAN_COLLIDE"];
	_veh5 setPosATL [13367.7,4130.67,0];
_veh6 = createVehicle ["Land_PipeWall_concretel_8m_F",[13368.7,4135.66,0],[],0,"CAN_COLLIDE"];
	_veh6 setPosATL [13368.7,4135.66,-2.52724e-005];
_veh7 = createVehicle ["Land_PipeWall_concretel_8m_F",[13358.9,4131.66,0],[],0,"CAN_COLLIDE"];
	_veh7 setPosATL [13358.9,4131.66,0];
_veh8 = createVehicle ["Land_PipeWall_concretel_8m_F",[13374,4152.85,0],[],0,"CAN_COLLIDE"];
	_veh8 setPosATL [13374,4152.85,-2.67029e-005];
_veh9 = createVehicle ["Land_PipeWall_concretel_8m_F",[13373.1,4142.85,0],[],0,"CAN_COLLIDE"];
	_veh9 setPosATL [13373.1,4142.85,-2.86102e-006];
_veh10 = createVehicle ["Land_PipeWall_concretel_8m_F",[13375,4149.73,0],[],0,"CAN_COLLIDE"];
	_veh10 setPosATL [13375,4149.73,4.29153e-006];
_veh11 = createVehicle ["Land_PipeWall_concretel_8m_F",[13368.3,4145.63,0],[],0,"CAN_COLLIDE"];
	_veh11 setPosATL [13368.3,4145.63,1.90735e-006];

I think I need it only from ["Land_PipeWall_concretel_8m_F",[13368.3,4145.63,0],[],0,"CAN_COLLIDE"] or something?

and if there is more then one, there needs to be a , after the ], but not the last.  But yeah,  the _veh** is getting in the way?

Share this post


Link to post
Share on other sites

Will this get an update for 3den missions? If not, does anyone know a good alternative?

 


 

Every time I run SMC I get a ton of unwanted text with my sqf.  Here is a example.

 

What you posted is a script that creates those PipeWalls for you. Is this what you want instead?:

yourObjects = [
    ["Land_PipeWall_concretel_8m_F",[13362.4,4138,0],[],0,"CAN_COLLIDE"],
    ["Land_PipeWall_concretel_8m_F",[13367.7,4130.67,0],[],0,"CAN_COLLIDE"],
    ["Land_PipeWall_concretel_8m_F",[13368.7,4135.66,0],[],0,"CAN_COLLIDE"]
];

Why? This - by itself - will not do anything.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×