Jump to content

Problems after changes in local LUA-scripts for missions


Go to solution Solved by Rudel_chw,

Recommended Posts

Posted (edited)

Hello together,

actually I'm using the RAT-functions from moose to fill up my airspace, everthing works fine.
I'm editing my local LUA-script in M$ Visual Code but every time I make some changes in my script and save it, I have to click on "open" in my trigger list and pick my scriptfile again. After every change I made. If I don't do this no changes are considered.

image.png

My simple script:

planeTemplates = { 
    RAT_TMPL_01 = 40,
    RAT_TMPL_02 = 40,
    RAT_TMPL_03 = 30
}
for templateName,anz in pairs(planeTemplates) do 
    local pl=RAT:New(templateName)
    pl:SetTakeoff("air")
    pl:SetDeparture("RATZONE1")
    pl:Commute()
    pl:SetSpawnDelay(2)
    pl:SetSpawnInterval(1)
    pl:Spawn(anz)
end

It feels like there are some cashes or something like that. How can I solve this Problem? Are there any settings to "bake" a mission file in ME with fresh imports every time I'll start it?

I'm using the MT-Version 2.8.8.43704. 

Thanks for any tips and best regards,
Andreas

 

Edited by Atari800XL
  • Like 1

DCS MT😍, all maps except channel, FC3, F-16C Viper, F-15E, F/A-18C, AH-64D, F-5E, F-4E, P-51D, Spitfire, Fw-190D, MiG-21bis, L-39, AJS-37
Supercarrier, WWII-AP, CA, TrackIR5, F/A-18-Stick + Thrustmaster 16000, Stream Deck 8x4, 2x MFD Cougar
Ryzen9 5950X SMT off, 64GB RAM, RTX 4070 SUPER TI, UWQHD 3440x1440, Win11+DCS from separate M.2

  • Solution
Posted
13 minutes ago, Atari800XL said:

but every time I make some changes in my script and save it, I have to click on "open" in my trigger list and pick my scriptfile again.

 

This is "as designed", and actually a good thing as I will explain.  A DCS Mission is nothing more than a zipped file containing the mission definition (in LUA syntax), plus any additional files the mission uses: sounds, images, and scripts. It looks like this:

 

PcFgVlL.jpg

 

I have marked the two scripts that I use on this mission. This setup means that if you now go and edit a lua script and save it on your disk, the mission still has its own copy inside the MIZ file.  When you pick the script again, it gets updated inside the MIZ.

 

This is actually good, because it makes missions more portable ... you handle someone the MIZ file and they now have everything the mission needs, no need to hand out lua scripts, sound files, etc ... just the MIZ.

22 minutes ago, Atari800XL said:

It feels like there are some cashes or something like that. How can I solve this Problem?

 

Most likely you are using an old version of Moose, download the latest here:

 

https://github.com/FlightControl-Master/MOOSE/releases

 

22 minutes ago, Atari800XL said:

Are there any settings to "bake" a mission file in ME with fresh imports every time I'll start it?

 

Not that I know of, but this has never been a nuisance to me, as I don't update Scripts that often.

 

  • Like 1

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

Posted

Thanks for this detailed answer, I already feared that this import is an unique just-in-time action. As a beginner in DCS-scripting I very often have to make changes on my script(s) and re-import them. 

Yes, a final mission should be one piece, in our case a playable .miz-file to handout to others. But during developing a mission this is really annoying for me. Think I'll make a feature request for a fresh import checkbox at this point.

  • Like 1

DCS MT😍, all maps except channel, FC3, F-16C Viper, F-15E, F/A-18C, AH-64D, F-5E, F-4E, P-51D, Spitfire, Fw-190D, MiG-21bis, L-39, AJS-37
Supercarrier, WWII-AP, CA, TrackIR5, F/A-18-Stick + Thrustmaster 16000, Stream Deck 8x4, 2x MFD Cougar
Ryzen9 5950X SMT off, 64GB RAM, RTX 4070 SUPER TI, UWQHD 3440x1440, Win11+DCS from separate M.2

Posted
54 minutes ago, Atari800XL said:

Think I'll make a feature request for a fresh import checkbox at this point.


ok, but just a checkbox wont achieve it, as the editor doesnt know where the script is stored within your hard drive, the mission format would need to include the full path of every script.

  • Like 1

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

Posted
3 hours ago, Atari800XL said:

Yes, a final mission should be one piece, in our case a playable .miz-file to handout to others. But during developing a mission this is really annoying for me. Think I'll make a feature request for a fresh import checkbox at this point.

It would indeed be highly desirable to be able to use a code repository for your missions, and then have them reference scripts outside the miz itself for development purposes. That would be a dream, and enable us to use real IDEs for development and test purposes. 

The problem here is if we got this (and I hope that at one point we do), we'd need something similar to 'make mission' - a way to build a stand-alone mission from the mission 'project' that other people can use. That would also be the time to assemble all sound and other misc files that we currently have to add piecemeal and under arduous work-arounds. 

So: I'm wishing for a 'mission project' file type with logical links, and a 'mission' that can be auto-built from such a project that resolves all links and includes all linked files (not just scrips, also audio and other) into a playable mission that can be run anywhere.

  • Like 1
Posted (edited)

Anyway, this workflow is really annoying. This morning I started to paste my little Script in the textbox for code-execution - this works for my little scripts very well.
Changes in M$-VS, locally saved on harddrive, lua-debugger in background for syntax-check. copy&paste into this really little text-box. For my little learning-scripts in ME this is ok.

But: when I think of Blender3D for example with it's integrated little pythoneditor with syntaxhighlighting etc. ... this in ME for scripts would be a perfect solution for me.

I watched nearly all the videos from FlightControl and saw Eclipse IDE ... and wanted to jump out of the window^^ Many years ago I had to code with Eclipse in many Java-projects ... arrrrrr. 

But overall: it absolutely rocks (me) to see my little RAT-script working, F10 looks like flightrader24 and I'm curious about what I'm going to learn or try out next with this brilliant MOOSE.

EDIT: (timecode is cutten off from link) - at 17:15 exactly my problem^^

 

Edited by Atari800XL
  • Like 1

DCS MT😍, all maps except channel, FC3, F-16C Viper, F-15E, F/A-18C, AH-64D, F-5E, F-4E, P-51D, Spitfire, Fw-190D, MiG-21bis, L-39, AJS-37
Supercarrier, WWII-AP, CA, TrackIR5, F/A-18-Stick + Thrustmaster 16000, Stream Deck 8x4, 2x MFD Cougar
Ryzen9 5950X SMT off, 64GB RAM, RTX 4070 SUPER TI, UWQHD 3440x1440, Win11+DCS from separate M.2

  • Recently Browsing   0 members

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