Jump to content
Sign in to follow this  
mia389

Small issue I am having with DAC

Recommended Posts

Im trying to add this to the camps init line

		_campObjInit   = [[],[],[],[],["_x addEventHandler ["killed",{hint "It worked!"],[],[]];

default it looked like this

_campObjInit   = [[],[],[],[],[],[],[]];

an example gave me this

_campObjInit = [[],[],[],[],["_x lock true"],[],[]];

Im trying to get the hint to work when the land_Antena is destroyed. Im sure I have a script error as I have no clue. Need an expert. Full part looks like this:

you can see Im editing case: 5

	case 4:
{
	_campBasic     = ["FlagCarrierBLUFOR_EP1",["Land_Fire_burning",8,5,0],["Camp_EP1",5,0,0],["Logic",10,15,0],0];
	_campAmmo      = [["USLaunchers_EP1",10,2,0],["USSpecialWeapons_EP1",10,0,0],["USBasicAmmunitionBox_EP1",10,-2,0],["USBasicWeapons_EP1",10,-4,0]];
	_campStatic    = [["M119_US_EP1",-7,25,0,"US_Soldier_SL_EP1"],["M119_US_EP1",25,25,0,"US_Soldier_SL_EP1"],["M119_US_EP1",25,-20,180,"US_Soldier_SL_EP1"],["M119_US_EP1",-7,-20,180,"US_Soldier_SL_EP1"]];
	_campAddUnit   = [];
	_campUserObj   = [["Land_Antenna",5,-5,45]];
	_campRandomObj = [];
	_campWall      = ["Land_BagFenceLong",[-10,30],[40,56,0],[5,5,5,5],[1,0.2],[0,0]];
	_campObjInit   = [[],[],[],[],[],[],[]];
};
//-------------------------------------------------------------------------------------------------------------------------
case 5:
{
	_campBasic     = ["FlagCarrierTKMilitia_EP1",["Land_Fire_burning",-8,5,90],["TK_GUE_WarfareBBarracks_Base_EP1",5,0,90],["Logic",10,15,0],0];
	_campAmmo      = [["TKSpecialWeapons_EP1",20,2,0],["TKBasicAmmunitionBox_EP1",20,0,0],["TKBasicAmmunitionBox_EP1",20,-2,0],["TKBasicWeapons_EP1",20,-4,0]];
	_campStatic    = [["DSHKM_TK_INS_EP1",-7,25,0,"TK_INS_Soldier_EP1"],["DSHKM_TK_INS_EP1",25,25,0,"TK_INS_Soldier_EP1"],["DSHKM_TK_INS_EP1",25,-20,180,"TK_INS_Soldier_EP1"],["DSHKM_TK_INS_EP1",-7,-20,180,"TK_INS_Soldier_EP1"]];
	_campAddUnit   = ["TK_INS_Soldier_AA_EP1"];
	_campUserObj   = [["Land_Antenna",5,-10.5,45]];
	_campRandomObj = [];
	_campWall      = ["Land_BagFenceLong",[-10,30],[40,56,0],[5,5,5,5],[1,0.2],[0,0]];
	_campObjInit   = [[],[],[],[],["_x addEventHandler ["killed",{hint "It worked!"],[],[]];
};

---------- Post added at 09:50 PM ---------- Previous post was at 09:41 PM ----------

I did get this to work. So I now know it can be done :-) I was just seeing if anything would work. I must be close

_campObjInit   = [[],[],[],[],["_x allowDamage false"],[],[]];

Share this post


Link to post
Share on other sites

by using _x addeventhandler, are you using a foreach or for loop?

i didnt see you using a foreach so im thinking thats not a variable you should be using, as _x is a magic variable used to replace any number of elements in an array that need something done.

i might have misunderstood tho

Share this post


Link to post
Share on other sites

_campObjInit = [[],[],[],[],["_x addEventHandler [""killed"",{hint ""It worked!"";}];"],[],[]];

;)

Edited by Buliwyf

Share this post


Link to post
Share on other sites

TY so much. Instead of hint how would I run a script from that?

Share this post


Link to post
Share on other sites

Search is your best friend... but here is my example:

_campObjInit = [[],[],[],[],["_x addEventHandler [""killed"",{nul=_this execVM ""runFunction.sqf"";}];"],[],[]];

:cool:

Share this post


Link to post
Share on other sites

I meant without the event handler. Im thinking of putting an addaction in. So run a script that would have an addaction. Search really doesnt help me here since the command has to be in an array which kind of makes it special. It makes it to complex for me :-(

ty for your help though.

---------- Post added at 11:43 AM ---------- Previous post was at 11:37 AM ----------

_campObjInit = [[],[],[],[],["_this execVM ""runFunction.sqf;""],[],[]];

this didnt work for me. Im sure I need a { [ "" or something somewhere

---------- Post added at 11:59 AM ---------- Previous post was at 11:43 AM ----------

Solved!!

		_campObjInit   = [[],[],[],[],["[_x] execVM ""NameOfYourScript.sqf"""],[],[]];

---------- Post added at 12:40 PM ---------- Previous post was at 11:59 AM ----------

New problem

I cant run addaction to the object from the script. Im trying to add an addaction to the radio tower. It wont let me kill the tower so the event handler will not work for what Im trying to do.

I now need to know how to put an addaction in the line above. Then in my script I can make the next zones active :-)

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  

×