Adding an attachment

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

DMAN
Posts: 98
Joined: Fri Jan 11, 2019 3:56 am

RE: Adding an attachment

Post by DMAN »

ORIGINAL: michaelm75au

Using the 'Create new' in 'Scenario Attachments' in the editor should be creating the attachments in the AttachmentRepo and giving you the GUID to use in the Properties.
I am seeing that on my Beta copy but don't recall it in the release copy.


Image

I was wondering about that panel. It is blank for me.

So, I just packaged, evented, re-packaged all my overlays. It's a massive file all told so I'm curious what will happen when I test.

I loaded 4 overlays before and they displayed perfectly. Thanks, Michael [:)]

More to follow as the overlays are being re-packaged and I will test soon.
DMAN
Posts: 98
Joined: Fri Jan 11, 2019 3:56 am

RE: Adding an attachment

Post by DMAN »

Success!

All 95 (currently; will increase) overlays display as intended. It takes only a couple of minutes for them to load/render.

They really do add quite a bit of sharpness and detail to a scenario.

Thanks to everyone who aided my quest. Much appreciated [:)]
ProMitreCorp
Posts: 7
Joined: Wed Jan 18, 2023 2:10 pm

Re: Adding an attachment

Post by ProMitreCorp »

Ugh. I am not able to load overlays.
Version: Command PE - Premium Edition v2.1.12.1

I understand the steps:
* create attachment
* Get the ID of the attachment from the folder name
* Create a trigger and action that calls ScenEdit_UseAttachment('GUID')

I even tried running _UseAttachment() in the Lua console with no joy. The function returns 'true' which is supposed to indicate that the overlay loaded correctly.

I packaged my scenario and the resulting attachments folder was empty - which seems suspicious.

My Scenario Attachments "Properties" panel is empty, too.

And, of course, the sample provided in this thread uses a version of the DB I don't have, so it won't load.

Help.

Edit: Solved my problem. Filename length or spaces in the name was the problem.
Last edited by ProMitreCorp on Wed Feb 08, 2023 6:48 pm, edited 1 time in total.
ProMitreCorp
Posts: 7
Joined: Wed Jan 18, 2023 2:10 pm

Re: Adding an attachment

Post by ProMitreCorp »

My problem was the image file name. GMap.NET generates file names that look like: 'GMap at zoom 16 - ArcGIS_World_Topo_Map-638114443481562529.png'.
Using that file name failed.
Changing the name (of the .png and .pgw) to something like 'mymap1.png' worked.
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: Adding an attachment

Post by KnightHawk75 »

ProMitreCorp wrote: Wed Feb 08, 2023 6:22 pm My problem was the image file name. GMap.NET generates file names that look like: 'GMap at zoom 16 - ArcGIS_World_Topo_Map-638114443481562529.png'.
Using that file name failed.
Changing the name (of the .png and .pgw) to something like 'mymap1.png' worked.
Scenario wrapper file name used to get screwed up too if using multiple _ 's in certain cases, and using load recent, that was eventually fixed.

Wonder if the attachment stuff has a similar issue with parsing filenames.
Post Reply

Return to “Lua Legion”