MIssion Scripting Tools (Mist)- enhancing mission scripting Lua - Page 2 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 12-05-2012, 07:37 AM   #11
Speed
Veteran
 
Speed's Avatar
 
Join Date: Nov 2008
Location: Auburn, AL
Posts: 4,078
Default

ATTENTION:

There was a major problem with Mist v1_0. The mist.addEventHandler function was broken. You know how they always say "if it ain't broke don't fix it"? Well, yea... maybe I should have listened Anyway that also broke the mist.DBs.deadObjects database, preventing it from being populated.

I've already updated the Mist post to include Mistv1_1, which fixes these problems (never thought we'd see version 1.1 so early...). The only change is the fixing of mist.addEventHandler (and mist.DBs.deadObjects).
__________________
Intelligent discourse can only begin with the honest admission of your own fallibility.
Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/
Lua scripts and mods:
MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616
Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979
Now includes remote server administration tools for kicking, banning, loading missions, etc.

Last edited by Speed; 12-05-2012 at 07:40 AM.
Speed is offline   Reply With Quote
Old 12-05-2012, 08:17 AM   #12
Speed
Veteran
 
Speed's Avatar
 
Join Date: Nov 2008
Location: Auburn, AL
Posts: 4,078
Default

Here's the mist.demos.printFlightData function applied to weapons fired. For example, load the attached mission "Mist Weapon Flight Data.miz", select an F-15, and fire an AMRAAM- the mist.demos.printFlightData will output real-time flight data for the weapon:


When applied to player aircraft, there's still some shakiness in the acceleration-based values that I need to sort out, but angular data and velocity works very well- "Mist Player Flight Data.miz" is mist.demos.printFlightData applied to the player aircraft.

mist.demos.printFlightData isn't really useful for mission scripting, that's why we put it in the "demos" table- it demonstrates some of the power of the Simulator Scripting Engine for collecting data about the game environment. You can embed Tacview-like data collecting into your mission itself, base mission logic off of it if you want, and if you "unsanitize" the io and lfs libraries in MissionScripting.lua, then you can even output your data to a file and graph it using like Excel or something.
Attached Thumbnails
Click image for larger version

Name:	AMRAAM flight data.jpg
Views:	3049
Size:	54.9 KB
ID:	74569  
Attached Files
File Type: miz Mist Weapon Flight Data.miz (44.8 KB, 211 views)
File Type: miz Mist Player Flight Data.miz (41.0 KB, 241 views)
__________________
Intelligent discourse can only begin with the honest admission of your own fallibility.
Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/
Lua scripts and mods:
MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616
Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979
Now includes remote server administration tools for kicking, banning, loading missions, etc.
Speed is offline   Reply With Quote
Old 12-05-2012, 08:27 AM   #13
chromium
3rd Party Developer
 
Join Date: Dec 2008
Location: Milan
Posts: 3,419
Default

To use those script, can I:

1) execute by Triggered actions - command - run script action? + trigger with AI TASK action

2) load a .lua file instead of "run script" text?
__________________

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium is offline   Reply With Quote
Old 12-05-2012, 09:17 AM   #14
Speed
Veteran
 
Speed's Avatar
 
Join Date: Nov 2008
Location: Auburn, AL
Posts: 4,078
Default

Quote:
Originally Posted by chromium View Post
To use those script, can I:

1) execute by Triggered actions - command - run script action? + trigger with AI TASK action

2) load a .lua file instead of "run script" text?
Yes

Yes

Anywhere the mission editor lets you put Lua, that Lua will run in the global environment, where it will "see" Mist.
__________________
Intelligent discourse can only begin with the honest admission of your own fallibility.
Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/
Lua scripts and mods:
MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616
Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979
Now includes remote server administration tools for kicking, banning, loading missions, etc.
Speed is offline   Reply With Quote
Old 12-05-2012, 09:28 AM   #15
chromium
3rd Party Developer
 
Join Date: Dec 2008
Location: Milan
Posts: 3,419
Default

ok the last questions (than I will leave you at work ):

How do I load a function by file? I have to copy & paste (notepad ++) the function text in a new .lua file named as I want (es. functionLOS.lua)?

