Jump to content

Recommended Posts

Posted
I believe there is a bug currently with WP's of dynamically spawned units, but cause you're respawning ME placed units, I guess this isn't the issue. However, I had the same issue a while back when fiddling around with DAWS and fixed my problem by reassigning the route to the group after the group had spawned.

 

 

 

 

 

Creative, but not good.

 

 

 

Tried the same yesterday, but:

 

 

 

1. Performance drops dramatically. I mean, the mission came to a halt.

 

2. The units don't move a they should. The drive slowly and zig-sag...

 

Sent from mTalk

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

does anyone know how to make a table with the units that are LOS?

 

I use mist.getunitLOS, and i have a table with all values. Ibdont know how to put all [vis] values into antoyher table.

Posted
Creative, but not good.

 

 

 

Tried the same yesterday, but:

 

 

 

1. Performance drops dramatically. I mean, the mission came to a halt.

 

2. The units don't move a they should. The drive slowly and zig-sag...

 

Sent from mTalk

 

Ah Rgr. This was a while ago I tried thou. There is currently a discussion in ME scripting issues that might be related. http://forums.eagle.ru/showthread.php?t=147792&page=10

-16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com

 

EWRS - Early Warning Radar Script

 

Specs:

 

 

Gigabyte Sniper Z5-S

Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler

16GB RAM

Gigabyte GTX 1080

TM Hotas Warthog: SN: 06976

Saitek Pro Flight Combat Rudder Pedals

TrackIR5 with TrackClipPro & Oculus Rift

2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024

 

 

Posted
does anyone know how to make a table with the units that are LOS?

 

I use mist.getunitLOS, and i have a table with all values. Ibdont know how to put all [vis] values into antoyher table.

 

LOSData = { 
   [1] = { 
       unit = <a unitset1 "Unit"-type object>, 
       vis = { 
           [1] = <a unitset2 "Unit"-type object>, 
           [2] = <a unitset2 "Unit"-type object>, 
           ... 
       } 
   },

 

Each entry is a unit object. Its as if you literally did Unit.getByName() for each entry. For LOSData[1].unit it is the unit that can was checked with everything in the LOSData[1].vis table being the unit objects that it sees.

 

The following would return the unit names in a new table. Its indexed by unit name so that if the same name every repeats it just overwrites a previous value.

 

local visUnits = {}
for i = 1, #LOSData do
for j = 1, #LOSData[i].vis do
	visUnits[unit.getName(LOSData[i].vis[j])] = true
end
end
return visUnits

 

Also I don't want to dissuade you from experimenting with lua to make your own sam script, but I am in the process of updating my IADScript to work. Its not a major overhaul like I was waiting on doing, its just an update to account for changed behavior like how ground AI re-arm.

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

Posted (edited)
LOSData = { 
   [1] = { 
       unit = <a unitset1 "Unit"-type object>, 
       vis = { 
           [1] = <a unitset2 "Unit"-type object>, 
           [2] = <a unitset2 "Unit"-type object>, 
           ... 
       } 
   },

 

Each entry is a unit object. Its as if you literally did Unit.getByName() for each entry. For LOSData[1].unit it is the unit that can was checked with everything in the LOSData[1].vis table being the unit objects that it sees.

 

The following would return the unit names in a new table. Its indexed by unit name so that if the same name every repeats it just overwrites a previous value.

 

local visUnits = {}
for i = 1, #LOSData do
for j = 1, #LOSData[i].vis do
	visUnits[unit.getName(LOSData[i].vis[j])] = true
end
end
return visUnits

 

Also I don't want to dissuade you from experimenting with lua to make your own sam script, but I am in the process of updating my IADScript to work. Its not a major overhaul like I was waiting on doing, its just an update to account for changed behavior like how ground AI re-arm.

 

 

Thanks Grimes!! again and again and again, I did was finnally able to to do it by myself... Today I was going to share, itis a really interesting function to improve the AI behaviour. What I did is below. (by the why, what is better?? in terms of memory and CPU resources? to make loops with i=1.... or pairs/ipairs)

 

local targets = {}
for k, v in pairs (LOSData) do
	local tabledata = LOSData[k]
	for j, w in pairs (tabledata.vis)do			
		local targetinLOS = tabledata.vis[j]
		targets[#targets+1] = targetinLOS
	end
end

 

I found a fantanstic tool in Mist "mist.utils.tableShow" so i did my work and deducted it!!! Grimes you should open a donation account!!!

 

I cant stop thanking you for your advise "you should learn Lua!!!". I am doing really interesting things... I am in the process of a recon infantry script were the ground units report the situation of closer enemy GROUPS... in LAT LONG. It is in early stage and only work for blue coalition... but it is a starting point. i wil put it in a thread I opened about it.

 

One of my main problems is making tables and using the proper sintax in your functions... for instance in this function, I am not able to make it work. It happens all the time... sometimes I get it to work, but others... it is impossible.

 

check this... I tryed to use a solution you gave few days ago but... nope.


local bluegroups = {'extract1','extract2'}
for k, v in pairs(bluegroups) do
local group = bluegroups[k] 
local groupname = group:getName()
trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable{('[g]'.. groupname)}, trigger.smokeColor.Blue))
end

 

regarding the IADS, that would be great!!! As you mentioned, I made some experimenting, I know that making mistakes, researching, reading, makes you improve your lua skills... For instance, I finnally learnt and understand the Loops!!! and I now understand the tables. My problem now is how to use the results... In any case, I guess I just need to learn and to study!

Edited by ESAc_matador
Posted (edited)
I believe there is a bug currently with WP's of dynamically spawned units, but cause you're respawning ME placed units, I guess this isn't the issue. However, I had the same issue a while back when fiddling around with DAWS and fixed my problem by reassigning the route to the group after the group had spawned.

 

DAWS has been disabled, I conducted experiment. This has now been confirmed as new bug introduced with latest DCS World patch.

 

http://forums.eagle.ru/showthread.php?p=2802059

Edited by Shaman

51PVO Founding member (DEC2007-)

100KIAP Founding member (DEC2018-)

 

:: Shaman aka [100☭] Shamansky

tail# 44 or 444

[sIGPIC][/sIGPIC] 100KIAP Regiment Early Warning & Control officer

Posted
Thanks Grimes!! again and again and again, I did was finnally able to to do it by myself... Today I was going to share, itis a really interesting function to improve the AI behaviour. What I did is below. (by the why, what is better?? in terms of memory and CPU resources? to make loops with i=1.... or pairs/ipairs)

 

I really don't know of any sort of performance difference between them. Its more of whichever you find most useful for what you are doing. In that example I didn't need to use in pairs to iterate the table, so I didn't.

 

check this... I tryed to use a solution you gave few days ago but... nope.


local bluegroups = {'extract1','extract2'}
for k, v in pairs(bluegroups) do
local group = bluegroups[k] 
local groupname = group:getName()
trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable{('[g]'.. groupname)}, trigger.smokeColor.Blue))
end

 

 

