Jump to content
Sign in to follow this  
Reezo

SR5 Tactical IED Detection and Remote Det Script

Recommended Posts

Thanks for the debug _ADD ... will check it now. Is 1.3 out yet ? Still working with 1.2 here from the download address.

It is not. If it was the first thread would report v1.3 and not v1.2.

Are the BAF and PMC classnames the only ones we can use?

As far as I know these are the ones that 1) look like typical IEDs 2) work with ammo/muzzlename combinations that allows AI and players the "touch off" command.

FURTHER EDIT: I changed IEDDETECT.SQF so that it now says _ADD as a debug and all of the 5 IEDs are being added. Seems strange that I cannot detect them, when it is initd correctly onto my player. Will tinker some more!

You should edit IEDdetect_add.sqf instead. The latter is responsible for adding IEDs. If you look at the end of the script you'll find the debug command, the notification says "IEDDETECT_INIT COMPLETED" but it should say "IEDDETECT_ADD COMPLETED". It just makes it easier to understand when an object is added to the detectable-IEDs global array.

FURTHER FURTHER EDIT WITH SUCCESS ..... the problem line is

This is pretty weird..commenting out that IF cycle would basically blow the entire script up. This was also improved to enhance MP compatibility when multiple EOD units can detect IEDs. I wouldn't go that way but who am I to state this? :)

Also, you should consider watching the problem from this additional angle, as well: this IED detection script works. James' IED script works, too. If, while trying to blend them together, something goes wrong, it is not in one of the two scripts that I would go mess my hands in. I would rather focus on the code responsible for blending them together. I am absolutely noone to tell you what to do and what not of course, just my 2 cents, an additional point of view might be useful. Good luck always!

About adding "cut the wire" functionalities:

I don't know how much playability this is going to have (wonder if this playability is actually a word eheh). If I had a detector that tells me an IED is there, I would have no clue whether or not this was a proximity IED (in terms of scripting) or a "time" bomb. If it is the latter one, I don't think blending the "cut the wire" and the IED script will do anything useful (just use both of them independently in your mission and voilà! win-win). You would need to "stop" a proximity IED script (like James') to allow cut-the-wire operations..and what about the "right" cable to cut? How would I know? Mission-based objective or intel element? Then use the "cut the wire" script alone, I would say. 25% chance of blowing up when having NO clue about the wire will always mean "leave it alone and go round it", in my opinion.

So at the moment I don't see any particularly salty grain of thought to implement "cut the wire" things with this script but you should see this as a motivational hazard for you to try and convince me lol :)

Edited by Reezo

Share this post


Link to post
Share on other sites

Thanks for the reply mate. I dont know why the line you comment out works and the one designed to work doesn't.

I think for the 'cut the wire' type of IED we would need something like "it's not working on any known frequencies" and therefore you would have to carry it out manually. Perhaps some variable, or maybe even we just DON'T add it to the IED global variable. Just thinking out loud here :)

Share this post


Link to post
Share on other sites
Thanks for the reply mate. I dont know why the line you comment out works and the one designed to work doesn't.

I think for the 'cut the wire' type of IED we would need something like "it's not working on any known frequencies" and therefore you would have to carry it out manually. Perhaps some variable, or maybe even we just DON'T add it to the IED global variable. Just thinking out loud here :)

You're welcome. I'll definitely try my best to solve this once I smoothed out the edges of this script, I am sure others (provided they have interest eheh of course) can try to blend the scripts together for the time being (while I keep improving my script).

For 'cut the wire' situations, yes, I get where you are going and I like it. There is still something to think about, though..but we're getting there.

The 'cut the wire' script seems more oriented towards "objective" planning, like there is THE bomb (or DA bomb lol) in a mission. My script goes more along the line of what James' did..we're thinking almost as if these were modules, like ALICE or others work, to create a more lively environment.

But anyway, it's definitely worth exploring..

maybe..just maybe (brianstorming..) we could think it this way:

SINCE my objective is to try and develop a specific engineer/EOD type of player..it could be worth adding stuff where skill plays a dominant factor on defusing and other disposal tasks.

BECAUSE OF THIS we could try adding something like this:

1. the bomb has a display where random sequences appear

2. random sequences change irregularly: some stay for 1 second, some stay for 0.5, some stay for 2 seconds etc.

3. you have to cut all four wires, one at the time

4. you must cut them (click) when the sequence follows a certain pattern, like (very easy example, just for the sake of it) when it's an even number.

Since you don't know how long the number will stay on display, a certain attitude is required..like "omg it's the right number, it's been like that for 1 second..what do I do? I click? I wait? etc..

5. After a certain amount of sequences the bomb goes off or

6. The bomb goes off if you step away from it (pressure plate booby).

Again: Brainstorming :D

UPDATE: v1.3 is out! Check 1st post

Edited by Reezo

Share this post


Link to post
Share on other sites

And maybe add a skill gain for every sucessful disarm, remote disarm etc for engineer, kindof like XP..

Making engineer, stronger better faster as long as he is alive, reset when dead etc..

Just brainstorming a little as well.

Share this post


Link to post
Share on other sites

Very nice. I "fear" we should bug hunt v1.3 and then start making some players really jump up their chair (or levitate their headphones, either one is ok :))

