Jump to content
Sign in to follow this  
GoreZiad

Putting AI on top of objects and how to unarm them?

Recommended Posts

When putting AI in bunkers/buildings they tend to stay on the bottom floor, is there any way around this? Or putting them on chairs and what not. Also, what can I put in the init line to unarm them?

I knew how to do this in ArmA 1, but I guess it's a little different in this game? Maybe not?

Thanks.

Share this post


Link to post
Share on other sites

place them outside the bulding. Make a waypoint on to the building, click OK. Open the waypont and a new menu has been added. Select which position you want your unit in, and click OK.

When the mission starts, he will move to that position.

If you just want to place the unit in height, just place him on the object, and put this in his init linie: this setpos[getpos this select 0, getpos this select 1, (getpos this select 2) +10.0]

That should place him 10 meters up in the air. He will then drop until he hits something to stand on, så don't set it too high.

Edited by speeder

Share this post


Link to post
Share on other sites
what can I put in the init line to unarm them?

Thanks.

removeallweapons this

Share this post


Link to post
Share on other sites

Easiest way of placing AI in buildings is to make use of the buildingpositions.

You can create a simple script for this and call it from the init to easily place an AI in the desired position of a building.

Here:

setbpos.sqf

_obj = _this select 0;
_index = _this select 1;
_building = nearestBuilding _obj;
_obj setPos (_building buildingPos _index);

Now just place the AI next to the building and put this in the init: (x is the number of the position inside that building)

nul=[this,x] execVM "setbpos.sqf";

Share this post


Link to post
Share on other sites

DaveP released a script here in this forum called AI Urban Building/Combat Positioning Script. This script let the AI take random positions in houses ect...with example mission.

Sorry, i found the thread not at the moment, but you also can get it from here if you want.

Edit: here is the link to the thread

Share this post


Link to post
Share on other sites
Easiest way of placing AI in buildings is to make use of the buildingpositions.

You can create a simple script for this and call it from the init to easily place an AI in the desired position of a building.

Here:

setbpos.sqf

_obj = _this select 0;
_index = _this select 1;
_building = nearestBuilding _obj;
_obj setPos (_building buildingPos _index);

Now just place the AI next to the building and put this in the init: (x is the number of the position inside that building)

nul=[this,x] execVM "setbpos.sqf";

I've just tried that script but it just puts the units into the sea.

Ignore I put a coment in the script that messed it up.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Hehe no you're not going to tell me I have a bug in a script that consists of merely 4 lines of code! :P

Share this post


Link to post
Share on other sites

dumb question perhaps but where exactly... do i type the...

_obj = _this select 0;

_index = _this select 1;

_building = nearestBuilding _obj;

_obj setPos (_building buildingPos _index);

because I always get this ''local variable.. global space thing..."

Share this post


Link to post
Share on other sites

@Vostov: put it in a plain text file (use notepad or similar) with a .sqf extension, in your mission directory (each mission made in the editor has its own directory). You then call it as explained in Tajin's post.

Share this post


Link to post
Share on other sites

Oh I guess we need some sort of basic "How to create and execute an script"-HowTo these problems seem to appear frequently.

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  

×