Forum Jump :

Author Message


Posts: 22
Rank:


Level: Member

Country: us
Location: Jupiter, Cloud 9
Occupation: Plant Burner
Age: 87
In-game name: war1ox

 
#1 Posted at 2015-08-10 14:19        
     
I have a script I used from another mission that I would like to get working in my own mission, but I can't seem it get it to work. It's basically an Utes fence removal script that damages it then falls over. I've searched for a bit, found a script to add fencing but nothing to remove it.

What I've done:
    1. Placed code into the description:
      class FenceRemoval
      {
        title = "Fence Removal:";
        values[] = {1,2,3};
        texts[] = {"Yes","No","55% Removal"};
        default = 1;
      };
    };

    2. Placed code into the init:
    [] execVM "scripts\FenceRemoval.sqf";
    waitUntil{sleep 0.1; scriptDone _fences};

    3. Placed FenceRemoval.sqf into mission\scripts\
    _should = paramsarray select 8;
    if (_should == 2) exitWith {};
    
    _fencesArray = [6166, 6167, 6168, 6169, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4151, 4152, 4153, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5151, 5152, 5153, 5154, 5155, 5156, 5157, 5264, 5044, 5045, 5046, 5050, 5047, 5048, 5049, 5051, 5052, 5474, 5473, 5472, 5471, 5470, 5469, 5468, 5467, 5466, 5465, 5489, 5488, 5487, 5486, 5485, 5484, 5483, 5482, 5481, 5480, 5479, 5478, 5477, 5476, 5475, 5687, 5686, 5685, 5655, 5684, 5683, 5682, 5681, 5680, 5681, 5680, 5679, 5678, 5677, 5676, 5675, 5674, 5673, 5701, 5700, 5699, 5698, 5697, 5696, 5695, 5694, 5693, 5692, 5691, 5690, 5689, 5688, 8831, 8830, 8829, 8828, 8827];
    
    {
    	_random = floor(random 100);
    	if (_should == 3) then {
    		if (_random <= 55) then {
    			_fence = (getPos Server) nearestObject _x;
    			_fence setDamage 1;
    		};
    	};
    	
    	if (_should == 1) then {
    		_fence = (getPos Server) nearestObject _x;
    		_fence setDamage 1;
    	};
    }forEach _fencesArray;

I have the option within parameters to adjust this at mission start but the setting doesn't take effect. The original mission uses it just fine. I've been scanning it repeatedly all day so to prevent myself from pulling a brain muscle, I've came here for help. Can anyone please shed some light on this? It's probably something stupid.. I appreciate any help given. Thanks! *HELP*

This post was edited by war1ox (2015-08-10 17:51, ago)

Steam: war1ox

Author Message


Posts: 1524
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2015-08-11 00:37        
     
I just copied the main script and first I set the variable _should with a value of 3 and it takes out about 50% of the fence, when set to 1 it takes out all the fence.

I didn't use the description or

this did give me an error so I removed the line,_fences was not defined.
waitUntil{sleep 0.1; scriptDone _fences};

You can only damage it.


Advertisement


Author Message


Posts: 22
Rank:


Level: Member

Country: us
Location: Jupiter, Cloud 9
Occupation: Plant Burner
Age: 87
In-game name: war1ox

 
#3 Posted at 2015-08-11 02:19        
     
F2KSel, I'm having trouble understanding. Is there a way you can just post your modified script to remove the fence entirely?


EDIT: Could someone please modify this for me? I've been fiddling with the code for about week to get it to work but no success. I really would just like to remove the fence altogether.

This post was edited by war1ox (2015-08-11 16:02, ago)

Steam: war1ox

Author Message


Posts: 1524
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2015-08-11 18:16        
     
All I uses was the init.sqf to run the code
[] execVM "scripts\FenceRemoval.sqf";


then in the main script

_should = 1;// 1 to remove all fences or change to 3 to remove randomly 
if (_should == 2) exitWith {};

_fencesArray = [6166, 6167, 6168, 6169, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4151, 4152, 4153, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5151, 5152, 5153, 5154, 5155, 5156, 5157, 5264, 5044, 5045, 5046, 5050, 5047, 5048, 5049, 5051, 5052, 5474, 5473, 5472, 5471, 5470, 5469, 5468, 5467, 5466, 5465, 5489, 5488, 5487, 5486, 5485, 5484, 5483, 5482, 5481, 5480, 5479, 5478, 5477, 5476, 5475, 5687, 5686, 5685, 5655, 5684, 5683, 5682, 5681, 5680, 5681, 5680, 5679, 5678, 5677, 5676, 5675, 5674, 5673, 5701, 5700, 5699, 5698, 5697, 5696, 5695, 5694, 5693, 5692, 5691, 5690, 5689, 5688, 8831, 8830, 8829, 8828, 8827];

{
	_random = floor(random 100);
	if (_should == 3) then {
		if (_random <= 55) then {
			_fence = (getPos Server) nearestObject _x;
			_fence setDamage 1;
		};
	};
	
	if (_should == 1) then {
		_fence = (getPos Server) nearestObject _x;
		_fence setDamage 1;
	};
}forEach _fencesArray;


Make sure you have the files saved in the correct place.
You will also need to place a gamelogic and name it server.

I'm not at my Arma PC today so can't post a mission file.


Author Message


Posts: 22
Rank:


Level: Member

Country: us
Location: Jupiter, Cloud 9
Occupation: Plant Burner
Age: 87
In-game name: war1ox

 
#5 Posted at 2015-08-11 22:15        
     
Hey it worked! Thanks a lot!

Steam: war1ox