Jump to content

Wrecking Crew

Members
  • Posts

    1933
  • Joined

  • Last visited

Posts posted by Wrecking Crew

  1. On 3/26/2024 at 8:02 AM, Tippis said:

    Some of this could probably be fixed by scripting up what is probably what is more often the desired outcome: a specific set of numbers, but in random order, or at least some kind of weighted function where previous results are less likely to reappear. I.e. not random at all in the literal sense, but more appealing to the intuitive sense of what a random pattern should look like.

    Hi Tippis, folks.  I did this, in my clunky way 😎  I have five sets of coordinates and want one set chosen randomly, for the first objective.  When the objective is complete, another one can be accepted and the next coordinate set is randomly selected from the remaining four.  Rinse and repeat.  For the set up, Flag 5 is set to a random value between 1 - 5 at mission start.  Then scripting will define a dictionary with values {1, 2, 3, 4, 5}.  

    Mission Start: Flag 5 set to a random value from 1-5

    Mission Start: Create a "F5Dict", and remove the current value of Flag 5 from the dictionary.  Flag 5 value determines the coordinate set (one of five) for the objective

    -- MS, code.Create F5Dict
    Flag5Dict = {1,2,3,4,5}
    do
     local Flag5Value = trigger.misc.getUserFlag('5')
     local indexsearch = 0
     for index, data in pairs(Flag5Dict) do
      if (data == Flag5Value) then indexSearch = index end
     end
     table.remove(Flag5Dict,indexSearch)
    end

    After the first objective is complete, the player can select to attack a second objective from the remaining four values in the dictionary; Flag 75 goes True, so Switched Condition Do Script..

    -- SC, Select Next Killbox, F75T
    do
     if #Flag5Dict > 0 then
      local indexRand = math.ceil(math.random(#Flag5Dict))
      trigger.action.setUserFlag(5, Flag5Dict[indexRand])
      -- remove the new value
      table.remove(Flag5Dict,indexRand)
     end
    end

    Complete the objective.  Rinse & repeat.

     

    Credit for the code help goes to Franze

    Boxcutter Hari 02.lua Boxcutter Hari 29S1g.miz

    • Like 1
    • Thanks 2
  2. Wow, blast from the past!

    @Mav87th  I use a "Latch" flag approach --

    --- System Flags ---
    --- Latches: do not turn off once set
    --- Timers: Use for control

    Example --

    Flag 50 goes true and is the Latch flag that will never go false again

    Flag 506 is the associated Timer flag and can be turned On or Off as needed.

     

    Another tip -- for every mission I have a .lua file with all of the notes, scripts, flag assignments, and events.  See the attached.

    edit 20240228 -- updated miz file

    Confounded 02.lua

    Confounded Bridge 29C1f.miz

  3. Perhaps this will help --

    --- MS: code.Create & Load Client Tables
    aircraftClientBlueNames = {}
    aircraftClientRedNames = {}
    
    do
     local function contains(tbl, val)
      for _,v in ipairs(tbl) do
       if v == val then return true end
      end
      return false
     end
     for uName, uData in pairs(mist.DBs.humansByName) do
      if(contains({'red'}, uData.coalition)) then
       if not(contains(aircraftClientRedNames, uName)) then
        table.insert(aircraftClientRedNames, uName)
       end
      end
      if(contains({'blue'}, uData.coalition)) then
       if not(contains(aircraftClientBlueNames, uName)) then
        table.insert(aircraftClientBlueNames, uName)
       end
      end
     end
    end

     

  4. Here is the structure I use for just a couple of mods..  One is of the mod folder structure and target, the other shows OMM when I open it -- I need to go to Recent to find the .omx file.  There must be a better way.. ?

     

    OMM On Open.png

    OMM WC Structure.png

  5. Here is an example.  It's long ... 

    This is yours -- 

    if trigger.misc.getUserFlag(5),1) == 5 then

    is missing a "(" like this Flag((5,1) == 5,,,, but I don't know if that actually works

     

    local msg = {}
    msg[#msg + 1]='Welcome to the Witches Hollo mission! \n \n'
    if trigger.misc.getUserFlag('30000') == 0 then -- All Four Objectives Still Alive -- Blue Counter F30000 is False
     msg[#msg + 1]='Blue must clear out the Witches Hollo of the Red HQ and three Red Camps.  See the Briefing for HQ & camp target coordinates. \n \n'
     msg[#msg + 1]='Use JTAC Hummers to spot targets and laser designate.   \n \n'
     msg[#msg + 1]='Go Blue! \n \n'
     msg[#msg + 1]='Blue to win: \n'
     msg[#msg + 1]='Destory the Red HQ and three camps: East Camp, Central, and West. \n \n'
     msg[#msg + 1]='See the Radio F10 Menu for mission options including Restart. \n \n'
    end
    if trigger.misc.getUserFlag('30000') == 1 then -- Three Objectives Still Alive
     if trigger.misc.getUserFlag('30101') == 0 then -- RDR VGrp01 HQ Alive 
      msg[#msg + 1]='Very nice Blue pilots -- one camp was destroyed. \n \n'
      msg[#msg + 1]='Finish the mission objectives.  Destroy the Red HQ building! \n'
     else -- RDR VGrp01 HQ Dead FT 30101
      msg[#msg + 1]='Very nice Blue pilots -- the Red Headquarters was destroyed! \n \n'
      msg[#msg + 1]='Finish the mission objectives -- destroy the three Red camps at Witches Hollo. \n'
     end
    end
    if trigger.misc.getUserFlag('30000') == 2 then -- Two Objectives Destroyed, Two Still Alive
     if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33001') == 0 then -- HQ & Central Camp Alive
      msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n'
      msg[#msg + 1]='The Central Red camp is also operational. \n \n'
      msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n'
     end
     if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33101') == 0 then -- HQ & East Camp Alive
      msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n'
      msg[#msg + 1]='The East Red camp is also operational. \n \n'
      msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n'
     end
     if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33201') == 0 then -- HQ & West Camp Alive
      msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n'
      msg[#msg + 1]='The West Red camp is also operational. \n \n'
      msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n'
     end
     if trigger.misc.getUserFlag('30101') == 1 then -- HQ Plus One Camp Dead
      msg[#msg + 1]='Very nice Blue pilots -- the Red Headquarters was destroyed! \n \n'
      msg[#msg + 1]='Finish the mission objectives -- destroy the last two Red camps at Witches Hollo: \n'
      if trigger.misc.getUserFlag('33001') == 0 then -- Central Camp Alive
       msg[#msg + 1]=' Central Camp \n'
      end
      if trigger.misc.getUserFlag('33101') == 0 then -- East Camp Alive
       msg[#msg + 1]=' East Camp \n'
      end
      if trigger.misc.getUserFlag('33201') == 0 then -- West Camp Alive
       msg[#msg + 1]=' West Camp \n'
      end
      msg[#msg + 1]='\n \n'
     end
    end
    if trigger.misc.getUserFlag('30000') == 3 then -- Three Objectives Destroyed
     if trigger.misc.getUserFlag('30101') == 0 then -- HQ Alive
      msg[#msg + 1]='Blue pilots -- the Red Headquarters building is still operatonal. \n \n'
      msg[#msg + 1]='Destroy this structure to complete the mission objectives and send the red dogs back to Kaspi! \n \n'
     end
     if trigger.misc.getUserFlag('33001') == 0 then -- Central Camp Alive
      msg[#msg + 1]='Blue pilots -- The Central Red camp is still operatonal. \n \n'
      msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n'
     end
     if trigger.misc.getUserFlag('33101') == 0 then -- East Camp Alive
      msg[#msg + 1]='Blue pilots -- the East Red camp is still operatonal. \n \n'
      msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n'
     end
     if trigger.misc.getUserFlag('33201') == 0 then -- West Camp Alive
      msg[#msg + 1]='Blue pilots -- the West Red camp is still operatonal. \n \n'
      msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n'
     end
    end
    if trigger.misc.getUserFlag('30000') > 3 then -- All Objectives Destroyed
     msg[#msg + 1]='Blue wins today hooray!  Fun flying under the clouds. \n \n'
     msg[#msg + 1]='All mission objectives are met! \n \n'
     msg[#msg + 1]='Mop up any remaining Red units around Witches Hollo. \n \n'
    end
    trigger.action.outText(table.concat(msg), 25)

     

  6. 22 hours ago, MadKreator said:

    Quick side-track here… Do you like Open Mod Manager better than OVGME? 

    Yes.  I used JSGME way back for rFactor.  I tried OVGME but found OMM and chose it because it is up to date.  I set up my OMM like this, it took a couple of tries -

    C:\Users\..\Saved Games\DCS Mods\DCS Open Beta\Library

    And

    C:\Users\..\Saved Games\DCS Mods\DCS Open Beta\Backup

    • Like 1
  7. On 11/11/2023 at 7:32 PM, MadKreator said:

    commenting out this partial section ( line 4 ) DOES remove the MFDS from the Alt-F1 view in the A-10c2. See top of screenshot for full file path. Its in ....MFCD\indicator\BAKE\init.lua

    @MadKreator thank you!  That took out the MFCDs for my A-10C II.  I did comment the whole line.  I will try my hand at using Open Mod Manager to apply it.  I do appreciate the time you took to figure it out.

     

    One more thing  😎  What I really want is to only remove the MFCD from LAlt-F1 when the MFCD knob is turned to Off.  That's the way it worked in the original A-10.  

     

    edit -- the init.lua change is working perfectly with Open Mod Manager.  Thanks again!

    MadKreator A-10C II No MFCDs.zip

    • Like 1
  8. On 11/9/2023 at 11:32 PM, lesthegrngo said:

    go to DCS > Mods > Aircraft > A10C >Cockpit Scripts > MFCD > Indicator > MFCD_init.lua Make a backup of that file then open the original (edited)

    In it you will find a line " purposes = {render_purpose.GENERAL,render_purpose.HUD_ONLY_VIEW} " (edited)

    Replace that with " -- purposes = {render_purpose.GENERAL,render_purpose.HUD_ONLY_VIEW} "

    Hi, yes, but...  I did this ^^^ in the ..>Aircraft>A-10C_2>.., not the A-10 folder.  I flew my A-10C II and the MFCDs were still in the LALT-F1 view, for both On and Off.  I don't have the A-10C installed.

  9. 5 hours ago, MadKreator said:

    @MAXsenna @lesthegrngo As I responded on discord, You can do this exact same thing in the viewporthandling.lua and it will turn off the in-cockpit mfd’s for every plane ( that I have) except for the a-10. The a-10 must follow a different set of rules that other aircraft. 

     

    Hey, thanks for this.  So, comment out this one line, only -- ?

    -- edit: commenting out this one line only did not remove the A-10C II's MFCDs from LAlt-F1 HUD Only View

    render_purpose.HUD_ONLY_VIEW,

     

    16 hours ago, lesthegrngo said:

    Replace that with " -- purposes = {render_purpose.GENERAL,render_purpose.HUD_ONLY_VIEW} "

    save it and try the A10C to see if the MFCD's are still there

     

    And, thank you @lesthegrngo for this.  It did not help with my A-10C II.  I will try the tip from @MadKreator

    • Like 1
×
×
  • Create New...