Jump to content

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua


Recommended Posts

thanks!

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

Great work :)

 

2 more features I thought would be nice to add to MIST -

1. static UnitNameTables, for example - [red][static] etc..

2. getUnitsInZones - a bit different then what we have right now, getting the actualy units in a zone or a polygon zone would be great.

 

I'll try to do it myself in the GitHub, probably will fail miserably :)

Link to comment
Share on other sites

In a script that I'm using, the routing functions are used to move ground groups from point to point.

 

I check the meteo conditions (rain) to determinee if is more suitable having road enabled or disabled and for alter movement speed.

 

I found that your mist.terrainHeightDiff function could also be used to define "not suitable" the automatic routing outside road if too much height difference is found between starting and ending point. Sadly, as routes may vary from 6 to 20 km long in my script, the range could be too large for a good estimate in mixed terrain.

 

Do you think it's possibile to execute the function every 50 meters with a range of 200 mt over a straght line between starting VEC3 point and destination VEC3 point?

 

How may I setup such think?

 

Thanks in advance for those who can help :)

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

Great work :)

 

2 more features I thought would be nice to add to MIST -

1. static UnitNameTables, for example - [red][static] etc..

2. getUnitsInZones - a bit different then what we have right now, getting the actualy units in a zone or a polygon zone would be great.

 

I'd like to expand the UnitNameTables functionality to also check for skill or if a player is occupying a unit via Combined Arms. Not sure what all is required cause that is Speed's code and I've never messed with it really.

 

 

I found that your mist.terrainHeightDiff function could also be used to define "not suitable" the automatic routing outside road if too much height difference is found between starting and ending point. Sadly, as routes may vary from 6 to 20 km long in my script, the range could be too large for a good estimate in mixed terrain.

 

Do you think it's possibile to execute the function every 50 meters with a range of 200 mt over a straght line between starting VEC3 point and destination VEC3 point?

 

How may I setup such think?

 

The mist.terrainHeightDiff function is mostly used to see if a given area is flat enough to spawn an object there. Really the way you'd want to go about it is to use land.getProfile() or do the same basic thing manually by using land.getHeight() and trigonometry to offset the land.getHeight() every so many meters.

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

and trigonometry

 

:cry:

 

I'll try...;)

 

EDIT: as it is going to go off-topic, cause I will use the build in SSE function, I moved the question here: http://forums.eagle.ru/showpost.php?p=2161607&postcount=1


Edited by chromium

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

  • ED Team

Hi all

 

Need some advice,

 

I am using

 

The following will respawn a group and send the group on its route as defined in the mission editor in 2 minutes (120 seconds)


 if not Group.getByName('groupName') then
  mist.respawnGroup('groupName', 120)
end

 

Which is working well, but the respwaned units do not seem to be aggressive and engage like the original group, has anyone any advice?

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

The 2nd variable has two modes of use. If it is a boolean value then the groups task is assitgned to the group as they spawn. If it is a number then that is when the task will be re-assigned.

 

In the case of ground units they will just sit there until ordered to move and should engage as expected. In the case of aircraft the aircraft will spawn in heading north and try to land at the nearest base. When specified delay time is reached a new task will be given to the AI to fly to their initial position and start the route. Before the AI are given that task, they are basically task-less and won't be aggressive.

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

  • ED Team
The 2nd variable has two modes of use. If it is a boolean value then the groups task is assitgned to the group as they spawn. If it is a number then that is when the task will be re-assigned.

 

In the case of ground units they will just sit there until ordered to move and should engage as expected. In the case of aircraft the aircraft will spawn in heading north and try to land at the nearest base. When specified delay time is reached a new task will be given to the AI to fly to their initial position and start the route. Before the AI are given that task, they are basically task-less and won't be aggressive.

 

thanks for the reply Grimes

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

I'd like to expand the UnitNameTables functionality to also check for skill or if a player is occupying a unit via Combined Arms. Not sure what all is required cause that is Speed's code and I've never messed with it really.

 

I'd help out anyway I can, but I really think that editing MIST in such magnitude should be left to the experts :)

 

Found an issue with using UnitNameTables.

For example - I added [red][helicopter] in one of the raise flag in polygon or in zone functions, then place a red AI ka-50 with late activation inside the zone/polygon, the flag would recognize the late activated unit even before it is activated.

 

I'm guessing that late activated units are present in the mission and this is why it is recognizing it, but then that means there needs to be another step in the flag or in whatever function tests if the unit is in the zone, it needs to check - isalive or if group.getbyname or something similar.

