Jump to content
Sign in to follow this  
whisper

getHideFrom always returns [0, 0, 0]

Recommended Posts

I tried to see how one could enhance a bit CQB AI behavior, and for this I tried to use a combination of findCover and getHideFrom, unfortunately, all getHideFrom returns me is [0, 0, 0].

Anyone having better luck than me? If so, how?

Share this post


Link to post
Share on other sites

I've tried it tooo - same result here.

It doesn't seem to work at all, seeing as it should at least return the current position of the soldier if there is truly NO hiding space. Returning [0,0,0] is a clear indication that there is no working code there.

Share this post


Link to post
Share on other sites

hint format["%1",eastMan getHideFrom player], player = west.

This seems to always returns a non [0,0,0] result so long as eastMan and the player. Unfortunately, the returned point is frequently meters in the air, or on on top of the player. It seems to be a point that the hider should move away from more than a point they should move towards. Possibly the estimated location of the player?

edit: I'm now quite sure the returned point is the position the hider thinks the enemy is at. Try a mission with setCaptived enemy following cycling loop around the setCaptived hider a town. When the hider has direct line of sight, the returned point is directly on the enemy unit. When the enemy is out of sight but the hider still knowsAbout the enemy, the returned point will be somewhere near the enemy, but never exactly on him.

Possible uses:

* creating a less precise enemy location to be used for hiding from.

* a handy suppressive fire target area!

Share this post


Link to post
Share on other sites
hint format["%1",eastMan getHideFrom player], player = west.

This seems to always returns a non [0,0,0] result so long as eastMan and player know about each other.

Unfortunately the returned point is frequently meters in the air, or on on top of the player. It seems to be a point that the hider should move away from more than a point they should move towards. Possibly the estimated location of the player?

Strange, I tried this command many times and always got [0,0,0] back...

I'll try it out when I get home.

EDIT: Oh my god I've just realized what it could mean if you are right about the "estimated location" of the enemy.... this could work wonders for suppressive fire scripts...

*rubs hands and laughs menacingly*

Share this post


Link to post
Share on other sites

Hey -

Well to me it returns what I suspect is the closest hiding location:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">EnemyLoon move (EnemyLoon GetHideFrom player)works like a charm and

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1\n%2",EnemyLoon getHideFrom player,position player]returns two different positions.

I find it an extremely powerful command.

Hope it helps,

Igor.

[edit]

But as fasad said, the units need to know about each other.

[/edit]

Share this post


Link to post
Share on other sites

Some time ago i've fiddled a bit with findCover and other functions. Here's a old&ugly snippet of code that i've found was -partly- working.

The "setHideBehind" function is not well documented and quite cryptic on BIKI (returns nothing ?).

Not sure if it's actually working in this snippet ...

About suppressive fire: i tried to simulate that using some invisible targets. Sadly these targets still do stop bullets, so suppression cannot work as intended.

Hope somebody will find a workaround for that.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = _unit findCover [(position _unit), (position _enemy), 200];

if(!isNil("_obj")) then

{

_pos = _unit getHideFrom _enemy;

_unit setHideBehind [_obj, _pos];

_unit domove position _obj;

};

NOTE: i've seen position being [0,0,0] as well as [0,0,1]. Maybe it has to be intended as "posture", such as crouched, prone or standing ?

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  

×