Jump to content
Sign in to follow this  
Sasuke

Open/Close H-Barrier Wall with Laptop

Recommended Posts

Hey guys, I've made an FOB for the 2nd Commando's (Using a Template from Armaholic) and I'm adding a classified area for Officers only (Which will just be something nice for the others to look forward to) and the only way to get in is through a laptop code. I've had a few ideas, but the one that I really wish I knew how to do was that a pop-up box (The Yellowy-Green thing lots of addons use) that you have to enter the code into, the you have the option to press "Enter Code".

For the actual removal of it, I'm going to use something along the lines of this.

Hmmm, i think the easiest way to do it would be to setup your outposts in editor where you want them then use "objectName hideObject true;" in effect turning them invisable. then you could use a trigger to turn them visable again with "objectName hideObject false;".. now, i say use a trigger because it has global effect and the hideobject command is local effect, so the trigger should make it so that everyone playing see's them again. (just tested) looks like your going to have to name all your pieces to hide because i couldnt get the "nearestobjects" command to work with all the pieces for some reason. so, just declare somewhere in mission or init your outpost name and objects - example
outpost1 = [bunk1,bunk2,bunk3];

then use a trigger with condition true (so it removes them at mission start). then this in act:

{_x hideObject true} forEach outpost1 

then have another trigger that uses

{_x hideObject false} forEach outpost1 

whenever/however you want to get them back. another issue is a safe place for player who set off outpost to appear. if he's there in the middle, a building could spawn on him. that would be bad ;) also dont use this on ai units, they will still shoot and wont be seen.

Any help would be greatly appreciated. Thanks!

Lieutenant M. Sasuke

2nd Commando's Australian Regiment

Share this post


Link to post
Share on other sites

well for opening the gate, you can use that:

_gateopen = [[block1,Block2], 123456789] execVM "opengate.sqf";

Block1 & block 2 are the Hbarriers you want to act as gate.

123456789 is the password that will open the gate.

opengate.sqf:

_gatearray = _this select 0;
_truepass = _this select 1;

[enter password script here]
//make notice that you need to make a varable named "_usedpass", that will be the password that was entered to the laptop.

if (_usedpass == _truepass) then {
{
_x hideobject true;
} forEach _gatearray;
sleep 10;
{
_x hideobject false;
} forEach _gatearray;
};

**not tested**

cant help you with the entire password idea script, but when you got it, just put it in.

ill give the dialog a try, but it would take time... always wanted to know how to do a ingame dialog, but it looks so complicated...

Edited by Silderoy

Share this post


Link to post
Share on other sites

You could incorporate Wolfrug's codepad script from OFPEC.com. That is what the older life missions used.

Share this post


Link to post
Share on other sites

Having a look at that now... Not sure as to where the mirrors are located, though.

Share this post


Link to post
Share on other sites

Looking at the second link, I've managed to change it up so that it now tends to my own scripts when activated/deactivated.

private ["_bomb", "_id"];
_bomb = _this select 0;
_id = _this select 2;
[b]CODE = [(round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9))];[/b]
_displayok = createdialog "KeypadDefuse";

private ["_code", "_inputcode", "_DEFUSED"];
_code = _this select 0;
_inputcode = _this select 1;
// compare arrays to see if code matches
_DEFUSED = [_code, _inputcode] call BIS_fnc_areEqual;

if (_DEFUSED) then {
titletext ["Password Successful. Area Open.", "PLAIN DOWN"];
Cheget removeaction defuseaction;
};
if (!_DEFUSED) then {
titletext ["PASSWORD FAILED. ALARM TRIGGERED.", "PLAIN DOWN"];
sleep 5;
Playsound "Alarm.ogg"
};

CODEINPUT = [];

However, I need it to only open to the password '365736'. I've been messing around with it for a while now but I can't seem to get it quite right... The BOLD part is what I believe I need to change. I've tried...

CODE = [(365736)];

Any suggestions?

Share this post


Link to post
Share on other sites

sorry I can't help you with the scripting, but can you release a small template with this when you get it fully working so others can use it too?

Thomas

Share this post


Link to post
Share on other sites
code = [3, 6, 5, 7, 3, 6];

Of course... I forgot to keep seperating the numbers... Thank you so much for this!

sorry I can't help you with the scripting, but can you release a small template with this when you get it fully working so others can use it too?

Thomas

When it's finished and working I'll upload a link for a downloadable version... Probably from my Dropbox.

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  

×