Jump to content
Mynock

Closing Doors In Usermade Terrains Possible?

Recommended Posts

Trying to figure out if this is relatively easily do-able. On a lot of community made maps with older "non-Arma 3" buildings, the Object Modifiers module for closing doors within a given radius has no effect. It works fine on Arma 3 vanilla buildings, but does not on other buildings on a lot of community made maps. Unfortunately, it seems like 99% of community made maps have tons of buildings with the doors sitting wide open at mission start which sort of ruins the ability to have players search and clear them in a relatively realistic fashion. I found older threads from previous Arma titles, but none of those scripts did anything but either not work or cause errors.

 

I'm not an Arma wizard, so if it's really complicated to get the doors closed on buildings then I'll have to modify the mission structures for the campaign I'm working on or just scrap the project and start on a different route. But I'm hoping there's a somewhat simple way to fix this that I haven't been able to uncover yet in my searching.

Share this post


Link to post
Share on other sites

You could try this, I'm using it to have a door start open on a mission.

obj1 = position this nearestObject 58927; obj1 animate ["door_3_rot",1];

I've got that line in a logic, and the logic is placed roughly in the centre of the building in question. Said building's ID is 58927, which you can see by pressing the ID button in the editor. From there I just guessed it until the right door swung open. The building was small so this was an easy approach but I imagine it'd be a pain for some larger buildings.

 

Door names might give you a bit of trouble though. I used this on an ArmA 3 building.

Share this post


Link to post
Share on other sites

You could try this, I'm using it to have a door start open on a mission.

obj1 = position this nearestObject 58927; obj1 animate ["door_3_rot",1];

I've got that line in a logic, and the logic is placed roughly in the centre of the building in question. Said building's ID is 58927, which you can see by pressing the ID button in the editor. From there I just guessed it until the right door swung open. The building was small so this was an easy approach but I imagine it'd be a pain for some larger buildings.

 

Door names might give you a bit of trouble though. I used this on an ArmA 3 building.

Gave it a shot, no dice unfortunately. I have no idea what the building's name is, so finding the door for it will be all but impossible. I tried a bunch of generic names I thought might work like "door_1" for example along with about 50 others that made sense, but no luck. Thanks though, this may prove useful to me in another situation.

 

Mynock, look in the Arma 2 threads. You'll find the right door name to be used in beno_83au's script. I had the same issue with A2 containers and found the solution there (ie in the A2 scripting thread).

 

You may try that:

https://forums.bistudio.com/topic/98267-oa-closing-all-the-doors-within-radius/

I had tried what is in that linked thread but no luck with that (on the Thirsk Winter map anyway). I'll try hunting through more of the arma 2 threads to see what I can find, but it's simply not worth hours and hours of research. I'd rather risk pissing off the terrain creator and just placing my own buildings in the mission editor for my mission only without modifying the actual terrain files themselves. Since I'm not modifying their terrain and am just adding mission editor objects I would hope it would be okay, but I have no idea how sensitive the creators are of various maps and if that's a big no-no in the arma community.

 

The whole reason I was asking about this was I want to have a mission with a snowstorm going on but as part of the mission the player has to meet with an informant, and I just think it would look strange to have the player approach a house in the middle of a blizzard with all the doors wide open. Might ruin the atmosphere and immersion a little.

Share this post


Link to post
Share on other sites

The door names will be very different to what I have. I know that "dvere" and "vrata" are ArmA 2 door names but I think they're for the doors (small/large) on the aircraft hangers. So for them it would be "dvere1", "vrata1", "dvere2", "vrata2", etc, according to what I've read.

 

Also, those names are Czech names, which I'm sure fills you with excitement. I did find this while looking for ArmA 3 names a short while ago. It lists a whole bunch of corresponding words in Czech-English so if you're up for it it might be worth browsing.

Share this post


Link to post
Share on other sites
configFile >> "CfgVehicles" >> _houseType >> "AnimationSources"

If you iterate through this as if it were an array, you'll get doors and lights which you can open/close resp. enable/disable using "animate", e.g. by an addAction command. Don't know about naming conventions in ArmA 2, but you may even filter out the lights so you only get the doors.

 

Since, according to the forum rules, advertising personal projects is not permitted and I'm not sure about the following, I'm just saying that there's currently a related project in this subforum which is currently being worked on for compatibility with ArmA 2 buildings. You may wanna keep an eye on that, because this issue here will probably be considered. :)

 

The ultimate question is though, whether these buildings even have animation sources. Because if the doors are wide open because they're static, I don't see a way to solve this other than getting the animation sources into the models. But I'm not into Addon creation so that's not my department.

Share this post


Link to post
Share on other sites

The door names will be very different to what I have. I know that "dvere" and "vrata" are ArmA 2 door names but I think they're for the doors (small/large) on the aircraft hangers. So for them it would be "dvere1", "vrata1", "dvere2", "vrata2", etc, according to what I've read.

 

Also, those names are Czech names, which I'm sure fills you with excitement. I did find this while looking for ArmA 3 names a short while ago. It lists a whole bunch of corresponding words in Czech-English so if you're up for it it might be worth browsing.

Thanks, I'll have a look through that and see if I can get anywhere.

 

configFile >> "CfgVehicles" >> _houseType >> "AnimationSources"

If you iterate through this as if it were an array, you'll get doors and lights which you can open/close resp. enable/disable using "animate", e.g. by an addAction command. Don't know about naming conventions in ArmA 2, but you may even filter out the lights so you only get the doors.

 