You can remove the two local statements and just use this:

 

trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable{('[g]'.. v)}, trigger.smokeColor.Blue)

 

When you iterate that table the values would be the following.

k v

1 'extract1'

2 'extract2'

 

In order to use getName() you have to have an object or a group object. What you have there was just a string. Also it is kind of pointless to do Group.getByName('whatever'):getName() because you already have the name.

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

Posted
I really don't know of any sort of performance difference between them. Its more of whichever you find most useful for what you are doing. In that example I didn't need to use in pairs to iterate the table, so I didn't.

 

 

 

 

You can remove the two local statements and just use this:

 

trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable{('[g]'.. v)}, trigger.smokeColor.Blue)

 

When you iterate that table the values would be the following.

k v

1 'extract1'

2 'extract2'

 

In order to use getName() you have to have an object or a group object. What you have there was just a string. Also it is kind of pointless to do Group.getByName('whatever'):getName() because you already have the name.

 

Thaaanks!

 

I am doing something really interesting, you will see. It almost done... it will need some tweaking, and refinement, but, the idea is really funny for all type of missions involving ground units.

Posted
Hi Grimes, I wanted to do a script/trigger using the F10 (F10 - Others) option to spawn a group, unit etc, if you know what I mean, how do I do that? I just can't find anything about it.. thanks

 

I don't have mist functions for it, but you are looking for Mission Commands

 

missionCommands.addCommand('Request Task', 'req', pickTask, nil)

 

This is a sample from On Station. In the menu it will be labeled as "Request Task" and it will run the function pickTask passing no variables. So basically you can create a function that spawns the units that gets called. Here is an example of passing values and using a submenu.

 

local sub = missionCommands.addSubMeni('Spawn Menu')

missionCommands.addCommand('Spawn Air', sub, spawn, 'air')

missionCommands.addCommand('Spawn Choppa', sub, spawn, 'DO IT NAOH')

missionCommands.addCommand('Spawn Ship', sub, spawn, 'boat')

missionCommands.addCommand('Spawn Ground', sub, spawn, 'ground')

  • 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

Posted
Very cool. I'll take a time and see if I can get it to work. This is exactly what I wanted. Thank you Grimes.

That I can help! If needed asistance ;)

 

I have to pay Grimes by teaching others what I learn! The most we are scripting the better!

  • Like 1
Posted

I find it easier to use the trigger system to make an F10 entry, then call the script or action from the flag change.

 

Some of the problems in DCS mission building is caused by the fact that the people that can write scripts tend to write one or two scripts and not use much of the trigger system, whilst those that don't, use the triggers and conditions in complex ways to launch other people's scripts. That hybridizing leads to a lot of confusion and difficulty.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Posted
Some of the problems in DCS mission building is caused by the fact that the people that can write scripts tend to write one or two scripts and not use much of the trigger system, whilst those that don't, use the triggers and conditions in complex ways to launch other people's scripts. That hybridizing leads to a lot of confusion and difficulty.

 

