Jump to content
Sign in to follow this  
drunken officer

create buildingPos

Recommended Posts

Hi guys

I need a buildingPos in my house. Because the KI have to spawn there. I create one point in my memory-lod, called "buildingPos 1".

But when i try it in the editor

"this setPos [revier buildingPos 1];" nothing happends.

Can somebody explane me, how to create a building postion?

Thx

Share this post


Link to post
Share on other sites

First tip, dont have spaces in your named point, can cause issues.

Use "buildingPos_1" or "buildingPos1"

Second, I think the command is;

this setpos (_building modeltoworld (_building selectionposition "buildingPos1"));

Share this post


Link to post
Share on other sites

All 'rong! :cool:

Here is how you do it in O2.

Create a Paths-LOD. Now create small triangles all over the place. (Copypasta... :rolleyes:). The entrance points need to be named in1, in2,... Each entrance/exit gets its own in# selection.

Connect each triangle the way you seem fit. The AI will follow the face-outline ingame. Even through walls and anything you tell it to go through. To define building postions, you have to select just one single vertice at a time, and name it pos#. i.e. pos1, pos2, pos3, pos10, pos100. You get the idea. Each vertice needs a unique selection name. So here: No copypasta.

Now, here a picture to illustrate the above. Pictures usually tell it better than my words.

bpos.jpg

About the piece of code:

If it is an editor placed object, run this:

this setPos (yourEditorPlacedBuildingName buildingPos (floor random 25))

ditch the floor-random part if you don't want the unit to be randomly placed in one of the first 25 building positions.

If it is an object in an island, run this:

this setPos ((nearestBuilding this) buildingPos (floor random 25))

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  

×