Jump to content
Danskkat

Door Locks on Buildings in MP

Recommended Posts

I've been working a mission where I have a bunch of custom buildings placed through Eden.

I need certain doors locked while others not, as one might expect. So I used the attributes editor to lock the correct doors.

 

Works great for me, the host!

However, players who have joined me can open all doors with no problem.

 

I figure I need to remoteExec something somewhere, however, I haven't been able to find a script on the list that works for doors other than vehicles. What am I missing?

Thanks!

Share this post


Link to post
Share on other sites

YUS! Thank you, I did not see that in my Googles.

Much appreciated!

Share this post


Link to post
Share on other sites
13 minutes ago, Danskkat said:

I've been working a mission where I have a bunch of custom buildings placed through Eden.

I need certain doors locked while others not, as one might expect. So I used the attributes editor to lock the correct doors.

 

Works great for me, the host!

However, players who have joined me can open all doors with no problem.

 

I figure I need to remoteExec something somewhere, however, I haven't been able to find a script on the list that works for doors other than vehicles. What am I missing?

i had that issue a week or so ago as well, after testing it seemed that when you set the door in the editor, it is not done globally (for example, door SetVariable ["bis_Disabled_Door_1", 1, false] is what its doing locally where as it needs to do door SetVariable ["bis_Disabled_Door_1", 1, true]). so what you can do is in the init of the building

NumberOfDoors = GetNumber(ConfigFile >> "CfgVehicles" >> (typeOf this) >> "numberOfDoors");
if(NumberOfDoors <= 0) exitWith {};
 
for "_i" from 1 to NumberOfDoors do
{
    this SetVariable[Format["bis_disabled_Door_%1",_i], 1, true];
};

edit sorry didnt see the above post, was tabbed out for a bit before writing

  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, gokitty1199 said:

sorry didnt see the above post, was tabbed out for a bit before writing

Still appreciated. Actually, since it's fresh in your mind from having done it recently:

Did you find a clean way to only have specific doors locked?

I'm not at my computer so haven't looked at the BIS_fnc page for it.

Share this post


Link to post
Share on other sites
2 minutes ago, Danskkat said:

Still appreciated. Actually, since it's fresh in your mind from having done it recently:

Did you find a clean way to only have specific doors locked?

I'm not at my computer so haven't looked at the BIS_fnc page for it.

you would have to figure out the door number. what you can do to figure that out is simply double click on the building in the editor, go to special states(where you control the doors) and you will see door numbers above the doors. open/close them to figure out which ones are which and then simply make an array of

DoorNumbers = [0, 2, 3];
 
{
    this SetVariable[Format["bis_disabled_Door_%1",_x], 1, true];
} ForEach DoorNumbers;

numbers of the doors you want locked. slight change to the script

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, gokitty1199 said:

you would have to figure out the door number. what you can do to figure that out is simply double click on the building in the editor, go to special states(where you control the doors) and you will see door numbers above the doors. open/close them to figure out which ones are which and then simply make an array of


DoorNumbers = [0, 2, 3];
 
{
    this SetVariable[Format["bis_disabled_Door_%1",_x], 1, true];
} ForEach DoorNumbers;

numbers of the doors you want locked. slight change to the script

 

 

Oh slick. Excellent. I did a quick search and couldn't find BIS_disabled_door in any of the script lists I have bookmarked so no wonder I couldn't find it.

Thank you so much. Seriously huge help.

Share this post


Link to post
Share on other sites
1 minute ago, Danskkat said:

 

 

Oh slick. Excellent. I did a quick search and couldn't find BIS_disabled_door in any of the script lists I have bookmarked so no wonder I couldn't find it.

Thank you so much. Seriously huge help.

np, yea the variables themselves that objects have can be tricky to find

Share this post


Link to post
Share on other sites
7 minutes ago, gokitty1199 said:

np, yea the variables themselves that objects have can be tricky to find

Thankfully Eden tells and shows you which door is where. So knowing that's how I can use that script, it should be pretty easy from there. ....... I hope.

 

I'm assuming this needs to be remoteExec

Share this post


Link to post
Share on other sites
2 minutes ago, Danskkat said:

Thankfully Eden tells and shows you which door is where. So knowing that's how I can use that script, it should be pretty easy from there. ....... I hope.

 

I'm assuming this needs to be remoteExec

negative, check out the parameters for SetVariable. the last parameter is a bool which controls whether or not the variable is global or not. so if its set to false it will be the same as if you set it only in the editor like you said in your main post because it is local, if you set it to true then it means its global so it will be that way for all clients

  • Like 1

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

×