Jump to content
Sign in to follow this  
Rommel

[OA] Closing all The doors within radius

Recommended Posts

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

I thought this code to be so bloody useful in the now prominent and constant CQB setting we find ourselves within OA, how can I close all the doors. :p

That others may want it also; enjoy.

EDIT: We need a code snippets thread for things like this.

Edited by Rommel

Share this post


Link to post
Share on other sites

It would be nice as it can be a pain finding the right bit of code, 4I was looking for a bit of code like that the other day.

Share this post


Link to post
Share on other sites

Interesting, last night I was looking for a solution like that and here it is. :)

EDIT: We need a code snippets thread for things like this.

Well why you just don't create one then? :p

Share this post


Link to post
Share on other sites

Thanks for the code Rommel, and I fully support the idea of snippets threads.

Share this post


Link to post
Share on other sites

Make a code snippet thread, and link to it in your sticky FAQ thread :shine:

Share this post


Link to post
Share on other sites

lol, On my mission lastnight I was placing all kinds of game logics to do this. Perfect timing. Now I can go clean it up with this code. Thank you much for sharing!

Share this post


Link to post
Share on other sites

so umm heres a very noob question where would i put that code to close the doors, i just wanna add it into the domination map, for the main base and a little FOB i created for my group of guys?

Share this post


Link to post
Share on other sites

i thoguth maybe there could be a place for this in the Biki as it seems a good community edited place to house it

Share this post


Link to post
Share on other sites

i placed it in the init line of a invisable H, and it seems to only close the single doors...I put it in the mine by Farad Adad, and the big garage and cargo container doors stayed ope, buy the single doors on the house closed.

Share this post


Link to post
Share on other sites

Amazing, I come onto the forum thinking it could take 2-3 hours to learn how to write ninety pages of BIS script to close doors and instead I find this in less than 10 seconds.

KUDOS TO YOU ROMMEL! <3 lol

Share this post


Link to post
Share on other sites

I tried to use this script with both an invisible H and a trigger but with no luck.

I have the code saved as "door.sqf" and saved it in the init file. in the init (for the H) and/or in the on act (for the trigger) i put "null = [this] execVM "doors.sqf"; no dice, I also took the "[]" off "this", no dice. Its going to be something really stupid I'm sure, as I'm all thumbs with this stuff.

Any help would be greatly appreciated!

Its on the Zargabad map if that makes a difference.

Share this post


Link to post
Share on other sites

all i did was copied the code rigt into the init line of the invis H and it works, just doens't close double-sided doors for me atleast

Share this post


Link to post
Share on other sites

I placed in gameLogic and it closes every single door within the radius. This includes the double wooden doors at the Zargabad market area.

Share this post


Link to post
Share on other sites

Odd I've placed the code in a gamelogic and H and nothing not a single door closes.

Well it does work but not on the first lot of doors I tried it on, it seems not to work on barracks or control tower doors or older Arma2 buildings.

It seemsto close the door on some buildings it's _b animate ["dvere" + str _i,0] not _b animate ["dvere" + str _i,1] even then I still find doors that aren't working with the script but will work manually.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Anyone know the door anims for the long barrack objects (mil_barracks_i.p3d) found at the Utes airport?

Never mind, found it. "Door_01". All thanks to Arma1 config explorer :)

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Thank you for this Rommel, you're a life saver. And thank you as well CarlGustaffa for finding that barracs door anim. It was driving me crazy :)

Share this post


Link to post
Share on other sites

Just be careful opening and closing doors, if you quit a game while the doors are in transition they will fail to operate again until a new map is loaded.

This had been fixed in the latest beta patches.

Share this post


Link to post
Share on other sites

Awesome. :)

And someone make a snippets thread right away! It would probably be the most popular thread in this section. :D

Share this post


Link to post
Share on other sites

hate to bring up an old thread, i just wanted to say thank you, this is an amazing and easy to use script! :) hope it works in MP

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
Sign in to follow this  

×