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


Notices

Reply
 
Thread Tools Display Modes
Old 07-17-2018, 01:34 AM   #1381
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

Quote:
Originally Posted by Wrench View Post
Results are about the same whether using 'turningpoint' or 'flyoverpoint' as the type in mist.fixedWing.buildWP.

Thats a longstanding bug of the scripting engine. AI given tasks via the scripting engine, for one reason or another, defaults to the flyoverpoint waypoint type for any task assigned during the mission. It works when you spawn an aircraft with that route assigned. But when you give it a new task after the aircraft spawns is when the bug occurs.
__________________
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 07-17-2018, 02:08 AM   #1382
Wrench
Member
 
Join Date: Feb 2015
Posts: 405
Default

Thanks grimes.
Can I spawn then using a scirpted route, and have that read properly, or does it have to come from the .miz?
Wrench is offline   Reply With Quote
Old 07-17-2018, 02:15 AM   #1383
Wrench
Member
 
Join Date: Feb 2015
Posts: 405
Default

2nd question:
Can I abuse the CA system to make the aircraft think it received the route from a Game Master, given that it will follow that route properly?
Wrench is offline   Reply With Quote
Old 07-17-2018, 08:47 PM   #1384
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 302
Default

I think what Grimes is saying is that no matter what way you do it via scripting you're going to get a "flyoverpoint" so until they fix that you are out of luck.
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 07-17-2018, 11:51 PM   #1385
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

If you spawn a group with their route, it works.

If you spawn a group then give them any route, its broken and uses fly over points. (as in having to use pushTask or setTask to give it to them.


I don't know if CA routes are effected by this bug or not.
__________________
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 07-18-2018, 03:50 PM   #1386
Wrench
Member
 
Join Date: Feb 2015
Posts: 405
Default

They're not, that's what the first screenshot was from. I had actually taken that one after the scripted route.

Are CA functions accessable via script? I couldn't find anything on the wiki, and didn't see anything in the CA Lua files that beared fruit.
Wrench is offline   Reply With Quote
Old 08-01-2018, 11:20 PM   #1387
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 240
Default

Here's a question for Grimes, hope you have time to check if is true or not. I am writing the next sequence:

Code:
local groupData = mist.getGroupData('MyGroup')
groupData.groupID = newGID
groupData.groupName = 'New Name'
groupData.units[1].unitId = newUID
groupData.units[1].unitName = 'New Unit'
groupData.units[1].groupName= 'New Unit'
groupData.units[1].groupId=newGID

mist.dynAdd(groupData )
Everything works beautiful, checking on F10 map group name is the new name. I can't see the unit name but I can extract it and it looks ok. Problem comes when I want to pick up the group coming from the unit itself

local findGroupName = Unit.getGroup(myUnit):getName()

This returns the name of the initial group MyGroup and not New Name. Is there something I missed here?
Ta
__________________
OK
Zayets is offline   Reply With Quote
Old 08-04-2018, 04:23 AM   #1388
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 240
Default

Right, I see there's no answer to my question above which probably is my fault being too specific. I have played more with dynAdd function and noticed that if I add a new group based on a

Code:
model = getGroupData('MyGroup')


model and then dumping the mist.DBs to the log both mist_DBs_groupsByName.lua and mist_DBs_MEgroupsByName.lua I notice they are identical. Moreover, mist_DBs_dynGroupsAdded.lua is empty. That despite the fact that I see the new groups on the F10 map and funny enough they have the new group name I have assigned them using model["groupName"] = 'NewGroup'.
Which brings me to my question: what does clone supposed to do in the function call? Is this what I need to see the new group being created in the mist.DBs.groupsByName?

Code:
mist.dynAdd{ units = table unitsTable, country = string/number countryName/countryIndex, category = string/number categoryName/categoryIndex, name or groupName = string groupsName, groupId = number groupId, clone = anything clone, }
If so, how do I do that? Simply by assigning model["clone"] = true? I am asking because there's no example in the mist.DBs.groupByName

Thanks in advance!
__________________
OK
Zayets is offline   Reply With Quote
Old 08-05-2018, 07:28 AM   #1389
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,600
Default

Clone acts as a flag to automatically generate a new groupName, groupId, unitNames, and unitIds if present. Usually it'll rename it USA GND 1 for groupname and USA GND 1 unit 1 for units.

Can you upload the miz file so I can experiment with it directly instead of having to recreate it and potentially doing something slightly different that I don't get the same result.
__________________
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-05-2018, 10:36 AM   #1390
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 240
Default

Thanks Grimes. Figured it out myself through many tries that clone gives a new name and a real new group in the mission. Basically that was what I missed from my function call. While we are at it, assigning a route to a newly created group is possible only through goRoute() function? WHich means that the group must be spawned?
__________________
OK
Zayets 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:56 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.