Jump to content
Heeeere's johnny!

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

Recommended Posts

Automated Doors - v2.5

 

news_download_a3_3.png

Download v2.5 from Armaholic


What?
For each player on the map, this script creates and removes triggers on nearby buildings which open the door if a player intends to walk through it and closes it again, when he walks away. This script is configurable and customizable on both server and client side.

Features:

  • all doors open and close automatically
  • usable in Singleplayer (client side) or in Multiplayer (server side only)
  • support for dynamic locations where this script should only work
  • support for side specific locations, where this script only works for players of the respective side
  • actions for the following features:
    • enable/disable automatically closing doors
    • enable/disable "Automated Doors" completely
    • irreversibly* remove all actions related to "Automated Doors"
  • globally force doors to stay open, no matter what the player's actions say
  • can be terminated and restarted without trigger-leftovers or action-leftovers
  • minimized server load due to need-based dynamic object management
  • available as script and as addon

*) Actions will be available again, if you rejoin the server (MP) or restart ArmA (SP) respectively

Supported maps:

  • Altis/Stratis (combined in one file)
  • Chernarus
  • Takistan
  • Zargabad
  • Utes

Why?
At some point, I got annoyed of having to walk really close to a door and sometimes even having to scroll, if my default action is something different, to get the right action to finally open it. Maybe there's some people out there feeling similarly.


How?
Download the script here. (Armaholic, same link as above)

execVM "automatedDoors.sqf"

If you use Automated Doors on a map which is not listed above, but has buildings from one or more of these maps or if you want to override the script's default behavior, paste the respective map name(s) as parameter into the script like this:

[["Altis", "Chernarus", "Takistan"]] execVM "automatedDoors.sqf"

If you don't do so, the script will automatically take into account all maps.

Singleplayer:
Using the script: Execute the above line once upon mission start - that's it.
Using the addon: Start ArmA 3 with startup parameter -mod=@automatedDoors - that's it.

Multiplayer:
Execute this script server side once upon mission start. Client side execution is prevented by "isServer" check.

After joining a mission running this script, it might take a few seconds until it actually works for you as new player, because the sever runs the "scan loop" regularly, not taking into account JIP or just spawned players.


Further Information

 

"Automated Doors" has two optional parameters:

maps -> (optional, default: "all") defines the buildings to be taken into account by this script

-> e.g. ["altis", "chernarus"] means, all buildings from Altis and Chernarus will be taken into account

doorsStayOpen -> (optional, default: false) global definition of door closing behavior

- if true, doors will have to be closed manually, player action "Don't keep doors open" has no effect

- if false, doors will close automatically, player action "Keep doors open" has an effect

You can easily customize important values, like the size of the area of the door triggers, the time between each scan for surrounding buildings or the area to scan on each loop. Do that by changing the defines at the beginning of the file (after the comment block).

Define locations:
If you want this script to only work in certain areas, create locations of type "Name" and set their name with the prefix "doors". This script will check on each scan loop if such locations exist. If so, it will only manage these areas. If all "doors" locations are deleted, this script will handle the whole map again.

Side specific locations:
If you create a location as described above and setVariable ["locationSide", any side here] to it, the doors inside that location automatically open and close only for players of that side.

Have a nice Play!

Changelogs:

v2.5
- automatedDoors.sqf: changed plain numbers in radius array to defines
- outsourced building arrays to separate files and #include them
- added doorsTakistan.sqf (door positions on Takistan)
- added doorsUtes.sqf (door positions on Utes)
- added doorsZargabad.sqf (door positions on Zargabad)
- fnc_getModelPos optimized, because nearestObject might not always take the building the player is in
- slightly optimized handling of first script parameter ("_objects")
- added DOOR_RADIUS_LARGE to all remaining gates on Altis and Stratis

- renamed #define DOOR_RADIUS to DOOR_RADIUS_SMALL
- added #define DOOR_RADIUS_LARGE (6 meters)
- using DOOR_RADIUS_LARGE on very wide fences/doors including "Land_BarGate_F"
- door radius can be individually set for each building class (default is DOOR_RADIUS_SMALL)


v2.4
- renamed #define DOOR_RADIUS to DOOR_RADIUS_SMALL
- added #define DOOR_RADIUS_LARGE (6 meters)
- using DOOR_RADIUS_LARGE on very wide fences/doors including "Land_BarGate_F"
- door radius can be individually set for each building class (default is DOOR_RADIUS_SMALL)


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


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


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


