Jump to content
Sign in to follow this  
Deg

setPos trouble

Recommended Posts

Hi all, so right now im just testing some stuff on the mission im working on, and right now i have a empty tent that on mission start will appear in one of three places. Now i wanted to have an AI move with the tent plus a flag pole for testing purposes so for the ai unit i put in its init

guy setPos (getPos tent)

now that works great it puts him right in the middle of the inside of the tent. So my question is how can i move the flag pole so that it sits outside the tent and not in the middle, im pretty sure it has something to do with adding

 objectName setPos [x,y,z]

but i cant seem to figure it out any help would be greatly appreciated. Thanks :)

Deg

Share this post


Link to post
Share on other sites
flagpole setPos [(getPos tent select 0)+1,(getPos tent select 1)+1,(getPos tent select 2)]

Share this post


Link to post
Share on other sites

or for the lazy coders:

flagpole setPos (tent modelToWorld [1,1,0])

Share this post


Link to post
Share on other sites

Thank you that worked :) just a question though, those +1s what does the first and second one determine exactly so i can completly understand, i was messing around trying to set the flagpole all around the tent. Thanks

Deg

---------- Post added at 14:51 ---------- Previous post was at 14:49 ----------

Thanks Master85 that worked to :) guess i just need to mess around with the values.

Share this post


Link to post
Share on other sites

Thanks Kylania i do understand what [x,y,z] does i was referring to

flagpole setPos [(getPos tent select 0)+1,(getPos tent select 1)+1,(getPos tent select 2)]

i wasnt sure if the +1s ment the same thing, the issue i was just having i was doing

flagpole setPos (tent modelToWorld [1,1,0])

instead of

pole setPos (tent modelToWorld [1,1,0])

oops :o Thanks for the help folks :)

Share this post


Link to post
Share on other sites

I can't count how many times I've had an error which was caused by me using one name in one place and another name for the same object in another place. :) Glad you got it working.

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  

×