Jump to content
Sign in to follow this  
tequnique

create marker on a target the AI spots?

Recommended Posts

Hello guys... I'll return with a specific question :)

QUESTION:

I wish the AI to paint a target they spot on the map with a marker (IE named "Contact spotted"). I've seen the AI create a sort of target history on the map - so somehow one should be able to return these values and create a marker on them.

Reasoning:

Later on I wish to bombard that marker with artillery or send in reinforcements to it.

Share this post


Link to post
Share on other sites

Not exactly what you want but at least a point to start from. I've made this script to verify if the AI really magically knows (as some always state) where the player is. So i wrote this script which spits out all info the AI knows about the player, included his assumed (not necessarly the real) position of him.

You may rewrite the routine so it wont scan for player but for enemies of all (or just some) sort:

private ["_unit", "_target", "_knowntargets", "_pos", "_class", "_side", "_level", "_type", "_accuracy", "_knows", "_msg", "_markerstr", "_Xpos", "_Ypos"];
_unit = group _this;
while {true} do {
deleteMarker "markername";
_knowntargets = (leader _unit) nearTargets 9999;
{
	if ((_x select 4) == player) then {
		_target = _x;
		_markerstr = createMarker["markername",_x select 0];
		_markerstr setMarkerShape "ICON";
		"markername" setMarkerType "DOT";
		_pos = _target select 0;
		_class = _target select 1;
		_side = _target select 2;
		_level = _target select 3;
		_type = _target select 4;
		_accuracy = _target select 5;
		_knows = (leader _unit) knowsabout _type;
		_msg = "Position: %1\nClass: %2\nSide: %3\nThreat: %4\nType: %5\nAccuracy: %6\nKnows: %7";
		hintsilent format [_msg, _pos, _class, _side, _level, _type, _accuracy, _knows];
	};
} foreach _knowntargets;
sleep 0.5;
};

Share this post


Link to post
Share on other sites

Thank you that is great... hehe.. Im working like a fruitcake to learn scripting now... as I am creating a single/multiplayer scripting framework to be released at a very much later stage

Takes time.. but once I'm more skilled Ill definently see what I can do with this...

Share this post


Link to post
Share on other sites

Mods, delete this post please.

Edited by Taurus

Share this post


Link to post
Share on other sites

To exactly see what the script does, open up the editor, place yourself as player (preferably as sniper) and a enemy group. In the groupleaders initline, call the script:

nul = this execVM "NameOfScript.sqf";

Make sure you have a big distance between you and the group. In my test scenarion, the enemy group was located on the runway on Utes, near the control tower. Myself i was placed straight east of them, up the little hill, near the road. There are some small walls to hide behind.

Now start to take the group under fire. As soon they now that you are there somewhere, a hintbox will appear top right of the scrren, telling you what they know (or what they think to know) about you.

For your purpose, i guess "Position" and "Accuracy" might be the most interesting factors. Position shows what they guess where you are and Accuracy says how accurate they know (guess) your position. Be aware that accuracy isn't meant as level but as radius. Say accuracy is 200, then they think you are at "position" or in a radius of 200m near to this position. The smaller the number, the more likely they pinned your position down.

You might also check the map where a dot marker shows your guessed position.

It's really interesting and for the purpose you have surely more than just "good to know". Finally you might use accuracy value to decide if it's wirth to launch an arty mission or if the enemy position isn't accurate enough for.

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  

×