Link to comment
Share on other sites

Hoping someone can help me here:

 

First time making mission with ME;

- start AI Huey (set to 'Uncontrolled') via trigger,

- after flying along various waypoints, can make it land anywhere where I want to; then can make it stay parked (active) on that landing spot for 'X' time,

but cannot turn 'off' the AI Huey engine / lights.

In other words, make it a "static" object, waiting for new trigger to start it up again.

 

Tried a variety of triggers like: 'Group Deactivate', 'Group AI Off', 'Unit AI Off', 'Unit Stop', but nothing seems to stop the Huey from being active.

 

Question:

Is it possible at all to turn the Huey off after landing somewhere from a WP?

If so, what is the command being used?

 

Regards

 

Edit:

Sorry, was not clear enough;

what I am aiming to do is make the AI Huey start-up by a trigger, fly it's route,

land, shut down again,

and then sit there in 'stand-by' mode (no lights, no spinning rotor) at it's assigned ramp place,

ready to be started up again by another trigger later on, to fly it's same waypoint route again.


Edited by DSPALLASVI
Define aims better

ASUS Sabertooth X79 TUF Motherboard / Intel Core i7-3930K Unlocked Processor Six Core / Corsair CMP32GX3M4X1600C10 Dominator Memory Kit - 32GB (4x 8GB) / OCZ Solid 3 480GB Solid State Drive / EVGA GeForce GTX 670 FTW+ / Corsair CW-9060002-WW Hydro H70 CORE CPU Cooler / Seagate ST1000DM003 1TB Hard Drive / BenQ XL2420TX 24" Widescreen LED Gaming Monitor - 1920 x 1080 / Windows 7 Ultimate Edition, 64-bit / C-Tek 12-bit: Foot Pedals - Robinson Cyclic - 5-button-hat cyclic - Collective / TrackIR-5

Link to comment
Share on other sites

We've had a very successful test of our campaign last night.

It uses the new MIST 3.5, seems like the lag issues that were previously have been resolved, but I would still recommend doing more stressful tests, we only tested with around 15 pilots.

Link to comment
Share on other sites

Sorry, was not clear enough;

what I am aiming to do is make the AI Huey start-up by a trigger, fly it's route,

land, shut down again,

and then sit there in 'stand-by' mode (no lights, no spinning rotor) at it's assigned ramp place,

ready to be started up again by another trigger later on, to fly it's same waypoint route again.

 

AI aircraft don't work like that. Each take-off and landing must be done as a new flight.

 

We've had a very successful test of our campaign last night.

It uses the new MIST 3.5, seems like the lag issues that were previously have been resolved, but I would still recommend doing more stressful tests, we only tested with around 15 pilots.

 

Thanks for testing it! Unfortunately I don't have a large number of players to call on to test out MP stability. If lag didn't occur with 15 players on the new version and it did occur on the older version, then I'd say there has been an improvement and it should be ok for release. I still have some other tests I need to run, but if no issues are found I plan on releasing 3.5 asap.

 

Found an issue with using UnitNameTables.

For example - I added [red][helicopter] in one of the raise flag in polygon or in zone functions, then place a red AI ka-50 with late activation inside the zone/polygon, the flag would recognize the late activated unit even before it is activated.

 

I'm guessing that late activated units are present in the mission and this is why it is recognizing it, but then that means there needs to be another step in the flag or in whatever function tests if the unit is in the zone, it needs to check - isalive or if group.getbyname or something similar.

 

Yes late activated AI are considered "alive", but I already used a check Unit.isActive() to determine if the unit is activated, which should prevent the condition from returning true. Admittedly the new mist.getUnitsInPolygon lacked that check, which has now been addressed. But I'll double check to make sure Unit.isActive() is working as it should.

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

AI aircraft don't work like that. Each take-off and landing must be done as a new flight.

Thanks Grimes, started to get that impression when no triggers had the desirable effect. Will find a way to work around it then.

 

Am trying to put together a 'meeting way-point' in the sky for a trigger action to become active. The point would be at a certain altitude, but would not be active above or below that certain altitude.

For example, a waypoint that consists of L/L coordinates 'X' and 'Y', and that also is active between, say, 1500 and 1700 meters.

That way an aircraft flying over that 'X-Y' point, and flying at 1600 mtrs height would trigger a flag / action etc.

But being above or below the "corridor' would not have any effect.

Would that be possible at all?

 

Appreciate your help...

