This is what Sui wrote in reply to a guy's question on placing an object relevant to a unit's current position...
object setpos [(getpos unit select 0) + (sin (getdir unit - 90) * 20), (getpos unit select 1) + (cos (getdir unit - 90) * 20), 0]
Breaking it down to explain it...
(getpos unit select 0)
gets the x co-ord of unit
... + (sin (getdir unit - 90) * 20)
minus's a value that depends on the direction unit is facing. The - 90 means the position will be 90 degrees to the left of where the unit is facing. The * 20 means the distance will be 20m away.
... (getpos unit select 1) + (cos (getdir unit - 90) * 20)
this is exactly the same as the x co-ord line, apart from the underlined differences. These are necessary due to the y co-ord being perpendicular to the x co-ord
I could not get this to work for the life of me. Instead of unit I put self... instead of unit I also tried the name of other soldiers... and instead of object I tried AAA317... just cuz I tried that object name once b4 with something else and seemed to work once. I'm putting this in the init field of unit I try it on and doesn't work at all. The guy that started the previous post about this said he had a solution and clicked solved but didn't say what had ended up working for him
I'd appreciate any help. Basically, what I'm trying to do is place a tree or two or whatever in a map without having to go through the tediousness of scripting because I haven't learned all that is required for that yet. Later, hopefully I'll learn the camcreate stuff.
Thanks in advance m8s.