Jump to content

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua


Recommended Posts

If the group was placed in the editor you can use mist.getGroupTable which returns the entire table for that group as saved in the mission file. 

Frequency and other stuff are added in where available to the databases and get grabbed via getGroupData. However its more of a curated list of info and I do need to go in and add values that I missed from time to time. Looking through the DB examples the frequency value seems to be a little inconsistently present. 

  • Thanks 1

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

What I don't understand is the difference between normal and late activated.  Also late activated units have their frequencies defined in the mission file. I need really a closer look how these databases are generated. 

Link to comment
Share on other sites

  • 1 month later...

Is there a way to respawn with mist a group of aircrafts placed in the editor, set uncontrolled ? 

If I use mist.respawninzone it respawn uncontrolled, but then setcommand/setTask doesn’t work to set the aircraft controlled. It stays empty with this

local task = {
	id = "Start",
	params = {
	},
}

local group = Group.getByName("PlaneGroup-1")

group:getController():pushTask(task

 

Also is there a way to have them respawn with the original livery set in the editor ? Usually they respawn with the default one

 

thanks 

Link to comment
Share on other sites

Just use mist.respawnGroup(groupName, true)

 

respawnInZone is meant for ground vehicles or airspawned aircraft to provide some semblance of randomness within the set area. With respawnGroup it should keep most of the parameters like livery, weapons, and uncontrolled the same. 

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

local gp = mist.getGroupTable("whatever")
gp.uncontrolled = nil
mist.dynAdd(gp)

If you want to clone the group just add a gp.clone = true before mist.dynAdd.

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

I have a question - is this a bug in MIST, or just a DCS oddity that I've been unable to verify?

In the implementations for mist.getUnitsByAttribute() and mist.getGroupsByAttribute(), when it is populating the "cEntry" object it has the line:

    cEntry.categry = att.category

is the misspelling of "categry" deliberate here?  I can't find anything in the DCS Scripting Engine documentation, nor in the MIST sourcecode (or the MOOSE sourcecode) to confirm or contradict this.  The "categry" entry is later checked against the mist.DB data, but I haven't been able to trace whether that data contains "categry" or "category" (I wish DCS had a Lua debugger built in!)

If its a deliberate misspelling to match a corresponding spelling in the core DCS scripting engine, it might be an idea to note that in an inline comment - lest some enthusiastic but ill-informed programmer like myself tries to 'correct' it. 🙂


Edited by Loophole
Link to comment
Share on other sites

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

Anyone else having issues with comms / radio menus not appearing?

No changes to any script files, but it appears September 2nd's patch has is no longer allowing menus to be created by MIST?

Not getting any errors or anything of the sort; just not getting menus appearing anymore.

 

But were literally just working days ago.

Link to comment
Share on other sites

Cancel the alarm; figured out what I did. I don't fully understand why it isn't making the menu, but resolved what I did so that the menu does appear.

 

Unrelated to patch; just apparently made the same change to both files and had forgotten.

Link to comment
Share on other sites

  • 4 weeks later...

Hello everyone   im new to mist.   

 local ref = trigger.misc.getZone("targetArea")
 trigger.action.circleToAll(-1 , 1, ref.point , ref.radius , {0, 0, 0, 0} , {1, 0, 0, .7} , 0 , true)

I found this on the hoggit website and i desperately need this for a mission im working on. It works on Do Script, but if i do another one with a different trigger   it doesn't work    the first one in the order works but the second never happens     why is this?

 

 

I might be a noob and this isnt Mist because it did work with out loading Mist.  if thats the case i apologize and what should i do to make this work?


Edited by BuxtonHouse
Link to comment
Share on other sites

The second parameter (1 in your case) is the ID of the marker. It must be unique. For your second circle, try incrementing the ID.

local ref = trigger.misc.getZone("targetArea1")
trigger.action.circleToAll(-1, 1, ref.point, ref.radius, {0, 0, 0, 0}, {1, 0, 0, .7}, 0, true)

ref = trigger.misc.getZone("targetArea2")
trigger.action.circleToAll(-1, 2, ref.point, ref.radius, {0, 0, 0, 0}, {1, 0, 0, .7}, 0, true)

 


Edited by Chump
Link to comment
Share on other sites

20 hours ago, Chump said:

The second parameter (1 in your case) is the ID of the marker. It must be unique. For your second circle, try incrementing the ID.

local ref = trigger.misc.getZone("targetArea1")
trigger.action.circleToAll(-1, 1, ref.point, ref.radius, {0, 0, 0, 0}, {1, 0, 0, .7}, 0, true)

ref = trigger.misc.getZone("targetArea2")
trigger.action.circleToAll(-1, 2, ref.point, ref.radius, {0, 0, 0, 0}, {1, 0, 0, .7}, 0, true)

 

 

Thank you for the advice and help but it doesnt seem to work.

Link to comment
Share on other sites

There are no scripting functions for causing failures. The closest that exists is to exploit the function meant to mimic loading cargo by making the aircraft weigh much more than it should. https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo

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

4 hours ago, Grimes said:

There are no scripting functions for causing failures. The closest that exists is to exploit the function meant to mimic loading cargo by making the aircraft weigh much more than it should. https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo

LOL - adding 100 tons of cargo to a fighter jet feels much more funny and punishing than a tasteless "kick"...

Link to comment
Share on other sites

Gradually increase the weight as they fly away from a base if they loaded to much of a certain weapon or randomly changing the weight is also fun. To bad its all at the center of mass and can't shift the weight around. 

  • Like 1

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

Wonder if anyone could help with this error I'm having (I think with skynet but the logs point to mist). This is  the error message I get in the logs:

 

2022-10-04 20:33:07.747 ERROR   SCRIPTING: MIST|doScheduledFunctions|1300: Error in scheduled function: $1[string "C:\Users\test\AppData\Local\Temp\INSTANCE_7\/~mis00007DEE.lua"]:1896: Object doesn't exist

The line referenced is in file : mis00007DEE.lua which is the "temp file" for this version of skynet: SKYNET VERSION: 3.0.0 | BUILD TIME: 23.07.2022 1512Z

When I navigate to the line in question (1896) it shows:

return self.dcsRepresentation:getPosition() which comes from the following function in the Skynet file referenced above......

function SkynetIADSAbstractDCSObjectWrapper:getPosition()
    return self.dcsRepresentation:getPosition()
end

 

Thanks in advance to any of you coding geniuses out there.

 

Martin

Link to comment
Share on other sites

1 hour ago, Badass1982 said:

When I navigate to the line in question (1896) it shows:

return self.dcsRepresentation:getPosition() which comes from the following function in the Skynet file referenced above......

function SkynetIADSAbstractDCSObjectWrapper:getPosition()
    return self.dcsRepresentation:getPosition()
end

The mist error is simply due to the skynet code scheduling the function through mist. There error is still within skynet and apparently related to self.dcsPrepresentation being nil or no longer accessible. Would have to guess that skynet has an isExist() check on it before running that somewhere. 

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

  • 2 months later...

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
×
×
  • Create New...