Jump to content
Sign in to follow this  
SgtDThompson

Spawning Player/AI in building

Recommended Posts

Hey guys, I am wondering how you get a unit to spawn on the second level of a building, not on the roof. I have been checking the forums for over an hour and can't seem to find the right thread for this subject.

Share this post


Link to post
Share on other sites

You can use this in the unit's initialization field:

this setPos [getPos this select 0, getPos this select 1, x];

The x at the end is a number. 1 is 1 meter (above ground) I believe. You need to fiddle around with it a bit to get the right number. It can be negative I think but I don't know if that will do you any good.

Alternatively you can use this in the unit's initialization field:

this setPos ((nearestBuilding this) buildingPos 1)

That will put the unit in building position #2 of the nearest building to it. The reason it is number 2 is because it is zero based. IE building position #1 = 0, position #2 = 1, #3 = 2, etc. The building has to have building positions for this one to work. To check if it does you can try putting a waypoint on the house and a new box should appear with building positions in it.

Share this post


Link to post
Share on other sites

this works fine for bungalows but how do i get unites to spawn on the transmission towers?

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  

×