Forum Jump :

Author Message


Posts: 175
Rank:


Level: Member

Country: us
Location: New jersey
Occupation: Flying
Age: 20
In-game name: Starsky396

 
#1 Posted at 2012-11-22 19:25        
     
What is going on is that I am using the script that makes houses lights turn on and chimneys smoke. The script is this:
 [scriptName "Alice\data\scripts\fnc_houseEffects.sqf";
/*
	File: fnc_houseEffects.sqf
	Author: Karel Moricky

	Description:
	Creates effects on house (lights in windows, chimney smoke)

	Parameter(s):
	_this: OBJECT - house
*/

_mode = _this select 0;
_door = _this select 1;
_obj = _door getvariable "ALICE_obj";
_logic = bis_alice_mainscope;

switch (_mode) do {

	//--- START
	case 1: {
		if (count crew _door > 1) exitwith {};

		//--- Partcile Sources
		_PSlist = [];
		for "_i" from 0 to 10 do {
			_pos = _obj selectionposition format ["AIChimney_small_%1",_i];
			if (_pos distance [0,0,0] == 0) exitwith {};

			if (random 1 > 0.5) then {
				_worldpos = (_obj modeltoworld _pos);

				_PS = "#particlesource" createVehicle _worldpos;
				_PS setParticleCircle [0, [0, 0, 0]];
				_PS setParticleRandom [1, [0, 0, 0], [0.1, 0.1, 0.1], 2, 0.2, [0.05, 0.05, 0.05, 0.05], 0, 0];
				_PS setParticleParams [["\Ca\Data\ParticleEffects\Universal\universal.p3d", 16, 8, 16], "", "Billboard", 1, (4 + random 4), [0,0,0], [0, 0, 0.5 + random 0.5], 1, 1.275, 1, 0.066, [0.4, 1 + random 0.5, 2 + random 2], [[0.4, 0.4, 0.4*1.2, 0.1 + random 0.1], [0.5, 0.5, 0.5*1.2, 0.05 + random 0.05], [0.7, 0.7, 0.7*1.2, 0]], [0], 1, 0, "", "", ""];
				_PS setDropInterval .3;
				_PSlist = _PSlist + [_PS];
			};

		};
		_door setvariable ["BIS_ALICE_PS",_PSlist];

		//--- Global manager of house effects
		if (isnil {_logic getvariable "ALICE_houseffects"}) then {
			_scope = _logic spawn {
				scriptname "Alice\data\scripts\fnc_houseEffects.sqf:Loop";
				_logic = _this;
				while {true} do {
					waituntil {sleep 1; daytime > 17 || daytime < 4};
					_list = _logic getvariable "ALICE_houseffects";
					//_delay = 100 / (count _list + 1);
					{
						_door = _x;
						_obj = _door getvariable "ALICE_obj";
						_limit = 0.5;
						if (daytime > 17 && daytime < 21) then {_limit = 0.2};
						if (daytime > 0 && daytime < 4) then {_limit = 1};

						//--- Let there be the light!
						for "_i" from 1 to 5 do {
							if (random 1 > _limit) then {
								_obj animate [format ["Lights_%1",_i],1];
							} else {
								_obj animate [format ["Lights_%1",_i],0];
							};
						};
						//sleep _delay;
						sleep 1;
					} foreach _list;
				};
			};
			_logic setvariable ["ALICE_houseffects",[]];
		};
		[_logic,"ALICE_houseffects",[_door]] call bis_fnc_variablespaceadd;
	};

	//--- END
	case 0: {
		_destroyed = if (count _this > 2) then {_this select 2} else {false};

		if (count crew _door > 0 && !_destroyed) exitwith {};

		_PSlist = _door getvariable "BIS_ALICE_PS";
		if (!isnil "_PSlist") then {
			for "_i" from 1 to 5 do {
				_obj animate [format ["Lights_%1",_i],0];
			};
			{deletevehicle _x} foreach _PSlist;

			_door setvariable ["BIS_ALICE_PS",nil];
		};

		[_logic,"ALICE_houseffects",[_door]] call bis_fnc_variablespaceremove;
	};

	default {};
}; 



I put this in my init.sqf (I named the script livinghouses):
execVM "livinghouses.sqf"
After that I start up the mission and I get no script errors but the houses lights do not turn on and the chimneys do not smoke. Any ideas on whats going on?