Share this post


Link to post
Share on other sites

New version working PERFECTLY with Virtual Training Space mission :)

Being able to spawn ANYTHING on the fly and making it an IED is cool !

I haven't seen any bugs that are showstoppers, in fact I haven't seen ANY bugs in the latest version.

Thanks for your patience albertors .... looks like it has paid off !

Share this post


Link to post
Share on other sites

I'm really loving this script. Your suggested method did not work for me, so I haxxed around with it a bit, and got it working with James' Advanced IED script. At least it works for me testing it out. Not sure how it will affect MP. I got inspired by your way of detection in v.1. :)

One way to do it is to change James IED_MAN_v6.sqf script file.

At line 83 he has a "sleep 2;". Replace that line with the following code:

//Initiate Reezo's "SR5 Tactical IED Detection and Remote Det script";
sleep 5;
private ["_near","_nearCount","_Check_Types"];
_near = _iedpos nearObjects 2;
_nearCount = count _near;
_Check_types = ["BAF_ied_v1","BAF_ied_v2","BAF_ied_v3","BAF_ied_v4","BAF_IEDBox","Land_IED_v1_PMC","Land_IED_v2_PMC","Land_IED_v3_PMC","Land_IED_v4_PMC"];

for [{_y = 0},{_y < _nearCount},{_y = _y + 1}] do
{
{

	if ((_near select _y) isKindOf _x) then {

		nul0 = [(_near select _y)] execVM "scripts\IEDdetect\IEDdetect_add.sqf";

		//the line below does not seem to work when trying to incorporate HOZ' disarm script.
		// HOZBOMBACT = (_near select _y) addAction ["Disarm Bomb", "HOZ_dabomb\scripts\ACT_dabombdlg.sqf", [player]];
	};
} forEach _Check_types;
};

Now it is important to replace the sleep, as the 2 second sleep is insufficient time for the ied to get setup correctly and return as an object... That had me going for a while :D.

With that working it should be no problem to further incorporate Hoz' script. I've added the line for good measure. Just setup Hoz script as allways, and uncomment the line under the one that says "uncomment line below" ;).

EDIT: Scratch that. I tried it and that didnt work.

The IED department is really shaping up real nice these days :)

Edited by Nielsen
Correction

Share this post


Link to post
Share on other sites

Thanks guys! Getting all the positive energy I can, store it, go to bed, work tomorrow and get back home to try and do more stuff :)

I am absolutely thrilled when I know that you're loving this script :)

Here is my official update:

I've been trying to add a new variable event, so far we have:

1. Fake IED detected (rare)..after a while the instrument reports the inconsistency but it might take it up to 1 minute. This means in a mission it can REALLY make things more exciting like: "Guys! Stop! I am reading an IED down this alley, we have to etc.etc."

