Jump to content
Sign in to follow this  
Hiroto Takahiro

Building config issuse

Recommended Posts

I am trying to configure a simple test building into Arma 3 and i am having issues with syntax in the config file.

class CfgPatches {

class house_test {
	units[] = {""};
	weapons[] = {};
	requiredVersion = 0.100000;
	requiredAddons[] = {};
};
};

class CfgVehicleClasses {

class house_test {
	displayName = "Test Houses";
};
};

class CfgVehicles {
/*extern*/ class House;

class Land_test_house: House {
	scope = 2;
	model = "House_test\house_test.p3d";
	mapsize = 7.5;
	displayName = "House";
	vehicleClass = "house_test";
	accuracy = 0.200000;
	cost = 10;
	armor = 5000;

	class AnimationSources {

		class Door {
			source = "user";
			animPeriod = 2;
			initPhase = 0;
		};
	};

	class UserActions {

		class OpenDoor {
			displayName = "Open Door";
			position = "door_knopf";
			radius = 2;
			onlyforplayer = 1;
			condition = "this animationPhase "Door" < 0.5";
			statement = "this animate ["Door", 1]";
		};

		class CloseDoor {
			displayName = "Close Door";
			position = "door_knopf";
			radius = 2;
			onlyforplayer = 1;
			condition = "this animationPhase "Door" >= 0.5";
			statement = "this animate ["Door", 0]";
		};
	};
};
};

And this is the error i am getting when trying to make it a .bin file

File C:\Program Files (x86)\Steam\SteamApps\common\Arma 3\@House_test\addons\Hou
se_test\config.cpp, line 46: '/CfgVehicles/Land_test_house/UserActions/OpenDoor.
Door': '"' encountered instead of '='
Config : some input after EndOfFile.
Error reading binary file 'C:\Program Files (x86)\Steam\SteamApps\common\Arma 3\
@House_test\addons\House_test\config.cpp'
W:\c\Arma3_02\El\ParamFile\paramFile.cpp(891) : Class destroyed, but still locked
Press any key to continue . . .

As you can see on line 46 i have a issues with the syntax i am not sure what the correct way going about this is

Thanks.

Edited by KFord

Share this post


Link to post
Share on other sites

Hi KFord,

If I'm not mistaken, the problem lies in this line:

condition = "this animationPhase "Door" < 0.5";

Try replacing it with this because the double quotes inside a string need to be 'escaped' in order to work:

condition = "this animationPhase ""Door"" < 0.5";

- Edit

Also

statement = "this animate ["Door", 0]";

needs to become:

statement = "this animate [""Door"", 0]";

You need to do that for both the OpenDoor and CloseDoor classes.

Share this post


Link to post
Share on other sites

yeah thanks it seems to work now!

But if i goto open the open in game the open door and close door both appear and if i open it the close door dose not show anymore any ideas about that thanks.

Share this post


Link to post
Share on other sites

I'm afraid I can't help you out with that unless you accidently copied over the 'condition' from OpenDoor to CloseDoor, that would cause the Close Door action to vanish after opening the door. But I don't have any experience with setting up buildings, the problem with the quotes was just a syntax error for the engine.

Share this post


Link to post
Share on other sites

It can depend on if your door is actually closed or open in the model itself.

Sometimes you may need to switch the >, <= around and the 0 and 1

Share this post


Link to post
Share on other sites

Sup m8's i have a little trouble here and i need ur help.
I decided to implement the ability 2 open and close da door (lock unlock), but not 2 BIS houses, this feature is implemented using with variable "bis_disabled_Door_1, but unfortunately, this variable work apparently only with BIS houses.
K i decided 2 do differently in the cfg file, do check on UserAction, that if the house is closed, do not show UserAction "Scroll menu".
class open_door_1 { 
displayName = "Open Door"; 
position = "Interact1"; 
radius = 1; 
onlyForplayer = "true"; 
condition = "((this animationPhase 'Door_1') < 0.5) && (this getVariable 'tc_house_unlock')"; 
statement = "this animate ["Door_1", 1]"; 
};
this getVariable 'tc_house_unlock'
K, u see this now, but unfortunately the cfg generates an error when i add the second condition, a possible reason that "this" here is the door, not the house.
Guys i ask ur help, why this error is appears and there are options whether to remove she?
P.s - sorry 4 my bad eng.

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  

×