Jump to content

Recommended Posts

Hi! 

 

I'm having issues spawning in ACE3 IED's with pressure plate activation on. Currently there's 50 IED's that spawn in, they're simulated objects and should (?) work with pressure plate, yet they don't. 

 

Here's the faulty script: 

if (!isserver) exitwith {};
//Theres a marker called center in the middle of the map
_centerMrk = "center";
_dist = 25000;

_center = getmarkerpos _centerMrk;
_counter = 0;
_rDist = 5.75;

// Objects used as IEDs
_iedList =
[
	"ACE_IEDLandBig_Range",
	"ACE_IEDLandSmall_Range",
	"ACE_IEDUrbanBig_Range",
	"ACE_IEDUrbanSmall_Range"
];

while {_counter < 50} do 
{	
	//Create position on map for IED
	_list = _center nearRoads _dist;
	_iedType = _iedList select (floor random (count _iedList));
	_road = _list select (round random (count _list));
	_roadDir = getDir _road;
	_newDir = _roadDir;
	_dir = _newDir;
	_pos = getpos _road;
	_posx = _pos select 0;
	_posy = _pos select 1;
	_tx = (_posx + (_rDist * sin(_dir)));
	_ty = (_posy + (_rDist * cos(_dir)));
	_iedPos = [_tx,_ty,0];

	//Create IED
	_trgMan = createVehicle ["I_C_Pilot_F", _center, [], 0, ""];
	_ied = createVehicle [_iedType, _iedPos, [], 0, ""];
	_ied setDir (random 360);
	_ied setPos getPos _ied;
    //So far so good, this is where I have to add some type of way to trigger them because they dont work by themselves like if you place them with zeus
	[_trgMan, _ied, "PressurePlate"] call ace_explosives_fnc_connectExplosive;
	deleteVehicle _trgMan; 
	
	//Add IED to list
	_counter = _counter + 1;
};

If anyone with knowledge about ACE3 could help me out that'd be highly appreciated. 

 

//Green

Share this post


Link to post
Share on other sites

activateAddons ["ACE_IEDLandBig_Range","ACE_IEDLandSmall_Range","ACE_IEDUrbanBig_Range","ACE_IEDUrbanSmall_Range"];

I don' t try maybe the solution by ;)))

 

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, Nach said:

activateAddons ["ACE_IEDLandBig_Range","ACE_IEDLandSmall_Range","ACE_IEDUrbanBig_Range","ACE_IEDUrbanSmall_Range"];

I don' t try maybe the solution by ;)))

 

Appreciate the help. Did not work however. Tried playing around with it. Seems like nothing fixes it. 

Share this post


Link to post
Share on other sites
[
	"ACE_IEDLandBig_Range_ammo",
	"ACE_IEDLandSmall_Range_ammo",
	"ACE_IEDUrbanBig_Range_ammo",
	"ACE_IEDUrbanSmall_Range_ammo"
];

That should fix it.
You're spawning the "defused" objects I believe, adding _ammo to the classname should give you the armed versions

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, Spatsiba said:

[_trgMan, _ied, "PressurePlate"] call ace_explosives_fnc_connectExplosive;

If you write in a trigger in game or editor is >> if (isserver) then { null = [_trgMan, _ied, "PressurePlate"] call ace_explosives_fnc_connectExplosive;};

 

another solution

 

into init.sqf

ace_explosives_fnc_connectExplosive = compile preprocessfilelinenumbers "myscript.sqf";

 

into a trigger

 null = [] spawn ace_explosives_fnc_connectExplosive;

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 2017-01-31 at 8:36 PM, JD Wang said:

[
	"ACE_IEDLandBig_Range_ammo",
	"ACE_IEDLandSmall_Range_ammo",
	"ACE_IEDUrbanBig_Range_ammo",
	"ACE_IEDUrbanSmall_Range_ammo"
];

That should fix it.
You're spawning the "defused" objects I believe, adding _ammo to the classname should give you the armed versions

EDIT: _ammo" is not an ACE item. Does not exist. 

On 2017-01-31 at 9:01 PM, Nach said:

If you write in a trigger in game or editor is >> if (isserver) then { null = [_trgMan, _ied, "PressurePlate"] call ace_explosives_fnc_connectExplosive;};

 

another solution

 

into init.sqf

ace_explosives_fnc_connectExplosive = compile preprocessfilelinenumbers "myscript.sqf";

 

into a trigger

 null = [] spawn ace_explosives_fnc_connectExplosive;

 

 

 

EDIT: Didn't work. Should work but doesn't. I've tried several different ways. Seems like it's being init but missing something? 

 

EDIT EDIT: 

 

adding "_Ammo" to the end of the classnames DOES work. Thanks for the help JDwang. 

Share this post


Link to post
Share on other sites

I recommend changing the code using the one below. 

         

    _list = _center nearRoads _dist;
            _road = _list select (round random (count _list));
            _roadConnectedTo = roadsConnectedTo _road;
            _connectedRoad = _roadConnectedTo select 0;
            _direction = [_road, _connectedRoad] call BIS_fnc_DirTo;
            _pos = getpos _road;
            _posx = _pos select 0;
            _posy = _pos select 1;
            _tx = (_posx + (_rDist * sin(_direction)));
            _ty = (_posy + (_rDist * cos(_direction)));
            _iedPos = [_tx,_ty,0];

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

×