2. Real IED detected .. but nothing the instrument can do. It could also be a fake..who knows? So you can look at things both ways eheh fun.

3. Remote Det available .. this means the instrument can broadcast a disruptive wave that can set the IED off. An action will be available but you will have to stand at safety distance or the device will tell you "danger close, aborted". If you are too far, the device will tell you that it is unable to broadcast the wave with enough strenght to reach the IED. When the IED goes off, it GOES OFF, literally..but the power of the explosion could be low, medium or high, randomly selected.

4. Manual Defusal Required. This is the last addition to my script. Your tool reports the only way to defuse the IED is to go there and do it the dirty way. The IED starts beeping, so it makes it easier to find (could be your tool reporting a sort of proximity sound notification). Now, the script checks if the IED object is something an engineer can normally "defuse" by using the default action (BIS added this to IEDs and Mines for engineers, since v1.54). This is the "easy" defusal mode. If course the IED could be remotely triggered by a triggerman, so approaching it just because the tool says so is..unsafe to say the least.

If the IED is another object, like a car, box, wreck, pile of tyres etc.. then the "nasty" manual defusal is necessary. You get close to the IED and use the "Defuse" action. Your tool comes up and reports some readings..random numbers for the moment. These numbers change at random intervals, from 0.3 to 2 seconds..next to your tool is the "INJECT CODE" button. You have to press the button when (this is for the time being) the reading is an even number. This is fairly easy but as I said the numbers change at random intervals so good reflexes are a priority.

I am having a hard time with the Resource Dialogs, if anyone wants to help I can PM him the v1.4 script (WIP).

But I might get a hang of it :) so sit tight.

From here on we can build it even more, like different reading types or better:

every time you inject during an even number you get a +1. Every click you make makes the next readings change more quickly. You get 5 readings, at the end if the score is positive you defuse it, otherwise..boom.

Good nite everyone :)

Share this post


Link to post
Share on other sites

Thats a great idea. Looking forward to any updates!

EDIT:

A bit more feedback:

1. When the IED is detonated, the added action for remote detonation stays on it, and it doesnt get removed when executed. You just get the "Too far" hint.

2. I think it is cool that the script runs automated scans. Thats great for many scenarios. However I think that it would be nice with an option to make manual scans. It would be way cool if you could bring up the scanner (if possible not from the action menu) and hit a scan button. Maybe it would take a few seconds to get results. Or you could bring up the dialog, switch on the scanner, and the script would stay active while it was turned on. In that regard it would be nice if we could pause the script.

3. I really like the manual defusal idea. The "nasty defusal" sounds cool, and with that then who would want to be an engineer:cool:. I would rather have it be determined by class of unit than object though. So engineers can disarm the regular way to stay BIS compatible, everyone else has to do it the "nasty" way. That way we can still disarm regular ied's placed by another script the fun way :)

Edited by Nielsen

Share this post


Link to post
Share on other sites

All sounds great, have you been messing around in my head?? :D

Just noticed I'm in the thanks :)

Share this post


Link to post
Share on other sites
Guest

Loving the script!

Is there a way to set it so that all engineers including AI engineers have the ability to detect? The reason I ask is because in my mission I have a recruit AI script and I want people to be able recruit an engineer and it will have the detection ability.

Is this possible?

Thanks

Share this post


Link to post
Share on other sites
Guest
Just add the ieddetect init to every engineer et voilà.

That will work for engineers already placed yes. But I want AI engineers that get recruited through the recruit AI script to have the detect ability.

Share this post


Link to post
Share on other sites

@Acelondoner: You just have to add the iedDetect_init to the recruit script you are using.. E.g. your script has a

[_unit] join Player;
or something like that.

Throw this next line in right below the one above:

nul0 = [_unit,50,30,20,01] execVM "scripts\IEDdetect\IEDdetect_init.sqf";

Make sure the "_unit"'s match. The _unit in red should be the same as the variable/prefix allready used to describe the unit in the recruit script (the blue one).

