

xcandiottix
Members-
Posts
33 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by xcandiottix
-
Land Event Error "Airbase Doesn't Exist"
xcandiottix replied to xcandiottix's topic in Mission Editor
I added that to make sure that there was actually a variable named getDesc before running the function. You can imagine the table structure is something like this: pseudo code event = {} event.place = {} event.place.getDesc = function() There are times that getDesc doesn't exist and calling it triggers an error, such as, when someone lands in a field. The field has no desc so straight away calling getDesc() will throw an error. -
Consider the following code: --Event handler set up --... if(event_id == 3) then --landing if(event == nil or event.place == nil or event.place.getDesc == nil or event.place:getDesc() == nil) then --This is not an airbase, etc return else --Do something end end If a helicopter lands at an oil derrick on the Caucuses map I get the following error at the second if statement in the code above: 2023-03-04 17:59:35.473 ERROR SCRIPTING (Main): Mission script error: [string "C:\dynamicCampaign\events.lua"]:266: Airbase doesn't exist stack traceback: [C]: ? [C]: in function 'getDesc' How can I avoid this error? It seems that calling getDesc() is making DCS error out in this case. Landings at other airbases or the ground works as expected. For additional color, here is the DCS event in the logs for the very same landing: 2023-03-04 17:59:35.473 INFO Scripting (Main): event:initiator_unit_type=SA342M,type=land,initiatorPilotName=blah,initiator_coalition=2,initiator_ws_type1=1,t=10532.934,initiator_object_id=16781581,initiatorMissionID=273,
-
Yeah ... specifically I mean this (screenshot). I want to dynamically mark to all an icon such as the tank one shown in the right menu panel.
-
Thank you for sending that ... I assume on a server everyone would need to be running this mod? I currently don't use any external code/mods other than SRS so I'd rather not use a mod. Seems like there is no way to just reference the pilot model otherwise though
-
If you're really convinced this is a mission critical component then would recommend the following instead of trying to add a 100 lines of code to your mission: local timestamp = timer.getTime() --returns x.xxx seconds since the mission started regardless of pausing local str_timestamp = tostring(timestamp) --convert the timestamp to a string local last_digit = string.sub(str_timestamp, -1) --extract the last character from the string env.info(last_digit) -- Output: If timestamp is 1234.567 this will return "7" You could run this every ten minutes and if timestamp is equal to 0 then you have a 10% chance of whatever happening. If you change it to any number <5 you have a 50% chance of it happening. <9 is a 90% chance. You're just trying to randomly make something happen in a video game .. this isn't a banking app so no need to try too hard. And honestly, you could just do math.random(1,10) and then write logic like above (if 1 do x if <5 do y or if <9 do z) and it will be fine. EDIT: Also, I'm sure someone is going to say if you run it every ten minutes the number will be .000 ... it won't be because scripts ran from the mission editor flow through DCS's coroutine manager and will always vary slightly. Run it for yourself and see. As long as there is actual stuff going on in your mission it will cause sufficient random stuttering in when this actually gets to fire. Appending this to export.do~every~frame would probably not work but I don't think you're trying to be that advanced with this.
-
When creating F10 map marks in the mission editor, the last menu item is for the nato icons of units such as tanks, infantry, etc. Are these also available to be placed dynamically and if so how? I want to place these icons down on F10 "statically" as enemy groups are reconned ... currently I used shapes but it is clunky and non-intuitive to randos joining the server. If not available, may I request these please?
-
For my server I have a pilot rescue system in which downed pilots can be picked up and returned to base for either points or, if an enemy, intel. Currently, the downed pilot objects only exist during the current session and after restart they are all deleted. I'm thinking about placing one of the LSO's from the carrier down after restart to take the place of the downed pilot object. But it would be better to use the actual pilot model. Is it possible currently? I'm guessing that object might not be something we dynamically have access to. If not, can I request the pilot model be added as a static object please?
-
fixed ATGMs not being cleaned up on impact
xcandiottix replied to MetalStormGhost's topic in General Bugs
A few patches ago weapons started going underground forever. I assume this is probably because DCS had to change the weapon logic so torpedoes can start working or something and have a hard weapon destruction floor wouldn't allow for undersea/ground level weapons to work ... who knows. Anyway, some weapons stop on the ground .. others go through .. here's a thread for when I see it. For example, tow at -90k feet to start off. -
About two years ago a patch came out that really screwed up AI path finding. It's been the same for the past two years. A few minutes ago I was watching someone on the server just drop CBU's all over AI units that get stuck at a bridge and I just can't take it any more. It really ruins game play when otherwise perfectly good units trying to drive to an objective get stuck at a bridge. Maybe 10% of all units actually make it over. The rest sit there wiggling as if they are trying to figure out what to do next. Please please please ... look into this one. Here's screenshots from the server right now. All of these units have a move order on road ... there's no reason for this:
- 1 reply
-
- 1
-
-
F10 Map Vectors Cause DCS to go "Not Responding" / No Crash Dump
xcandiottix replied to xcandiottix's topic in Mission Editor
After my most recent DCS "Not Responding" event I decided to export a windows crash dump. Hopefully someone more knowledgeable than I can make some sense of this. ******************************************************************************* * * * Exception Analysis * * * ******************************************************************************* KEY_VALUES_STRING: 1 Key : Analysis.CPU.mSec Value: 952 Key : Analysis.DebugAnalysisManager Value: Create Key : Analysis.Elapsed.mSec Value: 5904 Key : Analysis.IO.Other.Mb Value: 28 Key : Analysis.IO.Read.Mb Value: 1 Key : Analysis.IO.Write.Mb Value: 127 Key : Analysis.Init.CPU.mSec Value: 312 Key : Analysis.Init.Elapsed.mSec Value: 47417 Key : Analysis.Memory.CommitPeak.Mb Value: 151 Key : Timeline.OS.Boot.DeltaSec Value: 17287 Key : Timeline.Process.Start.DeltaSec Value: 11839 Key : WER.OS.Branch Value: vb_release Key : WER.OS.Timestamp Value: 2019-12-06T14:06:00Z Key : WER.OS.Version Value: 10.0.19041.1 Key : WER.Process.Version Value: 2.8.1.34667 FILE_IN_CAB: DCS.DMP NTGLOBALFLAG: 0 PROCESS_BAM_CURRENT_THROTTLED: 0 PROCESS_BAM_PREVIOUS_THROTTLED: 0 APPLICATION_VERIFIER_FLAGS: 0 EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 0000000000000000 ExceptionCode: 80000003 (Break instruction exception) ExceptionFlags: 00000000 NumberParameters: 0 FAULTING_THREAD: 00002abc PROCESS_NAME: DCS.exe ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached. EXCEPTION_CODE_STR: 80000003 STACK_TEXT: 00000083`9b7fdaf0 00007ff7`eb2e1d7b : 00007ff7`3d3a2e90 000001d6`3e5a0000 00007ff7`ead60000 000001d6`35a5a020 : DCS!SW+0x103bef 00000083`9b7ff0e0 00007ff7`eb27f7ef : 000001d0`3f9c10cd 000001d6`43aa0d14 00000000`00000000 00000000`00000000 : DCS!SW+0x14215b 00000083`9b7ff260 00007ffa`039d39e5 : 41660b20`20000000 00000000`00000000 00000000`00000000 00000000`00000000 : DCS!SW+0xdfbcf 00000083`9b7ff2a0 00007ffa`039d3efd : 00000000`00000000 000001d6`33bff1b8 00000000`00000000 00007ffa`3d4326cc : World!wSimTrace::CommandsTraceDiscreteIsOn+0x4b5 00000083`9b7ff3c0 00007ff7`eb571951 : 00007ff7`eb59a4a0 00007ff7`eb59a4a0 000001d0`cafa8c00 000001d0`cafa8c00 : World!wSimCalendar::DoActionsUntil+0x1fd 00000083`9b7ff410 00007ff7`eb5716ae : 00007ff7`eb59a4a0 000001d0`cafa8c70 000001d0`cafa8c70 00000000`ffffffff : DCS!SW+0x3d1d31 00000083`9b7ff470 00007ff7`eb5920b9 : 00007ff7`eb59a4a0 00000000`ffffffff 000001d0`cafa8c70 00000000`ffffffff : DCS!SW+0x3d1a8e 00000083`9b7ff4a0 00007ff7`eb5516f4 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`ffffffff : DCS!SW+0x3f2499 00000083`9b7ff4f0 00007ff7`eb5525c4 : 00000000`00000000 00000000`00000000 00000000`ffffffff 000001d0`cb4cec50 : DCS!SW+0x3b1ad4 00000083`9b7ff520 00007ff7`ecfd561a : 000001d0`cb4cec50 00000000`00000000 00000000`ffffffff 00000000`00000000 : DCS!SW+0x3b29a4 00000083`9b7ff560 00007ff7`eb93fba2 : 00000000`0000000a 00000000`00000000 00000000`00000000 00000000`00000000 : DCS!AmdPowerXpressRequestHighPerformance+0xf48616 00000083`9b7ffd20 00007ffa`59237614 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : DCS!SW+0x79ff82 00000083`9b7ffd60 00007ffa`5af026a1 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14 00000083`9b7ffd90 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21 STACK_COMMAND: ~0s; .ecxr ; kb SYMBOL_NAME: dcs+103bef MODULE_NAME: DCS IMAGE_NAME: DCS.exe FAILURE_BUCKET_ID: BREAKPOINT_80000003_DCS.exe!Unknown OS_VERSION: 10.0.19041.1 BUILDLAB_STR: vb_release OSPLATFORM_TYPE: x64 OSNAME: Windows 10 IMAGE_VERSION: 2.8.1.34667 FAILURE_ID_HASH: {6c8c440b-eaea-0435-9fd3-d1c4f6008018} Followup: MachineOwner --------- -
Hello, I have multiple dynamic map marks being added, removed or moved during the course of a 4 hour server session on my multiplayer server. It seems that when I have my F10 map marks file active, the server will randomly crash every other session, sometimes 1 hour in and sometimes 3.5 hours in. When the crash happens the DCS Beta Server application simply goes to "Not Responding". The log file stops at whatever random thing was going on in the server but does not point to the F10 map object functions specifically. However, when I deactivate the file the server runs flawlessly session after session. Now, I am sure one could say I've written bad code, but it will work and then randomly not work and whatever isn't working is not blatant in the logs. Therefore, I think something is going on under the hood of the DCS core code and a concern is that since this doesn't trigger a DCS crash dump, no one is aware this issue is happening except me. I think, if I had to guess, that the issue might be an issue with the unique ID of the map marks. Specifically, there is no idea what ID to start the map marks with and how this ID interplays with other ID systems in the DCS table. Basically, if I start my map marks at ID #1, does that create a DCS Table specifically for Map Marks? If so, great, but my mission file also has a set of static map marks. So, are those number starting with #1 and my dynamic map marks override statics? I don't know. But to avoid this, I start my dynamic map marks around ID 2,000. Is it possible that the static map marks start at ID 1, then I later create dynamic map mark 2,000 ... and an hour into the mission I've created map mark 10,000 and now DCS locks up trying to loop through a gapped table between 1 and 10,000? just making something up here. Or, is it possible that the map marks cross over with DCS object table IDs? Such as what if there is a plane or a tank with DCS object ID 2000 .. and then I create map mark 2,000 ... does that lock it up? Anyway, I need to use IDs because I move the map marks around and or change their color. In my mission file, there are no units, everything is added dynamically so I need a dynamic solution. I think an excellent fix would be if, when creating a map mark, it returns the dynamically created ID rather than me defining IDs which would be SO much easier. For example, consider what I am doing now: local id = 2000 local table mapObjects = {} function createMark() --Do stuff to set up the color and shape of the mark local markID = id + 1 mapObjects["frontLine"] = {} mapObjects["frontLine"] = markID trigger.action.textToAll(coalition, markID, centerPoint, color, etc) end function moveMark(name) --Let's move the front line --set up code stuff local frontLineID = mapObjects[name] trigger.action.setMarkupPosition(frontLineID, position) end As I add more stuff, I'm hoping I don't get an ID collision with who knows what as I am not sure if my IDs are unique or if I am sharing an ID pool with DCS also. So therefore, what if I can let DCS dynamically ID it for me but RETURN the ID like so: local table mapObjects = {} function createMark() --Do stuff to set up the color and shape of the mark local DCS_DYNAMIC_ID = trigger.action.textToAll(coalition, centerPoint, color, etc) mapObjects["frontLine"] = {} mapObjects["frontLine"] = DCS_DYNAMIC_ID --sometyhing like 1002345 or whatever end function moveMark(name) --Let's move the front line --set up code stuff local DCS_DYNAMIC_ID = mapObjects[name] trigger.action.setMarkupPosition(DCS_DYNAMIC_ID, position) end In this case I'll always have an ID that is in or around the same IDs but not duplicated or overlapping with anything else. As an aside, this was even harder to do back before the addition of being able to move and update existing marks. Before I also had to delete objects before I could move them and then assign a whole new ID. However, that system, after a few DCS patches, stopped working and also causing the game to hang. Therefore, I think I must be pushing this system to its breaking point and I think it would be good to solve. But I am very appreciative of the move/update system as it reduced the code overhead greatly. Thanks
-
Continued S_EVENT_DEAD Problems
xcandiottix replied to xcandiottix's topic in Scripting Tips, Tricks & Issues
My apologies, I took a second look at the code and in fact I must have switched it to the UNIT_LOST event. Here is the current code I have that is working. I too have a persistent campaign so this is critical. --if(world.event.S_EVENT_DEAD == event.id) then --Commented out in favor of below if(world.event.S_EVENT_UNIT_LOST == event.id) then --Note the initiator for unit lost is the same as it would have been for dead it seems. -
Thank you. It is via scripting. I can't tell if groups are breaking because of this or if it is in fact just a warning. Some of the groups do get move orders that may take a few hours to complete. However, that's nothing new in my campaign, this log event is though. I'll continue to monitor. One strange thing is that the log event fires unrelated to giving the move order. It would be helpful to know more about the conditions for this log event. Thank you for that, apologies for the report of a known issue.
-
Continued S_EVENT_DEAD Problems
xcandiottix replied to xcandiottix's topic in Scripting Tips, Tricks & Issues
Sorry for the confusion, "CRASH/DEAD" is just a generic log entry I made for something dying. You can ignore that. The exact problem is that the DEAD event was throwing an error because it had no initiator. After the hot patch a few days ago I think it is working again. Or at least I haven't seen the error since. -
After applying the latest DCS patch from 12/22 the following working code now throws an error: function Event_Handler_Global:onEvent(event) if(world.event.S_EVENT_DEAD == event.id) then env.info('START: helpers FUNCTION: helpers_Event_Handler:onEvent CRASH/DEAD event.initiator:getCategory(): OBJECT CAT:'..event.initiator:getCategory()) end end 2022-12-23 12:00:08.172 ERROR SCRIPTING (Main): Mission script error: [string "C:\dynamicCampaign\events.lua"]:722: attempt to index field 'initiator' (a nil value) stack traceback: [C]: ? [string "C:\dynamicCampaign\events.lua"]:722: in function 'onEvent' [string "Scripts/World/EventHandlers.lua"]:13: in function <[string "Scripts/World/EventHandlers.lua"]:11> This has always worked before. Any idea why the dead event no longer has a valid initiator field/object as of the last patch? I didn't see anything in the patch notes that would suggest something has changed.
-
In Lua, the fastest way to check if something exists is a nil check. Keep in mind people can change their user name so consider keying off the player's UCID. Be careful about what you do during the "onPlayerTryChangeSlot" event as you can accidentally prevent slot changing or break multi-slot aircraft compatibility. Recommend trying this: local ucid = net.get_player_info(player_id, 'ucid') local regulars = {} regular['tbe94jfjvkskkckvfjjr995olpsnm9'] = "me" --This value isn't for anything other than keeping track of who is who regular['nnght738h3u38ur2828ru29ru982uw'] = "John Doe" --This value isn't for anything other than keeping track of who is who regular['777h73h7fh3f7q7fh7er7eh7hhhhee'] = "Jane Doe" --This value isn't for anything other than keeping track of who is who If(regular[ucid] == nil) then --Some new user, log their UCID in case you want to add them to the regular list elseif(regular[ucid] ~= nil) then --Some known user else --some error end
-
Regarding this one, the aircraft is dynamically placed on to the carrier in groups of 2-4. Their Route -> Point -> action is "From Parking Area" and type is "TakeOffParking". Helipad and linkUnit are also appropriately set. Perhaps the lo-fi carriers start the planes off on the cat and there is no parking or the parking is bugged. I'll post more next time a hi-fi carrier enters the campaign. I'll follow-up on the track file as well.
-
Like this: local topRightMessage = "trigger.action.outTextForGroup(" .. groupIdNumber .. ",'" .. message .. "'," .. howManySecondsToDisplayNumber .. "); " net.dostring_in('server', topRightMessage)
-
Try net.send_chat_to(message, player_id)
-
I just wanted to raise awareness of somethings pertaining to the carriers over the last few patches. 1. The lo-fi carriers repeatedly fire off the S_EVENT_HIT function by the plane taking off. If you have code that does something when something gets hit you may find that event firing 100 times in a row during the catapult ... both AI and Human players. This caused my campaign to trigger Blue on Blue damage alerts. My guess is that the gear or hook is "hitting" the deck therefore triggering the event. 2. Lo-fi carriers are invisible. If you F10->F6 a lo-fi carrier it is invisible with planes sitting on top of it. If you zoom in at specific angles, very close, in starts to render again. 3. On all blue carriers, in regards to the AI F-14, E-2D, and S-3B if both or two of each make it to cat 1 and cat 2 (the front cats on the carrier) they will never take off. I think this is because the wings of both aircraft overlap for a few feet and this probably triggers a hit box telling each plane to stay put. In multiplayer, this will foul the deck. 4. The AI SU-27 can be placed on the hi-fi Kuznetsov but it will never take off and foul the deck. It seems only the SU-33 consistently takes off from the carrier. I believe IRL the SU-27K is the only 27 variant that can take off from the carrier so maybe the in-game one can not. Perhaps pulling the getDesc for the 27 would say if it is a carrier plane or not but I'm too lazy to go through that exercise. I'm not looking for clarification here or a wiki copy and paste about the history of Russian naval planes .. just pointing this out incase anyone has the same issue. 5. When a carrier is given a waypoint to follow it will often circle that way point but never actually get to it. This may be because I have a group of 5 ships in a "dice five" formation and they all can't make the turn. I've tried adjusting speed, formation, and formation width but no luck yet in solving this. If you notice your naval group just orbiting a point you may be having the same issue. **NEW 12/21** 6. On the hi-fi Kuznetsov, when there are three AI planes on deck preparing for take off and a fourth one lands, it noses into the lead aircraft that is trying to get to the cat and fouls the deck. Screenshots below. Note that the screenshot shows #1 for the cat rolls forward and gets stuck. I'm not looking for answers for fixes to the above, or providing a track file, I'm just pointing them out incase anyone is experiencing the same behaviors. As a fix for my multiplayer server, I am just dropping the lo-fi carriers out of the campaign as it seems the support for them is going away and I may ditch either the E-2 or F14 to prevent fouling until a patch fixes this. In the screenshot below these two planes have been on the deck for two hours now on the server while cats 3 & 4 have been launching planes no problem since those cats are staggered and no overlap occurs. Again, this happens on hi-fi carriers as well.
-
Yes, that problem. I noticed that not only were normal groups being turned into static objects on being killed but also stationary group objects in the campaign, such as manpads - pillboxes - outposts - etc, were also considered static objects. This was a huge headache because my code assumed that if I used the Group Object method of spawning something in then I should be able to track the death of that object as a Group death. However, when they died they were of the Static object type. It was very confusing. I assume that maybe DCS was swapping these no moving objects to static to save on processing .. but they would still shoot at the enemy .. I don't know. Anyway, I'll try to keep a close eye on if everything is back to working as expected now.
-
Ah, okay. I don't use any of the DCS add-ons such as mist but I do follow what you are saying. I too have a similar database but I don't bother cloning the DCS object tables into my DB as I am relying on DCS to keep that straight. Anyway, I think a long time ago if I tried to use the Group class on a destroyed object (especially when it is the last unit dying) that I would get a similar nil error. However, I implemented both the loop and the "getSize" as you have suggested and both seem to be working well. I will post if any further error occurs.
-
I have a table of all unit names and the unit names are the group name with a -## on the end. For now, I can substring the last characters off to get the group name and then count the number of units still alive in my table. But agreed, it is annoying to introduce a loop where one wasn't need before. Thank you for replying and reporting.
-
Hello, I run Operation Candyland, a DCS Open Beta multiplayer server that's been running for about 3 years now. The latest patch has severely broken the campaign. The following code no longer works: if(world.event.S_EVENT_DEAD == event.id) then local descTable = event.initiator:getDesc() local descCategory = descTable["category"] if(event.target:getCategory() == 1) then --This is object Type 1 UNIT if(descCategory == 2 or descCategory == 3) then --This is a ground unit or a ship unit unitsAlive = nil unitsAlive = event.initiator:getGroup():getSize() unit_name = event.initiator:getName() group_name = event.initiator:getGroup():getName() As you can see above, I want to get the GROUP NAME of the UNIT that has been killed. This code, which has worked for years, no longer works. It throws the following error at the variable "unitsAlive = event.initiator:getGroup():getSize()": ERROR SCRIPTING (Main): Mission script error: [string "events.lua"]:727: attempt to index a nil value Further testing shows that the "getGroup()" function of a dead unit is no longer returning a valid value. I have tried switching "S_EVENT_DEAD" to "S_EVENT_UNIT_LOST" or "S_EVENT_KILL" (and therefore substituting event.initiator to event.target) however the error persists. It seems to me that the patch "fix" for the dead event is removing the unit from it's parent group before firing this event. Therefore, it is now impossible to determine the Unit's parent group. Please let me know how I can determine the GROUP NAME of a UNIT that has been killed with the new patch "fix".