Reaper6 Posted March 21, 2015 Posted March 21, 2015 I am trying to add simulated Artillery illumination over a target area(using illumination bomb). Here is the code I have: local units = Group.getByName('test vehicle'):getUnits() if #units > 0 then local unit1pos = units[1]:getPosition().p trigger.action.illuminationBomb({x = unit1pos.x, y = unit1pos.y + 1000, z = unit1pos.z}) end Is there a way to have this happen every 300 seconds, until a specified time? Thank you Reaper6 "De oppresso liber" NZXT Phantom Full Tower, Intel Core i7 4960X Processor(6x 3.60GHz/15MB L3Cache) 20% Overclocking, 64GB DDR3-2133 Memory, NVIDIA GeForce GTX Titan Black-6GB SLI Mode(Dual Cards), Gigabyte GA-X79-UP4 Motherboard, ViewSonic PJD5132 SVGA Multi-Region 3D Ready Portable DLP Projector, Track IR 5, Thrustmaster Warthog, Cougar MFDs.
nickexists Posted March 21, 2015 Posted March 21, 2015 Use this: http://wiki.hoggit.us/view/DCS_func_scheduleFunction Or you can use the improved version that is contained in Mist.
Reaper6 Posted March 21, 2015 Author Posted March 21, 2015 I tried this function, but doesn't seem to be correct. Am I doing it correctly? local function Illumination () local units = Group.getByName('test vehicle'):getUnits() if #units > 0 then local unit1pos = units[1]:getPosition().p trigger.action.illuminationBomb({x = unit1pos.x, y = unit1pos.y + 1000, z = unit1pos.z}) end timer.scheduleFunction(Illumination, {}, timer.getTime() + 300, 10800) "De oppresso liber" NZXT Phantom Full Tower, Intel Core i7 4960X Processor(6x 3.60GHz/15MB L3Cache) 20% Overclocking, 64GB DDR3-2133 Memory, NVIDIA GeForce GTX Titan Black-6GB SLI Mode(Dual Cards), Gigabyte GA-X79-UP4 Motherboard, ViewSonic PJD5132 SVGA Multi-Region 3D Ready Portable DLP Projector, Track IR 5, Thrustmaster Warthog, Cougar MFDs.
xcom Posted March 22, 2015 Posted March 22, 2015 local function Illumination () local units = Group.getByName('test vehicle'):getUnits() if #units > 0 then local unit1pos = units[1]:getPosition().p trigger.action.illuminationBomb({x = unit1pos.x, y = unit1pos.y + 1000, z = unit1pos.z}) timer.scheduleFunction(Illumination, {}, timer.getTime() + 300) end [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Reaper6 Posted March 22, 2015 Author Posted March 22, 2015 local function Illumination () local units = Group.getByName('test vehicle'):getUnits() if #units > 0 then local unit1pos = units[1]:getPosition().p trigger.action.illuminationBomb({x = unit1pos.x, y = unit1pos.y + 1000, z = unit1pos.z}) timer.scheduleFunction(Illumination, {}, timer.getTime() + 300) end I have tried it that way as well. It seems like the timer.schedulefunction or local funcID = mist.scheduleFunction(Illumination, {}, timer.getTime() + 300) doesn't work either. I set up a M109 on a patrol with a switched condition when enters a zone to set off the illumination bomb(reaches zone every 3.5minutes.) Just thought it would be easier to use the timer function.... Apparently doesn't want to work for me. "De oppresso liber" NZXT Phantom Full Tower, Intel Core i7 4960X Processor(6x 3.60GHz/15MB L3Cache) 20% Overclocking, 64GB DDR3-2133 Memory, NVIDIA GeForce GTX Titan Black-6GB SLI Mode(Dual Cards), Gigabyte GA-X79-UP4 Motherboard, ViewSonic PJD5132 SVGA Multi-Region 3D Ready Portable DLP Projector, Track IR 5, Thrustmaster Warthog, Cougar MFDs.
xcom Posted March 22, 2015 Posted March 22, 2015 Send your mission and I can check. The script should work. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Reaper6 Posted March 22, 2015 Author Posted March 22, 2015 I guess it doesn't work with using a vehicle. It seems to work with a trigger zone though. zonename = 'illumination' local function SignalTarget() Aimpoint = trigger.misc.getZone(zonename) Aimpointpos = {} Aimpointposx = Aimpoint.point.x Aimpointposz = Aimpoint.point.z Aimpointposy = land.getHeight({x = Aimpoint.point.x, y = Aimpoint.point.z}) Aimpt3 = {x=Aimpointposx, y=Aimpointposy, z=Aimpointposz} trigger.action.illuminationBomb({x=Aimpointposx, y=Aimpointposy + 1000, z=Aimpointposz}, trigger.smokeColor.Green) return timer.getTime() + 300 end timer.scheduleFunction(SignalTarget, nil, timer.getTime() + 1) If anyone is interested how to simulate artillery Illumination over a certain area. I used "Type" = ONCE / "Actions" = DO SCRIPT. This will drop an Illumination Bomb over the trigger zone @ 1000meters, every 300 seconds. It's useful if you are planning to operate Ka50s at night. "De oppresso liber" NZXT Phantom Full Tower, Intel Core i7 4960X Processor(6x 3.60GHz/15MB L3Cache) 20% Overclocking, 64GB DDR3-2133 Memory, NVIDIA GeForce GTX Titan Black-6GB SLI Mode(Dual Cards), Gigabyte GA-X79-UP4 Motherboard, ViewSonic PJD5132 SVGA Multi-Region 3D Ready Portable DLP Projector, Track IR 5, Thrustmaster Warthog, Cougar MFDs.
Reaper6 Posted March 23, 2015 Author Posted March 23, 2015 Definitely DO NOT use this for a server mission! It seemed to lag the server having illum bombs every 5 minutes. Not sure if it has to do with the scripting or what. We tried a mission with this last night, and was a NO-GO. Reaper6 "De oppresso liber" NZXT Phantom Full Tower, Intel Core i7 4960X Processor(6x 3.60GHz/15MB L3Cache) 20% Overclocking, 64GB DDR3-2133 Memory, NVIDIA GeForce GTX Titan Black-6GB SLI Mode(Dual Cards), Gigabyte GA-X79-UP4 Motherboard, ViewSonic PJD5132 SVGA Multi-Region 3D Ready Portable DLP Projector, Track IR 5, Thrustmaster Warthog, Cougar MFDs.
Recommended Posts