Jump to content

dwpenney

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by dwpenney

  1. Thanks! I actually started my journey by learning most of the lua scripting from the mission builders forums. At my current stage, I was wondering if it might be beneficial to turn my set of scripts into something more mode like, which would allow easier integration into multiplayer missions - instead of having to require mission builders to modify/update their missions. I will take a look at this. My concern though is that what I am attempting to do is have a non-player controlled custom unit hook into the event handler cycle by registering it's own event handler and then processing events. Example: I create a custom pilot model to represent a pilot on the ground without an aircraft. Allow this unit to be placed in the mission editor and then, on mission start, have an initialization script run that hooks into the event system. What I would like, is to not have the mission designer have to put the initialization script in (and the code, because I am not sure how the mission designer could call code in the mod/unit directory structure). So, from looking at the various units in DCS World (A-10A, etc), I can see make_flyable calls that contain links to a comm.lua script call that I could potentially hack into .. assuming make_flyable is called when the unit is placed as an AI unit. But then when I look at the Combined Arms mod, I don't see anything similar.
  2. I've tried placing init.lua and device_init.lia files around the mod directory structure hoping to see one of them get executed. Of course, I might be missing something or missed something in my tests. Do any aircraft builders know of a script run when the game starts and your unit is spawned in? Any answer is better than no answer :-)
  3. TL;DR: Is there an init.lua file that is called when an object spawns in game? I wonder if someone could point me in the right direction... I see all these examples about adding aircraft and such to DCS but I am looking for something both a little simpler and more complex. I think I can see how to add custom ground objects, and if I look at some of the downloadable mods for DCS I get good examples of just that. Shape files, Texttures, and a lua file to describe the object. Can someone give me a hint on how I can add a custom script to a ground object that will allow me to set up some in-game behaviour. I don't mean like how an object moves, or such, but how an object can feed into game events. I see the entry.lua and how that should interface with the game but where would I put my initialization call that would easily set up the event handler? Something tells me I can put an init.lua script somewhere in the directory structure and I want it called when the game starts. Example: I would like add a command building (with shape and texture) and have this show up in the mission editor and in game, have it (the code) listen for eject events. How can I add an initialization call to that structure so that it can set up an event handler and listen for events?
  4. I wonder if someone could point me in the right direction... I see all these examples about adding aircraft and such to DCS but I am looking for something both a little simpler and more complex. I think I can see how to add custom ground objects, and if I look at some of the downloadable mods for DCS I get good examples of just that. However, can someone give me a hint on how I can add a custom script to a ground object that will allow me to set up some in-game behaviour. I don't mean like how an object moves, or such, but how an object can feed into game events. Example: I can add a command building (with shape and texture) and have this show up in the mission editor. But how can I add an initialization call to that structure so that it can set up an event handler and listen for events? I see the entry.lua and how that should interface with the game but where would I put my initialization call that would easily set up the event handler? ie: Is there an init.lua file that is called when an object spawns in game?
  5. Hey guys. I had this working in DCS about a year ago. That was a much older version of DCS and a different version of MIST. My problem is that either the code I have is not working in the newer DCS/MIST or I just can't tune the frequency in correctly in the Huey. It could be the latter, or a combination of changes in the Huey that is making this not work. So the code I had was this (please excuse the typos as I am modifying the original code to have as few variables in it and therefore, hopefully, improve it's readability): position = Unit.getByName(src_unit_info.spawned_unit.name):getPosition().p transponder_freq = 250000 freq_txt = "" .. (transponder_freq / 1000 ) .. "kHz" temp_id = mist.scheduleFunction( trigger.action.radioTransmission, {"VHF_WarningTone.wav", position, 0, false, transponder_freq, 1000}, timer.getTime() + 10, 15) Now this worked. The .wav was included in the .miz file and I was able to start the Huey, turn the ADF to the frequency, see the signal strength indicator spike and head the wav (morse code) with the proper setting on the ADF. Now, in the new DCS/MIST, I have the following code (please excuse the comments interspersed in there as I was trying to make sure I had everything lined up): source_position = Unit.getByName(val.unitName):getPosition().p source_freq = 250000 temp_id = mist.scheduleFunction( -- Function trigger.action.radioTransmission, -- File Name, Vec3 position, AM|FM, loop?, freq, power {"VHF_WarningTone.wav", source_position, 0, false, source_freq, 500}, -- Time (now + transponder_delay) timer.getTime() + 10, -- repeat every n secs 15) Am I missing something obvious? I have a lower power in the second code block, but I am within a couple of km of the source position with the Huey. I get a signal strength indicator but I am hearing no sound. I added a function call to play the sound at the start of the mission just to make sure that it was found and sounded like it should. Any suggestions on how I can trouble shoot this with a different aircraft (in case it's the Huey)?
  6. I'm still hesitant about this. Being able to look outside the game at key cards (ok, I can just get off my arse and memorize the HOTAS) is one thing but flipping switches.... this is required.
  7. Looking forward to it Gradoc! I love the way it interacts with DCS:A-10C but I keep wishing I could get some Huey and Mi-8 love in there :-)
  8. Can any of you mission designers/editor guru's tell me where I can get documentation on the airport resupply settings in the editor? Maybe, if I ask nicely, where/how I can impact that via LUA code? Please? :-)
  9. I know it just appeared on everyone's credit card statements but does anyone have a checklist?
  10. Holy wow! It is _that_ easy! I was expecting some work to cast a function as a CommandFunction - I must be over thinking it :-) function PilotDown.radioCommand (test_text) msg.text = PilotDown::radioCommand (): " .. test_text msg.displayTime = duration msg.msgFor = {coa = {coalition}} mist.message.add (msg) mist.debug.dump_G ("PilotDown-main-radio_command-dump_G.log") end [...] PilotDown.tmp_data = missionCommands.addCommand ("SAR Test and Debug", nil, PilotDown.radioCommand, "Test and Debug") path_data was a table that looked like this in the mist dump: ["PilotDown"]["tmp_data"] = table: 0000000021EE2860 { ["PilotDown"]["tmp_data"][1] = "SAR Test and Debug", }, Sure enough, under the comms F10 menu my SAR Test and Debug option was there and selecting it triggered the message and the mist dump. Easy. :-) Now I have to figure out my coalition stuff to only get those messages to show for the correct side. Is it going to be that simple to add options under the "SAR Test and Debug" comm menu by passing the tmp_data table to subsequent addCommand calls in the path parameter? Can I just pass nil for the command and argument in that case or do I have to have an 'empty' command (a command that does nothing)? Can I even add commands under the SAR Test and Debug command (like a tree)?
  11. More info: I am working on a script that can be plugged into a mission and generate dynamic downed pilots that can be rescued by SAR units. It doesn't use triggers but periodic LOS calculations to determine when to initiate events. I am working on how I can, as I have seen missions with triggers do, have a recovery team spawn or have the pilot move to the SAR unit. Before I get more complicated with my code, I'd like to see if I can trigger a couple of these 'behaviours' from the radio list.
  12. Is there some option that does not use triggers? Something that might call a lua function instead? I saw this one on the scripting wiki but I can't figure out how I might create a CommandFunction Path missionCommands.addCommand(string name, Path or nil path, CommandFunction сommandFunction, any argument)
  13. Does anyone have any examples that they can share where, in a lua script, you add/remove commands from the f10 radio?
  14. I love the idea. I would like to see the kneeboard moveable and resizable (configuration file would be fine). Of course that's with respect to the 2d one that is in game now. As a 3d model in the game, I don't think it really matters as long as it can be disabled/enabled by key press so you could see around it. Just my 2 cents.
  15. I am part way into something similar. I have a script that detects any eject event and spawns a pilot for that event, provides lat/lon for the downed pilot in a text radio message and (I think) a transponder freq for someone to home in on. At a set distance from the SAR unit, the downed unit will pop a flare and at a closer distance, pop smoke. My next steps are to get the pilot on board and possible spawn a recovery team to go get him/her. It's coming together but there are few issues to clean up and a lot of features to finish.
  16. miz file are actually a .zip file - according to 7zip anyway. Try opening the file in 7zip and and add the wav file to it. In my script I am using mist to run the sound every 10 second for 30 seconds: PilotDown.temp_id = mist.scheduleFunction( trigger.action.radioTransmission, {"VHF_WarningTone.wav", position, 0, false, pilot_info.transponder, 1000}, timer.getTime() + 10, 30) I am doing some LOS work, so I refresh the sounds every 30 seconds until the pilot is picked up or dies .. that's the intention anyway. Question: What are you using the static sound for?
  17. So is the key part this? trigger.action.radioTransmission('VHF_WarningTone.wav', PilotPosition, 0, true, 250000, 1000); Is that the key to adding a radio transmission? According to the scripting engine wiki: function trigger.action.radioTransmission(string fileName, Vec3 point, enum radio.modulation modulation, boolean loop, number frequency, number power) transmits audio file to broadcast. fileName name of audio file. The file must be packed into the mission archive (miz). point position of the transmitter modulation modulation of the transmission loop indicates if the transmission is looped or not frequency transmitter frequency in Hz power transmitter power in Watts So I am not sure how long the transmission lasts and has to be repeated. POssibly as long as the .wav file is active/playing?
  18. So is the key part this? trigger.action.radioTransmission('VHF_WarningTone.wav', PilotPosition, 0, true, 250000, 1000); Is that the key to adding a radio transmission? According to the scripting engine wiki: function trigger.action.radioTransmission(string fileName, Vec3 point, enum radio.modulation modulation, boolean loop, number frequency, number power) transmits audio file to broadcast. fileName name of audio file. The file must be packed into the mission archive (miz). point position of the transmitter modulation modulation of the transmission loop indicates if the transmission is looped or not frequency transmitter frequency in Hz power transmitter power in Watts So I am not sure how long the transmission lasts and has to be repeated. POssibly as long as the .wav file is active/playing?
  19. If you go to the Tiggers portion of the ME, you can add a Continuous Action when part of a group (your SAR Helo) is in a trigger zone with an Action of 'Radio Transmission'. Maybe that is what Evil was talking about? I set mine to my SAR Helo holding zone, FM, Loop, Freq: 1000 (kHz) and 100w power. Not sure if a sound file is actually required or not. Not sure if this can be dynamic as it is attached to a zone and not a unit.
  20. Hey Joyride. I have been working on something similar. Do you have a unit transmitting an ADF tune-able signal yet?
  21. Thanks Joyride! This starts me on the dark path to LUA scripting in DCS :-)
  22. Nice! Now I'd like to get a 'downed pilot' spawned at a player crash site :-)
  23. Is it possible to allow it to be moved (screen position) by editing a LUA file? I have two monitors in a vertical configuration (for Helios) and this display is appearing on the bottom monitor - I'd like to be able to move it to the top.
  24. Matt: You have my support for the DCS and DCSW products. I appreciate the hard work.
  25. My 2 cent's: Great job by everyone involved on the development, testing and production teams. Appreciate the hard work and the many hours.
×
×
  • Create New...