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


Notices

Reply
 
Thread Tools Display Modes
Old 12-14-2017, 09:05 AM   #1331
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

You can also easily validate the returned units and either try it again or if applicable just remove the offending unit.

That isn't a solution I'd prefer to do within mist because it could be kind of resource intensive. I'd prefer to try and figure out if an object is in a building before it even spawns. I have one idea worth trying out that I am experimenting with right now. Part of the problem is that you can detect buildings near a point, but you don't know a whole lot about the shape of a building. Its sadly not a simple pointInPolygon test as there isn't a polygon to test. Suppose I could build
or ask ED for a 2d point DB of assorted world objects.
__________________
You can only tie the world record for lowest flight.
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 12-14-2017, 09:16 AM   #1332
chromium
3rd Party Developer
 
Join Date: Dec 2008
Location: Milan
Posts: 3,297
Default

or else you might try to run a world.search on Scenery object for a 5 m radius for each unit placement. But sounds like calculation intense even writing it...
__________________

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.
chromium is offline   Reply With Quote
Old 12-25-2017, 03:11 PM   #1333
JFCshloss
Junior Member
 
Join Date: Mar 2017
Posts: 78
Default

try to use it in dcs 2 ti get a string error as soon as mission is un paused any thoughts?
JFCshloss is offline   Reply With Quote
Old 12-26-2017, 07:44 AM   #1334
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

Quote:
Originally Posted by JFCshloss View Post
try to use it in dcs 2 ti get a string error as soon as mission is un paused any thoughts?
I need to know what the error is. Copy paste the error that is in dcs.log.
__________________
You can only tie the world record for lowest flight.
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-14-2018, 10:26 AM   #1335
Darkfury
Junior Member
 
Join Date: Feb 2017
Location: UK
Posts: 16
Default

Apologies, this is probably a dumb question. It's my first DCS script I am trying, let alone MIST. I just want to output a different message to two pilots for a training mission. Whatever I seem to do, both client aircraft receive both messages despite them being called 'Pilot01' and 'Pilot02' and using the below code.

Mist is running at startup and I get no errors so I think all is well with that.

Maybe I have a scope problem? I don't yet have my head around scoping in DCS or LUA. Any ideas? This is in DCS 1.5.8 latest build.


Code:
    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-1' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot01'}} 
    mist.message.add(msg)


    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-2' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot02'}} 
    mist.message.add(msg)

Last edited by Darkfury; 01-14-2018 at 10:29 AM.
Darkfury is offline   Reply With Quote
Old 01-14-2018, 03:37 PM   #1336
doodenkoff
Member
 
Join Date: Oct 2015
Posts: 400
Default

Quote:
Originally Posted by Darkfury View Post
Apologies, this is probably a dumb question. It's my first DCS script I am trying, let alone MIST. I just want to output a different message to two pilots for a training mission. Whatever I seem to do, both client aircraft receive both messages despite them being called 'Pilot01' and 'Pilot02' and using the below code.

Mist is running at startup and I get no errors so I think all is well with that.

Maybe I have a scope problem? I don't yet have my head around scoping in DCS or LUA. Any ideas? This is in DCS 1.5.8 latest build.


Code:
    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-1' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot01'}} 
    mist.message.add(msg)


    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-2' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot02'}} 
    mist.message.add(msg)
I thought I'd run that through a quick mission to see if anything obvious stood out. Funny thing, I can't output any message with that script. And I see it is literally the exact syntax demonstrated at the Hoggit wiki.

MIST loads fine; I can see that in the logs. But I cannot get a message to ouput. I've tried various conditions, "time more", UNIT IS ALIVE, etc....but nothing outputs a message. I have the units named properly.

A workaround would be to make the planes single-unit groups, with group and unit names the same, then use the native "MESSAGE TO GROUP" to output the message.

If you have a single group with two individually named aircraft, try changing it to two groups with single aircraft. A "Pilot01" group and a "Pilot02" group. I have a suspicion, MIST is treating groups as units (?).
__________________
Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060

Last edited by doodenkoff; 01-14-2018 at 03:42 PM.
doodenkoff is offline   Reply With Quote
Old 01-14-2018, 10:55 PM   #1337
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

Quote:
Originally Posted by Darkfury View Post
Apologies, this is probably a dumb question. It's my first DCS script I am trying, let alone MIST. I just want to output a different message to two pilots for a training mission. Whatever I seem to do, both client aircraft receive both messages despite them being called 'Pilot01' and 'Pilot02' and using the below code.

Mist is running at startup and I get no errors so I think all is well with that.

Maybe I have a scope problem? I don't yet have my head around scoping in DCS or LUA. Any ideas? This is in DCS 1.5.8 latest build.


Code:
    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-1' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot01'}} 
    mist.message.add(msg)


    local msg = {} 
    msg.text = 'Your callsign for this sortie  is COLT 1-2' 
    msg.displayTime = 10  
    msg.msgFor = {units = {'Pilot02'}} 
    mist.message.add(msg)
If they are in the same group it is unfortunately a limitation of DCS at present. A while back you could only have one client aircraft per group, but they changed it so each unit could be a client. However they haven't in turn added a "Message to Unit" functionality. The smallest entity we can send a message to is the group. If they aren't in the same group, then there could be a bug in my code.
__________________
You can only tie the world record for lowest flight.
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-15-2018, 03:58 PM   #1338
Darkfury
Junior Member
 
Join Date: Feb 2017
Location: UK
Posts: 16
Default

Thanks a ton Grimes. At least I know I am not doing anything wrong. They are all in the same group. Damn that current limitation!

I will amend my mission to either separate them, or skip that bit.

Thanks doodenkoff for trying to help as well!
Darkfury is offline   Reply With Quote
Old 01-20-2018, 09:11 PM   #1339
Zarma
Member
 
Join Date: Oct 2014
Location: Switzerland
Posts: 877
Default

Hi guys.

Is there a way in MIST to set an air unit with unlimited fuel or set his fuel back to full ?

In my case, it's a reaper acting as JTAC. If I use a respawn script while he is on a scripted orbit, the game crashes.
__________________
i7 6700k, 16 Go RAM, GTX 1080, Warthog HOTAS Throttle & Stick, Saitek Combat Rudder, (MFD Cougar) (Trackir 5 Pro) Oculus Rift CV1

http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Zarma is offline   Reply With Quote
Old 01-20-2018, 09:40 PM   #1340
Johnny_Rico
Senior Member
 
Johnny_Rico's Avatar
 
Join Date: Jul 2017
Posts: 1,337
Default

DCS engine only has facilities to read fuel status, sadly you cannot write values
__________________
METAR weather for DCS World missions

Guide to help out new DCS MOOSE Users -> HERE
Havoc Company Dedicated server info Connect IP: 94.23.215.203
SRS enabled - freqs - Main = 243, A2A = 244, A2G = 245
Please contact me HERE if you have any server feedback or METAR issues/requests
Johnny_Rico 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 06:21 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.