GithubHelp home page GithubHelp logo

kymckay / arma-silentmapconverter Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 4.24 MB

A program used to convert SQM files into SQF files for ARMA 2/3.

License: GNU General Public License v3.0

Python 100.00%

arma-silentmapconverter's People

Contributors

astruyk avatar kymckay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arma-silentmapconverter's Issues

Overhaul code

My current method of reading and translating mission.sqm isn't the most ideal. It runs well but I should really redesign it to be more logical and structurally digestible.

Perform init field inline

Instead of using setVehicleInit I should really just have the code run after the unit is created. This allows the program to be useful for A3 and A2.

Remember to replace "this" with the unit variable name.

Add support for waypoints

The code structure to support it is already there, I just need to add in the code to extract and transfer values. Values to support:

  • position
  • placement (placement radius)
  • expCond
  • expActiv
  • type
  • timeoutMin
  • timeoutMid
  • timeoutMax
  • combatMode
  • combat (behavior)
  • speed
  • formation
  • completionRadius
  • showWP

Re-write in another language

Now that I've got the basic program done in python it would be nice to avoid the whole "packaging the interpreter" spiel by re-writing this in another language.

Would cut down on file size and remove some hassle from compiling.

C++ is a possibility.

setWaypointType for each waypoint

Mentioned it on IRC but AI spawned on HC or on server from the script all have their waypoints turned into guard waypoints. With the current generated .sqf it doesn't specify the waypoint type (setWaypointType) after each addWaypoint. Would it be possible to add it? Taking most CBB missions into account, move makes up the vast majority of missions.

This would also be a good way to verify whether guard is now just the default waypoint / if there's a way around the problem or if it's a bigger problem with the creating/recreating waypoints that needs to be reported.

Here's a copy of OP British plus the folder I used to HC if you want to test it yourself https://dl.dropboxusercontent.com/u/14592975/arma3/op_british_smc.rar

Single units and static weapons don't have correct facing

They appear to always face north after spawning, even though they have 'setPos ...' being called with what appear to be the correct values from the original mission/editor. Not sure what's up with this. Maybe they aren't initialized or something?

Objects placed close together don't get spawned at correct location

It looks like objects get shifted to avoid collisions - this messes up things like sandbags. Consider using "CAN_COLLIDE" instead of "FORM" for those objects to allow them to be placed in the same spot as originally pulled from.

To repro:

  1. Create a mission with two overlapping sandbags (that is, with their ends touching and overlapping slightly so they appear to be one object).
  2. Run script on mission
  3. Run generated SQF code to re-create original objects. They appear in different locations than originally placed.

Waypoints are created in the air instead of on the ground

I had a simple mission setup with some units patrolling around some cars blocking the road. When exported into SQF from the mission it looks like their waypoints are added above the ground (visible when I add those units to Zeus). I don't think it's breaking behaviour for this simple test, but it might affect other waypoint types.

My guess is it's an ATL/ASL issue...

Exported mission SQF (Map was Altis):

// Created by SMC v2.0.2
// 03/17/15 17:04:15

// --Vehicles/Objects--
_veh0 = createVehicle ["O_Truck_02_covered_F",[12642.443,15900.986,0],[],0,"FORM"];
    _veh0 setDir -6.5021181;
_veh1 = createVehicle ["O_Truck_02_covered_F",[12631.437,15909.576,0],[],0,"FORM"];
    _veh1 setDir 174.05939;
_veh2 = createVehicle ["Land_BagBunker_Large_F",[12684.727,16139.941,0],[],0,"FORM"];
    _veh2 setDir -197.96167;
