MIssion Scripting Tools (Mist)- enhancing mission scripting Lua - Page 150 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 01-06-2020, 08:32 AM   #1491
msalama
Veteran
 
msalama's Avatar
 
Join Date: Apr 2008
Posts: 4,292
Default

I also tried with a condition testing whether the group is alive before executing the call but still get this. Am stumped TBH. Ideas anyone?
__________________
Huey probs & gripes? Do read the following please: https://forums.eagle.ru/attachment.p...1&d=1555258147
msalama is offline   Reply With Quote
Old 01-07-2020, 12:06 AM   #1492
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 8,190
Default

What is the unit type that is getting hit and what are you hitting it with?

It looks to purely be an issue of the unit taking damage, which triggers the function call, and likely almost being dead or dead enough that getPosition() fails on it. Thus a nil value is being returned from mist.getLeadPos(), the script continues on, and errors because I guess I didn't think of that possibility existing.

Problem is easily fixable, just would like to be able to recreate it to know if it is a DCS issue and to ensure that the fix I make to mist works.
__________________
The right man in the wrong place makes all the difference in the world.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Old 01-07-2020, 05:11 AM   #1493
msalama
Veteran
 
msalama's Avatar
 
Join Date: Apr 2008
Posts: 4,292
Default

This happens regardless of the unit type and the weapons / platform used. I believe it's a current DCS issue myself, since I've done stuff like this in the past and it has worked OK.
__________________
Huey probs & gripes? Do read the following please: https://forums.eagle.ru/attachment.p...1&d=1555258147
msalama is offline   Reply With Quote
Old 02-08-2020, 06:26 PM   #1494
flo57100
Member
 
Join Date: Sep 2013
Posts: 274
Post Destroy client planes in a zone ?

Hello there !

I would like to destroy/kill client airplanes/helicopters when they enter a specific zone. Or better, to set client planes/helicopters fuel quantity to zero if they enter this zone

Is it a way to do that with mist ? And if yes could someone tell me how ? I try to figure out how it works, without success for now
flo57100 is offline   Reply With Quote
Old 02-08-2020, 07:45 PM   #1495
davidp57
Member
 
Join Date: Jul 2011
Location: Metz, France
Posts: 422
Default

In my opinion, the only way to destroy a client plane/helo is to destroy it with an explosion or a weapon hit.
__________________
Zip - VEAF

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum
If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !
davidp57 is offline   Reply With Quote
Old 02-09-2020, 03:45 PM   #1496
flo57100
Member
 
Join Date: Sep 2013
Posts: 274
Default

What I want is destroying player aircraft/helicopter unit in a specific zone (here DA Groomlake) I had a look on the web, and I try to copy/paste some lines from some scripts I found, and I came to this:

local units = mist.makeUnitTable{('[blue][plane]','[blue][helicopter]')}, -- make list of all blue planes and helicopters
local zone = trigger.misc.getZone('DA Groomlake') -- get the trigger zone
local inZone = {}, -- table of units inside the zone

local function check()
for i = 1, #units do -- iterate units
if Unit.getByName(units[i]) then -- if returned
local u = Unit.getByName(units[i])
if u:getLife() > 0 then -- if it is alive
if mist.utils.get2DDist(u:getPosition().p, zone.point) < zone.radius then --if it's une zone
u:getController():function unit:destroy()
inZone[u:getName()] = true
end
end
end
end
end
end




Of course, I tried it and had mist error message in game. But am I close from something ? I copiedpasted some stuff, but I do not know anything about lua
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	198
Size:	24.2 KB
ID:	226931  
flo57100 is offline   Reply With Quote
Old 02-09-2020, 04:41 PM   #1497
davidp57
Member
 
Join Date: Jul 2011
Location: Metz, France
Posts: 422
Default

What error do you get ?

Your lua seems pretty good to me, except that you should use a variable to store Unit.getByName(units[i]) instead of calling Unit.getByName() twice.


If you ever need french-speaking help with mission editing, feel free to drop to the VEAF's discord or forum. I'm often here, and always eager to help !
__________________
Zip - VEAF

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum
If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !
davidp57 is offline   Reply With Quote
Old 02-10-2020, 10:53 PM   #1498
sadjad-vosoul
Junior Member
 
sadjad-vosoul's Avatar
 
Join Date: Apr 2017
Location: Imperial State of Iran (Before 1979)
Posts: 91
Default

i am fool and super noob... really trying to learn this , and my question is :
is it possible to import real weather data from METAR and other charts like wind charts etc... automatically by Scripting for having real LIVE weather condition in servers ?!?
and can call that thing weather engine ?!
for example in FSX it is possible to download weather condition from Internet and refreshing it every 15 minutes !
__________________

CPU: i5 7500 @ 3.8GHz + watercooling / Mainboard: ASUS STRIX H270F Gaming / Ram: 16gig 2400 / GPU: ASUS DUAL GTX 1060 6G OC /Monitor: ASUS VG278HE 27" 144Hrz / Headtracker: homemade track ir / HOTAS :Logitech 3D pro / Mouse & Keyboard: CoolerMaster Devastator 3

WISH LIST : KC-707 & KC-747 / F-5F Tiger II / F-4D/E Phantom II / T-45C Goshawk / AH-1J Intl. Cobra (209) / BELL 214A ISFAHAN / BELL 206 JETRANGER / Boeing CH-47 Chinook
sadjad-vosoul is offline   Reply With Quote
Old 02-16-2020, 07:17 PM   #1499
Wrecking Crew
Senior Member
 
Wrecking Crew's Avatar
 
Join Date: Apr 2011
Location: Colorado
Posts: 1,804
Default

After this recent upgrade to DCS v2.5.6,
I am getting a new error of -
...:4618: in function 'units in zones'...
from a file called ~mis00002F51.lua, see the screenshot of the error
The attached zip contains the screenshot, the mission, the .lua file.
The ~mis00002F51.lua file is the same as the mist v4.3.74 that I load into the mission with a Do Script File action.



I am running DCS 2.5.6 Open Beta as a client and also as a server and the error is coming up on both installs.
Attached Thumbnails
Click image for larger version

Name:	DCS MIST error getUnitsInZones.png
Views:	119
Size:	19.1 KB
ID:	227753  
Attached Files
File Type: zip DCS MIST error getUnitsInZones WC 20200216 - Copy.zip (3.95 MB, 9 views)
__________________
Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
Wrecking Crew is offline   Reply With Quote
Old 02-18-2020, 12:20 AM   #1500
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 8,190
Default

Likely related to all the mission start with no conditions bugs like this one: https://forums.eagle.ru/showthread.php?t=263603

It is trying to run code before all of the the objects are even loaded in. Mist won't even be able to correctly schedule the check to run.

Just from my test mission I added some logging and note the timestamps:

2020-02-18 00:12:08.967 INFO SCRIPTING: Mission Start No Condition
2020-02-18 00:12:52.280 INFO SCRIPTING: Once No Condition Check

Missions started loading just before that first entry, then 44 seconds later when time starts advancing in the actual mission the Once condition is run.

You can wait for a patch to fix it or switch all of the mist function calls to Once>Time More>Do Scripts.
__________________
The right man in the wrong place makes all the difference in the world.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Reply

Tags
mist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:35 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.