Jump to content
Heeeere's johnny!

[SCRIPT] Automated Doors 2.5 - doors open and close automatically

Recommended Posts

Just used addon version ..THANKYOU !!  It is wonderful.

I'm glad to read that. :)

 

However, I found that I was able to open doors from quite a distance.... any way to tweak the sensitivity down just a fraction (seems like 50cm too far)

The trigger radius is currently set to 5 meters, because that's where you can basically run through the door without stopping. However, that's one of the reasons why I looked for a way to call an addon with parameters.

 

I don't know how other players feel about that, but of course I can trim it down. Just give me a feeling from which distance the door should open and I'll upload a version just for you to test. ;)

 

Have a nice Play!

Johnny

Share this post


Link to post
Share on other sites

Actually now that you say it is to do with running, that makes sense.   Now here is a thing .... is it POSSIBLE that the addon/script detects the speed you are travelling and sets the open distance accordingly (as it is for running and about 3.5m for walking) ?

 

This addon has made it into my 'always on' list.  Thanks for that !

Share this post


Link to post
Share on other sites

Now here is a thing .... is it POSSIBLE that the addon/script detects the speed you are travelling and sets the open distance accordingly (as it is for running and about 3.5m for walking) ?

 

Short answer:

Don't think so, but I'm not sure.

 

Long answer:

The way this system works is that it creates triggers which have a certain area with the given radius (5 meters) and if you enter that area, the door opens.

 

Now, it is possible to resize that area, but since triggers are global objects, this resizing would also happen to every other player when we're talking Multiplayer. But even for Singleplayer purposes, right now I cannot think of an efficient way of doing that other than grabbing all triggers and resizing their area everytime you start/stop running.

 

I uploaded some modified versions though with 4m, 3.5m and 3m radius, which you can find here:

 

https://spideroak.com/browse/share/see/sqf/sqf/automatedDoors/2.0_4m/

https://spideroak.com/browse/share/see/sqf/sqf/automatedDoors/2.0_3.5m/

https://spideroak.com/browse/share/see/sqf/sqf/automatedDoors/2.0_3m/

 

You may want to try them out and see if one of them fits your needs better than the default version with 5m.

 

Have a nice Play!

Johnny

Share this post


Link to post
Share on other sites

Johnny, you are a star Sir ... will test them out and feedback to you!

Share this post


Link to post
Share on other sites

Many thanks for the addon version.....as Kremator said earlier this is now part of my "always on" mods......Genius.  :D

Share this post


Link to post
Share on other sites

Johnny, you are a star Sir

 

Genius.  :D

 

Well, I must admit, these titles were still missing on the list of what people called me so far. ;)

 

Thanks for your appreciation! :)

  • Like 1

Share this post


Link to post
Share on other sites

I've settled on the 3m in the end. It means that I need to get close enough to not trigger accidentally. In fact, even when running there is only a little pause as I wait for the door to open, but I can live with that.

Your praise is deserved. Now move onto another project that will make our Arma experience better :)

Share this post


Link to post
Share on other sites
Yeeeeeah...tear down this door... johnny!  :D 

 

It´s a kind of feature i was always looking for.

In the past i often got a bullet after the "open door action".

This addon eliminates the annoying "open the door please".

 

Thx for that great work and the update.

 

Greetings

McLupo

  • Like 1

Share this post


Link to post
Share on other sites

Does this install like a Mod or like an UPSMON script?

 

Do I install in the typical Mod @folder within SteamApp/common/

 

Or do I just run as a script like UpSMon?

Share this post


Link to post
Share on other sites

Does this install like a Mod or like an UPSMON script?

 

Do I install in the typical Mod @folder within SteamApp/common/

 

Or do I just run as a script like UpSMon?

Depends if you want to add it to every mission or have it automatically enabled.  If the latter yes, put it in the Arma3 root directory (where arma3.exe is) and then run the commandline -mod=@automatedDoors;

  • Like 1

Share this post


Link to post
Share on other sites

I also found that 3m seems to be the sweet spot. You can't run full on and have the door open in time but realistically that doesn't happen anyway. But you can open everydoor and gate without it pinning you against a wall or pushing you to the side etc.

 

I noticed on my mission that if I die and respawn that the add actions are no longer there. I play on a dedicated server. Has anyone else noticed this or do I have something interfering with this script?

 

And a question. how do I set the params on the server?(what to put and where)  Ex. to have the doors stay open automatically.

Share this post


Link to post
Share on other sites

I also found that 3m seems to be the sweet spot. You can't run full on and have the door open in time but realistically that doesn't happen anyway. But you can open everydoor and gate without it pinning you against a wall or pushing you to the side etc.

That is actually a really good point which is why I'll make 3m the new default range in v2.1 :)

 

I noticed on my mission that if I die and respawn that the add actions are no longer there. I play on a dedicated server. Has anyone else noticed this or do I have something interfering with this script?

I'm glad you mentioned that, because I never tested what would happen after death and respawn. Thanks for mentioning, I'll put that in as well.

 

And a question. how do I set the params on the server?(what to put and where)  Ex. to have the doors stay open automatically.

If you run the script server side, you just have to invoke it with the respective parameters, meaning:

[["arma3"], true] execVM "automatedDoors.sqf"

