Lua script as attachment not working with ScenEdit_UseAttachment()

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
User avatar
NimrodX
Posts: 82
Joined: Sat May 12, 2018 8:34 pm
Contact:

Lua script as attachment not working with ScenEdit_UseAttachment()

Post by NimrodX »

I must be missing something that's not provided in the documentation because this isn't working.

ScenEdit_UseAttachment() doesn't seem to be running my lua script at all. Not in an Action script, not in the Lua console.

I've attached a scenario that demonstrates what is not working.
Attachments
Luainittest.zip
(3 KiB) Downloaded 7 times
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Lua script as attachment not working with ScenEdit_UseAttachment()

Post by michaelm75au »

This command is used to load files from the Attachment repository. You will need to create the file as an attachment, and use the attachment id as its name.
Use ScenEdit_RunScript() to run a Lua script from [Command base directory]/Lua
Michael
User avatar
NimrodX
Posts: 82
Joined: Sat May 12, 2018 8:34 pm
Contact:

RE: Lua script as attachment not working with ScenEdit_UseAttachment()

Post by NimrodX »

There seems to be no real benefit to Lua attachements at all. So far I haven't encountered anything that can't be better managed by creating a Lua Script Action and triggering it on scenario load, etc. This is much less trouble than trying to deal with all of the attachment bundling issues, unless maybe the Lua script is so large that it exceeds some hard limit for the text blob size of an Action. And in that case it seems likely that multiple lua script Actions could be executed.

Am I missing anything here?
Post Reply

Return to “Tech Support”