Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: uk
Location: Hamburg
Occupation: Working on that
Age: 46
In-game name:

 
#1 Posted at 2009-08-16 13:40        
     
Gents, Silence and myself have been trying to work on a anti personnel mine. Not to kill people but to mame and hence putting influence on the squad/team work. We have tried many things from using a trigger with sound effect (looks and sound good but no damage, to now our final solution game logic with the following script/code entered in to the "init" box, this works to the point that you apply damage but no sound or effect. Also does know of an easier way for placing the mine e.g click on the map where you want the mine atm we are using the co-ordinates as seen in the code. Any tips gentelmen?

Here is the code we are using in the "init" box:

mine = "mineE" createVehicle [3664,3601,0]; mine = createTrigger["emptyDetector",getPos mine]; mine setTriggerArea [1,1,0,false]; mine setTriggerActivation ["any","present",false]; mine setTriggerStatements["this","thislist select 0 setdamage 0.9,hint'boom'","hint 'no civ'"];

Many thanks Edd.


Author Message


Posts: 1522
Rank:


Level: Member

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

 
#2 Posted at 2009-08-17 17:44        
     
I've come up with a scripted version it does what I want it to do, I based it on your code.
I can't test for multiplayer so that may need some work.

//////////////////////////////////////////////////////////////////
// place a game logic on the map at the center of the mine field
// place this code into the logics init line.
// null=[this,30,120] execvm "createmines.sqf" and save thsi script as createmines.sqf
// this = minefield center // _spread/30 is the diameter of the mine field // _mines/120 is the number of mines planted
// Adjust the values as you wish.

_pos    = _this select 0;
_spread = _this select 1;
_mines  = _this select 2;

_height = -0.08;// sink mine depth // zero is on the surface.

for [{_p = 0},{_p < _mines},{_p = _p + 1}] do
{
mine = "mineE" createVehicle [(getpos _pos select 0)+(random _spread)-_spread/2, (getpos _pos select 1)+(random _spread)-_spread/2,_height];
mine = createTrigger["emptyDetector",getPos mine];
mine setTriggerArea [1,1,0,false]; 
mine setTriggerActivation ["any","present",false]; 
mine setTriggerStatements["this","[thislist select 0] execVM""mine.sqf""",""];

save this script as mine.sqf

// save script as mine.sqf
_unit = _this select 0;
_bomb1 = "B_30mm_HE"  createVehicle [(getPosASL _unit select 0),( getPosASL _unit  select 1),-3];
_bomb2 = "GrenadeBase" createVehicle [(getPosASL _unit select 0),( getPosASL _unit  select 1),-40];
_unit setdamage 0.89; // adjust damage for best results

This post was edited by F2kSel (2009-08-17 18:05, ago)


Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: uk
Location: Hamburg
Occupation: Working on that
Age: 46
In-game name:

 
#3 Posted at 2009-08-18 19:27        
     
Cheers Mate. Super I will see how it goes and let you know. Watch this space.


Author Message


Posts: 15
Rank:


Level: Member

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

 
#4 Posted at 2009-08-20 19:51        
     
Ok this was the answer thanks for the input, this works on MP Server, placed one at a time.

Mine Position based on a marker ingame

mine ="mineE" createVehicle [(getMarkerPos "mark01" select 0),(getMarkerPos "mark01" select 1),-0.08];
mine = createTrigger["emptyDetector",getPos mine];
mine setTriggerArea [1,1,0,false];mine setTriggerActivation ["any","present",false];
mine setTriggerStatements["this","[thislist select 0] execVM""mine.sqf""",""];

Explosion, dosen't kill first time, but If statement will make sure if you hit x2 mines it will kill you


if(isServer) then 

{

	_unit = _this select 0;
         _bomb1 = "B_30mm_HE"  createVehicle [(getPosASL _unit select 0),( getPosASL _unit  select 1),-25];
	_bomb2 = "GrenadeBase" createVehicle [(getPosASL _unit select 0),( getPosASL _unit  select 1),-160];
	if ((Damage _unit) >= 0.65) then {_unit setDamage 1} else {_unit setDamage 0.65};


};

Thanks for input, it was a satisfying solution to a problem, thanks again