Jump to content

Reload Lua File on Running Mission?


TheThumper

Recommended Posts

Hey Folks,

Does anyone have any tips/tricks that would allow me to reload a changed lua file without having to "Do the Dance"? Say via the F10 menu or the like.

 

By "Do the Dance" I mean

  1. Quit the mission
  2. Select the triggers menu in ME
  3. Select the trigger
  4. Open the Browse Window for Lua file
  5. Select same Lua file
  6. Save mission
  7. Rerun mission

 

Thanks in advance for any help here.

~Thump.

 

Computer Specs:

i7-6700K@4.00GHz, 32GB, 850 EVO 1TB, GTX 1080 Ti, Samsung Odyssey VR

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

The mission is essentially an archive file, you can unpack/pack it with 7z.

 

What I do:

- Unpack your mission to a folder (for example 'build')

- Copy your lua file to the folder build/I10n/DEFAULT and overwrite your lua script that is there

- Pack folder again as a .miz file and copy the file to your C:\Users\<yourusername>\Saved Games\DCS\Missions folder

 

You can write an easy .bat script to do this for you, such as

 

"7za.exe" -obuild -aoa x mymission.miz

xcopy myscript.lua build\l10n\DEFAULT /y /i

"7za.exe" a "mymission.miz" .\build\* -tzip

xcopy "mymission.miz" "C:\Users\<yourwindowsuser>\Saved Games\DCS\Missions" /i /y

 

This way you can open DCS, click on MISSION, select your mission and play. Then when done, exit the mission. Change your lua, run the .bat script, and play the mission again. Repeat until your lua script works.


Edited by dikkeduif
Link to comment
Share on other sites

If you are using MOOSE, there is a way to load your scripts from it's saved location, rather than using the script stored in the .miz file.

 

Wayz Out

 

 

Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe

HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

Link to comment
Share on other sites

If you are using MOOSE, there is a way to load your scripts from it's saved location, rather than using the script stored in the .miz file.

 

 

This is exactly what I was looking for, guy in video actually refers to the issue as "The Dance" also. Thanks very much A101Wayz!

~Thump.

 

Computer Specs:

i7-6700K@4.00GHz, 32GB, 850 EVO 1TB, GTX 1080 Ti, Samsung Odyssey VR

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

guy in video actually refers to the issue as "The Dance" also.

LOL, yeah, found it very funny that you called it that way, too. When I watched Pikey's vid the first time, that expression stuck in my head and since than every time I do it, I tell my self, "okay, let's to the dance" :D

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

When testing a Moose file, I run DCS in windowed mode so I can edit the script without leaving DCS. Use a Do Script trigger:

 

dofile([[e:\Game Data\Scripts\Mission Scripts\Your Script.lua]])   -- complete file path of script.

 

Then when you fly mission from within the ME the edited script loads dynamically. So procedure is reduced simply to edit the script and fly mission from within ME. Rinse and repeat.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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