Jump to content

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua


Recommended Posts

I'm trying to automatically detect the name of a zone I have flown into. I confess I haven't read every page in this thread but various 'search' attempts haven't found the answer.

 

Is there a way to do this?

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Link to comment
Share on other sites

  • 2 weeks later...

Btw, anyone using open beta MUST use mist rev 53 or higher or else the databases will not correctly populate.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Btw, anyone using open beta MUST use mist rev 53 or higher or else the databases will not correctly populate.

 

The OP is not up to date?? It still delivers 3.3 although I found 3.6.44 somewhere else. Where will I find 'rev 53'?

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Link to comment
Share on other sites

Dev Branch

 

I can't edit speeds thread, and my first post is the last main release. Though dev branch could probably be set to a public release. I just need to change some stuff in the documentation first.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Dev Branch

 

I can't edit speeds thread, and my first post is the last main release. Though dev branch could probably be set to a public release. I just need to change some stuff in the documentation first.

 

Sorry for being thick here. I can click on your hyperlink and indeed see an online directory, and one file is called "mist.lua" and it says v53 next to it, but I can't figure out how to download it. I can click on it, then it shows me the file content (all the code lines) inside the webpage, but how do I get the lua file and save it on my computer?

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

Click the "download zip" or click on mist.lua, click RAW and download that file.


Edited by Grimes

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Hi Grimes,

 

I can't get mist to work in DCS 1.5. When I try to use it (as I did many times before in older versions) I get the message "attempt to index global mist (a nil value)". What am I doing wrong? I attached a very simple message that simply outputs "Hello".

test mist in V1.5.miz

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

Yeah known bug with the scripting engine. The initialization script file isn't working at the moment. Just put it in a Mission Start> Time Less> Do Script FIle trigger and it will work

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Yeah known bug with the scripting engine. The initialization script file isn't working at the moment. Just put it in a Mission Start> Time Less> Do Script FIle trigger and it will work

 

Thanks that did the trick.

 

Another point though. Am I correct that mist's message system now conflicts with DCS world's own message system. It seems that now if I use the mist.msg system, the message gets rebroadcast over and over again quickly filling up the entire screen. If needed I can provide example missions.

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

I added the extra variable to the end so it should display in the old format, but the functionality has gotten bugged in the past it could be re-bugged. I will investigate.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

V4 release for DCS 1.5

 

Download

 

 

Changelog:

 

V4 release for DCS 1.5

 

- added proper support for DCS 1.5's new messages and mission file formatting.

-added a check when adding unitTypes for messages to figure out the correct in-game unit name for a given unit. For example the Mi-8 helicopter is always displayed as 'Mi-8MTV2', however its actual in game name is 'Mi-8MT', this feature allows for you to list 'Mi-8MTV2', 'Mi-8MTV', or 'Mi-8' to get messages sent to the Mi-8. Shortcut also works for the relevant aircraft 'Mig-21', 'Mig-15', 'FW-190', and 'Bf-109'.

-added mist.getAvgPos now accepts static objects in addition to units.

-made DB creation check the mission editor version for no paticular reason

-added mist.getLastDBUpdateTime which returns the most recent time the DB update function has run.

-changed mist.makeUnitTable processed entry to return the time it was processed instead of a boolean value.

-Changed teleport/respawn/clone functions to spawn aircraft at random altitudes instead of constants if the point given is vec2/not specified.

-Fixed FlagFuncs will now recognize units added in dynamically. Note this only applies if you send it unitTableNames identifier and not the table that the function creates.

-Added variable to all flagfuncs. unitTableDef is the original definition used for units.

-Fixed all getUserFlag checks to compare with numerical value instead of boolean

-Fixed check in mist.getUnitsLOS to verify units are active in a mission

-Fixed check in mist.goRoute to verify both the group and controller are valid before assigning

the route

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Thanks for the new version Grimes!

 

Do you know if there is a changelog or list of lua changes in 1.5?

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Thanks for the new version Grimes!

 

Do you know if there is a changelog or list of lua changes in 1.5?

 

See the pages I edited on the wiki on Sep 28th. Otherwise check the changelog.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

See the pages I edited on the wiki on Sep 28th. Otherwise check the changelog.

 

Thanks Grimes! That's just what I was looking for.

 