ASUS Sabertooth X79 TUF Motherboard / Intel Core i7-3930K Unlocked Processor Six Core / Corsair CMP32GX3M4X1600C10 Dominator Memory Kit - 32GB (4x 8GB) / OCZ Solid 3 480GB Solid State Drive / EVGA GeForce GTX 670 FTW+ / Corsair CW-9060002-WW Hydro H70 CORE CPU Cooler / Seagate ST1000DM003 1TB Hard Drive / BenQ XL2420TX 24" Widescreen LED Gaming Monitor - 1920 x 1080 / Windows 7 Ultimate Edition, 64-bit / C-Tek 12-bit: Foot Pedals - Robinson Cyclic - 5-button-hat cyclic - Collective / TrackIR-5

Link to comment
Share on other sites

Mist 3.5 Release

 

Download here or below: https://github.com/mrSkortch/MissionScriptingTools/releases

 

3.5 Changelog

 

re-factored database updating functions.

added mist.flagFunc.group_alive

added mist.flagFunc.group_dead

added mist.flagFunc.group_alive_more_than

added mist.flagFunc.group_alive_less_than

added mist.getUnitSkill

added mist.stringMatch

added mist.groupTableCheck

added mist.randomizeNumTable

added mist.spawnRandomizedGroup

added mist.randomizeGroupOrder

added mist.getUnitsInPolygon

added mist.terrainHeightDiff

added getGroupPayload

DB additions: callsign, psi, modulation, frequency, uncontrolled, radioSet, hardpoint_racks, onboard_num, and point

 

modified flagfuncs now support string values for flag and stop flags

optimized mist.getGroupData

 

 

Edit: updated file for hotfix

 

Edit 2: updated file for hotfix 2

mistv3_5.rar


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

Small issue with function mist.pointInPolygon ( line 2690 )

 

function mist.pointInPolygon(point, poly, maxalt) --raycasting point in polygon. Code from [url]http://softsurfer.com/Archive/algorithm_0103/algorithm_0103.htm[/url]
local type_tbl = {
	point [color="Red"][b]= 'table',[/b][/color]
	poly = [color="Red"][b]'table', [/b][/color]
	maxalt = {'number', 'nil'}, 
	}

 

Marked the fixed and missing part.

 

 

There seems to be another problem, the zone/poly parameter is not getting cought by the function for some reason.

It only get NIL value.

I've done some more tests, it seems it's because of the error testing that's been added in the new MIST3.5, I'm not sure exactly why it is returning a message that it gets a NIL value instead of a table, I've tested the table before and after the error testing, it seems that it is there in the poly parameter all along.


Edited by xcom
  • Like 1
Link to comment
Share on other sites

Good find. I've updated the release build on github and from my post above. For now I've simply commented out the error check. Will re-enable it in a future release or not depending on whether or not I implement error checking for every single function.

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

We've done another test with the latest MIST and around 25 players, there were many LAGs.

 

The problem seems to be related to AI air unit respawns, we only tested DynAdd and Clone, but I think all of the respawn options are affected.

 

We then tried the following -

1. Removed all the respawned AI air units = LAGs were completly removed.

2. Add instead of MIST.Clone function, the DCS scripting engine - trigger.action.activateGroup function = LAGs were still there.

3. Use Start task for air units to just make them start the task (unit is always present in the mission) = no LAGs were shown, was only tested with few participants.

 

Question is, could it be that the latest version/versions, have some kind of change in the way addgroup function works? maybe something is not working correctly and causes these new LAGs.

 

Grimes - Is there any chance to get the devs to have a look?

Link to comment
Share on other sites

Method 3 has the 3d object and textures already spawned into the world and loaded into memory. Methods 1 and 2 do not. There has almost always been a minor pause when spawning a unit into the world, especially so if the unit type isn't already spawned. Generally it is noticed by a short pause. A similar pause can be experienced by hitting F11 to view an airbase really far away from where you are, where it takes a moment or two to load the terrain.

 

A simple test you can run is to spawn in an A-10 group in the air and then clone it once each second for a few seconds. First spawn should lag a tiny bit, subsequent spawns shouldn't be noticeable.

 

It is worth noting that the only scripting caused MP issue I have run into was that of de-sync of actions if something script heavy was running. I noticed it in early iterations of my IADScript and had to make adjustments accordingly.

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

We did have the test with 6 different types of airplanes/choppers.

I'll have some more tests done to be sure.

 

Another question that popped to mind, have you any idea how long will an airplane/chopper stay on the ground before it spawns off due to lack of tasking?

Link to comment
Share on other sites

If i remember correcly was about 30 min

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

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...