Hope that helps :)

Share this post


Link to post
Share on other sites
Guest

Hmm... I'm not quite fiollowing:o

This is the contents of init_newunit.sqf:

_unit = _this select 0;

/*****************************************************************
following section to run only on server.
Note: duplicate respective code in the pve in the init.sqf
******************************************************************/
if(isServer) then{
[_unit] execFSM (BON_RECRUIT_PATH+"unit_lifecycle.fsm");
} else {
bon_recruit_newunit = _unit;
publicVariable "bon_recruit_newunit";
};




/*****************************************************************
Client Stuff
******************************************************************/
_unit addAction ["<t color='#949494'>Dismiss</t>",BON_RECRUIT_PATH+"dismiss.sqf",[],-10,false,true,""];

I guess it has to go somewhere in there?

Share this post


Link to post
Share on other sites
I guess it has to go somewhere in there?

Nah, not quite :)..

This references some other code. The

PublicVariable "bon_recruit_newunit";
triggers the code we want to change I think.

Otherwise it is the unit.lifecycle.fsm file that handles it. But I dont know much about FSM I must say.

What recruit script are you using? Give me a link to it, and I'll see if I can figure it out ;)

Edited by Nielsen

Share this post


Link to post
Share on other sites
1. When the IED is detonated, the added action for remote detonation stays on it, and it doesnt get removed when executed. You just get the "Too far" hint.

Whoa, thanks for letting me know. Will fix this asap.

2. I think it is cool that the script runs automated scans. Thats great for many scenarios. However I think that it would be nice with an option to make manual scans. It would be way cool if you could bring up the scanner (if possible not from the action menu) and hit a scan button. Maybe it would take a few seconds to get results. Or you could bring up the dialog, switch on the scanner, and the script would stay active while it was turned on. In that regard it would be nice if we could pause the script.

Nice idea. I think we should have an actual object that can be picked up from a crate and put in the inventory. About bringing up the scanner, pausing etc. that could be done easily but I MUST learn about dialog screens, controls and generally about RscPictures and similar. If you have ANY kind of material on it that you can point me to, I'd be glad to study. I am a total noob when it comes to dialogs and custom interfaces :)

3. I really like the manual defusal idea. The "nasty defusal" sounds cool, and with that then who would want to be an engineer. I would rather have it be determined by class of unit than object though. So engineers can disarm the regular way to stay BIS compatible, everyone else has to do it the "nasty" way. That way we can still disarm regular ied's placed by another script the fun way

Well, regular disarming can still be done on all kinds of IEDs (BAF_ied_v1, for example). To do regular disarming, you must be an engineer, anyway. Nasty defusals via code-injection need the Nomad tool, so it would be great (again) if it was a real item that can be picked up and used. I think it will be easier to understand when I manage to release v1.5 lol..but I need to study dialogs, so please any kind of tutorial I can get my eyes on would be awesome..and someone please make a Nomad 3d model to make it an item ;)

Better get to work!

beeep..beeep..beeeep.. ;)

Share this post


Link to post
Share on other sites
Thank you for helping:)

This is the script http://www.armaholic.com/page.php?id=12113

No problem. I figured it wouldnt take me more than a few minutes.

I had a look at it, and it seems simple enough. However I just realized that you only wanted engineers to be able to detect, so some kindof check is needed I think (like Kremator suggested). I dont know a/the overall type of engineer like "tank". "Engineer" does not seem to work. But you can however easily make it right for a specific type of engineer. Lets say you are playing a mission with US Army (OA) units.

Open the recruit.sqf script in the "bon_recruit_units" folder.

At line 45 where it says:

/********************* UNIT CREATION ********************/

_unit = group player createUnit [_unittype, [(getPos bon_recruit_barracks select 0) + 20 - random 40,(getPos bon_recruit_barracks select 1) + 20 - random 40,0], [], 0, "FORM"];

_unit setRank "PRIVATE";