// --Units--
_group0 = createGroup west;
_group2 = createGroup east;
    _unit2 = _group2 createUnit ["O_soldier_SL_F",[12613.095,15978.438,0],[],0,"FORM"];
    if (isNull _unit2) then {_unit2 = createVehicle ["O_soldier_SL_F",[12613.095,15978.438,0],[],0,"FORM"]; [_unit2,_group2] call BIS_fnc_spawnCrew;};
        _unit2 setSkill 0.5;
        _unit2 setRank "SERGEANT";
    _unit3 = _group2 createUnit ["O_soldier_AR_F",[12608.095,15973.438,0],[],0,"FORM"];
    if (isNull _unit3) then {_unit3 = createVehicle ["O_soldier_AR_F",[12608.095,15973.438,0],[],0,"FORM"]; [_unit3,_group2] call BIS_fnc_spawnCrew;};
        _unit3 setSkill 0.44999999;
        _unit3 setRank "CORPORAL";
    _unit4 = _group2 createUnit ["O_soldier_AAR_F",[12603.095,15968.438,0],[],0,"FORM"];
    if (isNull _unit4) then {_unit4 = createVehicle ["O_soldier_AAR_F",[12603.095,15968.438,0],[],0,"FORM"]; [_unit4,_group2] call BIS_fnc_spawnCrew;};
        _unit4 setSkill 0.40000001;
    _unit5 = _group2 createUnit ["O_medic_F",[12598.095,15963.438,0],[],0,"FORM"];
    if (isNull _unit5) then {_unit5 = createVehicle ["O_medic_F",[12598.095,15963.438,0],[],0,"FORM"]; [_unit5,_group2] call BIS_fnc_spawnCrew;};
        _unit5 setSkill 0.40000001;
    _unit6 = _group2 createUnit ["O_soldier_TL_F",[12618.095,15973.438,0],[],0,"FORM"];
    if (isNull _unit6) then {_unit6 = createVehicle ["O_soldier_TL_F",[12618.095,15973.438,0],[],0,"FORM"]; [_unit6,_group2] call BIS_fnc_spawnCrew;};
        _unit6 setSkill 0.5;
        _unit6 setRank "SERGEANT";
    _unit7 = _group2 createUnit ["O_soldier_AR_F",[12623.095,15968.438,0],[],0,"FORM"];
    if (isNull _unit7) then {_unit7 = createVehicle ["O_soldier_AR_F",[12623.095,15968.438,0],[],0,"FORM"]; [_unit7,_group2] call BIS_fnc_spawnCrew;};
        _unit7 setSkill 0.40000001;
    _unit8 = _group2 createUnit ["O_soldier_LAT_F",[12628.095,15963.438,0],[],0,"FORM"];
    if (isNull _unit8) then {_unit8 = createVehicle ["O_soldier_LAT_F",[12628.095,15963.438,0],[],0,"FORM"]; [_unit8,_group2] call BIS_fnc_spawnCrew;};
        _unit8 setSkill 0.44999999;
        _unit8 setRank "CORPORAL";
    _unit9 = _group2 createUnit ["O_soldier_F",[12633.095,15958.438,0],[],0,"FORM"];
    if (isNull _unit9) then {_unit9 = createVehicle ["O_soldier_F",[12633.095,15958.438,0],[],0,"FORM"]; [_unit9,_group2] call BIS_fnc_spawnCrew;};
        _unit9 setSkill 0.40000001;
// --Waypoints--
_wp20 = _group2 addWaypoint [[12615.85,15999.277,19.283798],0];
    _wp20 setWaypointBehaviour "SAFE";
_wp21 = _group2 addWaypoint [[12674.478,16112.748,28.636181],0];
_wp22 = _group2 addWaypoint [[13090.5,16163.888,17.052177],0];
_wp23 = _group2 addWaypoint [[13179.168,15965.93,13.909006],0];
_wp24 = _group2 addWaypoint [[13138.612,15754.242,13.263485],0];
_wp25 = _group2 addWaypoint [[12664.796,15743.496,16.572479],0];
_wp26 = _group2 addWaypoint [[12611.768,15940.767,17.200161],0];
    _wp26 setWaypointType "CYCLE";

Overhaul: known issues

  • When replacing magic variable "this" from init fields, all occurrences are replaced. If the string appears within a string or variable name this can result in unwanted replacements.
  • Init fields could have whitespace at the end, which could create bad sqf.
  • Numerical config values can use format 1e+010, these aren't currently recognised

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.