If I have to send the mission to other people, do this loaded file will be stored in the .miz archive? Or I have to send also the .lua files to be loaded?

thanks a lot

(as usual I'm keeping group names between consecutive mission and scenarios, so I need to reduce at most the "porting" workload to save time and prevent errors)


------------------------------------------------------

PS: Speed, Grimes, would you like to see a "script wish list thread" to let the mission builder to tell you what functions could be intersting to be added?
__________________

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Last edited by chromium; 12-05-2012 at 09:32 AM.
chromium is offline   Reply With Quote
Old 12-05-2012, 09:36 AM   #16
Speed
Veteran
 
Speed's Avatar
 
Join Date: Nov 2008
Location: Auburn, AL
Posts: 4,078
Default

Quote:
Originally Posted by chromium View Post
ok the last question (than I will leave you at work ):

How do I load a function by file? I have to copy & paste (notepad ++) the function text in a new .lua file named as I want (es. functionLOS.lua)?
Yes, this is part of why I prefer using DO SCRIPT instead of DO SCRIPT FILE. Also, you're probably aware of the rare "crap, my mission lost all its attachments" bug. DO SCRIPT FILE may also be affected by this bug; DO SCRIPT is immune to it. So yea, I like using DO SCRIPT instead. However, Grimes often prefers using DO SCRIPT FILE... to each his own, I guess.

Quote:
If I have to send the mission to other people, do this loaded file will be stored in the .miz archive? Or I have to send also the .lua files to be loaded?

thanks a lot
Yes, the Lua file is included in the zipped .miz archive, just like any sounds or pictures your mission might also use.
__________________
Intelligent discourse can only begin with the honest admission of your own fallibility.
Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/
Lua scripts and mods:
MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616
Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979
Now includes remote server administration tools for kicking, banning, loading missions, etc.
Speed is offline   Reply With Quote
Old 12-05-2012, 09:45 AM   #17
chromium
3rd Party Developer
 
Join Date: Dec 2008
Location: Milan
Posts: 3,419
Default

Perfect... ehm... to be onest I'm not aware of that attachment problems, but I'll find my way using it .
__________________

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium is offline   Reply With Quote
Old 12-05-2012, 10:43 AM   #18
Megagoth1702
Member
 
Join Date: Oct 2011
Location: Berlin, Germany
Posts: 846
Default

The attachment problem often happened to me when I saved the mission withou actually changing anything within it. You know, you alt tab out for a long time, then alt tab back in and you're not sure whether you saved the mission or not. So you just save it one more time. That's when I lost my files within the mission.

I believe it is enough to move a unit a little bit to make the mission "changed".

Speed, have you gotten this bug WITHOUT not having changed it between saves?
__________________

System specs:
Spoiler:
2500k @ 4.6 GHz
8GB RAM
HD7950 OC'd
Win7 x64
Posting tracks to make your DCS better - attention bump incoming!
Megagoth1702 is offline   Reply With Quote
Old 12-05-2012, 10:48 AM   #19
chromium
3rd Party Developer
 
Join Date: Dec 2008
Location: Milan
Posts: 3,419
Default

Quote:
Originally Posted by Megagoth1702 View Post
You know, you alt tab out for a long time, then alt tab back in and you're not sure whether you saved the mission or not. So you just save it one more time. That's when I lost my files within the mission.
sounds like the story of my editing life: I suffer a compulsive "PRESS SAVE BUTTON" syndrome. I'll definitely go thrugh the DO SCRIPT if it's like you told.
__________________

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium is offline   Reply With Quote
Old 12-05-2012, 11:01 AM   #20
Megagoth1702
Member
 
Join Date: Oct 2011
Location: Berlin, Germany
Posts: 846
Default

Awesome, no SLmod but pretty much the same functions, haha.

Speed, looking at the mist manual I can not find anything like "unitsFiring", that sets a flag to true once a unit has fired something. Am I overlooking something?

Thanks.
__________________

System specs:
Spoiler:
2500k @ 4.6 GHz
8GB RAM
HD7950 OC'd
Win7 x64
Posting tracks to make your DCS better - attention bump incoming!
Megagoth1702 is offline   Reply With Quote
Reply

Tags
mist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:31 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.