v2.0
- added parameters:
objects (optional, default: ["arma3"]) no use yet, intended to enable ArmA 2 and Tanao object compatibility
doorsStayOpen (optional, default: false)
if true, doors will have to be closed manually
if false, doors will close automatically
- running script can be referred to by global variable "scriptHandle_automatedDoors" (e.g. to terminate)
- added "isServer" check so script does not accidentally run on a client on a multiplayer server
- added actions to enable/disable this script's functionality solely for the player executing the action
- added action to remove (not hide!) all these annoying "Automated Doors" actions ;-)
- added addon version (PBO file) to the project which is invoked with default parameters [["arma3"], false]
- fixed door trigger position for kiosks
- added "Land_u_Barracks_V2_F" to buildings array
- used #define in automatedDoors_debug.sqf for redundant door position arrays, drastically reducing file size
- without #define: 42 kB (1492 lines)
- with #define: 32 kB (784 lines)
- several minor changes

v1.4
- addAction for each player to individually enable/disable automated doors
(added when player joins the server)
- alternatively:
- comment out addAction statements
- set boolean variable "usesAutomatedDoors" to player
-> true = doors open automatically, false = they don't

v1.3
- added "Land_BarGate_F" to buildings array

v1.2
- added kiosks to buildings array
- added support for custom door trigger locations
- locations MUST be of type "Name" and name MUST start with "doors"
- on each scan iteration:
- if door trigger locations exists, door triggers will only be managed in these areas
(all other triggers will be deleted)
- if all door trigger locations are deleted, door triggers are managed throughout the whole map again
- removed some "fool prove" lines as they were unnecessary
- some minor changes

v1.0
- initial release

  • Like 1

Share this post


Link to post
Share on other sites

Great script! What if we wanted to only have automated doors for defines areas?

Dirty Haz

Share this post


Link to post
Share on other sites

First, thanks for the script. It will be very useful!

Having difficulties getting script to work. I put the [] execVM "automatedDoors.sqf"; in the initServer.sqf file right? If so, I cannot get it to work.

Suggestions?

Thanks

CJHammer

Share this post


Link to post
Share on other sites
I put the [] execVM "automatedDoors.sqf"; in the initServer.sqf file right?

Well, no. You need to have a serverside pbo file which contains this file. Otherwise you'd be trying to execute the file as if it were clientside which results in an error message in your rpt log:

Warning Message: Script automatedDoors.sqf not found

---------- Post added at 10:09 ---------- Previous post was at 10:06 ----------

Great script! What if we wanted to only have automated doors for defines areas?

Dirty Haz

Cool idea! I'll implement that soon(ish). :)

Share this post


Link to post
Share on other sites

Nice work Jonny. Script works flawlessly. But where is the realism?

Share this post


Link to post
Share on other sites
Nice work Jonny. Script works flawlessly.

Thanks!

But where is the realism?

This has nothing to do with realism, you're right. But that was not my intention. My intention was to give players and modders a tool to ease whatever they're doing ingame. If they want to use it in missions to encourage lazyness, that's probably not why people chose ArmA over CS, BF or CoD, but that's their decision.

I pesonally use it while developing my scripts and missions, because I tend walk through a lot of buildings or spawn and remove buildings in VR and it just gets annoying always having to open the doors over and over again. So in that terms, it's just easing my developments.

But apart from that, you never know what missions the people of the ArmA community might create, like how realistic are zombies? Or the ArmA version of "flappy bird". My point is, not every ArmA mod is intended to be realisic or even militaristic (see "Altis Life"). They are intended to be fun and maybe the concept of whatever present or future mission might allow or probably even require automated doors. We'll know for sure the day such a mission is created. :)

Share this post


Link to post
Share on other sites

Hey thanks very much for this script Johnny it works perfectly and just what I needed.

Was about to try and write a script to do exactly the same but thanks to you I don't have to now.

Cheers mate.

Share this post


Link to post
Share on other sites
Hey thanks very much for this script Johnny it works perfectly and just what I needed.

Glad to read that.

Was about to try and write a script to do exactly the same but thanks to you I don't have to now.

;)

Share this post


Link to post
Share on other sites

Superb!

Dirty Haz

