Jump to content
Sign in to follow this  
On_Sabbatical

Adding "Deactivate mine" action to another class

Recommended Posts

I want to add "deactivate mine" to another class of soldiers in my mission,but i am a bit clueless on how to do it !

I 've made a small script doing the same thing ,but i want the action to trigger only when i look towards the mine ;cursortarget didn't work for me though !

Thanks;

Share this post


Link to post
Share on other sites

Its a property in config that defines if unit can deactive mines and you can't change this without using an addon. If you want help with your script, post it away and let us know where your problem is (or explain it generally)

Share this post


Link to post
Share on other sites

Ok thanks,

I use this:

player addaction [localize "STR_WF_Removemine","removemine.sqf",[],80,false,true,"","(cursortarget iskindof 'MineCore')&&(player distance cursortarget < 5)"];

But when i look towards the mine ,the action does'nt appear !!

Edited by On_Sabbatical

Share this post


Link to post
Share on other sites

I suppose, that last part, condition, must be between "", as a string.

Share this post


Link to post
Share on other sites

Yeah, and removemine.sqf must be a string too.

And I'm not too sure about that, but I don't think a priority of 80 is valid? I think they go to maximum 6 or 10.

Share this post


Link to post
Share on other sites

oh guys ,thanks,

Don't worry about syntax errors ,it's correct on my mission but still not working ...

It's just that last part : "(cursortarget iskindof 'MineCore')&&(player distance cursortarget < 5")

That has somethin wrong !

Share this post


Link to post
Share on other sites

") -> )"

Hmm. Also did some test with mines placed in editor and created via

_mine = createMine ["MineMine", position player, [], 0];

Mines placed in the editor seems not behave as "usual" object. Its init field is not executed, can't be measured distance to it, can't be checked class (isKindOf, typeOf), naming it, eg as m1 not works...

Placed such mine "thing" in editor, in init field was hint "hop". Nothing happened after preview. Then changed mine for randomly selected object (Line-keeper's box), init unchanged, this time hint was displayed.

Mines created via above script seems to be something else. Distance is measured, class can be checked...

Share this post


Link to post
Share on other sites

Also note that cursorTarget doesn't work with all objects. Small objects tend to be ignored, although I know for sure that the PMC IEDs are recognized.

Share this post


Link to post
Share on other sites

you can make a configpatch for your units wit hthis line added to the config

class USMC_SoldierS_Engineer: USMC_Soldier_Base

{

canDeactivateMines = 1;

};

e.g.

class mysoldiertype: USMC_Soldier_Base // whatever parent class it has

{

canDeactivateMines = 1;

};

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  

×