MikeSinn Posted December 31, 2017 Posted December 31, 2017 I'm hoping some MIST expert can help a Newbie out... I am trying to create a simple Target Practice mission that will allow me to learn new planes against a semi-random set of enemy aircraft. I have 3 sets of possible enemy planes with one being selected at random. I have 5 possible starting points for the enemy aircraft and am using the Mist.CloneInZone function to spawn the enemy aircraft into the starting zone. However, the cloning script crashes when executed. The actual script I am using is as follows: local ATA_Target = 'ata_easy' local Start_Zone = 'Fstart_Zone' local tgtChoice = mist.random(3) local zoneChoice = mist.random(5) ATA_Target = ATA_Target..tgtChoice Start_Zone = Start_Zone..zoneChoice trigger.action.outText(ATA_Target,10) trigger.action.outText(Start_Zone,10) ATA_NewGroup = mist.cloneInZone(ATA_Target,Start_Zone) ATA_NewGroupName = ATA_NewGroup["name"] trigger.action.outText(ATA_NewGroupName,10) I've attached a copy of the actual MIZ file as well. Can some kind soul tell me where I'm going wrong?Target Practice.miz
Stacker Posted January 1, 2018 Posted January 1, 2018 Hi MikeSinn, the problem here is that zone names seem to be case sensitive. You've used a different case for your zone name in the script compared to what you have in your mission. In particular it's the capital 'Z' when your zones actually use a lower case 'z'. Change the following line - local Start_Zone = 'Fstart_Zone' to this local Start_Zone = 'Fstart_zone' I just tried that and your script now spawns in an enemy flight. Cheers. i7-4790K@4.7GHz : EVGA 1070 SC : 16GB Corsair Vengence Pro : 2xEVO 840 SSD : EVGA 850W PSU : CORSAIR H100i Cooler : ASUS Z97-AR MB : CORSAIR OBSIDIAN 750D FULL TOWER
MikeSinn Posted January 1, 2018 Author Posted January 1, 2018 Hi Stacker, Thanks for the extra set of eyes and catching this error. I stared at the screen quite a while trying to figure out where the syntax error was but never saw the case issue. I need to learn more about how to debug Lua scripts I guess...
Recommended Posts