[_unit] execVM (BON_RECRUIT_PATH+"init_newunit.sqf");

if (_unit isKindOf "US_Soldier_Engineer_EP1") then {nul0 = [_unit,50,30,20,01] execVM "scripts\IEDdetect\IEDdetect_init.sqf";};

/*******************************************************/

Insert the red line. That should do it I think.

If you are not playing with OA US units, then just find the typename for the correct engineer. E.g. if playing regular Arma 2 you would use "USMC_SoldierS_Engineer". And make sure to adjust the numbers in the execVM array for your prefered settings for the IED detection script.

@Albertos:

Just to be clear, the problem is not when you remote detonate, but when my triggerman detonates the IED. If the triggerman detonates so the IED no longer exists, then the remote option stays on.

I think it would be SO awesome with an object for the script, however I have nothing to offer but my hype in that department. I have zero experience with creating models/addons.

About the dialogs. I have only just recently thought about diving into dialogs myself, so I propably cant help you there. I got a lot of inspiration from Hoz' script though. But I sadly dont know of any tutorials on the subject.

I think I understand what you mean about the disarm now. Sounds cool. Looking forward to the next version.

Sent you a pm btw.

Edited by Nielsen
typo

Share this post


Link to post
Share on other sites
@Albertos:

Just to be clear, the problem is not when you remote detonate, but when my triggerman detonates the IED. If the triggerman detonates so the IED no longer exists, then the remote option stays on.

Ah ok, I get it now. This can be solved easily. I will make it so that my _remoteDet.sqf script checks for the existence (alive _IED, for example) and, if NOT found, it will remove the action. I will probably add the "anomaly inconsistent" as if the tool believes the previous IED report was fake (since the IED stops existing).

This would avoid adding a new .paa image (doable but still, les is mo :)).

Share this post


Link to post
Share on other sites

You could check if the unit is an engineer by the relevant entry in their config:

engineer = 1;

If you use something like:

if (getNumber (configFile >> "CfgVehicles" >> typeOf _unitname >> "engineer") == 1) then
{
      Your code here:
};

That way, you won't jave to keep adding classes in as new addon units are released.

Hope that's helpful for you.

Share this post


Link to post
Share on other sites

@Albertos: Yeah no biggie.. And I agree, no need to make another dialog for that.

@Das Attorney: Great idea..

Share this post


Link to post
Share on other sites
Guest
No problem. I figured it wouldnt take me more than a few minutes.

I had a look at it, and it seems simple enough. However I just realized that you only wanted engineers to be able to detect, so some kindof check is needed I think (like Kremator suggested). I dont know a/the overall type of engineer like "tank". "Engineer" does not seem to work. But you can however easily make it right for a specific type of engineer. Lets say you are playing a mission with US Army (OA) units.

Open the recruit.sqf script in the "bon_recruit_units" folder.

At line 45 where it says:

Insert the red line. That should do it I think.

If you are not playing with OA US units, then just find the typename for the correct engineer. E.g. if playing regular Arma 2 you would use "USMC_SoldierS_Engineer". And make sure to adjust the numbers in the execVM array for your prefered settings for the IED detection script.

@Albertos:

Just to be clear, the problem is not when you remote detonate, but when my triggerman detonates the IED. If the triggerman detonates so the IED no longer exists, then the remote option stays on.

I think it would be SO awesome with an object for the script, however I have nothing to offer but my hype in that department. I have zero experience with creating models/addons.

About the dialogs. I have only just recently thought about diving into dialogs myself, so I propably cant help you there. I got a lot of inspiration from Hoz' script though. But I sadly dont know of any tutorials on the subject.

I think I understand what you mean about the disarm now. Sounds cool. Looking forward to the next version.

Sent you a pm btw.

Thanks Nielsen, I would test this^ but for some reason this script is acting wierd in my mission atm...

It's saying that the engineer (detector) is an IED:confused: and just keeps on scanning saying it was clean. Also, no IED's are getting picked up on the scanner apart from the one I just mentioned.

Any ideas?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×