I can hopefully fix the radio beacons in my script now. :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Thanks for the update Grimes... i get a bit confused by the naming conventions being used by MIST .... I note in post #836 that v.mist_4_0_55 can be downloaded yet in this thread: http://forums.eagle.ru/showthread.php?t=147792 you reference v53 for download which is merely named mist.lua on github. Can you clarify how you are approaching versioning so I know I have the latest running lua?

 

AHA! - NM... i see now that there is also mist_4_0_55.lua in that same repository - sorry ... didnt see that earlier.

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

Cause I pushed the update to release 4 which was build 55 after I made that post and forgot to update it. The v53 is the minimum version you can use with DCS 1.5. It has the DB fixes but not the message fixes which are in v55.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

has the MIST respawn script changed?

 

CONTINUOUS-> DO SCRIPT -> if not Group.getByName('XX') then

mist.respawnGroup('XX', true)

end

 

Doesnt seem to work anymore and throws errors.

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

Yeah there are two bugs that unfortunately are still around. Group.getByName() and coalition.getGroups() return dead groups, so your above check simply doesn't work anymore. Additionally if you have the group object the function Group.isExist() also doesn't work... sigh. Anyways below is a little function I used in On Station that acts as a work-around and will still work once those bugs get fixed.

 

	local function groupIsDead(groupName) -- a certain bug hasn't been fixed, so I have to use this instead. 
	if (Group.getByName(groupName) and Group.getByName(groupName):isExist() == false) or (Group.getByName(groupName) and #Group.getByName(groupName):getUnits() < 1) or not Group.getByName(groupName) then
		return true
	end
	return false
end

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

yeah - i figured it out via elimination and getbyname was the problem - i have them respawning now with CONTINUOUS -> GROUP DEAD (XX) -> DO SCRIPT: mist.respawnGroup('XX', true)

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

Really? Group Dead trigger should only work the first time. At least the last time I checked the triggers only recognize groups in the mission editor and not groups added via scripting.

 

 

Also I pushed a fix for mist to the dev branch. There was apparently a small issue with the respawn/clone/teleport scripts running on groups that belong to the new countries. I've fixed the issue.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

It seems that when you use a DO SCRIPT action, it does not save the code file anymore in the miz archive. I tried to send a MIST enhanced mission to my friend and it does not find mist code anymore resulting in errors. If you look into the miz archive, there isn't any additional file.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

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.

Link to comment
Share on other sites

Question about messaging via the mist message.add function. I'm getting the issue where the same group of intruders are triggering a separate message line. Additionally each message is taking two line due to the "----------Combined Arms Message-----------"

 

 

 

 

intruder[interceptorside][#intruder[interceptorside] + 1] =

{

name = actualintrudername,

unit = actualintruder,

group = actualintrudergroup,

GroupID = actualintrudergroupID,

UnitID = actualintruderID,

unittype = actualintrudertype,

pos = actualintruderpos,

size = actualintrudergroupsize,

number = n

}

--start alert message to interceptor side >>

if nomessages == 0 then

local _vars = {}

local _msgunits = {}

_msgunits[1] = actualintrudername

local friendly = ' '

_vars.units = _msgunits

if interceptorside == 'blue' then

_vars.ref = coalition.getMainRefPoint(coalition.side.BLUE)

friendly = 'blue'

else

_vars.ref = coalition.getMainRefPoint(coalition.side.RED)

friendly = 'red'

end

 

if dspmsgunits == 1 then

_vars.metric = 1

end

 

_vars.alt = actualintruderpos.y

 

local _coordinatestext = string.format("BULLSEYE %s", mist.getBRString(_vars))

local _msg = "GCI ALERT!! BANDITS AT BEARING AND RANGE FROM ".._coordinatestext.." ASL"

 

local _msgtable={}

_msgtable.text = _msg

_msgtable.name = actualintrudergroupID.."GCI" --XX7

_msgtable.msgFor = {coa={friendly}}

_msgtable.displayTime = dspmsgtime

--send the message

mist.message.add(_msgtable)

end

 

 

 

By my understanding because the message name is the same I should just get the same message line updating because Mist sets the extra value in the mist function to make it work like it did previously. Have I done something incorrect in 1.5 terms?

 

For the Combined Arms thing the message is going out to red or blue. How would I send the message at the faction level but not to the CA slots - I assume this would mean it would go back to a single line per message.

 

Thanks for any help anyone can give.

 

Cheers,

Stonehouse

Screen_151005_001702.thumb.jpg.f89c72431e4f254d33d5c45e60ca3943.jpg


Edited by Stonehouse
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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