Jump to content
Sign in to follow this  
-WH-Wallace

AI Defend Bunker

Recommended Posts

Is it possible to make an AI gunner use a bunker as cover to fire from? I have been screwing around for a few hours and this is starting to bug me. Any tips?

Thanks,

Wallace

Share this post


Link to post
Share on other sites

I should have another version of that above script out soon that will man bunker positions in addition to static weapons. The later script, the "loose" on will at least go into a crouch position to shoot over some low fortifications but it won't deliberately sit inside the bunker.

For now you have two choices. First is name the bunker something - for example "BUNKER". Next put this in the init of a unit which you to man it:

this setPos (BUNKER buildingPos 1) 

Experiment with buildPos 2, 3,4 and so one to see how many and which positions you want to use.

Second option is you can place units directly in the bunker where they should be with the editor. Use setUnitPos in their init to give them the right stance (for example setUnitPos "UP") and then use this forceSpeed 0 to lock them in place. If the bunker is a bit off the ground use:

this setPos [(getPos this select 0),(getPos this select 1),0.3]

The 0.3 is the part you can change to go higher or lower. Using 0.3 will raise the unit up about 1/3 of a meter. For the second story of a bunker you will need to use a larger number there.

Share this post


Link to post
Share on other sites

If you put a static weapon inside a bunker, would AI go inside and man it?

If you want units inside bunker already, I have a few templates with AI units inside along with ammo boxes. I will post later if needed.

Share this post


Link to post
Share on other sites

Templates would be awesome, when I get home I will start playing around with what you guys said. I was using the 'this enableAttack false' but they would just go prone behind the sandbags and never get up...

Hope I can get this all sort, thanks for a quick responses!

~S~ Wallace

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  

×