Jump to content
Sign in to follow this  
Kyle_K_ski

Can AI stand and/or patrol on roofs?

Recommended Posts

Simple question, and I'm hoping that the answer is "Yes."

I've been spawning enemy AI on the tops of the gray apartment buildings, to patrol its edges, act as a sentry and/or as a sniper. Yet every time I go to evaluate the AIs presence on top of the building, it turns out that it's in the building, and usually comes charging out when it detects my units' presence.

How can I enable the AI to spawn on top of, and stay on top of the roofs of buildings?

Yours,

Kyle

Oct. 27, 2007

crazy_o.gif

Share this post


Link to post
Share on other sites

Hi Kyle_K_ski,

whistle.gif

   I'm not sure if you got this far yet,but try setting the position of the unit using the object command. Reference the house by ID to get an accurate pos on the the building and set the z axis to 10 or fifteen; well to the hight of the roofs. I'm not sure about getting them to patrol on top, that'll take me a while to figure out if it's possible.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{<unit type>} createUnit [[0,0,1000],unitGroup,{Soldier_1 = this}]; housePos = getPos (object 60);Soldier_1 setpos [(housePos select 0),(housePos select 1),10]

Thanks 0perator

Share this post


Link to post
Share on other sites

Hello Kyle,Operator,

These units where placed using just the editor.Putting

them directly over a building.

rooftopsentryyt2.jpg

So once you get the height correct,they should

stay in place.And won't try to engage incoming

units.

Roadway and path lods are a bit quirky.And not as stable

as you might think.In my experience,getting the

units to do anything other than staying in one place,

will probably result in them walking off the edge of the

building.

But they can at least stay there.And they can be effective

enough,while they have line of sight.

smile_o.gif

Share this post


Link to post
Share on other sites

Hi Macser,

Quote[/b] ]

These units where placed using just the editor.Putting

them directly over a building.

banghead.gif

   Great observation! I tried that too and it would be the simplest way of doing business. Very well, I agree. To my defense though; the impression I got is that the createUnit command was being use to spawn soldiers.

Share this post


Link to post
Share on other sites

Macser,

Could you share with me the height setting you used for the two story apartment building? I've even tried extreme heights of 25-30, yet the units always come running out of the buildings, and have never stayed on the roof.

I've done searches for the command that needs to be placed in the unit's init line, and all of the searches came up with the same command:

this setpos [(getpos this select 0),(getpos this select 1), *]

Replace the "*" with the desired height number. I'm building a mission set in El Qlabsha that's situated on the ARABIA_TadcoFarm_Bronze island. What I like about this location is its layout, and its extensive use of enterable buildings. It also has apartment complexes that are 5 stories and 9 stories tall. There are taller structures as well, but I doubt that the AI can even see that far down to the ground. wink_o.gif

If you happen to know what the rooftop settings are for the 5 and 9 storied buildings, I certainly wouldn't mind you sharing those with me as well. biggrin_o.gif

It's too bad that the AI traverse poorly across the tops of the buildings, but I shouldn't be too surprised by that. I don't know how many times in the past my own avatar has fallen through the rooftop to the floor below. A bit surreal, don't you think?

Thanks for your quick responses guys.

Yours!

Kyle

Oct. 27, 2007

smile_o.gif

Share this post


Link to post
Share on other sites

Kyle_K_ski,

try loadind OFP vanilla and add a unit over the apartment building.

I loaded the map and placed some units over the buildings and they all stood on top. Might be a custom AI script or something.

Share this post


Link to post
Share on other sites

Hello again,

Yeah it seems to work fine if you just position em

over any building while in the editor.But take care

with the left/right and forward/back placement.

Because the edges of the buildings are a little

further in than they appear.Pull the units back a

little from the edges,otherwise they initialise on the

ground.Which may be what you're experiencing.

This works fine for a mission,if you want them there

on start up.Otherwise,Operator's suggestion would be

better for positioning during a mission.From a trigger

or whatever.

Also if you want to use the setpos command.You could

place something small like an ammo box,in the editor.

Give it a variable name and stick it in the building centre.

It may drop through the floor,but that's no problem.

Then reference that in the units init field.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

This setPos [ getPos box select 0, getPos box select 1, (getPos box select 2) +30]

"box" being the ammo box.Or whatever.

Or try Operator's way.Just experiment more with the

X and Y co-ordinates.Because 25-30 on the Z axis seems

about right for a 5 story building.

And I've tried some of that on vanilla OFP maps and

a few community ones too.As long as the building

has a roadway on top,there shouldn't be a problem.

Hope that's of some help.

smile_o.gif

Share this post


Link to post
Share on other sites

Thanks for your feedback!

It worked, particularly when I FINALLY noticed that a "+" or a "-" is needed when specifying heights!

They still have the tendency to walk off of the rooftops.

I'm hoping that if I have the rooftop AI use the Trench script that'll they hold their positions till they're really in trouble. Of course, I have to be able to LOCATE the script in order to download it.

Anybody have any ideas where I can get the latest and stablest version?

Thanks!

Kyle

smile_o.gif

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  

×