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


Notices

Reply
 
Thread Tools Display Modes
Old 07-29-2019, 05:19 AM   #1471
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 8,055
Default

Quote:
Originally Posted by johnv2pt0 View Post
I had two borders that were defined by late activated helos, and it seemed that the flag was getting tripped at the time that the helo's would have crossed paths had they been activated and flying at their assigned speeds. I moved the waypoints around to make sure they didn't cross and the problem was solved.
Yeah that was a lovely bug that was fixed and reappeared less than a year later. Think its actually getting fixed in the next patch. Anyway I always use ground units to define polygons and set their probability of appearing to 0%. Mist just needs the path to be in the mission file to find it.
__________________
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 08-07-2019, 06:50 PM   #1472
Exocet
Member
 
Join Date: Aug 2013
Location: Paris
Posts: 255
Default

Hi,
I'm building a mission with scrypt but I can not make it all work ..

I want try a mark spot. I copy past the cod from her: https://forums.eagle.ru/showthread.php?t=193232 For apply to my tanker but it did not work.
Tanker name group is KC135mprs. What wrong?

Thank


Plane = Group.getByName( "KC135mprs" )

if Plane and Plane:isExist() then
local Vec3 = Plane:getUnit(1):getPosition().p
local GroupID = Plane:getID()
trigger.action.markToCoalition( 2, "Plane Marking", Vec3, GroupID )
end
Exocet is offline   Reply With Quote
Old 08-22-2019, 01:21 PM   #1473
VampireNZ
Senior Member
 
VampireNZ's Avatar
 
Join Date: Oct 2013
Location: New Zealand
Posts: 1,338
Default

I am trying to have AI aircraft spawn in a random location in a zone for ACM. I have them activated via a radio message, then immediately run the mist.teleportInZone, which does randomize their location - but it is like it creates a new aircraft. It has a different skin and doesn't follow it's task/waypoint - just heads for the closest airfield and lands. I even flew right up behind it and shot it with no reaction.

I have even tried Triggered Action after a 10 sec wait to change waypoint/engage Player aircraft etc but it does not respond at all.
Any suggestions?
__________________
Asus Maximus VIII Hero Alpha| i7-6700K @ 4.60GHz | nVidia GTX 1080ti Strix OC 11GB @ 2075MHz| 16GB G.Skill Trident Z RGB 3200Mhz DDR4 CL14 |
Samsung 950 PRO 512GB M.2 SSD | Corsair Force LE 480GB SSD | Windows 10 64-Bit |
TM Warthog with FSSB R3 Lighting Base | VKB Gunfighter Pro + MCG | TM MFD's | Oculus Rift S | Jetseat FSE

VampireNZ is offline   Reply With Quote
Old 08-27-2019, 05:47 AM   #1474
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 8,055
Default

Quote:
Originally Posted by VampireNZ View Post
I am trying to have AI aircraft spawn in a random location in a zone for ACM. I have them activated via a radio message, then immediately run the mist.teleportInZone, which does randomize their location - but it is like it creates a new aircraft. It has a different skin and doesn't follow it's task/waypoint - just heads for the closest airfield and lands. I even flew right up behind it and shot it with no reaction.

I have even tried Triggered Action after a 10 sec wait to change waypoint/engage Player aircraft etc but it does not respond at all.
Any suggestions?
It does create a new aircraft, just it shares as many parameters of the old one as possible and erases the old one. Its not actually a teleport, it just mimics it. Make sure it has the 2nd value for the command since that defines whether or not it keeps the same task.

mist.teleportInZone('group', true)
__________________
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 09-11-2019, 07:49 PM   #1475
TFP Kane
Junior Member
 
Join Date: Dec 2018
Location: GA, USA
Posts: 15
Default

Is their a way to set a timer on when a group respawns. I have a FreeFlight missions build and trying to put a delay spawn on to the drones that i have flying around. Here is a copy of the script that i use to respawn them











for k, v in pairs(droneACDB) do
if not Group.getByName(v['group']) then
local msg = {}
msg.text = "Respawning" .. v['name'] .. "Drone Group."
msg.displayTime = 30
msg.msgFor = {coa = {'all'}}
mist.message.add(msg)
mist.respawnGroup(v['group'], true)
local con = Group.getByName(v['group']):getController()
con:setOption(AI.Option.Air.id.ROE, AI.Option.Air.val.ROE.WEAPON_HOLD)
con:setOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.NEVER)
con:setOption(AI.Option.Air.id.SILENCE, true)
con:setOption(AI.Option.Air.id.REACTION_ON_THREAT, AI.Option.Air.val.REACTION_ON_THREAT.EVADE_FIRE)
end
__________________
TFP Kane"Sticks"
Sever manger for The Flaying Pandas


The Flying Pandas Info

Website: www.tfpgaming.com
Teamspeak: 66.150.214.230
Discord: https://discord.gg/EdVprTy
TFP Kane is offline   Reply With Quote
Old 09-12-2019, 12:07 AM   #1476
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 8,055
Default

Make a function to respawn the group and copy all of the mist.respawnGroup and controller stuff into that.

Code:
local function respawn(groupName, val)
mist.respawnGroup(groupName, true)
local con = Group.getByName(groupName):getController()
con:setOption(AI.Option.Air.id.ROE, AI.Option.Air.val.ROE.WEAPON_HOLD)
con:setOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.NEVER)
con:setOption(AI.Option.Air.id.SILENCE, true)
con:setOption(AI.Option.Air.id.REACTION_ON_THREAT, AI.Option.Air.val.REACTION_ON_THREAT.EVADE_FIRE)
end
Then schedule the function to respawn it.

mist.scheduleFunction(respawn, {v['group'], true}, timer.getTime() + 10
__________________
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 10-19-2019, 05:58 AM   #1477
Pizzicato
Member
 
Pizzicato's Avatar
 
Join Date: May 2008
Location: Vancouver, BC
Posts: 871
Default

Hey guys,


Just wanted to make sure I'm correctly understanding something. If I want to spawn a specific aircraft group from a table that I've created using mist.makeUnitTable({'[blue][plane]}), do I then need to get get the groupName of the unit in question and then use that to find the reference to the group I want to spawn? e.g.

Quote:
table_BlueAircraft = mist.makeUnitTable('[blue][plane]')
unitToSpawn = table_BlueAircraft[indexOfInterest]
groupToSpawn = mist.DBs.MEunitsByName[unitToSpawn].groupName
Group.activate(Group.getByName(groupToSpawn))
This feels pretty convoluted, and I suspect it's just a product of my lack of scripting skill. Is there a cleaner, more efficient way of accomplishing the same thing?
__________________
i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Pizzicato is offline   Reply With Quote
Old 11-05-2019, 04:07 AM   #1478
xXMustangXx
Junior Member
 
Join Date: Jul 2013
Posts: 29
Default

Hello,

is it possible to have a different thread with short mission sample of the most used MIST functions?

something similar to what CTLD has here?
Example Missions Thread: http://forums.eagle.ru/showthread.php?p=2621619

or maybe there is already one?

Thanks!
xXMustangXx 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 12:35 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.