Since, according to the forum rules, advertising personal projects is not permitted and I'm not sure about the following, I'm just saying that there's currently a related project in this subforum which is currently being worked on for compatibility with ArmA 2 buildings. You may wanna keep an eye on that, because this issue here will probably be considered. :)

 

The ultimate question is though, whether these buildings even have animation sources. Because if the doors are wide open because they're static, I don't see a way to solve this other than getting the animation sources into the models. But I'm not into Addon creation so that's not my department.

 

I don't know what technically counts as static in a game. The doors in question can be closed and opened via the player action menu, they just happen to be in the open position by default on a lot of user made maps.

Share this post


Link to post
Share on other sites

The doors in question can be closed and opened via the player action menu, they just happen to be in the open position by default on a lot of user made maps.

 

Oh, ok, now I understand. Well that makes things a lot easier:

 

//assuming this exists in the community maps

_mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");

_mapRadius = (_mapCenter select 0) max (_mapCenter select 1);

{

    _houseType = typeOf _x;

    _animationSources = configFile >> "CfgVehicles" >> _houseType >> "AnimationSources";

    _sourceCount = count _animationSources;

    

    for "_i" from 0 to _sourceCount - 1 do

    {

        _sourceName = configName (_animationSources select _i);

        _x animate [_sourceName, 0];

    };

} forEach (nearestObjects [_mapCenter, ["House"], _mapRadius]);

 

Kudos to Killzone_Kid for his SQF to BBCode Converter.

Share this post


Link to post
Share on other sites

 

Oh, ok, now I understand. Well that makes things a lot easier:

 

//assuming this exists in the community maps

_mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");

_mapRadius = (_mapCenter select 0) max (_mapCenter select 1);

{

    _houseType = typeOf _x;

    _animationSources = configFile >> "CfgVehicles" >> _houseType >> "AnimationSources";

    _sourceCount = count _animationSources;

    

    for "_i" from 0 to _sourceCount - 1 do

    {

        _sourceName = configName (_animationSources select _i);

        _x animate [_sourceName, 0];

    };

} forEach (nearestObjects [_mapCenter, ["House"], _mapRadius]);

 

Kudos to Killzone_Kid for his SQF to BBCode Converter.

Thank you for compiling this. Unfortunately I am not an Arma wizard and have no clue what to do with it  :unsure: Where should I place this within the editor or within the specific mission folder to test it out? I'm assuming this would go in an init.sqf file, but I'm not 100% sure. Do I need to change any of the words or variables in that code to apply to a specific structure, map, etc, or should this simply close all non-static doors in the terrain? Thank you for your help thus far, it is appreciated.

Share this post


Link to post
Share on other sites

I'm assuming this would go in an init.sqf file, but I'm not 100% sure.

But you're right. :)

 

Do I need to change any of the words or variables in that code to apply to a specific structure, map, etc,

No.

 

or should this simply close all non-static doors in the terrain?

Yes, having said that it will not only affect doors, but anything which counts as "animation source" which could also be lights or whatever. But unless switching off all lights inside all houses is a problem for you, you can run this without any problem I'm aware of.

 

Thank you for your help thus far, it is appreciated.

You're welcome. :)

Share this post


Link to post
Share on other sites

Had a chance to try that out tonight. Unfortunately it does not close the doors, probably because as you wrote it doesn't exist in the community map I tried it on (Thirsk). I do appreciate the attempt though. I'm going to keep investigating, but it seems as though this may not be possible, or easily solved anyway, at this time, so I will need to either modify my plans for my missions or work around the issue somehow with editor placed structures perhaps. Maybe I'll get really bold and try my hand at the object creator tools and make a couple of my own structures to suit my needs (yeah right, but I can dream). Thanks again for your help beno_83au, 1212pdmcdmppm, and Heeeere's johnny! I really appreciate it.

  • Like 2

Share this post


Link to post
Share on other sites

Replacing the building like you said wouldn't be too bad of an idea, you'd at least have your pick of whatever building you want to use then. Works a charm in VBS when you need to have a different building for whatever reason (usually because it's less than ideal for the scenario), but it shouldn't be too difficult in ArmA.

Share this post


Link to post
Share on other sites

Hello,

 

Was there any further progress on this? 

I have been trying to work a problem with getting doors that are open on the FSF N'Ziwasogo to be closed at the beginning of the mission.  It seems all the doors to buildings on the map start in the open position.  I have tried many iterations of door closing scripts that I know worked in ARMA 2 and I have tried to use the door open/close module.  I am hoping someone may be able to help.  The doors should be able to close I think since a player can actively open and close them.  The script I was trying to use to make it happen is as follows:

0 = [getpos doors,1000] spawn {  sleep 1;  {  private "_b";  _b = _x;  for "_i" from 0 to 7 do {  _b animate ["door_" + str _i + "_rot",0]  };  } foreach ((_this select 0) nearobjects (_this select 1))  }

I know this script (placed in an on activation block of a trigger named doors) works for opening and closing doors on Altis but so far does not do anything for me on the FSF N'Ziwasogo map.  So it would appear to me that the problem is something to do with the map, not necessarily the script, so I was hoping someone with some insight to the map might be able to help me.  Thank you for any help someone might be able to provide me with.

 

I know it seems trivial but I just don't think a military installation would have all of the doors to all of the buildings open...OCD can be a real pain at times....

Share this post


Link to post
Share on other sites

Hello, so in this line of inquiry, I am having issues with CUP A1 and A2 buildings not functioning on Fallujah, in particular the A2_ss_hanger and the A1 budova. the former with no function to close the open doors and the latter with the doors closed; and glass does not break. Is this a Map compatibility issue? Is there a fix to this? 

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

×