Jump to content

MIssion Scripting Tools (Mist)- enhancing mission scripting Lua


Recommended Posts

An easy one.

 

I am doing a table with mist. Makunittable with units SAM, like {'[sAM] '} but i need to use only radar sam units.

 

Anyone knows the how?

 

I tryed to filter the results with unit:hasSensors(Unit. Sensor. RADAR)... Unsuccesfully.

 

Any help?

 

I'm attaching a file that produce a table that log groups, not units, but you might get what you need from this code.

the key for you is this line, I believe:

 

if unit_Table:hasAttribute("EWR") or unit_Table:hasAttribute("AWACS") or unit_Table:hasAttribute("SAM SR") or unit_Table:hasAttribute("SAM TR") then

 

PS: "unit_Table" isn't a table, is the result of Unit.getByName func.

samlog.lua


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

I'm attaching a file that produce a table that log groups, not units, but you might get what you need from this code.

the key for you is this line, I believe:

 

if unit_Table:hasAttribute("EWR") or unit_Table:hasAttribute("AWACS") or unit_Table:hasAttribute("SAM SR") or unit_Table:hasAttribute("SAM TR") then

 

PS: "unit_Table" isn't a table, is the result of Unit.getByName func.

 

Thanks, it might work. Does it work for groups? It will make my life easier!

Link to comment
Share on other sites

Thanks, it might work. Does it work for groups? It will make my life easier!

 

It produces (on my side) a table that log this info for every group:

 

1. If some unit has a radar, the max radar range;

2. If some unit has weapons (like sam missile), the weapon range & ceiling;

3. The group position intended as unit #1 position

4. If the group is "movable" or non (i.e. SA-8 vs SA-3)

 

You might need small modification to get it work by your side, but you can.

 

PS:

I believe it's so similar to what you need cause we both are writing a simplified IADS code... I need it for the next DAWS release.

 

PS2:

This should work at mission start only, cause It doesn't check if the units are alive. Therefore, I will send you the final code (launchable when you need to update the table) as soon it is done.

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

It produces (on my side) a table that log this info for every group:

 

1. If some unit has a radar, the max radar range;

2. If some unit has weapons (like sam missile), the weapon range & ceiling;

3. The group position intended as unit #1 position

4. If the group is "movable" or non (i.e. SA-8 vs SA-3)

 

You might need small modification to get it work by your side, but you can.

 

PS:

I believe it's so similar to what you need cause we both are writing a simplified IADS code... I need it for the next DAWS release.

 

PS2:

This should work at mission start only, cause It doesn't check if the units are alive. Therefore, I will send you the final code (launchable when you need to update the table) as soon it is done.

 

I am just doing a simple Radar Jamming... By switching off some sams but I am having problems with things, that I dont really understand why with getByName things and the stuff.

Link to comment
Share on other sites

Can't understand last sentence, can you repeat?

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

Sorry.

 

I mean... I dont know why the function i am doing doesnt work... Lol. The function obtain a group. And I used it to get locations etc. And if i put...

 

Sam = Group:getname(group) it works...

But if i do

 

unitleader = Group. getByName(Sam) :getUnit(1):getName() it doesnt work... What i am doing wrong?

Link to comment
Share on other sites

Sorry.

 

I mean... I dont know why the function i am doing doesnt work... Lol. The function obtain a group. And I used it to get locations etc. And if i put...

 

Sam = Group:getname(group) it works...

But if i do

 

unitleader = Group. getByName(Sam) :getUnit(1):getName() it doesnt work... What i am doing wrong?

 

Why don't you do

group:getUnit(1):getName() ?

 

Anyway don't know, I think you removed the space between (Sam) and :getUnit. Don't know...

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

Why don't you do

group:getUnit(1):getName() ?

 

Anyway don't know, I think you removed the space between (Sam) and :getUnit. Don't know...

 

Thanks, problem solved.

 

My probblem is, that i am learing programming for the first time and i dont know when should i call getByName()... I do trial and error... Hahahh any suggestion or lead?.

Link to comment
Share on other sites

I'm learning too that way :)

I'm not that good (you can see that looking into DAWS code), but if you need try to ask what you want to get, and I'll try to answer (better via PM to do not spam MIST thread)

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

http://wiki.hoggit.us/view/Mission_Scripting_Tools_Documentation

 

Hoggit Documentation is down?

 

I get a 502 bad gateway error.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Oh no.... :'(

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Its back.

 

That is great! :thumbup:

 

Thx my friend! :smilewink:

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

MIST broken in 2.0.4.59188? Just updated and nothing is working, (Mist scripts that is)

 

Sierra

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

Works fine for me. Is it an old or new mission? Try deleting and recreating the trigger to load it? Checked DCS.log for scripting error messages?

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

MIST is working... the GCI CAP script is not functioning. Old mission but I deleted Mist, GCI, range and missile scripts and readied each. I then went through and rebuilt each component of the script as far as individual units etc.

 

Same script works in 1.5. I'll mess with it more tomorrow.

 

Sierra


Edited by Sierra99

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

Invisibull made the same comment that GCICAP has stopped working on NTTR. I haven't got time to follow up on it at the moment due to work stuff but the obvious change is the additional air bases. A lot of stuff hangs on the script getting the details of airbases into a table so possibly something is going wrong there. Perhaps the returned values from coalition.getAirbases are different somehow and the script can't deal with it??? That's just a guess anyway. Invisibull was PMing lukrop so perhaps he'll look at it.

Link to comment
Share on other sites

Hello Everyone;

 

In the first post is that the lastest version of MIST.v1_1.zip??? :music_whistling:

Speed hasn't been active for a while. I can't edit his posts. Just follow the links regarding mist in my signature and my first post in the thread.

 

Invisibull made the same comment that GCICAP has stopped working on NTTR. I haven't got time to follow up on it at the moment due to work stuff but the obvious change is the additional air bases. A lot of stuff hangs on the script getting the details of airbases into a table so possibly something is going wrong there. Perhaps the returned values from coalition.getAirbases are different somehow and the script can't deal with it??? That's just a guess anyway. Invisibull was PMing lukrop so perhaps he'll look at it.

 

Whatever is the issue, if its related to the NTTR and scripting engine let me know. I checked several different scripts on the updated map, but not everything. Any idea what might be breaking it would be helpful.

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

Really don't have much time as I said, however I squeezed in a quick test a bit before heading off to sleep after a long day at work. Don't know for sure if this is the issue but perhaps someone can try a quick test set up of lukrop's script using the names in the attached pic or set up a little script to dump the airbase names for NTTR. I think that the issue may be that the map names for bases do not match internal names so there is a disconnect between the zone names people enter and the actual airbase names. They need to match for the script to use the base for spawning GCI&CAP groups. The zone designates the base as a GCICAP capable base if you will.

 

Ideally it would be nice from a scripting viewpoint if the internal names match the map names but if they don't or can't then that's how it is and we'll need to adjust. If it was an easy change however for the dev team to make at this point in time then it would definitely make life easier in the long run. Probably for everyone actually, not just the non ED scripters.

 

Anyway test results below along with the test mission.

 

Best wishes,

Stonehouse

Untitled.thumb.jpg.1717bbe497dc2eedc34b4f8cf377ef5c.jpg

testgetairbases.miz


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