ED Forums

ED Forums (https://forums.eagle.ru/index.php)
-   Mission Editor Discussion and Questions (https://forums.eagle.ru/forumdisplay.php?f=210)
-   -   MIssion Scripting Tools (Mist)- enhancing mission scripting Lua (https://forums.eagle.ru/showthread.php?t=98616)

Speed 12-04-2012 10:38 PM

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua
 
Mission Scripting Tools
Expanded Lua Scripting Library for mission scripting by Speed and Grimes

What is it?
MIssion Scripting Tools (Mist) is a collection of Lua functions and databases that is intended to be a supplement to the standard Lua functions included in the simulator scripting engine. Mist functions and databases provide ready-made solutions to many common scripting tasks and challenges, enabling easier scripting and saving mission scripters time. The table mist.flagFuncs contains a set of Lua functions (that are similar to Slmod functions) that do not require detailed Lua knowledge to use. However, the majority of Mist does require knowledge of the Lua language, and, if you are going to utilize these components of Mist, it is necessary that you read the Simulator Scripting Engine guide on the official ED wiki.

Community Contributions
The purpose of Mist is to provide a set of scripts for the DCS community, by the DCS community. We are open to people contributing their own scripts into Mist, but we reserve the right to edit your script in any way we see fit before “officially” including it into Mist. Also, feel free to contribute ideas as for what scripts to develop next.

Usage Rights
Feel free to modify or redistribute Mist in any way you see fit (even including it in paid content is OK by us), AS LONG AS you don’t try claim that our work is your own.

How to use it?

Mist is not a mod of the game files. You include it into your missions simply by using the DO SCRIPT or DO SCRIPT FILE trigger actions to load Mist at or near mission start.

Mist Guide
A full .pdf guide for Mist is included in the attached Mist v3_3.rar file. Additionally, documentation is available online here.

Example DBs are also included.


Current feature overview
“Flag functions” – functions that can be used by persons with very little Lua knowledge. Functionally similar to many Slmod functions, these set a flag to true when they detect a certain game condition.
Spoiler:

mist.flagFunc.mapobjs_dead_zones
mist.flagFunc.mapobjs_dead_polygon
mist.flagFunc.units_in_zones
mist.flagFunc.units_in_moving_zones
mist.flagFunc.units_in_polygon
mist.flagFunc.units_LOS


“Scripting functions”- intended to be used within a larger Lua script. These require knowledge of the Lua language to use.
Spoiler:

General
mist.scheduleFunction
mist.removeFunction
mist.addEventHandler
mist.removeEventHandler
mist.getGroupPoints
mist.getUnitsInZones
mist.getUnitsInMovingZones
mist.pointInPolygon
mist.getDeadMapObjsInZones
mist.getDeadMapObjsInPolygonZone
mist.getUnitsLOS
mist.getNorthCorrection
mist.getHeading
mist.getPitch
mist.getRoll
mist.getYaw
mist.getAoA
mist.getClimbAngle
mist.getAttitude

Utilities
mist.utils.makeVec2
mist.utils.makeVec3
mist.utils.toDegree
mist.utils.toRadian
mist.utils.deepCopy
mist.utils.round
mist.utils.dostring
mist.utils.basicSerialize
mist.utils.serialize
mist.utils.serializeWithCycles
mist.utils.oneLineSerialize
mist.utils.tableShow

Debug
mist.debug.dump_G
mist.debug.writeData
mist.debug.dumpDBs

Vector Operations in Vec3
mist.vec.add
mist.vec.sub
mist.vec.scalar_mult
mist.vec.dp
mist.vec.cp
mist.vec.mag

Demos
mist.demos.printFlightData


Databases- databases built for easier mission scripting. (Example DBs included with Mist v3_3.rar file).
Spoiler:

STATIC DBs
Unit DBs
mist.DBs.units
mist.DBs.unitsByName
mist.DBs.unitsById
mist.DBs.unitsByCat
mist.DBs.unitsByNum

Group DBs
mist.DBs.groupsByName
mist.DBs.groupsById


Zone DBs
mist.DBs.zonesByName
mist.DBs.zonesByNum

Human-controllable unit DBs
mist.DBs.humansByName
mist.DBs.humansById

Misc. static DBs
mist.DBs.navPoints
mist.DBs.missionData

REAL-TIME DBs
mist.DBs.aliveUnits
mist.DBs.deadObjects

DOWNLOAD LATEST VERSION HERE

Speed 12-04-2012 10:38 PM

Reserved

Grimes 12-04-2012 10:39 PM

V4+ must be used for DCS 1.5 or higher.

MIST on Github for latest release
Mist 4.1 Download and info Posthttp://forums.eagle.ru/showpost.php?...&postcount=910
Mist Online Documentation: http://wiki.hoggit.us/view/Mission_S..._Documentation
Some great references for LUA in general:
http://www.lua.org/pil/
http://lua-users.org/wiki/TutorialDirectory
http://lua-users.org/wiki/SampleCode

Also feel free to make suggestions for features you might want to see added.

Puddlemonkey 12-05-2012 12:18 AM

Thanks. This is the mut's nuts :book:

gunterlund21 12-05-2012 12:58 AM

speed what is the difference between mist.flagfunc.units_in_moving_zone and the function in SLmod. Looks the same.

Grimes 12-05-2012 01:10 AM

They are basically the same. However the key difference is that Slmod functions require slmod to be installed. Mist is added to the mission file itself and therefore DOESN'T require the end user to install a mod in order for the function to work.

gunterlund21 12-05-2012 05:13 AM

Quote:

Originally Posted by Grimes (Post 1622401)
They are basically the same. However the key difference is that Slmod functions require slmod to be installed. Mist is added to the mission file itself and therefore DOESN'T require the end user to install a mod in order for the function to work.

Ahhh thats awesome. Now it makes the mission more modular and transportable and still get the benefits of slmod... Nice!!!!!! I also like the ability to create zones that arent just circular.

mwd2 12-05-2012 07:37 AM

New Toys :thumbup: but i haven`t manage the old ones....! :lol:

chromium 12-05-2012 08:30 AM

Thanks guys :D

chromium 12-05-2012 08:32 AM

PS: seems the attachment doesn't exist now :(


All times are GMT. The time now is 11:01 AM.

Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.