How do I ... ?

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
Mog1
Posts: 5
Joined: Sat Oct 08, 2016 3:46 pm

How do I ... ?

Post by Mog1 »

How can I add a datalink for, say a ship, to an aircraft? I have added weapons and sensors but I dont see how to add a datalink.
Thanks in advance,
Mog
M1A2G
Posts: 29
Joined: Wed Sep 13, 2017 10:12 am

RE: How do I ... ?

Post by M1A2G »

Add comm link(First you must create a CONFIG FILES.If you do not know what this file is,please read the Command Manual ebook): Missile datalink with database ID# 3 used as an example:
<CommAdd_3 />
<!--SA-10 Missile Datalink-->

Here is a fully example:
<Unit_20541cc5-e6ff-47af-8b3f-df4e088d010a>
<!--Type 055 Zheng He (Type 055 Renhai [Zheng He] [2834])-->
<CommAdd_261 />
<!--SA-17/SA-N-12 Command Datalink [12 Channels]-->
</Unit_20541cc5-e6ff-47af-8b3f-df4e088d010a>
Attachments
QQ25130..03142123.jpg
QQ25130..03142123.jpg (75.02 KiB) Viewed 341 times
Mog1
Posts: 5
Joined: Sat Oct 08, 2016 3:46 pm

RE: How do I ... ?

Post by Mog1 »

I found that post last night and gave it a try. So to add "126 AEGIS Command Datalink [AN/SPY-1B] AEGIS Weapon Link" the entry would read:

<CommAdd_126 />
<!--AEGIS Command Datalink [AN/SPY-1B] AEGIS Weapon Link -->

I am just copying from your post. I dont really understand whats happening here.

Thanks,
Mog
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: How do I ... ?

Post by KnightHawk75 »

Another option is just pop into the LUA console in the editor and run the following AFTER Changing the name= and guid = parts to match your unit (which you can get from right clicking the unit and selecting scenario editor\copy id to clipboard and then pasting into console script:

Code: Select all

local myunit =  ScenEdit_GetUnit( {name='SAM Bn (SA-21a/b Growler [S-400 Triumf])', guid='9c291657-7c61-4935-a6d3-25face9f7897'} );
 --example adding 20 extra channels for sa21\25 missile links, change for what your unit needs. 
 ScenEdit_UpdateUnit( {guid=tostring(myunit.guid),mode='add_comms',dbid='267'} );  
 

Then press Run.

Code: Select all

 --If you want to check a units comms list before or after you can run this to dump output just make sure it comes after the 'local myunit' line above so that 'myunit' exists for this part of the code:
 print('--comms list---');
 for i, v in ipairs(myunit.components) do
    if v.comp_type=='CommDevice' then
    print(v);
    end
 end
 print('--end comms list---');

Also in some cases extra 'Comms' will get added automatically if adding certain Mounts, usually it's a vehicle component for SAM sites that do that, but not always, just saying. For example on the s400 if you add a Vehicle GraveStone 92N2 as Mount it will also add comms links that come with it. Note if you remove the mount though the comms entry that was added will get removed (most of the time anyway). Just wanted to mention it as another round about way to do this without code or ini files, but it will not apply to all things, like if you wanted to add milstar comms to said unit you must do it via LUA or ini's.



User avatar
Primarchx
Posts: 1954
Joined: Sun Jan 20, 2013 9:29 pm

RE: How do I ... ?

Post by Primarchx »

ORIGINAL: KnightHawk75

Another option is just pop into the LUA console in the editor and run the following AFTER Changing the name= and guid = parts to match your unit (which you can get from right clicking the unit and selecting scenario editor\copy id to clipboard and then pasting into console script:

Code: Select all

local myunit =  ScenEdit_GetUnit( {name='SAM Bn (SA-21a/b Growler [S-400 Triumf])', guid='9c291657-7c61-4935-a6d3-25face9f7897'} );
 --example adding 20 extra channels for sa21\25 missile links, change for what your unit needs. 
 ScenEdit_UpdateUnit( {guid=tostring(myunit.guid),mode='add_comms',dbid='267'} );  
 

Then press Run.

Code: Select all

 --If you want to check a units comms list before or after you can run this to dump output just make sure it comes after the 'local myunit' line above so that 'myunit' exists for this part of the code:
 print('--comms list---');
 for i, v in ipairs(myunit.components) do
    if v.comp_type=='CommDevice' then
    print(v);
    end
 end
 print('--end comms list---');

Also in some cases extra 'Comms' will get added automatically if adding certain Mounts, usually it's a vehicle component for SAM sites that do that, but not always, just saying. For example on the s400 if you add a Vehicle GraveStone 92N2 as Mount it will also add comms links that come with it. Note if you remove the mount though the comms entry that was added will get removed (most of the time anyway). Just wanted to mention it as another round about way to do this without code or ini files, but it will not apply to all things, like if you wanted to add milstar comms to said unit you must do it via LUA or ini's.

Thanks! That looks great. Where's the comms db listing at these days? I used to know... :(
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: How do I ... ?

Post by KnightHawk75 »

I replied in another thread about the dump location, but it's in \DB\Database Component ID Number List\db3k_442.txt

Probably time for another dump of it for the next db release, though you can always load up something like sql-lite db browser and just query\dump the related tables.
It's easier usually if you're trying to replicate something that exists on an existing unit though to just query that unit via LUA and see what's what.
Post Reply

Return to “Mods and Scenarios”