Home   Help Search Login Register  

Author Topic: Report target position + a new question about Radio chatter  (Read 2157 times)

0 Members and 1 Guest are viewing this topic.

ido

  • Guest
I want to make a Radio Alpha trigger that each time I trigger it will give me the location of a specific enemy target, the broadcast should be semilar to the broadcast in MP when a player reports an enemy with right mouse button - "position BC34 enemy car", can it be done and how ?

another question: is there anyway to convert "position" array type to map cordinates (eg. "BC34") ?
« Last Edit: 14 Sep 2006, 17:27:21 by Ido Rosenthal »

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Report target position
« Reply #1 on: 14 Sep 2006, 16:42:53 »
You can have a marker moved to the location of the target, using the setMarkerPos command. If you combine this with a radio message saying "Target vehicle located. All units: check your maps for accurate position" or something simal, you should get the effect you're asking for. I assume it's the same vehicle every time, right?

If so, have a look at these commands in the COMREF:

setMarkerPos
setMarkerType
sideChat
sideRadio

EDIT: about your second question... No, not to my knowledge.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

ido

  • Guest
Re: Report target position
« Reply #2 on: 14 Sep 2006, 17:26:40 »
hmm its a good idea, not really what I was looking for but a good bypass. no way of making the 0-0-1 thing to report the target position on the map ?

I have another one - is there a way to change PAPA_BEAR callsign to something else ?

Offline Cheetah

  • Former Staff
  • ****
Re: Report target position + a new question about Radio chatter
« Reply #3 on: 14 Sep 2006, 17:33:48 »
Yup there's a way to do so.
Write a script that checks the x-y coords and translates them into XX00 format. It'll cost you some time, but you can make a script like that.

About the callsigns:
make a stringtable and add:
"STR_CFG_GRPNAMES_ALPHA","YOUR CALLSIGN"

You can then use this to transmit something with your callsign on the radio.
Don't know the correct syntax though  :confused:
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

ido

  • Guest
Re: Report target position + a new question about Radio chatter
« Reply #4 on: 14 Sep 2006, 17:40:08 »
about the script... where do I begin, I mean is there a formula or some sort of thing to convert it ? what is the distance between two grid lines on the map?

I know about the ALPHA thingy (I used it to change my own unit callsign) but what should be the group name of PAPA_BEAR ?
I've tried: STR_CFG_GRPNAMES_HQ and STR_CFG_GRPNAMES_PAPA_BEAR
« Last Edit: 14 Sep 2006, 22:48:45 by Ido Rosenthal »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Report target position + a new question about Radio chatter
« Reply #5 on: 14 Sep 2006, 17:48:16 »
Hah. Of course there is. :)

The old ed.depot had it, and lo and behold, so does the current one! I took a quick look, and found a function (gridcoord.sqf by uiox), which according to the blurb "Return the position with the format "Aa00"". So there you have it. I'm a bit fuzzy on how to call functions, so someone else can help you with that, and I'm not sure if it takes into account larger/smaller islands (i.e., standard 12km^2 or the bigger Nogova-type ones), but well.

 :cool2:

Anyway, worth a try!

/Wolfrug
"When 900 years YOU reach, look as good you will not!"

Offline Cheetah

  • Former Staff
  • ****
Re: Report target position + a new question about Radio chatter
« Reply #6 on: 14 Sep 2006, 17:56:11 »
about the script... where do I begin, I mean is there a formula or some sort of thing to convert it ? what is the distance between to grid lines on the map?

Uhm, thought that the distance between them was 1000 metres? As they're squares this is for X and Y axis.
So what you can do, is use getPos and then select the X-coordinate using select. Divide this number by the distance (1000 metres?), so divide by 1 as getPos returns distance in km. And select the corresponding letter from the alphabet. E.g. 0.4656 gets the A.
Then the larger square is divided in smaller squares, you do the same procedure only then with < 1000 metres (get the distance).
Give it the corresponding letter and do the same for the Y-axis.

Make it a script and you can use it to return the Bf61 for example. I know that there was some documentation of these squares (eg: bf13, x axis: 1005353 - 5352895 : y axis: 5000-6000, but don't know if it still exists)
Hope this helps.

@callsign
Don't know now, have no time to do research on it sorry mate.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Cheetah

  • Former Staff
  • ****
Re: Report target position + a new question about Radio chatter
« Reply #7 on: 15 Sep 2006, 00:47:17 »
I made a function which you can use in your mission to get the radio coordinates. The function is attached to this reply.

A brief instruction
  • Download the function
  • Put the function in the mission folder: ..../Users/Username/missions/missionname/
  • Create a file "init.sqs"
  • Put this line in it: getRCoord = preprocessFile "getRCoord.sqf"
  • Call the function with this: variableName = [OBJECTNAME] call getRCoord;
  • Use this variable in your mission and have fun.
  • For a hint, use this: hint format ["Map coordinates: %1",variableName];

NOTE: Only tested with the BIS Maps (Everon, Malden, Kolgujev, Desert Island, Nogova)

Hope that this helps you (and possibly others).
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Report target position + a new question about Radio chatter
« Reply #8 on: 15 Sep 2006, 17:04:04 »
 i use this script, unfortunatley i have commited a great sin and forgot who made it, i thimk mandoble.
 
Code: [Select]
; *****************************************************
; ** Operation Flashpoint Script File
; *****************************************************

;calculates the ingame grid coordinates (e.g. Be39) from a position array [x,y,z]
;[<positionarray>, <frontmatter>, <backmatter>, <comchannel>] exec "gridcoordinates.sqs"
;With comchannel you can choose the method of output:
;<comchannel> = ["Hint"]                          --> Hint
;                              ["SideChat", <unit>]    --> Sidechat by <unit>
;Example:
;[GetPos player, "My position is grid ", ". Over.", ["SideChat", player]] exec "gridcoordinates.sqs"

_pos = _this select 0
_xpos = _pos select 0
_ypos = _pos select 1
_frontmatter = _this select 1
_backmatter = _this select 2
_comchannel = _this select 3

?((_xpos < 0) OR (_xpos >= 12800) OR (_ypos < 0) OR (_ypos >= 12800) ): _string = "XxXx"; Goto "SendMessage"

_xcoarserest = (_xpos Mod 1280)
_xslotcoarse = (_xpos - _xcoarserest)/1280                               
_xslotfine =(_xcoarserest - (_xcoarserest Mod 128))/128       

_yslot = 99 - (_ypos - (_ypos Mod 128))/128
                           
_ystring = Format["%1",_yslot]
?_yslot < 10: _ystring = "0" + _ystring

_upper = ["A","B","C","D","E","F","G","H","I","J"]
_lower = ["a","b","c","d","e","f","g","h","i","j"]
_xstring = (_upper select _xslotcoarse) + (_lower select _xslotfine)

_string = (_xstring + _ystring)

#SendMessage
   _output = _frontmatter + _string + _backmatter
   Goto (_comchannel select 0)
   Goto "End"

#SideChat
   (_comchannel select 1) SideChat _output
   Goto "End"

#Hint
   Hint _output
   Goto "End"

#End
   Exit
I love ofp

ido

  • Guest
Re: Report target position + a new question about Radio chatter
« Reply #9 on: 15 Sep 2006, 18:27:29 »
thanks everyone, finally I decided to use nominesine idea and the heli will mark the position of the target on the map because I use custom radio messages during the mission.
and I've managed to figure out how to change the PAPA_BEAR name when i finally found this thread:
http://www.ofpec.com/forum/index.php?topic=23945.0