OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Killzone on 02 Oct 2003, 17:57:52
-
Hello,
I have made a script that allows a unit to build a small mobile camp anywhere they travel on the map. I used the createvehicle command for most of it. My problem is this:
All the created objects face in the same direction (north) and looks good but I would like to add another tent so that it faces in another direction. I have been using this command line for all my objects
tent = "campempty" createvehicle getPos b; tent setpos [(getPos b select 0) - (4), (getPos b select 1) + (11.5), 1.3]
It builds the camp in relation to "b". Is there something I can add to this so that a second tent will face in another direction besides north? It does not matter what direction "b" is facing the camp always point north.
I would like another tent a couple meters beside the firsth tent but facing in another direction. Plus I want to add fencing to this but if it all faces in the same direction it would not serve a very good purpose ;)
As always, Thanks in advance ;D
-
tent setdir (value between 0 and 360)
-
Damn!! that was a fast response. It worked great thanks a lot. ;D ;D ;D
-
As an alternative, you could use the mission editor to create the camp on one of the outlying islands. That way you can set it up exactly as you like. Then just setPos it in when you want. Inamimate objects like tents don't cause much lag, so having them pre-created shouldn't slow things down.
Another possibility would be to learn about the command getDir. This would allow you to camCreate the camp in any orientation you like, say based on the direction the player is facing.