Jump to content
Sign in to follow this  
Carbone

Unit killed discovery

Recommended Posts

Hi,

How to make if one is spotted an enemy unit is found dead?

For example, a guard who is patrolling near or at a short distance, if the guard is dead, not hid, we are located, logically.

I can do this with triggers, but I would do with a script.

Thks.

Edited by Carbone

Share this post


Link to post
Share on other sites
A rather vague answer to a specific question.

yep ;)

Share this post


Link to post
Share on other sites

I dont know of a reliable proven method to do it but I have been designing an idea with knowsabout and possible body removal code so that the dead body is replaced with a dirt mound or just lowered into the ground as the default system.

Idea:

If you have a guard patrol setup and the guards are not grouped then you could try this idea out.

Use a killed EH or make a script that loops and checks !alive guardname and runs this code upon either.

Upon doing a stealth kill on a guard, create a proxy object like invisible H (since deletecollection is going away and i dont know how hideobject new command works yet) use createvehicle command for this.

setpos command it at the dead body position and run another script to check if any of the other guards have a knowsabout value of, say, over 1.6 to it. The script will check the knowsabout of the proxy object so the default detection system of the AI can be used instead of a user custom made system that would be tons more work.

If you get to the body and have an action that somehow runs code to hide the body and then deletes the invisible heipad proxy object then your covert kill is successful. The guards can no longer check for the deleted object as the script will finish once you perform the hiding of the body. Use addaction to the dead body to create a custom script for the body removal. You can try the default hide body system but it may have unseen issues and that forces you to remake a body removal system of your own that works perfect.

Custom systems that replace default systems is nature of the beast stuff in this series....

Of course a good guard patrol would have units checking in after a set time and if someone doesnt check in then an alarm goes out, but that would have to be another layer.

Also you would have to statically prepare a list of the guard unit names so its not a dynamic solution but the concept should be sound and sane.

guardarray = [guardname1,guardname2,guardname3]

then the script could loop through the array and do that knowsabout check for each guard to the proxy object. Once one guard knowsabout over the threshold they all should as the patroll would sound a general alarm right?

So now you have the job of preparing a reaction but maybe you have that done allready.

if any guards knowsabout goes above the threshold it was because you killed a guard and another patrolling guard saw the dead body before you were able to remove it.

I have to test out the idea but hopefully it gives you an idea of some things you can research like: killed eventhandler setup, spawning objects with createvehicle,looping through arrays with code and how the knowsabout command works and can possibly be used in a stealth scenario. Addaction, deletevehicle command are involved as well. So your task is really learning how to use these different commands to acheive your goal and the information is out there. Once you know how then you can implement the code and start testing in the editor. I recommend testing with enemy units in the vicinity and out of vicinity for stress testing reasons and any change to the performance of things in general.

The hardest part of enhancing the game with scripts for me is planning out the pure logic away from any syntax. Second hardest part is overcoming game limitations that hamper your idea somehow and requires more advanced methods.

I hope this was helpful and let me know if you had any questions or thoughts about this input to your idea.

Share this post


Link to post
Share on other sites

Well i use such a feature in Group Link 4.

It gives A.I. the abillity to detect dead bodys and set alert if they are on their own side.

It's a bit tricky to get the needed conditions.

The basic is to add all killed units into a array.

Then you can use this array to check the distance and knowsAbout value between all alive units and the killed units in the array.

So if any of the alive units is closer then 100 meters to any units in the killed array and the alive unit has a knowledge more then 0 about any of the killed units in the array then you can do what ever you want.

Note: The knowsAbout value about a unit which knows something about a killed unit always is 1.6.

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  

×