Jump to content
Sign in to follow this  
limmy3

Stupid AI faces wall

Recommended Posts

Hello,

after my last question was answered perfectly and works fine.

Here is my next problem. crazy_o.gif  And I have another millions...  wink_o.gif

I have a soldier in a MG who stands in a wall corner so he should look out 45°. The soldier is MoveInGunner to MG and Soldier DoTarget Player linked.

To make it clear one wall standing 0° (North) to 180° the second 270° to 90°. The second wall touches with the 270° end the other with its 180° end. That's stupid ...  whistle.gif

So the soldier should look in direction towards 45°.  banghead.gif

But he doesn't he looks to 270° and therefore towards the wall.

I tried the SetDir command of 45° (North East) but is won't work.

The player is in direction of about 330° to the soldier. So this shouldn't effect the soldier and there are to many walls between them.

The second question would be is it possible to give the soldier the command to scan horizon? pistols.gif

Well, actually the part between the walls from 0° to 90°.

Everybody is  welcome.gif

Regards limmy3

Share this post


Link to post
Share on other sites

Hi,

To watch a specific direction try this, place a game logic in the direction you want him to look.

Then call:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MGGunner DoWatch [(GetPos GL1) Select 0,(GetPos GL1) Select 1,3]

GL1 is the name you give to the game logic. MGGunner is the name you giive to your machine gunner.

To get him to scan a particular arc, just periodicly move the game logic and call the above code again.

P.S You don't need a logic, you can do it all with trigonmetry. But it's easier to demonstrate the idea this way.

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  

×