OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: jamie_psx on 12 Sep 2002, 03:57:25
-
Hi guys I'm new to the forum and I have an editing question:
Does anyone know how to get the direction that a tank gunner is facing once he's at his station?
I tried:
GetDir (Gunner tank_name)
and
GetDir Player
but it gives me an invalid FFFFFEF hexadecimal value, instead of a 0-360degree value.
Alternatively, can you get this direction by finding which way the tank's gun is pointing?
I know that OFP-engine knows because any change in the guns or gunner's direction is reflected in the gunner's compass.
-
Welcome to the forums! I don't know the answer to this. But I do know that the name of the gunner: if the tank is called tank1 the gunner is automatically called tank1G. Similarly the driver and commander are tank1D and tank1C. So I would have thought that
GetDir tank1G
would have worked.
Tried a quick test. (No, I don't have anything better to do.) Created a tank called you've guessed it tank 1. Created a trigger and put this in the condition line
(getdir tank1G) == (getdir tank1C)
and the trigger fired as soon as I previewed the mission. Obviously the gunner and commander are always facing the same way at the start of a mission.
Hope that helps you do whatever you're trying to do.
-
Thanks, I'll give it a shot.
-
If I want a turned turret I insert a object (named) on the map in the direction where the gunner should aim at.
Then add to the gunners initline (if you've a empty tank and three crewmembers) or write it into a script.
gunner1 KnowsAbout object1
gunner1 doTarget object1
This should work...maybe you've to loop it in a script if there's some action around the gunner is interrested in.
I haven't tried the tank1G setdir ... thing but sounds quite good!
Greetz
Plage