Jump to content
Sign in to follow this  
alexcroox

How do I close these doors on mission start?

Recommended Posts

3F66EBFC006DB99228F4C2CFC84CEA700D89C31D

 

 

My current code on a game logic placed ontop of it:

0 = [getpos this,100] spawn {
	sleep 1;
	{
		private "_b";
		_b = _x;
		
		for "_i" from 0 to 7 do {
			_b animate ["dvere",1];
			_b animate ["dvere_" + str _i,1];
			_b animate ["dvere_1_" + str _i,1];
			_b animate ["dvere_2_" + str _i,1];
			_b animate ["Door_01",1];
			_b animate ["door_1_rot",1];
			_b animate ["hatch_1_rot",1];
		};
	} foreach ((_this select 0) nearobjects (_this select 1))
}

As you can see I've tried every door variation I could find online!

Share this post


Link to post
Share on other sites

Closing a door is done by 0. You used 1 instead, so that will not do anything since the doors are already open.

 

Since I can't tell whether this is BI or community content, I'd recommend to find out the door names by either looking into the configs or by pointing at the doors while using the following code, which will display the door name in the center of your screen:

["test", "onEachFrame", {
	private "_intersectObjectName";
	_startPos	= ASLToAGL eyePos player;
	_endPos		= positionCameraToWorld [0, 0, 100];
	
	_intersectObjects = [cursorTarget, "VIEW"] intersect [_startPos, _endPos];
	_intersectObject = _intersectObjects select 0;
	if (!isNil "_intersectObject") then {
		_intersectObject = _intersectObject select 0;
		titleText [_intersectObject, "PLAIN", 0.001];
	}
}] call BIS_fnc_addStackedEventHandler;

If they can't be opened or closed then there's probably no handler for this, hence they are probably a static part of the model just like the walls and everything else.

Share this post


Link to post
Share on other sites

I think that is the same Land_Ammostore2 that Sahrani uses, and which can be closed. The door names are "Door1" and "Door2". Also for whatever reason, the state for closing these doors is 1, not 0. Edit: Code for the game logic:

0 = [getpos this, 100] spawn {

  sleep 0.1;

  {
   _x animate ["Door1", 1, TRUE];
   _x animate ["Door2", 1, TRUE];
  } foreach ((_this select 0) nearObjects (_this select 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
Sign in to follow this  

×