Jump to content
Sign in to follow this  
KillSh0t

setpos of static weapons...

Recommended Posts

I'm trying to set static weapons ontop of buildings I.E. AA guns...MG's...

The problem I'm having is getting the gun to sit level with the roof of the house...

Im using

this setPos ((position this nearestObject 1506) buildingPos 12); this setDir 106;this setCaptive true;

and I know theres a way to adjust the height but I cant for the life of me remember what it is....

Can someone help me out, I looked on BI's wiki but most of that is chinese to me :(

Share this post


Link to post
Share on other sites

Put this in your unit init

0 = this spawn { while {alive _this} do { hintSilent str (getPosATL _this); copyToClipboard str (getPosATL _this); sleep 0.1; } };

As soon as you find the spot where your static would be good, pause, alt-tab out of the game and copy-paste the position! Voila:D

Edit: Shuko's example will probably be easier, since you have the direction already and don't need to set it afterwards.

Edited by Antigoon

Share this post


Link to post
Share on other sites
this setpos [(getPos this select 0), (getPos this select 1),0];

This is what i use in the init of static objects (same as units) - The last "0" is the height, depending on how many floors high u want ,3] will get you on top of first floor etc. But u can fiddle to get it perfect; ,3.2] for example.

Edit; What map are you using for this? I recall having trouble with map Namalsk, some spots on the map with the "setpos" were sitting on crazy angles!

Edited by fosfap
namalsk

Share this post


Link to post
Share on other sites

thanks for the help....ill give some of these ideas a try....

Im using this idea on takistan, just thought putting some AA guns ontop of buildings would add some realizism to things and makes it easier when trying to find a place to put the guns.

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  

×