["arma3"] - the types of buildings which this scrpt should work on. Currently, there's no other possibilities that "arma3", because other stuff is WIP, but in the future it's supposed to support "arma2" for ArmA 2 objects are in some community maps. Also, when Tanao is out, it's supposed to support Tanao objects as well.

true - doors stay open (default = false) - if true, they will open automatically, but have to be closed manually, no matter what the actions of the players say.

 

If you want to change other parameters, like the size of the trigger area, you can do that with the #defines in the top of the script (under the big comment block).

Share this post


Link to post
Share on other sites

Automated Doors v2.1

 

news_download_a3_3.png

Download v2.1 from Armaholic


Changelog:

v2.1
- reduced default door trigger radius to 3 meters
- if scriptHandle_automatedDoors is terminated, all related triggers and actions will be removed
- door actions will be readded upon respawn
- scriptHandle_automatedDoors is broadcast to the clients, because it's needed for creating/removing the actions
  -> terminating the script client side does not affect the script server side
- a few minor changes

Share this post


Link to post
Share on other sites

The event handler you added doesn't work in a dedicated server environment.

player addEventHandler ["Respawn", _fnc_addDoorActions];

I'm not an experienced coder by a long shot but the only way I could get this to work was to make that line a function and then call it  using the BIS_fnc_MP to execute it on all the clients.

 

There's probably better ways of doing that however!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the hint! This was actually a fail on my side, because using "player" on the server does not make sense. But I didn't realize that, because I didn't test it in MP.

 

Quickfix:

[[[_fnc_addDoorActions], {player addEventHandler ["Respawn", _this select 0];}], "BIS_fnc_call", true, true, true] call BIS_fnc_MP;

A proper fix will be in the next update, which will come very soon.

Share this post


Link to post
Share on other sites

Automated Doors v2.2

 

news_download_a3_3.png

Download v2.2 from Armaholic

 

Changelog:

v2.2
- fixed server side execution of "player addEventHandler ..." -> now in BIS_fnc_MP call
- added Chernarus buildings to buildings array
- replaced that fuckup of compile statement with better readable function initialization
- added optional "isInverted" parameter for each door
-> some doors in Chernarus buildings are twisted in functionality (1 = closed, 0 = open)
- changed default parameter to ["all"] -> all buildings arrays are taken into account
- addon version is invoked with ["all"] parameter

 

Hey guys,

version 2.2 now supports buildings from Chernarus as they were in ArmA 2. At this point, I will need your feedback even more.

Some door functionalities were twisted, meaning open = 0 and closed = 1 as opposed to the usual behaviour. So that had to be taken care of by additional scripting work. Please report if you experience any problems with these buildings on ported or custom maps. Of course nevertheless, also report any other issues you encounter.

 

I really appreciate your help! Stay tuned for more updates.

Have a nice Play!
Johnny

Share this post


Link to post
Share on other sites

Excellent Johnny, will check it out when I get home.

Have you thought of extending the mod in which it animates closed vehicle driver / passenger of doors when you get within a metre or so?

Share this post


Link to post
Share on other sites

Ok. Whaaat? Who did that?

 

Really this is going in wrong direction.

 

Instead of doing abracadabra with doors like in some freaking horror scenario we all should think about leak of proper animations for opening/closing house doors  or cars.

 

I realize that we all are bored with scrolling action which is such primitive.

Share this post


Link to post
Share on other sites

Have you thought of extending the mod in which it animates closed vehicle driver / passenger of doors when you get within a metre or so?

Actually, I don't really see a benefit in that. Who knows how many vehicles there will be on the map. Just think about a Life Mod. This could potentially be a "trigger overkill" and all that just for a slightly more immersive appearence.

 

Currently, there's still a lot of buildings which need to be added, but my real life has priority which is why it took me so long even for the few ArmA 2 buildings. But I have plans to improve the speed this works and maybe, when all that is done, I'll think about vehicles. ;)

Share this post


Link to post
Share on other sites

Been using this steady since the last update and it's been working flawlessly!!! Thank you very much for the great script!!! That was always a pet peeve of mine with arma was having to be so  close to the doors that you get pinned half the time or not being able to find the open door action at all (mostly the gates), especially under fire!!

  • Like 1

Share this post


Link to post
Share on other sites

Automated Doors v2.3

 

news_download_a3_3.png

Download v2.3 from Armaholic


Changelog:

v2.3
- fixed door positions for "Land_i_Barracks_V1_dam_F" and "Land_i_Barracks_V2_dam_F"
- fixed search for locations, because "mapCenter" from configFile is not the exact map center
- added support for side specific locations
  -> setVariable ["locationSide", any side here] to a location with name "doors..."
  -> doors inside that location automatically open only for players of that side
- "action removal waiting loop" is terminated when all script-related actions are removed intentionally by the player



Hey guys,

it took a while, but here's a small update on this thing. Actually, I hope anyone needs it, at all. :D Anyway, I will continue to make this thing work for more ArmA maps and hopefully it won't take too long. But please be patient with me, real life is never far away. ;)

 

Finfally, please report any bugs, lags, high client/server load, anything you feel is an issue directly related to this script. Thanks for your support. :D

Have a nice Play!
Johnny

Share this post


Link to post
Share on other sites

Hey, Sorry about a post this late. What's the open radius of Bar Gates? I want to use them in an FOB Setup where they automatically open when my vehicle(Oshkosh M-ATV Propulse from RPA Refined Vehicles) gets within 6 Meters and Close when I get about 7 meters past them. 

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

×