Jump to content

AKA_Clutter

Members
  • Posts

    524
  • Joined

  • Last visited

Everything posted by AKA_Clutter

  1. Here is what someone said on Casmo's Discord channel. Because it doesn't do anything in the real helicopter. It's why the cursor auto jumps to the boresight potion on the MFD. So it's not that ED didn't implement it, they just implemented in accordance with sme feedback and how it works in the software version presented.
  2. I followed the instructions and removed the screws. IIRC I looked at it and thought there might be some interference, and it was easy enough to do.
  3. Interested in how you did this. Do you have layouts you care to share.
  4. "Hi, I'm Uncle Bill and I'm here to help!" IMHO, not the first, not last time, MS has #$% us all.
  5. I use SkateZillas utility for this and it works great
  6. At the 1:17 mark in Virpil's release video, it looks like to me they have the "Counterbalance" upgrade kit installed. Curious if it is "required" to get the grip/base to function properly. ALso it will be interesting to see how this spring counterbalance works. I currently use the counterweight setup.
  7. We run our mission on a server that swaps to a specific instance for liberation missions, and then swaps back to a different server instance for general/public DCS missions. The issue is that some times, before I have a chance to copy the Liberation state.josn file to a different folder, or rename it, the server starts with the same mission ( even though there are other missions listed) and overwrites the state.json file. What I would like to do is copy the state.josn file to a different file about 45 to 60 seconds before the mission ends. I know the basics of Lua, but not sure how to use lua to copy a file. I can write to a file, just dln't know how to issue a command to copy a file. Can anyone point me the a direction to do this. Thanks
  8. Thanks Grimes. The main place I am looking to use it is in Liberation Campaign generated missions. It looks as though dead units are kept around from mission to mission. I have no clue if that would degrade server4 performance.
  9. Hi all, I have a few questions on the world.removeJunk function. I have added it to a test mission and it seems to work, or at least it doesn't throw any errors. 1. I read a few reports that this function was causing crashes, both ser4vers and clients. Has this been fixed and is it now working? 2. Assuming it's working, what would be the use case? Does removing the dead persistent units improve or is it primarily for ascetics. 3. are there limitations on the size of the sphere to use? Would it be better to use a lot of small ones, or one very large ones. Thanks, Cluitter
  10. IMHPO - One must bide your time. It will happen, or it won't. It will always be "not soon enough" , but once released, that will become history.
  11. Thanks for the response Kanelbolle. The reason I am checking to see if I get an error when trying to open the file is to try and avoid a runtime error that stops the script. I also posted this question on the Stack Overflow board. The response I got there, was that I was opening the file TWICE is rapid succession., which may caused a Time of check to Time of Use error (Time-of-check_to_time-of-use). As being new to programming and lua, I would never have figured this out. The responder also suggested a better way to do what I wanted to do. The key seems to be to open the file and assign that to a handle (Variable) and also capture the error, if the file can't be opened. I think the key is the follwoing line. local Test_File_Handle, err = io.open(FILENAME, "w") Anyway, my revised code is shown below and seems to work. I haven't tested to see what happens if I can't write the file to start with. local function Write_Mission_Stats () trigger.action.outTextForCoalition(2,MSG_Header .. "TEST - Simple test to write to file TEST" .. MSG_Footer, 15) ---[[ ALternate Method local Test_File_Handle, err = io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt", "w") -- For Clutter's Comuter -- local Generate_A2A_Summary_Stats_OutString = Summary_Stats_Report_Tbl (Index_TBL) if not Test_File_Handle then -- failed to open file, let's display the error -- print(err) -- or error(err), or whatever debugging function trigger.action.outTextForCoalition(2,MSG_Header .. "FIle was not opened\n" .. MSG_Footer, 15) trigger.action.outTextForCoalition(2,MSG_Header .. err .. MSG_Footer, 15) else local Generate_Mission_Config_Report_Tbl_Outstring = Mission_Config_Report_Tbl () trigger.action.outTextForCoalition(2,MSG_Header .. "TEST PRINT BEFORE WRITE CALL" .. MSG_Footer, 15) -- Output summary talbe of A2A groups trigger.action.outTextForCoalition(2,MSG_Header .. Generate_A2A_Summary_Stats_OutString .. MSG_Footer, 15) -- Output summary talbe of A2A groups -- opened the file, write some data Test_File_Handle:write("===============================\n") Test_File_Handle:write(" Mission Stats for AKA Campaign\n") -- Close the file Test_File_Handle:close() end return end -- Next line is to call the function to write mission states to a file. timer.scheduleFunction(Write_Mission_Stats, {}, timer.getTime() + 15*Sec_per_min)
  12. Hi all, I am trying to write information to a file and I am having an issue. I have commented out the sanitize lines in MissionScripting.lua and I am able to write to a file. However, I want to add a check to make sure that DCS sanitation has been disabled. I do this with an if statement, but this ends up generating an error. Here is the sbnipet of code that I am having issues with. local function Write_Mission_Stats () trigger.action.outTextForCoalition(2,MSG_Header .. "TEST - Simple test to write to file TEST" .. MSG_Footer, 15) -- Test_File_Handle = io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt","w") if io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt","w") ~= nil then local Generate_Mission_Config_Report_Tbl_Outstring = Mission_Config_Report_Tbl () Test_File_Handle = io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt","w") Test_File_Handle:write("===========================\n") Test_File_Handle:write("Mission Stats for AKA Campaign\n") Test_File_Handle:write("===============================\n") Test_File_Handle:write(Generate_Mission_Config_Report_Tbl_Outstring) else trigger.action.outTextForCoalition(2, "\n*************************************\n\nNot able to open wirte file. \n\n**********************", 15) end end -- Next line is to call the function to write mission states to a file. timer.scheduleFunction(Write_Mission_Stats, {}, timer.getTime() + 15*Sec_per_min) The error message is that the line with " Test_File_Handle:write("===========================\n")" attempt to index global Test_Handle(a nil) value). I check after the error and a file named "AKA_Test_File.txt" has been created,but is empty. If I remove the if statement, the code works fine and a file is written. I tried adding "Test_File_Handle = io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt","w")" as the text condition to the if statement, but it didn't like that at all. Can any tell me why this is happening, or a better way to check and see if I can write a file and not generate an error that stops the script. Thanks,
  13. Hi all, Is there a way to get selected Trigger zones to show on the F10 map in a multiplayer mission? I have the zone defined and it isn't "hidden" but doesn't show in in the F10 map when flying the mission. Is there a way to do this? Thanks,
  14. Do as I do. Let Skate do his thing, taking the time necessary to do it to his standards, don't ask when it will be ready, but check DAILY or whenever you use his utility. Works great for me.
  15. Works like a charm now. And it makes sense. With them at the bottom of the file, it would treat the line as an axes. Thanks!
  16. Hi all, I am trying to get this to work and am having some trouble. I have added the above line to both the DCS Install folder\mods\aircraft\F-16c\input\joystick\default.lua and the DCS Install folder\mods\aircraft\F-16c\input\keyboard\default.lua files. It shows up int the control setup as an assignable keyboard command but it doesn't show up as an assignable joystick/throttle command. I also tried adding it to just the joystick dafault.lua file, but that didn't work either. I added the command at the bottom of the file, just before the end of rile/return. Any idea of what I'm doing wrong?
  17. @PravusJSB Thanks for the short primer. Not sure that "tables" will ever be easy for me, but I'll keep plugging
  18. Any more news on this. Waiting "two more weeks" is hard.
  19. Cfrag, Thanks so MUCH! This explains a LOT and tells me what I need to do. I am just getting my toes wet with tables. I don't understand "for pairs" and for ipairs" in arrays with multi rows and columns, but I haven't HAD to use that yet. I do use one table that is an "array" of sorts. It has 30 rows (one for each group I want to spawn) and 13 columns for each row that contain various prices of data. If I understand the above correctly, I should be able to do what you point out by simply revising the line in the for loop from timer.scheduleFunction(F_ACTIVATE_LAG, i, timer.getTime() + GRP_Spawn_TSS*60) to LAG_TBL[i][14] = timer.scheduleFunction(F_ACTIVATE_LAG, i, timer.getTime() + GRP_Spawn_TSS*60) Thanks again for the quick response. Clutter
  20. Hi all, OK, I have a long winded, multifaceted question. I am using the base DCS api, and how no doubt there are better ways of doing. However, I am trying to learn the API and Lus. My questions are more about the DCS API, how it works, and that one can do in lua. I have developed a script to spawn up to 10 la te activation air CAP groups, with each group having a different probability of spawning and a different start time. I just a for loop to iterate through these 10 groups and then use the timer.scheduleFunction() to schedule the different groups. At some point, I may want to use the timer.removeFunction (number functionid) function to remove one or move of the timer.scheduleFunction() set by the for loop. From the Hoggit wiki page, it has the timer.scheduleFunction() set up as “local id = timer.scheduleFunction()” This generates SO many questions for me, I hope these make sense. 1. For the case where I run through the for loop to generate different timer.scheduleFunctions, do they have function IDs? If so how do I get the function ID? 2. Is the “functionid” a number or name? The wiki description seems to indicate a number, but that isn’t a proper lua name. 3. Assuming it is a proper lua name, is there a way to change the functionid/name as you iterate through the for loop. For example, the first time through the loop the timer.scheduleFunction has an id fo F_01, then second time the fuctionid is F_02 I hope those question make sense. I have attached a snippet of the script for illustration of what I am doing, and what generated the above questions. INDEX_TBL contains the starting index and the ending index of the groups to be spawned. That way I can easily change if it spawns 5 groups or 10 groups. PS Let me know if this isn’t in the correct forum section. --[[ ================================================================= function Spawn_LAG. - receives six inputts. These are: i Increment value from the main "for loop" that calls this function. Group_Name, LAG_TBL[1][1] Group_Prob, LAG_TBL[1][2] Group_Time LAG_TBL[1][3] Group_Time_Window LAG_TBL[1][4] Group_Num_Prob, LAG_TBL[1][5] Call timer.scheduleFunction for each gropu to be activated./ Check the group name for nil values. ================================================================= --]] function Spawn_LAG (i, Group_Name, Group_Prob, Group_Time, Group_Time_Window, Group_Num_Prob) local Current_Group = Group.getByName(Group_Name) if (Current_Group ~= nil) then local GRP_Size_Org = Current_Group:getSize() -- Determines how many are in the current group local Group_Prob_Test = math.floor(math.random()*1000)/1000 -- determines grop test proabaility to three decimal places, mainly for printing local TSS_Modifier, GRP_Spawn_TSS = fGRP_Spawn_TSS(Group_Time, Group_Time_Window) -- Calls function to determiene the Spawn tiume based on a base time and a time window LAG_TBL[i][9] = TSS_Modifier LAG_TBL[i][12] = GRP_Spawn_TSS LAG_TBL[i][6] = GRP_Size_Org LAG_TBL[i][7] = Group_Prob_Test if (Group_Prob_Test <= Group_Prob) then LAG_TBL[i][8] = "Yes" timer.scheduleFunction(F_ACTIVATE_LAG, i, timer.getTime() + GRP_Spawn_TSS*60) -- Activate Enemy CAP flight group. timer.scheduleFunction(Adjust_Num_Units_In_Group, i, timer.getTime() + GRP_Spawn_TSS + 2) -- Line to adjust units in A2A_LAG group based on a given probability else LAG_TBL[i][8] = " No" end end end -- End of function Spawn_LAG --[[ ================================================================= Main LAG Spawn loop ================================================================= --]] function LAG_Activation (Index_TBL) for i = Index_TBL [1], Index_TBL[2] do LAG_Spawn = Spawn_LAG (i,LAG_TBL[i][1], LAG_TBL[i][2], LAG_TBL[i][3],LAG_TBL[i][4],LAG_TBL[i][5]) end return end
  21. HI, As the title states, I am wondering if there is an easy way to check and see if a late activation unit has been activated via scripting, and not using MOOSE. I know I could probably add flags, or check the units speed, but am wondering if there is a simpler, more direct way. Thanks. Clutter
×
×
  • Create New...