Alerax Posted August 6, 2018 Posted August 6, 2018 Hi- This seems like a simple thing to do, but I can't figure out for the life of me. How do you call the aircraft's onboard number using a script command? In other words, if I set an F/A-18C (group name = GroupTest, unit name = UnitTest) with a tail number of 401 in the Mission Editor, what is the command line to call this tail number back? I've seen an attribute called onboard_num in the add.group function, which makes sense as an input to create a group/unit, but I can't seem to reverse to call this information. Thanks 1
Nix Mills Posted March 18, 2023 Posted March 18, 2023 (edited) Hi @Alerax Sorry for the late reply. That was a tough one. There doesn't appear to be a 'get' function for onboard / board / side / tail number. I found a few clues in the DCS World scripting file Scripts/Speech/common.lua in the lines under USNAVYPlayerAircraftCallsign. Here is a little script that looks up the three digits in your side number and prints them in a message. Each digit is multiplied by 10 and rounded down as they're otherwise some odd decimal numbers. Let's say your unit name is Aerial-1-1, which we will refer to as "player". local player = Unit.getByName('Aerial-1-1') local sidenumber = '' .. math.floor(10*player:getDrawArgumentValue(442)) .. math.floor(10*player:getDrawArgumentValue(31)) .. math.floor(10*player:getDrawArgumentValue(32)) trigger.action.outText('Player number is:' .. sidenumber, 30) Hope that helps you or anyone else who is looking for help on this. Nix Edited March 18, 2023 by Nix Mills
Recommended Posts