Jump to content
pierremgi

[Sharing] Make the doors openable again on KUNDUZ map

Recommended Posts

Hi all,

If you used to play on Kunduz, Afghanistan map, you remarked the doors of any building are not active.

Here is a simple code to add in initPlayerLocal.sqf to make them work. (Create it in mission root if missing)

 

 

if (modParams ["@Kunduz, Afghanistan", ["active"]] param [0,false]) then {
inGameUISetEventHandler ["action","
  private _intersects = [];
  if (_this select 4 == 'Close Door' or _this select 4 == 'Close Window') then {
    _anims = 'true' configClasses (configfile >> 'CfgVehicles' >> typeof cursorObject >> 'AnimationSources') apply {configName _x};
    {
      _intersects = ([cursorObject, _x] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]);
      if (count (_intersects select 0) > 0) exitwith {_intersects}
    } forEach  ['VIEW','GEOM','FIRE'];
    if (count _intersects > 0) then {
      _select_door = (_intersects select 0) select 0;
      {
        if (count _anims > 0 && {[_select_door,_x] call Bis_fnc_inString}) exitWith {
  	      cursorObject animateSource [_x, 0];true}; false
      } forEach _anims;
    };
  };
  if (_this select 4 == 'Open Door' or _this select 4 == 'Open Window') then {
    _anims = 'true' configClasses (configfile >> 'CfgVehicles' >> typeof cursorObject >> 'AnimationSources') apply {configName _x};
    {
      _intersects = ([cursorObject, _x] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]);
      if (count (_intersects select 0) > 0) exitwith {_intersects}
    } forEach  ['VIEW','GEOM','FIRE'];
    if (count _intersects > 0) then {
      _select_door = (_intersects select 0) select 0;
      {
        if (count _anims > 0 && {[_select_door,_x] call Bis_fnc_inString}) exitWith {
          cursorObject animateSource [_x, 1];true};false
      } forEach _anims;
    };
  };
"];
};

 

Have fun on this beautiful map.

 

Updated Nov. 20th 2018 (see comments)

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I tested your link. It's a good news that people can use this great map without worrying for extra script. I'll just keep this thread as is until the new map is shrunk (binarized) and signed.

A 1 Go + signed map can be preferred to a 1.5 Go non-signed one.

 

I'm looking for a script detecting which map is used (Kunduz or Kunduz -  Fixed doors), while in game. More exactly, one of these values:

    publishedid = 0;
    name = "Kunduz, Afghanistan - Fixed Doors";
in meta.cpp located in the addOn folder.

These data seem to be the workable differences between the two maps. I looked for cfgWorlds or some cfgVehicles for houses.  I didn't find any difference between the 2 maps.
configsourceModList and configSourceAddonList  don't help here.

 

My aim is to check what map is loaded then run or not this script.

Share this post


Link to post
Share on other sites
8 minutes ago, HazJ said:

 

Thanks.These mods are same in regard their mod.cpp. Both returning:

 

name = "Kunduz, Afghanistan";
picture = "\pra3\pra3_kz\data\icons\kunduz_icon_ca.paa";
actionName = "Forums";
action = "https://forums.bistudio.com/topic/177230-kunduz-afghanistan-10km-v1x/";
description = "Kunduz, Afghanistan";
logo = "\pra3\pra3_kz\data\icons\kunduz_logo_ca";
logoOver = "\pra3\pra3_kz\data\icons\kunduz_logoOver_ca";
tooltip = "Kunduz";
tooltipOwned = "Kunduz, Afghanistan Owned";
overview = "With over one year of work and many failed attempts I'd like to thank Bohemia Interactive, contributors and the Arma 3 terrain modding community for their part in the successful completion of this terrain.";
author = "James2464";
overviewPicture = "\pra3\pra3_kz\data\icons\kunduz_icon_ca.paa";

 

But...

Once again the KK's comment was helpful!

In fact,  the check returns true for:

modParams ["@Kunduz Afghanistan - Fixed Doors", ["active"]] param [0,false]     // for the map with fixed door

and

modParams ["@Kunduz, Afghanistan", ["active"]] param [0,false]   // for the old one.

Note the @ seems to be mandatory here. (copy/paste the folder from the rpt file).

 

 

Note: Tested on server hosted + client:  players can have any version of this map. That works.  With the @Kunduz, Afghanistan one, the players will run my script. 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, pierremgi said:

I'm looking for a script detecting which map is used (Kunduz or Kunduz -  Fixed doors), while in game.

We should see if we can contact James and see if he can give us permission to fix these little aspects of the map that are needed, and reupload.

  • Like 2

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

×