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


Notices

Reply
 
Thread Tools Display Modes
Old 10-14-2013, 07:32 PM   #361
kontiuka
ED Translator
 
kontiuka's Avatar
 
Join Date: Feb 2012
Location: Ottawa, Canada
Posts: 3,382
Default

Quote:
Originally Posted by Prof_hilactic View Post
kontiuka

I am getting the same kind of problem with mist.teleportinzone and mist.respawninzone. DCS crash when I try to go back to the editor

I used to have the same problem with dynadd in mist 3.1 but since 3.2 dynadd works without crashing.

also with the function

mist.scheduleFunction(mist.respawnInZone,{'Armor_1', {'zone_1','zone_2', 'zone_3'} , true , 150},timer.getTime() + 10)

for some reason the group only respwn in zone_1. I don t know if it is a problem with me not knowing to program or the random number generator or a bug
I am also using 3.2 and I've tried dynAdd but I still get the game crash. All I'm doing is the following:

local groupData = mist.getCurrentGroupData ("New Airplane Group")
groupData.task = "CAS"
mist.dynAdd(groupData)

Would you mind showing me how you're using dynAdd? Thanks much.
kontiuka is offline   Reply With Quote
Old 10-15-2013, 12:07 AM   #362
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,599
Default

Quote:
Originally Posted by Zayets View Post
Hello guys, played a bit with mist.ground.patrol last night and noticed a strange thing (it may be the intended functionality but that I can't say myself). I have assigned a simple route (4WP) to a M113. On the last WP from the route I have added mist.ground.patrol('myUnit'). On WP 2 I have added trigger.action.outtext("WP reached",10) via run script under perform commands in advanced waypoints cmds. Unit is patroling alright but the message is printed only on the first pass through the route. Is that anything wrong I am doing?
The function doesn't grab the tasks assigned to the route. So what its doing is the group is following its normal route, and then at the end mist.ground.patrol() grabs all of the route points and effectively creates a new route.

Quote:
Originally Posted by kontiuka View Post
Under a couple of scenarios, when I use teleportInZone everything works fine until I exit the mission. Then I get a game crash. Sorry, no crash logs are created. My function call just looks like:

mist.teleportInZone ("My Group", "My Zone").

Scenario 1: I teleport an AI air group into a zone and then let the group land at any airport. The group lands fine but the game crashes when I exit the mission.

Scenario 2: I teleport an AI air group into a zone and then I jump into one of the planes. Again, this works fine until I exit the mission.
I'll have to do some testing. The initiatorMissionID is created by the debrief logs and as far as I know mist has no direct control over it.

Quote:
Originally Posted by yallu View Post
I'm just starting with Mist so I most likely got something wrong (I'm also new to Lua)... But just in case, is there a bug in mist.groupToRandomZone?

This code works the first time (so init(); works). But after group's death, it will respawn, starts moving and then crashes. It's not instant crash on respawn but takes a couple of seconds. Anything obvious wrong?
Most likely AI.Task.VehicleFormation.LINE_ABREAST is the cause. For some reason the scripting engine uses "Rank" instead of line abreast. The function accepts a string of the formation type, but not the enumerator of the vehicle formation. I should probably overload it so it will accept it.

Why its crashing could be related to how quickly the group gets spawned in and is told to have orders. I'll run some tests on respawned groups with that function to see if I can replicate crashes.


Quote:
Originally Posted by Prof_hilactic View Post
mist.scheduleFunction(mist.respawnInZone,{'Armor_1', {'zone_1','zone_2', 'zone_3'} , true , 150},timer.getTime() + 10)

for some reason the group only respwn in zone_1. I don t know if it is a problem with me not knowing to program or the random number generator or a bug
I just did a little test with it and it spawned in other zones, but the randomization was less than stellar. I'm gonna see if I can improve the distribution for a future release.
__________________
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-15-2013, 07:41 AM   #363
Zayets
Member
 
Join Date: Oct 2005
Location: Australia
Posts: 240
Default

Quote:
Originally Posted by Grimes View Post
The function doesn't grab the tasks assigned to the route. So what its doing is the group is following its normal route, and then at the end mist.ground.patrol() grabs all of the route points and effectively creates a new route.
Ah, that explains all. Is it difficult to implement?
__________________
OK
Zayets is offline   Reply With Quote
Old 10-16-2013, 10:40 PM   #364
ENO
Veteran
 
ENO's Avatar
 