Well he did ask in a thread dedicated to scripting tools...

 

I get what you are saying but thats always going to happen whenever you have two different systems in place that overlap in use. I've done quite a bit in both systems, even going as far as trying to make the same mission in both. Yes I prefer scripting for the majority of what I do now, but I still use triggers all the time when testing stuff out simply for the sake of simplicity and quickness. Each has its own strengths and weaknesses so its just down to whatever works best for whatever you are trying to accomplish. In the case of F10 menus the scripting functions have advantage in directly calling a function, can use sub-menus, and can use other functions to manage the menus automatically. Triggers are easier to use, especially if you are using it to interact with something else setup in the mission editor or you are using it for something that isn't complex.

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

Posted
Do you know the Ranger79? So, I was watching his videos about ME, and I think I found what I want without using/doing any script. I'll test it later, and yeah, using Flag On.

 

If you don't want submenus, or strange things.... you better go for the ME it's very simple. I am now all lua scripting, but just for fun... but before going to lua, you have to dominate the ME , to understand the philosophy of DCS

Posted

blinking text

 

Hi,

 

I recently switched from Mist 4.0.57 to the latest mist version. But now text generated by the mist message system blinks when several messages are displayed at the same time and sometimes overwrites the previous line.:helpsmilie:

[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

Posted
I recently switched from Mist 4.0.57 to the latest mist version. But now text generated by the mist message system blinks when several messages are displayed at the same time and sometimes overwrites the previous line.:helpsmilie:

 

I reproduced the issue. Its down to how it has to display the messages which apparently needs some adjusting. I'll have to fiddle with it a little bit and tweak some values to see if I can get it to display like 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

Posted

Hi Grimes,

 

Thanks. I encountered another serious problem. In my scripted MP mission, the server regularly quits. I can see what caused the problem as an error message on my server screen. It is a "Group does not exist" error. It occurs when a line of code tries to access the group of a client (which since about half a year ago is not defined any more due to an ED net code bug). In my lua codes I am now extra careful not to use client groups. The error message displayed also contained trace-back info (i.e. what function called the function that caused the error, what other function called that latter function, etc.), and all those functions were within mist itself. More specifically it occurs within the mist event handler function. I suspect that mist uses events to update its active units database, and under certain circumstances it enquires into the group of the unit that triggered the event. If that is a client, boom! Boy this bug by ED of not having client groups any more has wreaked havoc on the scripting community...

[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

Posted

Hi,

 

My server just paused with this error bug calling line in MIST script.

 

Note, disregard tabs with DAWS etc... all mods are disabled, server is running only latest SLMOD and mission scenario beside MIST runs below CTLD and CSAR scripts without modifications.

MIST-bug5782.thumb.JPG.49c981fde75c1a71bc35859bf758034d.JPG

51PVO Founding member (DEC2007-)

100KIAP Founding member (DEC2018-)

 

:: Shaman aka [100☭] Shamansky

tail# 44 or 444

[sIGPIC][/sIGPIC] 100KIAP Regiment Early Warning & Control officer

Posted (edited)

Hi Grimes...

 

I have a question fot GetLeadingBRString function. If I understand it gives you the latlong position of the average units of a group that are in a radial from a point (it can be the player position). Is it giving ONE group position? Or just average units position?.

 

What I would like to do is to collect a table of groups in front of the unit. Then to put them in the F10 and call for CAS. This is for recon Gazelle, Since you cant pass coordenathes to a fligth you can have a menu with all groups located in front of you and choose the one by its positiin. The second part is done, the F10 menu and the CAS call is done, but I need to know better this function my idea is collect all group that are LOS in a radius and in a bearing from 345-015 degrees. Maybe with a modification of GetLeadingBRString I could get it. Ill make a snipet and may be you can add to the mist. That 'd be something like, getgroupsinBR or similar.

 

Am I doing a good approach or I am missing something?

Edited by ESAc_matador
Posted

Truth be told those functions have always confused me. They were among the last functions Speed added to mist. I had to go in and test it to be sure, and even then I was confused so I had to add logging to the mist function to see exactly what was going on.

 

What those functions do is you give it a unitNameTable of units to check and a bearing. It will the find the unit that is most in that direction and if a radius is given, it returns the average position of other units within a radius of that object. It then returns that position and generates a string accordingly. In other words if you give it a degreeHeading of 0 and every blue unit, it should return a string based on the position of the northern most blue unit. I say should because it was returning just fine for north/south units but when I tried east/west directions it wasn't returning what I was expecting.

 

The BRstring function requires a reference position to give the Bearing, Range, Altitude from-to the target. MGRS and LL also have their own unique values required.

 

 

I think what you might be wanting is something like a "pointInPie" where you get the objects that are within a certain bearing of an objects heading. The function mist.getLeadingPos() kind of does that, but you would need to filter out units within a radius of the aircraft first before searching them.

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

  • Recently Browsing   0 members

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