Jump to content
Sign in to follow this  
void_false

Lock an object?

Recommended Posts

First of all, good time of a day, pll!

While making another mission i got stuck with one little thing: is it possible to lock somehow doors on resistance building? I just dont want to let player access some house, before he achieves some objectives.

I thought about placing closed house on the map . The house that has windows and doors only as textures. And after player achieves needed objectives i delete this house and place instead of it new one with windows and working doors.

But, hell, this looks weird wink_o.gif

Thanks in advance for any help smile_o.gif

Share this post


Link to post
Share on other sites

well, if u can detect if that door is open, u can close it with object ID [animate blablabla, but i dunno if u can detect it sad_o.gif

Share this post


Link to post
Share on other sites

UNPBO the BAS demo mission Ranger Raiders, this mission features a locked door smile_o.gif

Share this post


Link to post
Share on other sites

Well, thx for help.

But, Ironsight, i dont want to use addon smile_o.gif

Share this post


Link to post
Share on other sites
Well, thx for help.

But, Ironsight, i dont want to use addon  smile_o.gif

So read what he's writing:

Quote[/b] ]UNPBO the BAS demo mission Ranger Raiders, this mission features a locked door

By de-PBOing the mission, you can see how they pulled the trick.

Share this post


Link to post
Share on other sites
Well, thx for help.

But, Ironsight, i dont want to use addon  smile_o.gif

So read what he's writing:

Quote[/b] ]UNPBO the BAS demo mission Ranger Raiders, this mission features a locked door  

By de-PBOing the mission, you can see how they pulled the trick.

Seems pretty handy to me, UNPBOing a mission learns me a lot about making such additions to missions smile_o.gif

Share this post


Link to post
Share on other sites

Ok, i looked on BAS site and didnt find Ranger Raiders mission. BAS always uses strange addons such as their gamelogicls, so i thing they made a trick espessialy with some kind of addon.

Nevermind. just plz tell me where can i find that mission.

Share this post


Link to post
Share on other sites
Ok, i looked on BAS site and didnt find Ranger Raiders mission.

It's in the demo mission pack for the Delta/Ranger pack, it's on the download page  smile_o.gif

EDIT: A little mistake, look on the mission page since the addons page is offline wink_o.gif

Share this post


Link to post
Share on other sites

Heh, i have the addon but deleted missions. Downloading again  tounge_o.gif

EDIT:

Can you point me the link?

Share this post


Link to post
Share on other sites

try

object 15832 animate ["dvere",0]

to close the door

object 15832 animate ["dvere",1]

to open it

It's "dver","dvere","dvere1" or "dvere01"

I'm cant check it here...

15832 is just an ID I choose, I dunno it's a house...

Share this post


Link to post
Share on other sites

then i come in front of door and press middle mouse's button on action "Open Door" wink_o.gif

Share this post


Link to post
Share on other sites
well, if u can detect if that door is open, u can close it with object ID [animate blablabla, but i dunno if u can detect it  sad_o.gif

Should be something like this :

?object 15452 animationphase "dvere" > 0.01 : hint "door's open"

or

?object 15452 animationphase "dvere" < 0.9 : hint "door's closing"

Share this post


Link to post
Share on other sites

Well guys, looks like you completely dont understand me. I need to _lock_ the door. i dont need to close or open it. i just need it to be something like you have no that action to open door.

Share this post


Link to post
Share on other sites

You can't remove the action, but you lock it

lol, ok try this then :

[15421] exec "lockdoor.sqs"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

lockdoor.sqs

_ID = _this select 0

_unlockit = false

object _ID animate ["dvere",0]

#loop

?_unlockit : exit

?object _ID animationphase "dvere" > 0.01 : object _ID animate ["dvere",0]

~0.01

goto "loop"

Share this post


Link to post
Share on other sites

I don't know if you solved your problem yet but here is the exact link

Good luck with it wink_o.gif

Share this post


Link to post
Share on other sites

Thank you very much for help. thanks for script. I made small modifications to make it work propertly. Because it didnt let to *close* the door  biggrin_o.gif

here's new one:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_ID = _this select 0

_unlockit = false

object _ID animate ["dvere1",1]

#loop

?_unlockit : exit

?object _ID animationphase "dvere1" < 1 : object _ID animate ["dvere1",1]

~0.01

goto "loop"

Door slightly moves when you try to open it, but it is even better. I will add sound on event so it will look more realistic smile_o.gif

EDIT:

Tested on Victor Troska's house tounge_o.gif

Share this post


Link to post
Share on other sites

very useful script, thx! it would be interesting to know whether the script posted here matches the way BAS does it in that mission ...

Share this post


Link to post
Share on other sites

Yeah! thx everybody for help  smile_o.gif

BTW that mission doesnt run for me. some addons missing. What i wanted to ask is that which addons does it need? i have bavehawks and blackhawks + de/ra. Maybe it needs littlebirds? Or what?

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_ID = _this select 0

unlockit = false

object _ID animate ["dvere1",1]

#loop

?unlockit : exit

?object _ID animationphase "dvere1" < 1 : object _ID animate ["dvere1",1]

~0.01

goto "loop"

_unlockit is a bolean, but you can only set him to true in the lockscript itself because it's a local variable. (_unlockit)

I'd suggest you change that in a global variable, this allows you to unlock the door with a unlockit = true in a trigger,waypoint or another script.  smile_o.gif

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  

×