Jump to content

Terminator357

Members
  • Posts

    47
  • Joined

  • Last visited

Community Answers

  1. Terminator357's post in Pull Time of Day was marked as the answer   
    The function "timer.getTime" might work. It returns elapsed game time in seconds. There's 86400 seconds in a 24 hr day.
    Not as ideal as 24hr time but you can still count 'x' hours worth of seconds and run whatever scripts or triggers you want off that.

    https://wiki.hoggitworld.com/view/DCS_func_getTime
     
    edit:

    Simpler approach: You can set the mission start time, then just do the math for elapsed time in seconds and add a "Time More" condition to a script when you want the background to change.  
  2. Terminator357's post in Dynamic FireAtPoint - how do I get this to work? was marked as the answer   
    So... It looks like I couldn't pass the target point to the FireAtPoint task because I wasn't using "getPoint" correctly. Newb oversight, but there ya go...
    "getPoint" returns Vec3 coordinates, but artillery needs Vec2 coordinates, so "getPoint" by itself will not fetch a valid FireAtPoint target point.
    Vec3 points are defined by "x, y, z", Vec2 are defined by "x, y", so you have convert the Vec3 to Vec2 before passing it to the FireAtPoint task. 
    To convert a Vec3 point to a Vec2 point, just take the Vec3 "z" coordinate and use it for your Vec2 "y" coordinate. After that, everything works like you'd expect.
    Simple in hindsight, don't know why it was stumping me like that 🙂 
    Anyway, this script will dynamically assign a FireAtPoint task to the coordinates of any ground target you want based on whatever conditions you apply to it in the "getBy" function(s) and/or the ME. 
    local Target = {}
    Target.x = Unit.getByName('Target1'):getPoint().x
    Target.y = Unit.getByName('Target1'):getPoint().z
    target.radius = 10
    Target.expendQty = 20
    local fire = {id = 'FireAtPoint', params = Target}
    Group.getByName('Arty2'):getController():pushTask(fire)
     
×
×
  • Create New...