Death Merchant Posted July 19, 2023 Posted July 19, 2023 (edited) Can someone help me with this error? 2023-07-19 11:06:35.385 ERROR SCRIPTING (Main): Mission script error: [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis00001939.lua"]:19167: attempt to call method 'GetRandomVec2' (a nil value) stack traceback: [C]: in function 'GetRandomVec2' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis00001939.lua"]:19167: in function 'SpawnInZone' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis0000581A.lua"]:336: in function 'LoadRandomSAMs' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis0000581A.lua"]:426: in main chunk I'm trying to spawn a unit at a random location in a zone. local randSpawn = math.random(5) BASE:E("Tunguska if 3 or less.") BASE:E(randSpawn) if randSpawn <= 3 then SA19Spawn:SpawnInZone(samZone, true) -- Add Tunguska to SAM Zone BASE:E("Spawning SA-19") end The other units are spawning properly, but I get an error when MOOSE tries to call the GetRandomVec2 function. Any thoughts? Thanks, DM Edited July 19, 2023 by Death Merchant [PC] ASUS X570E - Ryzen 9 5950X - RX 6900 XT - 32GB 3600Mhz Hornet, A-4E-C, Huey, Ka-50, Mi-8, F-15E, F-14 Join us on Death Dealers PvE server.
HC_Official Posted July 19, 2023 Posted July 19, 2023 samZone , where is this defined No more pre-orders Click here for tutorials for using Virpil Hardware and Software Click here for Virpil Flight equipment dimensions and pictures. .
Solution Death Merchant Posted July 19, 2023 Author Solution Posted July 19, 2023 24 minutes ago, HC_Official said: samZone , where is this defined Yep, bad definition. I forgot I was pulling names from a table, and not the zone object. This fixed it: SA19Spawn:SpawnInZone(ZONE:FindByName(samZone["Zone"]), true) -- Add Tunguska to SAM Zone Thanks for the help, DM [PC] ASUS X570E - Ryzen 9 5950X - RX 6900 XT - 32GB 3600Mhz Hornet, A-4E-C, Huey, Ka-50, Mi-8, F-15E, F-14 Join us on Death Dealers PvE server.
Recommended Posts