Jump to content

[Question] AiA TP Chernarus Hangar Closed Doors at Restart?


CH!LL3R

Recommended Posts

Hi there,

 

I have a server with AllInArmaTerrainPack and the Map Chernarus. On NorthWest Airfield I saw some Hangars with animated gates and doors.

Than I build them in Editor and want to close the doors and the gate by Serverestart. Know this function from A2/bargate...

Searched in the AiA-Addon for the classname/ID of the gate and the door, this is what I've found:

class Land_Ss_hangar : House {
displayName = "Hanger";
animated = true;
model = "\ca\buildings\ss_hangar.p3d";
destrType = "DestructBuilding";
armor = 800;
accuracy = 0.5; // accuracy needed to recognize type of this target
cost = 0;
mapSize = 7.5;

class DestructionEffects : DestructionEffects {
class Ruin1 {
simulation = "ruin";
type = "\ca\buildings\ruins\ss_hangard_Ruins.p3d";
position = "";
intensity = 1;
interval = 1;
lifeTime = 1;
};
};

class AnimationSources {
class Door1 {
source = "user";
animPeriod = 14;
initPhase = 0;
};

class Door2 {
source = "user";
animPeriod = 11;
initPhase = 0;
};

class Door3 {
source = "user";
animPeriod = 10;
initPhase = 0;
};

class Door4 {
source = "user";
animPeriod = 9;
initPhase = 0;
};

class Door5 {
source = "user";
animPeriod = 7.5;
initPhase = 0;
};

class Door6 {
source = "user";
animPeriod = 6;
initPhase = 0;
};

class Door7 {
source = "user";
animPeriod = 0.5;
initPhase = 0;
};

class Door8 {
source = "user";
animPeriod = 1.2;
initPhase = 0;
};

class Door9 {
source = "user";
animPeriod = 1.2;
initPhase = 0;
};

class Door10 {
source = "user";
animPeriod = 1.2;
initPhase = 0;
};

class Door11 {
source = "user";
animPeriod = 1.2;
initPhase = 0;
};
};

class UserActions {
class OpenDoor {
displayName = "Open Hangar Door";
position = "Door7_Button";
radius = 1;
onlyForPlayer = 0;
condition = "this animationPhase ""Door6"" > 0.01";
statement = "0 = this spawn {_this animate [""Door7"", 1]; sleep 1.5; _this animate [""Door7"", 0]; _this animate [""Door6"", 0]; _this animate [""Door5"", 0]; _this animate [""Door4"", 0]; _this animate [""Door3"", 0]; _this animate [""Door2"", 0]; _this animate [""Door1"", 0]}; this say 'hangar_door_open';";
};

class CloseDoor : OpenDoor {
displayName = "Close Hanger Door";
condition = "this animationPhase ""Door6"" <= 0.01";
statement = "0 = this spawn {_this animate [""Door7"", 1]; sleep 1.5; _this animate [""Door7"", 0]; _this animate [""Door1"", 1]; sleep 3; _this animate [""Door2"", 1]; sleep 1; _this animate [""Door3"", 1]; sleep 1; _this animate [""Door4"", 1]; sleep 1.5; _this animate [""Door5"", 1]; sleep 1.5; _this animate [""Door6"", 1]}; this say 'hangar_door_close';";
};

class OpenDoor2 {
displayName = "Open Door";
position = "Door8_Button";
radius = 2;
onlyForPlayer = 0;
condition = "this animationPhase ""Door8"" > 0.5";
statement = "this animate [""Door8"", 0]; this animate [""Door9"", 0]";
};

class CloseDoor2 : OpenDoor2 {
displayName = "Close Door";
condition = "this animationPhase ""Door8"" <= 0.5";
statement = "this animate [""Door8"", 1]; this animate [""Door9"", 1]";
};

class OpenDoor3 {
displayName = "Open Door";
position = "Door10_Button";
radius = 2;
onlyForPlayer = 0;
condition = "this animationPhase ""Door10"" > 0.5";
statement = "this animate [""Door10"", 0]; this animate [""Door11"", 0]";
};

class CloseDoor3 : OpenDoor3 {
displayName = "Close Door";
condition = "this animationPhase ""Door10"" <= 0.5";
statement = "this animate [""Door10"", 1]; this animate [""Door11"", 1]";
};
};
};

If I put this code to the hangar init, will work perfect in the editor:

0 = this spawn {_this animate [""Door7"", 1]; sleep 1.5; _this animate [""Door7"", 0]; _this animate [""Door1"", 1]; sleep 3; _this animate [""Door2"", 1]; sleep 1; _this animate [""Door3"", 1]; sleep 1; _this animate [""Door4"", 1]; sleep 1.5; _this animate [""Door5"", 1]; sleep 1.5; _this animate [""Door6"", 1]}; this animate [""Door8"", 1]; this animate [""Door9"", 1];this animate [""Door10"", 1]; this animate [""Door11"", 1];

But if I make a sqf and load it on server, the hangar is there, all other buildings are there, but no automatic animation on the hangar doors.....

_vehicle_3 = objNull;
if (true) then
{
	_this = createVehicle ["Land_Ss_hangar", [6139.7441, 2149.1279, 0.25048551], [], 0, "CAN_COLLIDE"];
	_vehicle_3 = _this;
	_this setDir -122.88631;
	_this setPos [6139.7441, 2149.1279, 0.25048551];
	_initCodes set [count _initCodes,[_this,"0 = this spawn {_this animate [""Door7"", 1]; sleep 1.5; _this animate [""Door7"", 0]; _this animate [""Door1"", 1]; sleep 3; _this animate [""Door2"", 1]; sleep 1; _this animate [""Door3"", 1]; sleep 1; _this animate [""Door4"", 1]; sleep 1.5; _this animate [""Door5"", 1]; sleep 1.5; _this animate [""Door6"", 1]}; this animate [""Door8"", 1]; this animate [""Door9"", 1];this animate [""Door10"", 1]; this animate [""Door11"", 1];"]];
};

So, why does it works on the editor, but not on the server? I'm completly mystified....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...