Share this post


Link to post
Share on other sites

Sounds pretty neat....gonna give it a try. :cheers:

Share this post


Link to post
Share on other sites

duuuuuuuuuuude, i like your script... but your nickname woooooohooooooo :yay: :cool:

Gonna try this tonight. Good job!

  • Like 1

Share this post


Link to post
Share on other sites
Sounds pretty neat....gonna give it a try. :cheers:

Hope you find a somewhat senseful use other than easing mission development (or lazyness ;)).

duuuuuuuuuuude, i like your script... but your nickname woooooohooooooo :yay: :cool:

Gonna try this tonight. Good job!

Thanks and ... yeah, I like my nick too. :cool:

Share this post


Link to post
Share on other sites

Hey Johnny,

 

I know that this is a script, but would you consider making it as a little addon as well.   It is extremely useful, and that functionality would be awesome all the way through all gaming :)

 

Cheers mate.

Share this post


Link to post
Share on other sites

I agree.  I'm an add-on user.  I know nothing about scripting.  So I too would love to see this as an add-on.

 

-V

Share this post


Link to post
Share on other sites

Hey Johnny,

 

I know that this is a script, but would you consider making it as a little addon as well.   It is extremely useful, and that functionality would be awesome all the way through all gaming :)

 

Cheers mate.

 

I agree.  I'm an add-on user.  I know nothing about scripting.  So I too would love to see this as an add-on.

 

-V

 

Thank you guys for your input and support. :)

 

To be honest, I know how to create an addon, but my profession are scripts.

 

Is there a way to pass parameters to an addon's sqf file? Because I wouldn't want to have several PBO files for all possible parameters to invoke the automatedDoors.sqf with, just because it's not possible to pass parameters to an addon.

Share this post


Link to post
Share on other sites

Well if you find out about those parameters then an addon would be greatly appreciated mate :)

Share this post


Link to post
Share on other sites

Well it looks like my request got lost in the change over to the new forum system but I see you saw it before it did. Thank you for adding the option to be able to turn it on/off per user!

 

I also found another building that doesn't work with this script. I don't have the exact classname for it at this moment but there is a old\ruins\delapitated version of the barracks that's not included. it's the one that the ladder doesn't work to get on the roof. I can get the class name for it if you want??

 

Again...awesome script. Thanks!

Share this post


Link to post
Share on other sites

> Is there a way to pass parameters to an addon's sqf file?

 

I don't know.  I'm not a programmer in any way, shape, or form.  I just drop an add-on into the right place and enable or disable it as needed.

 

I'm not worried about all doors.  Just houses.  Those doors get annoying to always open.  I don't really care about automatically opening fences, car doors, and misc. other doors.  Just the standard house doors for CQB.

 

Actually, I use the "Action Button Mod" which makes opening doors a 1-click process.  Still, I play the Pilgrimage mission a lot, and you go into a million homes to look for "loot".  So a mod/add-on that automatically opens house doors would help a lot.

Share this post


Link to post
Share on other sites

Automated Doors - huge 2.0 update!

 

news_download_a3_3.png

Download Automated Doors 2.0 from Armaholic

 

Changelog:

v2.0
- added parameters:
    objects                   (optional, default: ["arma3"]) no use yet, intended to enable ArmA 2 and Tanao object compatibility
    doorsStayOpen   (optional, default: false)
                                     if true, doors will have to be closed manually
                                     if false, doors will close automatically
- running script can be referred to by global variable "scriptHandle_automatedDoors" (e.g. to terminate)
- added "isServer" check so script does not accidentally run on a client on a multiplayer server
- added actions to enable/disable this script's functionality solely for the player executing the action
- added action to remove (not hide!) all these annoying "Automated Doors" actions ;-)
- added addon version (PBO file) to the project which is invoked with default parameters [["arma3"], false]
- fixed door trigger position for kiosks
- added "Land_u_Barracks_V2_F" to buildings array
- used #define in automatedDoors_debug.sqf for redundant door position arrays, drastically reducing file size
    - without #define:    42 kB (1492 lines)
    - with #define:         32 kB (784 lines)
- several minor changes

 

Planned:
- compatibility with ArmA 2 and Tanao objects
- ability to terminate and restart without trigger leftovers

  • Like 2

Share this post


Link to post
Share on other sites

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

 

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)

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

×