Jump to content

CTLD JTAC error: 5618: attempt to index local '_enemyUnit' (a nil value)


Go to solution Solved by RafaPolit,

Recommended Posts

Posted (edited)

Good afternoon!

I have been enjoying flying with JTAC laser designation in the Through the Inferno servers.   I tried to create a simple JTAC scenario using CTLD and the JTACAutoLase feature.  I am getting an error attempting to index local "_enemyUnit" con the 'createSmokeMarker' function.

What do you believe could be missing from the very (VERY) basic implementation I did?  I can share the .miz file, but maybe the log is enough, so I'm attaching the log, if someone thinks that adding the mission file is useful, I'd be happy to attach it:
 

2023-01-09 01:04:11.013 WARNING SCRIPTING (Main): MIST|init|1206: Init time: 0
2023-01-09 01:04:11.013 INFO    SCRIPTING (Main): Mist version 4.4.90 loaded.
2023-01-09 01:04:11.014 INFO    VISUALIZER (Main): Preload() camera=-281894.172614, 944.316886, 645324.389769 radius=60000.000000
2023-01-09 01:04:11.014 INFO    EDTERRAINGRAPHICS41 (Main): ITerrainGraphicsImpl4::forceLoading(): pos=(-281894, 944.317, 645324), radius=60000
2023-01-09 01:04:11.513 INFO    EDTERRAINGRAPHICS41 (Main): surface5 clean up LOD 0: left 2  released 20
2023-01-09 01:04:11.514 INFO    EDTERRAINGRAPHICS41 (Main): surface5 clean up LOD 1: left 6  released 45
2023-01-09 01:04:11.514 INFO    EDTERRAINGRAPHICS41 (Main): surface5 clean up 2.338500 ms
2023-01-09 01:04:17.079 INFO    VISUALIZER (Main): Preload() finished
2023-01-09 01:04:17.146 INFO    APP (Main): Screen: mission_offline
2023-01-09 01:04:17.161 INFO    Dispatcher (Main): precache units resources in slots
2023-01-09 01:04:17.163 INFO    LUA (Main): Lua CPU usage: metric: average mission loading: 17.5165 %
2023-01-09 01:04:17.163 INFO    Dispatcher (Main): loadMission Done: Сontrol passed to the player
2023-01-09 01:04:19.684 INFO    APP (Main): MissionSpawn:spawnLocalPlayer 3,F-16C_50
2023-01-09 01:04:19.689 WARNING EDCORE (Main): Source mods/aircraft/f-16c/cockpit/shape is already mounted to the same mount /models/.
2023-01-09 01:04:19.701 INFO    VISUALIZER (Main): cockpit ILV loaded
2023-01-09 01:04:19.722 INFO    COCKPITBASE (Main): WebRTC VOIP init: registered radio receiver/transmitter "UHF_RADIO" with id - 0
2023-01-09 01:04:19.722 INFO    COCKPITBASE (Main): WebRTC VOIP init: enabled VOIP capability for radio UHF_RADIO
2023-01-09 01:04:19.722 INFO    COCKPITBASE (Main): WebRTC VOIP init: registered radio receiver "ARC-164 Guard Receiver" with id - 1
2023-01-09 01:04:19.722 INFO    COCKPITBASE (Main): WebRTC VOIP init: added guard receiver - ARC-164 Guard Receiver
2023-01-09 01:04:19.723 INFO    COCKPITBASE (Main): WebRTC VOIP init: registered radio receiver/transmitter "VHF_RADIO" with id - 2
2023-01-09 01:04:19.723 INFO    COCKPITBASE (Main): WebRTC VOIP init: enabled VOIP capability for radio VHF_RADIO
2023-01-09 01:04:19.724 INFO    COCKPITBASE (Main): WebRTC VOIP init: registered radio receiver "Base ILS localizer receiver" with id - 3
2023-01-09 01:04:21.038 INFO    COCKPITBASE (Main): lua state still active DED, 26 (status undefined)
2023-01-09 01:04:21.038 INFO    COCKPITBASE (Main): lua state still active EHSI, 28 (status undefined)
2023-01-09 01:04:21.038 INFO    COCKPITBASE (Main): lua state still active UHF_RADIO, 36
2023-01-09 01:04:21.038 INFO    COCKPITBASE (Main): lua state still active VHF_RADIO, 38
2023-01-09 01:04:21.038 INFO    COCKPITBASE (Main): lua state still active INTERCOM, 39 (status undefined)
2023-01-09 01:04:21.039 INFO    COCKPITBASE (Main): WebRTC VOIP init: registered radio receiver "Base TACAN receiver" with id - 4
2023-01-09 01:04:21.039 INFO    COCKPITBASE (Main): lua state still active MACROS, 52 (status undefined)
2023-01-09 01:04:21.039 INFO    COCKPITBASE (Main): lua state still active TGP_INTERFACE, 58 (status undefined)
2023-01-09 01:04:21.040 INFO    COCKPITBASE (Main): lua state still active DTE, 65 (status undefined)
2023-01-09 01:04:21.043 INFO    WORLDGENERAL (Main): loaded from mission Scripts/World/birds.lua
2023-01-09 01:04:21.053 INFO    LUA (Main): Lua CPU usage: metric: average mission execution: 91.4732 %
2023-01-09 01:04:26.708 INFO    SCRIPTING (Main):  I - CTLD - Loading version 20211113.01 in 2 seconds
2023-01-09 01:04:28.691 INFO    SCRIPTING (Main):  I - CTLD - Initializing version 20211113.01
2023-01-09 01:04:28.691 INFO    SCRIPTING (Main):  T - CTLD - ctld.alreadyInitialized=[false]
2023-01-09 01:04:28.691 INFO    SCRIPTING (Main):  T - CTLD - force=[nil]
2023-01-09 01:04:28.691 INFO    SCRIPTING (Main): Generating Laser Codes
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generated Laser Codes
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generating UHF Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generated  UHF Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generating VHF Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generated VHF Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generating FM Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Generated FM Frequencies
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): Searching for Crates
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): END search for crates
2023-01-09 01:04:28.692 INFO    SCRIPTING (Main): CTLD READY
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  D - CTLD - ctld.JTACAutoLase(_jtacGroupName=JTAC1, _laserCode=1688
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  T - CTLD - _laserB=6
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  T - CTLD - _laserCD=88
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  T - CTLD - _frequency=40.4
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  D - CTLD - ctld.notifyCoalition(_message=JTAC1, lasing new target, BTR-80. CODE: 1688. POSITION:  @ 42 14.461'N	 42 02.832'E - MGRS 38T KM 56371 80758)
2023-01-09 01:04:32.995 INFO    SCRIPTING (Main):  T - CTLD - _radio=
 .freq=40.4
 .name=JTAC1
 .mod=fm
2023-01-09 01:04:32.995 ERROR   SCRIPTING (Main): Mission script error: [string "C:\Users\xxxx\AppData\Local\Temp\DCS.openbeta\/~mis00000EBC.lua"]:5618: attempt to index local '_enemyUnit' (a nil value)
stack traceback:
	[C]: ?
	[string "C:\Users\xxxx\AppData\Local\Temp\DCS.openbeta\/~mis00000EBC.lua"]:5618: in function 'createSmokeMarker'
	[string "C:\Users\xxxx\AppData\Local\Temp\DCS.openbeta\/~mis00000EBC.lua"]:5470: in function 'JTACAutoLase'
	[string "ctld.JTACAutoLase('JTAC1', 1688, true, "all", 1)"]:1: in main chunk
2023-01-09 01:04:34.697 INFO    SCRIPTING (Main):  T - CTLD - jtacTargetsList for JTAC1 is : 
 .1=
  .dist=985.09104359134
  .unit=
   .id_=16777472


2023-01-09 01:04:59.635 INFO    LUA (Main): Lua CPU usage: metric: average mission execution: 4.9010 %
2023-01-09 01:05:02.052 INFO    DXGUI_WIN_ADAPTER (Main): resize main window to [0, 0]

 

Thanks in advanced, best regards,

Rafa.

Edited by RafaPolit

I'm Dragon in the Multiplayer servers.

Posted

As an extra info, if I disable the smoke (third argument to "false" on the JTACAutoLase function), everything works perfectly, but, obviously, I don't see smoke.

I'm Dragon in the Multiplayer servers.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...