OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: BronzeEagle on 25 Apr 2004, 17:10:48

Title: homing beacon
Post by: BronzeEagle on 25 Apr 2004, 17:10:48
wouldn't it be cool to have a homing beacon script?  
Title: Re:homing beacon
Post by: csde-PiLLe on 25 Apr 2004, 19:21:03
Well... have a marker and setpos it where you want the beacon to be. if the player "Switches off" the beacon (using radio or action menu), simply move the marker away (0,0,0) and setpos it back if the radio is reactivated.

If the beacon was to be attached to a vehicle, have a script looping every 1 or 2 seconds and setpos the marker accordingly.

Cheers
PiLLe
Title: Re:homing beacon
Post by: csde-PiLLe on 25 Apr 2004, 20:05:32
I did something like this for fun. I will try to attach it.

The ZIP should (*g*) be attached to the post above.

ZIP should be unpacked to "users/yourname/homingbeacon.eden" and the pbo here to "missions" (SP Mission FoldeR), with the current folder being your ofp-directory.

Cheers
PiLLe
Title: Re:homing beacon
Post by: csde-PiLLe on 25 Apr 2004, 20:08:34
If you were talking about, lets say, a "hint" giving you the current direction to your target, tell me and ill try to do that as well... but tomorrow ;)

Cheers and gn8
PiLLe
Title: Re:homing beacon
Post by: SEAL84 on 26 Apr 2004, 00:22:30
If I remember right, Devichaser had something like this in "Firelord" and Toadlife had some kind of tracer beacon in "Lojack."  You should probably as them, if you can get in touch with them.
Title: Re:homing beacon
Post by: myke13021 on 26 Apr 2004, 13:16:54
now i hope i uderstood it correctly....a "homing Beacon" shows you where someone is on the map, right?

If this is correct, this little script could help you for a start. If i'm wrong....ignore this post  ;D

Code: [Select]
?(side player == WEST): goto "trace"
exit

#trace
"civ0marker" setMarkerType "Destroy"
#loop
~5
?(civ0wanted == 0): goto "end"
_pos = getpos civ0
"civ0marker" setmarkerpos _pos
goto "loop"

#end
"civ0marker" setmarkertype "Empty"
"civ0marker" setmarkerpos [0,0]
exit

Explanations:

Code: [Select]
?(side player == WEST): goto "trace"
exit

i want only WEST units can see these markers....

Code: [Select]
"civ0marker" setMarkerType "Destroy"
as the marker is type "empty" at mission start, i have to make it visible.

Code: [Select]
?(civ0wanted == 0): goto "end"
at certain circumstances it doesn't need the marker any longer...so check this variable

Code: [Select]
_pos = getpos civ0
"civ0marker" setmarkerpos _pos

gets the pos of the unit and places the marker....this section is looped with a 5 sec delay...so pos is actualised every 5 secs...you can make this shorter or longer

Code: [Select]
"civ0marker" setmarkertype "Empty"
"civ0marker" setmarkerpos [0,0]

as the marker isn't needed for the moment, i switch it back to type "empty" and move it out of the map to a far corner.