Join Date: May 2012
Location: Okotoks, Alberta
Posts: 3,411
Default

Bit of an issue here Grimes that maybe you can help me with.

I've implemented some spawning using the CTTS script to bring in some folks at a certain point. They work fine... on the server side. But if the client is in there when the units spawn the client doesn't see them. If they log out and come back in... they are there.

Is there something I'm doing wrong?

Basically because I have "pause on load" the client is the person who comes in to get the mission started- and actually starts the clock. I'm thinking this may have something to do with it?
__________________
"ENO"
Type in anger and you will make the greatest post you will ever regret.

"Sweetest's" Military Aviation Art
ENO is offline   Reply With Quote
Old 10-16-2013, 11:42 PM   #365
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,599
Default

Quote:
Originally Posted by Zayets View Post
Ah, that explains all. Is it difficult to implement?
You should be able to create your own route with assorted scripts as part of it and then give it to the function mist.ground.patrolRoute.


Quote:
Originally Posted by ENO View Post
I've implemented some spawning using the CTTS script to bring in some folks at a certain point. They work fine... on the server side. But if the client is in there when the units spawn the client doesn't see them. If they log out and come back in... they are there.
So are the AI spawning as the player is loading into the server or is the client completely in game when the AI spawn?
__________________
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-17-2013, 01:31 AM   #366
ENO
Veteran
 
ENO's Avatar
 
Join Date: May 2012
Location: Okotoks, Alberta
Posts: 3,411
Default

Basically I've added a time+10 to allow everything to happen (IE: load mist etc)- but the time +10 can't happen without a client. When the client is there for the transition, the spawned units don't appear to the client- however when I look at the server simultaneously, they are there. When I log the client out (me), and back in then the units are there.

Specific to your question, the client in question- basically the client who needs to be there so that time can elapse- doesn't see the units generated unless they log out and come back in with the units already generated.
__________________
"ENO"
Type in anger and you will make the greatest post you will ever regret.

"Sweetest's" Military Aviation Art

Last edited by ENO; 10-17-2013 at 01:33 AM.
ENO is offline   Reply With Quote
Old 10-17-2013, 04:31 AM   #367
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,599
Default

Your not doing anything wrong its just broken. The good news is that it appears to already be fixed on the tester version.
__________________
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-17-2013, 03:41 PM   #368
ENO
Veteran
 
ENO's Avatar
 
Join Date: May 2012
Location: Okotoks, Alberta
Posts: 3,411
Default

Okay- so this is a 1.2.6 build issue?
__________________
"ENO"
Type in anger and you will make the greatest post you will ever regret.

"Sweetest's" Military Aviation Art
ENO is offline   Reply With Quote
Old 10-20-2013, 12:12 PM   #369
Prof_hilactic
Junior Member
 
Join Date: Sep 2013
Posts: 33
Default

Grimes,

I have some problem with a couple of mist function.

First:
local radar_wp1 = mist.utils.makeVec3GL(trigger.misc.getZone('Zone2').point)

throw an error about "can t perform arithmetic on a table". I manage to go past it with

local radar_wap1 = mist.utils.zoneToVec3('Zone2')

Second:
local radar_wap1 = mist.utils.zoneToVec3('Zone2')
local radar_wap2 = mist.utils.zoneToVec3('Zone3')
mist.groupToRandomPoint(_targetMimgroup,{radar_wap1, radar_wap2})

I get the error

attempt to index local 'point' (a nil value)
stack traceback:
[C]: ?
[string "C:\Users\rno\AppData\Local\Temp\DCS\/~mis00..."]:3176: in function 'getRandPointInCircle'
[string "C:\Users\rno\AppData\Local\Temp\DCS\/~mis00..."]:3221: in function 'groupToRandomPoint'
[string "C:\Users\rno\AppData\Local\Temp\DCS\/~mis00..."]:32: in function 'onEvent'
[string "Scripts/World/EventHandlers.lua"]:13: in function <[string "Scripts/World/EventHandlers.lua"]:11>

What am I doing wrong?
Prof_hilactic is offline   Reply With Quote
Old 10-21-2013, 10:28 PM   #370
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,599
Default

1. Thats weird, I'll test it out.

2. mist.groupToRandomPoint only accepts a table and each variable as a specific name that may or may not be required.
http://wiki.hoggit.us/view/GroupToRandomPoint

mist.groupToRandomPoint({group = _targetMimgroup, point = {radar_wap 1, radar_wap2}})
__________________
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
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:44 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.