OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Trash Can Man on 03 Jan 2006, 22:04:42
-
It's been ages since my last post! :) I'm getting back to mission making and I can't remember the way you elevate snipers either in towers or say on a building....lil help please
-
set the sniper to flying and position him on the tower/building icon until he stands up there. failing that just setpos his z vector 10 metres higher than it was.
-
It depends. If the buildings are built into the map, then simply placing the unit over the building will put them on the highest roadway lod
If the buildings are placed in the editor, then you will need a script command to raise their height:
this setpos [(getpos this select 0), (getpos this select 1), n]
where n is the height you want them at.
-Pilot
-
Thank pilot, that was the line I was looking for. Appreciate the help. :)
-
You should also check out buildingPos for placing units is buildings.
-
You should also check out buildingPos for placing units is buildings.
THobson! long time no see! where do I find out how to do this?
-
The command reference would be a good place to start. ;)
buildingPos (http://www.ofpec.com/editors/comref.php?letter=B#buildingPos)
Planck
-
this setpos ( (nearestbuilding this) buildingPos 1)
this works well, but how do I get him say on the second floor or any other floor for that matter?
-
maybe
Sniper disableAI "Move"
;)
-
Macca said something before when he was in his researchness time of making UnImpossible mission about usin unit disableAI "target" aswell to stop movement. Strangely, the AI will still engage targets so I'm not sure what it actually does.
But Macca said use it, so I bow before his infinite wisdom (as well as THobson's) and I will always use it when placing a sniper or anyone I want to stay in a fixed position.
-
THobson! long time no see! where do I find out how to do this?
Indeed, for a while you weren't around, and now I have a new job that is taking a huge amount of time. I see you have answers to your final point. Having suggested using buildingPos I should also warn you that you sould only use them at the start of the mission. You cannot believe the result they return after the mission has been saved and re-loaded.
-
http://www.ofpec.com/editors/comref.php?letter=D#disableAI
-
but how do I get him say on the second floor or any other floor for that matter?
Just use a different number for the buildingPos:
this setpos ( (nearestbuilding this) buildingPos 2)
Experiment till you 'find' the building position you want.
Most enterable buildings have more than one position.
Planck
-
Or you can adjust the height of the setpos command, but Planck's method will most probably be more accurate.
Notice the disableAI command is no longer effective after a mission load. If you want the sniper to stay where he is at the whole mission, you will need to set up a trigger to keep him there. Make the trigger activate repeatedly, in the condition field type:
time<=1
On Activation
SniperName disableAI "MOVE"; SniperName disableAI "TARGET";
Snytax not guarenteed.
-Pilot
-
Saved me from a bit of a trawl there Sniper, thanks. Was wondering how to sort out the load bug with disableAI, completely forgot about the 'time' command.
-
Just use a different number for the buildingPos:
this setpos ( (nearestbuilding this) buildingPos 2)
Experiment till you 'find' the building position you want.
Most enterable buildings have more than one position.
Planck
I was wondering about that number at the end!!! Thanks Planck