Jump to content

Recommended Posts

Posted (edited)

Post your script here, there might be problems with it.

 

I think the task needs to be pushed, like this:

 

My_Group = Group.getByName("group name in ME")

ActivateBeacon = { 
 id = 'ActivateBeacon', 
 params = { 
   type = type_enumerator, 
   system = system_enumerator, 
   name = string, 
   callsign = string, 
   frequency = number, 
 } 
}

[color="Red"][i]My_Group:getController():pushTask(ActivateBeacon)[/i][/color]

Edited by Hardcard
Posted

Yep. I definitely need to learn how to script. This is what I used. I don't even understand what all the other parts of your script are! Lol:

 

ActivateBeacon = { 
 id = 'ActivateBeacon', 
 params = { 
   type = 16408, 
   system = 7, 
   name = 'Beacon', 
   callsign = 'AA', 
   frequency = 123000.0, 
 } 
}

 

 

I just put this in the 'run script' advanced waypoint action

Windows 7 Enterprise 64bit | i7-4790K@4GHz | 8GB RAM | GTX970 347.52

Posted (edited)
I don't even understand what all the other parts of your script are!

 

I'll try to explain as best as I can.

 

Afaik, the following code only defines ActivateBeacon task (or command, in this case). It doesn't do anything else:

ActivateBeacon = { 
 id = 'ActivateBeacon', 
 params = { 
   type = 16408, 
   system = 7, 
   name = 'Beacon', 
   callsign = 'AA', 
   frequency = 123000.0, 
 } 
}

 

The beacon needs to be assigned to a group/unit, so you need to specify that group/unit in the script, otherwise it won't do anything.

 

Always keep in mind that scripts are "blind and dumb", meaning that they won't see/know/do anything that isn't specifically defined.

 

 

In this case, you need to tell the script how to find the group (or unit) in your mission, and then instruct it to run the task/command that you've defined.

 

 

 

 

-- The following line allows the script to find the relevant group, so to speak

 

Beacon_Object = Group.getByName("group name in ME")

 

 

-- If you're interested in an individual unit instead, use the following line

 

Beacon_Object = Unit.getByName("unit name in ME")

 

 

-- Then define the ActivateBeacon task/command, just like you did

 

ActivateBeacon = {

id = 'ActivateBeacon',

params = {

type = 16408,

system = 7,

name = 'Beacon',

callsign = 'AA',

frequency = 123000.0,

}

}

 

-- Finally, you need to tell the controller of that group or unit to run the ActivateBeacon task/command

 

Beacon_Object:getController():pushTask(ActivateBeacon)

 

 

-- To be honest, I've never worked with this kind of commands before, perhaps :pushTask() won't work with ActivateBeacon.

 

-- In that case, try :setCommand() instead, see if it works then

 

Beacon_Object:getController():setCommand(ActivateBeacon)

 

 

 

Edited by Hardcard
Posted

Thank you. This is really good info. I will try this out tonight.

Windows 7 Enterprise 64bit | i7-4790K@4GHz | 8GB RAM | GTX970 347.52

  • 2 weeks later...
Posted (edited)

After a quick test, at least I can confirm that the script runs from start to end (no apparent errors).

 

 

Are you sure about the type, system and frequency values? There's a chance the enumerators from the Hoggit wiki are outdated.

 

This is the SystemName enumerator table according to the current BeaconSites.lua file (located in Gamedir\Scripts\World\Radio).

As you can see, these system enumerators don't match the Hoggit Wiki's:

 

 

SystemName = {

PAR_10 = 1,

RSBN_4H = 2,

TACAN = 3,

TACAN_TANKER_MODE_X = 4,

TACAN_TANKER_MODE_Y = 5,

VOR = 6,

ILS_LOCALIZER = 7,

ILS_GLIDESLOPE = 8,

PRMG_LOCALIZER = 9,

PRMG_GLIDESLOPE = 10,

BROADCAST_STATION = 11,

VORTAC = 12,

TACAN_AA_MODE_X = 13,

TACAN_AA_MODE_Y = 14,

VORDME = 15,

ICLS_LOCALIZER = 16,

ICLS_GLIDESLOPE = 17,

}

 

 

 

 

For the beacon types, I've found the following enumerator table in BeaconTypes.lua (also located in Gamedir\Scripts\World\Radio)

 

 

BEACON_TYPE_NULL = 0

BEACON_TYPE_VOR = 1

BEACON_TYPE_DME = 2

BEACON_TYPE_VOR_DME = 3

BEACON_TYPE_TACAN = 4

BEACON_TYPE_VORTAC = 5

BEACON_TYPE_RSBN = 128

BEACON_TYPE_BROADCAST_STATION = 1024

 

BEACON_TYPE_HOMER = 8

BEACON_TYPE_AIRPORT_HOMER = 4104

BEACON_TYPE_AIRPORT_HOMER_WITH_MARKER = 4136

BEACON_TYPE_ILS_FAR_HOMER = 16408

BEACON_TYPE_ILS_NEAR_HOMER = 16424

 

BEACON_TYPE_ILS_LOCALIZER = 16640

BEACON_TYPE_ILS_GLIDESLOPE = 16896

 

BEACON_TYPE_PRMG_LOCALIZER = 33024

BEACON_TYPE_PRMG_GLIDESLOPE = 33280

 

BEACON_TYPE_ICLS_LOCALIZER = 131328

BEACON_TYPE_ICLS_GLIDESLOPE = 131584

 

BEACON_TYPE_NAUTICAL_HOMER = 65536

 

 

 

Btw, I've seen this mod, perhaps you'll find it useful.

Edited by Hardcard
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...