Difference between revisions of "Script - Flashy Deaths (new)"

From FreeSpace Wiki
Jump to: navigation, search
m (short description for the second cfg file)
m (header)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Function==
+
New version of the flashy deaths effect by [[User:Wanderer|Wanderer]]. You may wish to check out the script's [http://www.hard-light.net/forums/index.php/topic,61732.0.html thread] on [[Hard Light Productions|HLP]].
New version of the flashy deaths effect by [[User:Wanderer|Wanderer]]. You may wish to check out the script's [http://www.hard-light.net/forums/index.php/topic,61732.0.html thread] on [[HLP]].
 
  
 
Please note that this script requires two additional files in .cfg format whose specs can be found below.
 
Please note that this script requires two additional files in .cfg format whose specs can be found below.
 +
 +
<font color=red>NOTE THAT .CFG FILES GO TO DATA/CONFIG DIRECTORY</font>
  
 
==Table Entry==
 
==Table Entry==
We'll call this deto-sct.tbm
+
We'll call this '''deto-sct.tbm''' - it needs to be placed into '''''../data/tables/''''' directory.
 
<pre>#Conditional Hooks
 
<pre>#Conditional Hooks
 
+
 
$Application: FS2_Open
 
$Application: FS2_Open
 
$On Mission Start:
 
$On Mission Start:
 
+
 
[
 
[
 
+
---------------
+
----------------------
-- functions --
+
-- parser functions --
---------------
+
----------------------
 
+
 
--- get newline and make sure its lowercase
 
--- get newline and make sure its lowercase
 
function get_next_line(nfile)
 
function get_next_line(nfile)
Line 27: Line 28:
 
   return nline
 
   return nline
 
end
 
end
 
+
 
--- find keyword and return the place where it ends
 
--- find keyword and return the place where it ends
 
function find_keyword(line_to_parse, keyword)
 
function find_keyword(line_to_parse, keyword)
 
   -- find any instances of the keyword
 
   -- find any instances of the keyword
 
   keyword = keyword:lower()
 
   keyword = keyword:lower()
   key_s, key_e = line_to_parse:find(keyword)
+
   local key_s, key_e = line_to_parse:find(keyword)
 
+
 
   -- if we cant find a thing
 
   -- if we cant find a thing
 
   if key_s == nil then
 
   if key_s == nil then
 
       return nil
 
       return nil
 
   end
 
   end
 +
 +
  -- check if the line has been commented away
 +
  local comment_s, comment_e = line_to_parse:find("--")
 +
 +
  if comment_s == nil then
 +
      return key_e
 +
  elseif comment_s < key_s then
 +
        return nil
 +
  end
 +
 
   return key_e
 
   return key_e
 
end
 
end
 
+
 
--- function to initialize the vars
 
--- function to initialize the vars
 
function init_entry(name)
 
function init_entry(name)
   arrayShipW[name] = 0
+
   arr_SD_rad[name] = 1
   arrayShipH[name] = 0
+
  arr_SD_eff[name] = { }
   arrayShipL[name] = 0
+
   arr_SD_m[name] = 1
   arrayShipDetRadius[name] = 0
+
   arr_SF_rad[name] = 1
   arrayShipDetEffects[name] = { }
+
   arr_SF_eff[name] = 0
   arrayShipDetMult[name] = 1
+
   arr_SB_int[name] = 0
   arrayShipFlsRadius[name] = 0
+
   arr_SB_dur[name] = 0
   arrayShipFlsEffect[name] = 0
+
   arr_SB_time[name] = 0
 +
   arr_SB_dist[name] = 1
 
end
 
end
 
+
 
--- specific parsing funcs to make things easier to read ---
 
--- specific parsing funcs to make things easier to read ---
 
--- string or rather substring parser
 
--- string or rather substring parser
Line 62: Line 74:
 
   return substring
 
   return substring
 
end
 
end
 
+
 
--- function to parse numbers
 
--- function to parse numbers
 
function parse_number(start_key, line_to_parse)
 
function parse_number(start_key, line_to_parse)
   result = line_to_parse:match("%d+", e_key)
+
   local result = line_to_parse:sub(start_key)
   return tonumber(result)
+
  local r_value = result:match('[0-9%.]+')
 +
   r_value = tonumber(r_value)
 +
  return r_value
 
end
 
end
 
+
 
--- function to parse arrays of numbers
 
--- function to parse arrays of numbers
 
function parse_number_array(start_key, line_to_parse)
 
function parse_number_array(start_key, line_to_parse)
 
   -- stuff the array
 
   -- stuff the array
 
   local r = { }
 
   local r = { }
   for p in line_to_parse:gmatch("%d+") do
+
  local p
 +
   for p in line_to_parse:gmatch('[0-9%.]+') do
 
       p = tonumber(p)
 
       p = tonumber(p)
 
       p = math.floor(p)
 
       p = math.floor(p)
Line 80: Line 95:
 
   return r
 
   return r
 
end
 
end
 
+
 
--- function to parse things
 
--- function to parse things
 
function parse_entry(keyword, flashfile, type, use_same_line)
 
function parse_entry(keyword, flashfile, type, use_same_line)
Line 95: Line 110:
 
       while c_line:len() == 0 do
 
       while c_line:len() == 0 do
 
         c_line = get_next_line(flashfile)
 
         c_line = get_next_line(flashfile)
 +
        if c_line == nil then
 +
            -- end of file
 +
            return -2, false, return_array
 +
        end
 
       end
 
       end
 
       new_entry = find_keyword(c_line, "Name:")
 
       new_entry = find_keyword(c_line, "Name:")
 +
      current_start_line = c_line
 
   else
 
   else
 
       c_line = use_same_line
 
       c_line = use_same_line
 
   end
 
   end
 
+
 
   -- check if we found a new entry
 
   -- check if we found a new entry
 
   if new_entry == nil then
 
   if new_entry == nil then
       c_key = find_keyword(c_line, keyword)
+
       local c_key = find_keyword(c_line, keyword)
 
       if c_key == nil then
 
       if c_key == nil then
 
         -- we didn't find the thing...
 
         -- we didn't find the thing...
Line 123: Line 143:
 
   end
 
   end
 
end
 
end
 
+
 
-----------------------------------------------
 
-----------------------------------------------
 
-- loading the flash animations
 
-- loading the flash animations
Line 130: Line 150:
 
   while something_to_parse == true do
 
   while something_to_parse == true do
 
       local c_line = get_next_line(n_file)
 
       local c_line = get_next_line(n_file)
 
+
 
       -- if we are at end of file, stop the loop
 
       -- if we are at end of file, stop the loop
 
       if c_line == nil then
 
       if c_line == nil then
Line 136: Line 156:
 
         break
 
         break
 
       end
 
       end
 
+
 
       local entry_start = find_keyword(c_line, "Filename:")
 
       local entry_start = find_keyword(c_line, "Filename:")
 
+
 
       -- if we found something else, try next line
 
       -- if we found something else, try next line
 
       if entry_start ~= nil then
 
       if entry_start ~= nil then
 
         -- ok... so we should have a good entry candidate and all that
 
         -- ok... so we should have a good entry candidate and all that
 
         local current_entry = parse_string(entry_start, c_line)
 
         local current_entry = parse_string(entry_start, c_line)
         animation = gr.loadTexture(current_entry, true)
+
         local animation = gr.loadTexture(current_entry, true)
         table.insert(arrayDetEffects, animation)
+
         table.insert(arr_D_eff, animation)
 
         if animation:isValid() == false then
 
         if animation:isValid() == false then
 
             ba.warning("Animation defined in " .. filename_flashani .. " " .. current_entry .. " is invalid")
 
             ba.warning("Animation defined in " .. filename_flashani .. " " .. current_entry .. " is invalid")
Line 151: Line 171:
 
   end
 
   end
 
end
 
end
 
+
 
-- actual flash effect parsing function
 
-- actual flash effect parsing function
 
function parse_flash_file(flashfile)
 
function parse_flash_file(flashfile)
Line 171: Line 191:
 
       else
 
       else
 
         entry_start = find_keyword(use_same_line, "Name:")
 
         entry_start = find_keyword(use_same_line, "Name:")
 +
        current_start_line = use_same_line
 
         if entry_start ~= nil then
 
         if entry_start ~= nil then
 +
            local not_new_entry = false
 
             -- insert while loop here to enable breaks as next statements
 
             -- insert while loop here to enable breaks as next statements
 
             while entry_start ~= nil do
 
             while entry_start ~= nil do
               current_entry = parse_string(entry_start, use_same_line)
+
               if not_new_entry == false then
              -- init the entry
+
                  current_entry = parse_string(entry_start, use_same_line)
              init_entry(current_entry)
+
                  -- init the entry
              use_same_line = false
+
                  init_entry(current_entry)
 +
                  use_same_line = false
 +
                  ba.print("\nClass: " .. current_entry .. "\n")
 +
              end
 +
 
               local temp_val = nil
 
               local temp_val = nil
 
               local temp_arr = nil
 
               local temp_arr = nil
 
               entry_start = nil
 
               entry_start = nil
 
+
              -- detonation box width
 
              temp_val, use_same_line = parse_entry("Width:", flashfile, "n", use_same_line)
 
              if temp_val == -2 then
 
                  break
 
              else
 
                  arrayShipW[current_entry] = temp_val
 
              end
 
 
 
              -- detonation box height
 
              temp_val, use_same_line = parse_entry("Height:", flashfile, "n", use_same_line)
 
              if temp_val == -2 then
 
                  break
 
              else
 
                  arrayShipH[current_entry] = temp_val
 
              end
 
 
 
              -- detonation box lenght
 
              temp_val, use_same_line = parse_entry("Length:", flashfile, "n", use_same_line)
 
              if temp_val == -2 then
 
                  break
 
              else
 
                  arrayShipL[current_entry] = temp_val
 
              end
 
 
 
 
               -- detonation radius
 
               -- detonation radius
               temp_val, use_same_line = parse_entry("Detonation Radius:", flashfile, "n", use_same_line)
+
               temp_val, use_same_line = parse_entry("Detonation Radius Multiplier:", flashfile, "n", use_same_line)
 
               if temp_val == -2 then
 
               if temp_val == -2 then
 
                   break
 
                   break
               else
+
               elseif temp_val ~= -1 then
                   arrayShipDetRadius[current_entry] = temp_val
+
                   ba.print("DRM: " .. temp_val .. "\n")
 +
                  arr_SD_rad[current_entry] = temp_val
 
               end
 
               end
 +
 
               -- random detonation effects
 
               -- random detonation effects
 
               local temp_arr = {}
 
               local temp_arr = {}
Line 218: Line 222:
 
               if temp_val == -2 then
 
               if temp_val == -2 then
 
                   break
 
                   break
               else
+
               elseif temp_val ~= -1 then
                   arrayShipDetEffects[current_entry] = temp_arr
+
                   ba.print("DE: " .. temp_val .. "\n")
 +
                  arr_SD_eff[current_entry] = temp_arr
 
               end
 
               end
 
+
 
               -- multiplier for the detonation occurrance
 
               -- multiplier for the detonation occurrance
 
               temp_val, use_same_line = parse_entry("Detonation Multiplier:", flashfile, "n", use_same_line)
 
               temp_val, use_same_line = parse_entry("Detonation Multiplier:", flashfile, "n", use_same_line)
 
               if temp_val == -2 then
 
               if temp_val == -2 then
 
                   break
 
                   break
               else
+
               elseif temp_val ~= -1 then
                   arrayShipDetMult[current_entry] = temp_val
+
                   ba.print("DM: " .. temp_val .. "\n")
 +
                  arr_SD_m[current_entry] = temp_val
 
               end
 
               end
 
+
 
               -- final flash radius
 
               -- final flash radius
               temp_val, use_same_line = parse_entry("Flash Radius:", flashfile, "n", use_same_line)
+
               temp_val, use_same_line = parse_entry("Flash Radius Multiplier:", flashfile, "n", use_same_line)
 
               if temp_val == -2 then
 
               if temp_val == -2 then
 
                   break
 
                   break
               else
+
               elseif temp_val ~= -1 then
                   arrayShipFlsRadius[current_entry] = temp_val
+
                   ba.print("FRM: " .. temp_val .. "\n")
 +
                  arr_SF_rad[current_entry] = temp_val
 
               end
 
               end
 
+
 
               -- flash effect
 
               -- flash effect
 
               temp_val, use_same_line = parse_entry("Flash Effect:", flashfile, "n", use_same_line)
 
               temp_val, use_same_line = parse_entry("Flash Effect:", flashfile, "n", use_same_line)
 
               if temp_val == -2 then
 
               if temp_val == -2 then
 
                   break
 
                   break
               else
+
               elseif temp_val ~= -1 then
 +
                  ba.print("FE: " .. temp_val .. "\n")
 
                   math.floor(temp_val)
 
                   math.floor(temp_val)
                   arrayShipFlsEffect[current_entry] = temp_val
+
                   arr_SF_eff[current_entry] = temp_val
 +
              end
 +
 +
              -- blinding effect
 +
              temp_val, use_same_line = parse_entry("Blinding Effect Intensity:", flashfile, "n", use_same_line)
 +
              if temp_val == -2 then
 +
                  break
 +
              elseif temp_val ~= -1 then
 +
                  ba.print("BE: " .. temp_val .. "\n")
 +
                  temp_val = temp_val + "0"
 +
                  if temp_val < 0 then
 +
                    temp_val = 0
 +
                  elseif temp_val > 100 then
 +
                    temp_val = 100
 +
                  end
 +
                  arr_SB_int[current_entry] = temp_val
 +
              end
 +
 +
              -- blinding duration
 +
              temp_val, use_same_line = parse_entry("Blinding Effect Duration:", flashfile, "n", use_same_line)
 +
              if temp_val == -2 then
 +
                  break
 +
              elseif temp_val ~= -1 then
 +
                  ba.print("BEDu: " .. temp_val .. "\n")
 +
                  arr_SB_dur[current_entry] = temp_val
 +
              end
 +
 +
              -- blast effect delay
 +
              temp_val, use_same_line = parse_entry("Blast Effect Delay:", flashfile, "n", use_same_line)
 +
              if temp_val == -2 then
 +
                  break
 +
              elseif temp_val ~= -1 then
 +
                  ba.print("BEDe: " .. temp_val .. "\n")
 +
                  arr_SB_time[current_entry] = temp_val
 +
              end
 +
 +
              -- blast effect delay
 +
              temp_val, use_same_line = parse_entry("Blinding Effect Distance Multiplier:", flashfile, "n", use_same_line)
 +
              if temp_val == -2 then
 +
                  break
 +
              elseif temp_val ~= -1 then
 +
                  ba.print("BEDM: " .. temp_val .. "\n")
 +
                  arr_SB_dist[current_entry] = temp_val
 +
              end
 +
 +
              if current_start_line == use_same_line then
 +
                  use_same_line = get_next_line(flashfile)
 +
                  local temp_string = find_keyword(use_same_line, "Name:")
 +
                  if temp_string == nil then
 +
                    current_start_line = use_same_line
 +
                    entry_start = use_same_line
 +
                  else
 +
                    entry_start = nil
 +
                  end
 +
 +
                  not_new_entry = true
 
               end
 
               end
 
             end
 
             end
Line 253: Line 316:
 
   end
 
   end
 
end
 
end
 
+
 
----------
 
----------
 
-- main --
 
-- main --
 
----------
 
----------
 
+
 
-- init arrays
 
-- init arrays
 
arrayShipName = {}
 
arrayShipName = {}
arrayShipW = {}
+
arr_SD_rad = {}
arrayShipH = {}
+
arr_SD_eff = {}
arrayShipL = {}
+
arr_SD_m = {}
arrayShipDetRadius = {}
+
arr_SF_rad = {}
arrayShipDetEffects = {}
+
arr_SF_eff = {}
arrayShipDetMult = {}
+
arr_SB_int = {}
arrayShipFlsRadius = {}
+
arr_SB_dur = {}
arrayShipFlsEffect = {}
+
arr_SB_time = {}
arrayDetEffects = {}
+
arr_SB_dist = {}
 
+
arr_D_eff = {}
 +
 
-- open reference file, if any
 
-- open reference file, if any
 
-- if failed... pass the script
 
-- if failed... pass the script
filename_flash = "expl_flashes.cfg"
+
filename_flash = "exp_flashes.cfg"
 
filename_flashani = "exp_ani_flashes.cfg"
 
filename_flashani = "exp_ani_flashes.cfg"
if ((cf.fileExists(filename_flash, "data/tables/", false) == true) and (cf.fileExists(filename_flashani, "data/tables/", false) == true)) then
+
if ((cf.fileExists(filename_flash, "data/config/", true) == true) and (cf.fileExists(filename_flashani, "data/config/", true) == true)) then
 
   boolflashfileOK = true
 
   boolflashfileOK = true
 
end
 
end
 
+
 
if boolflashfileOK then
 
if boolflashfileOK then
 
   -- open to read the contents
 
   -- open to read the contents
   flashanifile = cf.openFile(filename_flashani, "r", "data/tables/")
+
   flashanifile = cf.openFile(filename_flashani, "r")
 
   -- parse contents
 
   -- parse contents
 
   parse_flash_ani_file(flashanifile)
 
   parse_flash_ani_file(flashanifile)
 
   -- close the file
 
   -- close the file
 
   flashanifile:close()
 
   flashanifile:close()
 
+
 
   -- continue with the rest in similar manner
 
   -- continue with the rest in similar manner
   flashfile = cf.openFile(filename_flash, "r", "data/tables/")
+
   flashfile = cf.openFile(filename_flash, "r")
 
   parse_flash_file(flashfile)
 
   parse_flash_file(flashfile)
 
   flashfile:close()
 
   flashfile:close()
 
+
 
   -- setup rest of the required stuff
 
   -- setup rest of the required stuff
 
   math.randomseed( os.time() )
 
   math.randomseed( os.time() )
   floatCounter = {}
+
   f_counter = {}
   vectorNull = ba.createVector(0,0,0)
+
   v_null = ba.createVector(0,0,0)
   arrayFlashShipList = {}
+
   v_temp = ba.createVector(0,0,0)
   arrayFlashShips = {}
+
  v_rnd_sphere = ba.createVector(0,0,0)
   arrayFlashShipClass = {}
+
  arr_FS_List = {}
   arrayFlashShipPosition = {}
+
   arr_FS = {}
   arrayFlashedShips = {}
+
   arr_FS_Class = {}
 +
   arr_FS_Pos = {}
 +
   arr_FS_done = {}
 +
  arr_FS_time = {}
 +
  bl_int = 0
 +
  bl_end = 0
 +
  bl_max = 0
 +
  bl_start = 0
 +
  bl_int_init = 0
 
else
 
else
 
   ba.warning("Failed to initialize flashy deaths script")
 
   ba.warning("Failed to initialize flashy deaths script")
 
end
 
end
 
+
 +
----------------------------------
 +
-- functions for later sections --
 +
----------------------------------
 +
 +
function blinding_effect(intensity, duration, time)
 +
  bl_int_init = bl_int
 +
 +
  if (intensity < bl_max) then
 +
      if intensity > bl_int then
 +
        local effect_time = bl_end - bl_start
 +
        local delta_time = time - bl_start
 +
 +
        if effect_time == 0 then
 +
            bl_max = intensity
 +
            bl_start = time
 +
            bl_end = time + (duration / 1000)
 +
        else
 +
            local pct_time = (effect_time - delta_time) / effect_time
 +
            if pct_time < 0.85 then
 +
              bl_max = intensity
 +
              bl_start = time
 +
              bl_end = time + (duration / 1000)
 +
            end
 +
        end
 +
      end
 +
  else
 +
      bl_max = intensity
 +
      bl_start = time
 +
      bl_end = time + (duration / 1000)
 +
  end
 +
end
 +
 +
function process_blinding_effect_frame(time)
 +
  if bl_max == 0 then
 +
      return
 +
  end
 +
 +
  local effect_time = bl_end - bl_start
 +
  local delta_time = time - bl_start
 +
  local pct_time = (effect_time - delta_time) / effect_time
 +
  local case_time
 +
 +
  -- lets go case by case
 +
  if pct_time < 0.0 then
 +
      -- effect has faded away
 +
      bl_int = 0
 +
      bl_max = 0
 +
      blindint_intensity_start = 0
 +
  elseif pct_time < 0.85 then
 +
      -- effect is still fading away
 +
      case_time = 1 - (pct_time / 0.85)
 +
      bl_int = bl_max * math.pow(((1 + math.cos(case_time * math.pi))/2),3)
 +
  elseif pct_time > 0.90 then
 +
      -- effect is still getting stronger
 +
      if pct_time == 0 then
 +
        case_time = -1
 +
      else
 +
        case_time = -1 * ((pct_time - 0.9) / 0.1)
 +
      end
 +
      bl_int = math.pow(((1 + math.cos(case_time * math.pi))/2),2) * (bl_max - bl_int_init) + bl_int_init
 +
  else
 +
      bl_int = bl_max
 +
  end
 +
 +
  if bl_int ~= 0 then
 +
      a = bl_int * 255
 +
      gr.flashScreen(a,a,a)
 +
  end
 +
end
 +
 +
function do_death_flash(name, number)
 +
 +
  -- death flash explosion
 +
  arr_FS_List[name] = 2
 +
  local v_F_pos = arr_FS_Pos[name]
 +
  arr_FS_Pos[name] = nil
 +
  local str_F_class = arr_FS_Class[name]
 +
  arr_FS_Class[name] = nil
 +
  local l_f_model_r = tb.ShipClasses[str_F_class].Model.Radius
 +
  local n_F_rad = 1.5 * (math.random() + 0.5) * l_f_model_r * arr_SF_rad[str_F_class]
 +
  local l_anim_flash = arr_D_eff[arr_SF_eff[str_F_class]]
 +
  if l_anim_flash:isValid() then
 +
      ts.createParticle(v_F_pos,v_null,f_F_time,n_F_rad,PARTICLE_BITMAP,-1,false,l_anim_flash)
 +
  end
 +
 +
  -- death flash blinding effect
 +
  if arr_SB_int[str_F_class] > 0 then
 +
      local coord_x
 +
      local coord_y
 +
      coord_x, coord_y = v_F_pos:getScreenCoords()
 +
 +
      if coord_x ~= false then
 +
        local l_f_dist_mult = 1
 +
        local l_player = hv.Player
 +
        if l_player:isValid() then
 +
            local l_v_plr_pos = l_player.Position
 +
            local l_n_distace_fls_plr = v_F_pos:getDistance(l_v_plr_pos)
 +
            local l_n_max_fls_distance = 2 * l_f_model_r * arr_SB_dist[str_F_class]
 +
            if l_n_distace_fls_plr > l_n_max_fls_distance then
 +
              local l_n_exp_dist_mult = l_n_distace_fls_plr / l_n_max_fls_distance
 +
              l_f_dist_mult = 1 / math.pow(l_n_exp_dist_mult, 2)
 +
            end
 +
            blinding_effect(arr_SB_int[str_F_class] * l_f_dist_mult, arr_SB_dur[str_F_class], f_M_time)
 +
        end
 +
      end
 +
  end
 +
 +
  -- purge from the list
 +
  table.insert(arr_FS_done, number)
 +
end
 +
 +
function check_flash(name)
 +
  local class = arr_FS_Class[name]
 +
  if arr_SB_time[class] > 0 then
 +
      if arr_FS_time[name] <= f_M_time then
 +
        return true;
 +
      end
 +
  end
 +
 +
  return false;
 +
end
 +
 +
function add_to_flash_list(name, class)
 +
  arr_FS_List[name] = 1
 +
  arr_FS_Class[name] = class
 +
  if arr_SB_time[class] > 0 then
 +
      local temp_time = math.random() + 1
 +
      arr_FS_time[name] = arr_SB_time[class] * temp_time / 1000 + f_M_time
 +
  end
 +
  table.insert(arr_FS,name)
 +
end
 +
 +
function get_rnd_vector_sphere()
 +
  local l_bool_ok_to_pass = false
 +
  local l_get_rnd = math.random
 +
 +
  while (l_bool_ok_to_pass == false) do
 +
 +
      -- get random vector (cube, -1 to 1)
 +
      v_rnd_sphere[1] = (2* (l_get_rnd() - 0.5))
 +
      v_rnd_sphere[2] = (2* (l_get_rnd() - 0.5))
 +
      v_rnd_sphere[3] = (2* (l_get_rnd() - 0.5))
 +
      local l_n_mag = v_rnd_sphere:getMagnitude()
 +
 +
      -- accept only values within a sphere (uniform)
 +
      if l_n_mag <= 1 then
 +
        v_rnd_sphere = v_rnd_sphere / l_n_mag
 +
        l_bool_ok_to_pass = true
 +
      end
 +
  end
 +
  return v_rnd_sphere;
 +
end
 +
 +
function get_ray_collision_pos(ship, v_ray, num_tries)
 +
  local l_or_ship = ship.Orientation
 +
  local l_m_model = ship.Class.Model
 +
  local l_f_radius = 30000
 +
  local l_v_pos_mod = v_null
 +
  local l_n_has_tried = 0
 +
  local l_c_ray_pos
 +
  local l_get_rnd = math.random
 +
 +
  while (l_n_has_tried < num_tries) do
 +
      if l_m_model:isValid() then
 +
        l_f_radius = l_m_model.Radius
 +
        for i=1,3 do
 +
            local l_rnd = (2* (l_get_rnd() - 0.5))
 +
              if l_rnd >= 0 then
 +
                  v_temp[i] = l_m_model.BoundingBoxMax[i] * l_rnd
 +
              else
 +
                  v_temp[i] = l_m_model.BoundingBoxMin[i] * l_rnd * (-1)
 +
              end
 +
            end
 +
        l_v_pos_mod = l_or_ship:unrotateVector(v_temp)
 +
      else
 +
        l_v_pos_mod = v_null
 +
      end
 +
 +
      local v_ray = v_ray * l_f_radius
 +
      local l_v_end_pos = ship.Position - v_ray + l_v_pos_mod
 +
      local l_v_start_pos = ship.Position + v_ray + l_v_pos_mod
 +
 +
      l_c_ray_pos = ship:checkRayCollision(l_v_start_pos, l_v_end_pos)
 +
 +
      if l_c_ray_pos ~= nil then
 +
        l_n_has_tried = 3
 +
      else
 +
        l_n_has_tried = 1 + l_n_has_tried
 +
      end
 +
  end
 +
 +
  return l_c_ray_pos
 +
end
 +
 +
function get_number_of_explosions(attempts)
 +
  local l_n_partials
 +
  local l_n_full
 +
  l_n_full, l_n_partials = math.modf(attempts)
 +
 +
  if l_n_partials ~= 0 then
 +
      if math.random() > l_n_partials then
 +
        l_n_full = l_n_full + 1
 +
      end
 +
  end
 +
 +
  return l_n_full
 +
end
 
]
 
]
 
+
 
$State: GS_STATE_GAME_PLAY
 
$State: GS_STATE_GAME_PLAY
 
$On Frame:
 
$On Frame:
 +
 +
[
 +
 +
f_M_time = mn.getMissionTime()
 +
 +
if ((f_M_time ~= nil) and boolflashfileOK) then
 +
 +
  f_F_time = ba.getFrametime(true)
 +
 +
  f_rnd = math.random()
 +
  n_ships = #mn.Ships
 +
 +
  for h = 1, n_ships do
 +
      o_ship = mn.Ships[h]
 +
      str_S_class = o_ship.Class.Name:lower()
 +
 +
      --ONLY SHIPS WITH EFFECTS--
 +
 +
      if ((arr_SF_rad[str_S_class] ~= nil) and (arr_SD_rad[str_S_class] ~= nil)) then
 +
        str_S_name = o_ship.Name
 +
        floatHP = o_ship.HitpointsLeft
 +
 +
        if floatHP <= 0 then
 +
 +
            v_S_pos = o_ship.Position
 +
 +
            if arr_SF_rad[str_S_class] > 0 then
 +
              if arr_FS_List[str_S_name] == nil then
 +
                  add_to_flash_list(str_S_name, str_S_class)
 +
              end
 +
            end
 +
 +
            if arr_SD_rad[str_S_class] > 0 then
 +
              arr_FS_Pos[str_S_name] = v_S_pos
 +
 +
              if f_counter[str_S_name] == nil then
 +
                  f_counter[str_S_name] = 0
 +
 +
              end
 +
 +
              f_rnd = math.random()
 +
              local l_n_SD_eff = #arr_SD_eff[str_S_class]
 +
 +
              while f_counter[str_S_name] > f_rnd do
 +
                  f_counter[str_S_name] = f_counter[str_S_name] - f_rnd
 +
                  local n_attempts = get_number_of_explosions(arr_SD_m[str_S_class])
 +
 +
                  for n = 1,n_attempts do
 +
                    local l_bool_ok_to_pass = false
 +
 +
                    local l_v_rnd = get_rnd_vector_sphere()
 +
 +
                    local l_c_pos = get_ray_collision_pos(o_ship, l_v_rnd, 3)
 +
 +
                    -- check if the ray actually hit anything even after three tries
 +
                    if l_c_pos ~= nil then
 +
                        local l_m_model = o_ship.Class.Model
 +
                        local l_f_det_r = (2* math.random() + 0.5) * l_m_model.Radius * arr_SD_rad[str_S_class] * 0.1
 +
                        local l_arr_SD_eff = arr_SD_eff[str_S_class]
 +
                        if l_n_SD_eff == 1 then
 +
                          local l_anim_det = arr_D_eff[l_arr_SD_eff[1]]
 +
                          if l_anim_det:isValid() then
 +
                              ts.createParticle(l_c_pos,v_null,f_F_time,l_f_det_r,PARTICLE_BITMAP,-1,false,l_anim_det)
 +
                          end
 +
                        elseif l_n_SD_eff > 1 then
 +
                          local l_n_rnd_id = math.random(l_n_SD_eff)
 +
                          local l_anim_det = arr_D_eff[l_arr_SD_eff[l_n_rnd_id]]
 +
                          if l_anim_det:isValid() then
 +
                              ts.createParticle(l_c_pos,v_null,f_F_time,l_f_det_r,PARTICLE_BITMAP,-1,false,l_anim_det)
 +
                          end
 +
                        end
 +
                    end
 +
                  end
 +
 +
                  if f_counter[str_S_name] <= 0 then
 +
                    f_counter[str_S_name] = 0
 +
                  else
 +
                    f_rnd = math.random()
 +
                  end
 +
 +
              end
 +
 +
              f_counter[str_S_name] = f_counter[str_S_name] + f_F_time
 +
            end
 +
 +
        end
 +
 +
      end
 +
 +
      n_FS = #arr_FS
 +
 +
      for x=1,n_FS do
 +
        name = arr_FS[x]
 +
 +
        if arr_FS_List[name] == 1 then
 +
 +
            if mn.Ships[name]:isValid() then
 +
              if mn.Ships[name]:hasShipExploded() == 2 then
 +
                  do_death_flash(name, x)
 +
              else
 +
                  -- randomized flash explosion
 +
                  if check_flash(name) == true then
 +
                    do_death_flash(name, x)
 +
                  end
 +
              end
 +
            end
 +
 +
        end
 +
 +
      end
 +
 +
      n_FS_done = #arr_FS_done
 +
      if n_FS_done > 0 then
 +
 +
        for o=n_FS_done,1,-1 do
 +
            table.remove(arr_FS,arr_FS_done[o])
 +
 +
        end
 +
 +
        arr_FS_done = nil
 +
        arr_FS_done = {}
 +
 +
      end
 +
 +
  end
 +
 +
  process_blinding_effect_frame(f_M_time)
 +
 +
end
 +
 +
]
 +
 +
$Application: FS2_Open
 +
$On Mission End:
 +
 +
[
 +
 +
-- kill the arrays...
 +
if boolflashfileOK then
 +
  arrayShipName = nil
 +
  arr_SD_rad = nil
 +
  arr_SD_eff = nil
 +
  arr_SF_rad = nil
 +
  arr_SF_eff = nil
 +
  arr_SB_int = nil
 +
  arr_SB_dur = nil
 +
  arr_SB_time = nil
 +
  local n_effects = #arr_D_eff
 +
  for j=1,n_effects do
 +
      arr_D_eff[j]:unload()
 +
  end
 +
  arr_D_eff = nil
 +
 +
  f_counter = nil
 +
  arr_FS_List = nil
 +
  arr_FS = nil
 +
  arr_FS_Class = nil
 +
  arr_FS_Pos = nil
 +
  arr_FS_done = nil
 +
  arr_FS_time = nil
 +
 +
  boolflashfileOK = nil
 +
end
 +
 +
]
 +
 +
#End</pre>
 +
 +
==expl_flashes.cfg==
 +
This file needs to be placed into '''''../data/config/''''' directory.
 +
 +
Please note that the following list isn't complete yet.
 +
 +
*'''Name:''' defines the ship for which this entry is made for
 +
*'''Detonation Radius Multiplier:''' defines the multiplier applied for the radius (base radius) of the detonation effects
 +
*'''Detonation Effects:''' list of ID values of the effects (defined in the other cfg file), may have multiple ones
 +
*'''Detonation Multiplier:''' multiplier which controls the amount of explosions triggered. 0.2 is 80% decrease, 1.2 is 20% increase
 +
*'''Flash Radius Multiplier:''' defines the multiplier applied to the radius of the flash when ship actually goes away
 +
*'''Flash Effect:''' ID values of the flash effect, as listed in line order entry in additional cfg
 +
*'''Blinding Effect Intensity:''' value from 0 to 100, sets the intensity of the blinding effect - requires flash effect to be defined
 +
*'''Blinding Effect Duration:''' sets the duration of the blinding effect in milliseconds
 +
*'''Blast Effect Delay:''' sets the base time for flash & blinding effect to appear in milliseconds
 +
*'''Blinding Effect Distance Multiplier:''' defines the multiplier applied to the blinding effect attenuation distances
 +
 +
Table allows for lines to be commented using '--' as comment marker
 +
 +
<pre>Name:          GTF Ulysses
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Hercules
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Hercules Mark II
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Ares
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Erinyes
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Loki
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Pegasus
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Perseus
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          GTF Myrmidon
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 +
Name:          SF Mara (terrans)
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
[
+
Name:          GTB Artemis
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTB Artemis D.H.
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTB Medusa
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTB Ursa
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTB Zeus
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTB Boanerges
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTDR Amazon
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
 +
 
 +
Name:          GTDR Amazon Advanced
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.25
 +
Blinding Effect Duration:    2500
 +
 
 +
Name:          GTS Hygeia
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTFR Triton
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
 +
 
 +
Name:          TC-TRI
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
 +
 
 +
Name:          GTFR Poseidon
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          TC 2
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          TSC 2
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          TAC 1
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          TTC 1
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
 +
 
 +
Name:          GTC Fenris
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
 +
 
 +
Name:          GTM Hippocrates
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.35
 +
Blinding Effect Duration:    3500
  
floatMissionTime = mn.getMissionTime()
+
Name:          GTC Leviathan
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
if ((floatMissionTime ~= nil) and boolflashfileOK) then
+
Name:          GTSC Faustus
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
   floatFrameTime = ba.getFrametime(true)
+
Name:          GTG Zephyrus
 +
Detonation Radius Multiplier:   0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
   floatRandom = math.random()
+
Name:          GTA Charybdis
   integerShips = #mn.Ships
+
Detonation Radius Multiplier:   0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:   0.25
 +
Blinding Effect Duration:    2500
  
   for h = 1, integerShips do
+
Name:          GTD Orion
      objectShip = mn.Ships[h]
+
Detonation Radius Multiplier:   0.5
      stringShipClass = objectShip.Class.Name:lower()
+
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:     4000
  
      --ONLY SHIPS WITH EFFECTS--
+
Name:          GTD Hecate
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:    4000
  
      if ((arrayShipFlsRadius[stringShipClass] ~= nil) and (arrayShipDetRadius[stringShipClass] ~= nil)) then
+
Name:          GTD Orion#2 (Bastion)
        stringShipName = objectShip.Name
+
Detonation Radius Multiplier:    0.5
        floatHP = objectShip.HitpointsLeft
+
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:    4000
  
         if floatHP <= 0 then
+
Name:         GTD Hades
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:    4000
  
            vectorShipPosition = objectShip.Position
+
Name:          GTI Arcadia
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:    4000
  
            if arrayShipFlsRadius[stringShipClass] > 0 then
+
Name:          GTVA Colossus
              if arrayFlashShipList[stringShipName] == nil then
+
Detonation Radius Multiplier:    0.5
                  arrayFlashShipList[stringShipName] = 1
+
Detonation Effects:        2, 3
                  arrayFlashShipClass[stringShipName] = stringShipClass
+
Detonation Multiplier:        2.0
                  table.insert(arrayFlashShips,stringShipName)
+
Flash Radius Multiplier:      1.0
              end
+
Flash Effect:              1
            end
+
Blinding Effect Intensity:    0.45
 +
Blinding Effect Duration:    4500
  
            if arrayShipDetRadius[stringShipClass] > 0 then
+
Name:          GTCv Deimos
              arrayFlashShipPosition[stringShipName] = vectorShipPosition
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.35
 +
Blinding Effect Duration:    3500
  
              if floatCounter[stringShipName] == nil then
+
Name:          GTC Aeolus
                  floatCounter[stringShipName] = 0
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
              end
+
Name:          NTF Iceni
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.35
 +
Blinding Effect Duration:    3500
  
              floatRandom = math.random()
+
Name:          NTF Boadicea
              local n_ShpDetEffects = #arrayShipDetEffects[stringShipClass]
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.35
 +
Blinding Effect Duration:    3500
  
              while floatCounter[stringShipName] > floatRandom do
+
Name:          GTT Elysium
                  floatCounter[stringShipName] = floatCounter[stringShipName] - floatRandom
+
Detonation Radius Multiplier:    0.5
                  orientationShip = objectShip.Orientation
+
Detonation Effects:        2, 3
                  local number_of_attempts = arrayShipDetMult[stringShipClass]
+
Detonation Multiplier:        2.0
                  local n_partials
+
Flash Radius Multiplier:      1.0
                  number_of_attempts, n_partials = math.modf(number_of_attempts)
+
Flash Effect:             1
                  if n_partials ~= 0 then
+
Blinding Effect Intensity:   0.15
                    if math.random() > n_partials then
+
Blinding Effect Duration:     1500
                        number_of_attempts = number_of_attempts + 1
 
                    end
 
                  end
 
                  for n = 1,number_of_attempts do
 
                    local floatRand_1 = (math.random() - 0.5) * arrayShipW[stringShipClass]
 
                    local floatRand_2 = (math.random() - 0.5) * arrayShipH[stringShipClass]
 
                    local floatRand_3 = (math.random() - 0.5) * arrayShipL[stringShipClass]
 
                    local vectorRand = ba.createVector(floatRand_1,floatRand_2,floatRand_3)
 
                    local floatDetoSize = (math.random() + 0.5) * arrayShipDetRadius[stringShipClass]
 
                    local vectorOrientedRand = orientationShip:unrotateVector(vectorRand)
 
                    local vectorDetoPosition = vectorShipPosition + vectorOrientedRand
 
                    local l_arrayShpDetEffects = arrayShipDetEffects[stringShipClass]
 
                    if n_ShpDetEffects == 1 then
 
                        animationDet = l_arrayShpDetEffects[1]
 
                        if animationDet:isValid() then
 
                          ts.createParticle(vectorDetoPosition,vectorNull,floatFrameTime,floatDetoSize,PARTICLE_BITMAP,-1,false,animationDet)
 
                        end
 
                    elseif n_ShpDetEffects > 1 then
 
                        numberRandomID = math.random(n_ShpDetEffects)
 
                        animationDet = arrayDetEffects[l_arrayShpDetEffects[numberRandomID]]
 
                        if animationDet:isValid() then
 
                          ts.createParticle(vectorDetoPosition,vectorNull,floatFrameTime,floatDetoSize,PARTICLE_BITMAP,-1,false,animationDet)
 
                        end
 
                    end
 
                  end
 
  
                  if floatCounter[stringShipName] <= 0 then
+
Name:          GTT Argo
                    floatCounter[stringShipName] = 0
+
Detonation Radius Multiplier:    0.5
                  else
+
Detonation Effects:        2, 3
                    floatRandom = math.random()
+
Detonation Multiplier:        2.0
                  end
+
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.25
 +
Blinding Effect Duration:    2500
  
              end
+
Name:          GTI Ganymede
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.40
 +
Blinding Effect Duration:    4000
  
              floatCounter[stringShipName] = floatCounter[stringShipName] + floatFrameTime
+
Name:          Knossos
            end
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.45
 +
Blinding Effect Duration:    4500
  
         end
+
Name:         GTSG Watchdog
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    5
 +
Blinding Effect Duration:    500
  
      end
+
Name:          GTSG Cerberus
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    5
 +
Blinding Effect Duration:    500
  
      floatFlashShips = #arrayFlashShips
+
Name:          GTSG Alastor
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    5
 +
Blinding Effect Duration:    500
  
      for x=1,floatFlashShips do
+
Name:          GTEP Hermes
      stringFlashShipName = arrayFlashShips[x]
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    5
 +
Blinding Effect Duration:    500
  
         if arrayFlashShipList[stringFlashShipName] == 1 then
+
Name:         TC-Meson Bomb
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
            if mn.Ships[stringFlashShipName]:isValid() == false then
+
Name:         GTSG Mjolnir
              arrayFlashShipList[stringFlashShipName] = nil
+
Detonation Radius Multiplier:    0.5
              local vectorFlashPosition = arrayFlashShipPosition[stringFlashShipName]
+
Detonation Effects:        2, 3
              arrayFlashShipPosition[stringFlashShipName] = nil
+
Detonation Multiplier:       2.0
              local stringFlashClass = arrayFlashShipClass[stringFlashShipName]
+
Flash Radius Multiplier:      1.0
              arrayFlashShipClass[stringFlashShipName] = nil
+
Flash Effect:              1
              local floatFlashRadius = (math.random() + 0.5) * arrayShipFlsRadius[stringFlashClass]
+
Blinding Effect Intensity:    0.25
              local animationFlash = arrayDetEffects[arrayShipFlsEffect[stringFlashClass]]
+
Blinding Effect Duration:    2500
              if animationFlash:isValid() then
 
                  ts.createParticle(vectorFlashPosition,vectorNull,floatFrameTime,floatFlashRadius,PARTICLE_BITMAP,-1,false,animationFlash)
 
              end
 
              table.insert(arrayFlashedShips,x)
 
            end
 
  
         end
+
Name:         GTSG Mjolnir#home
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.25
 +
Blinding Effect Duration:    2500
  
      end
+
Name:          GVF Seth
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
      integerFlashedShips = #arrayFlashedShips
+
Name:          GVF Horus
      if integerFlashedShips > 0 then
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
         for o=integerFlashedShips,1,-1 do
+
Name:         GVF Thoth
            table.remove(arrayFlashShips,arrayFlashedShips[o])
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
         end
+
Name:         GVF Serapis
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
         arrayFlashedShips = nil
+
Name:         GVF Tauret
        arrayFlashedShips = {}
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
      end
+
Name:          GVB Sekhmet
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
   end
+
Name:          GVB Osiris
 +
Detonation Radius Multiplier:   0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
end
+
Name:          GVB Bakha
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
]
+
Name:          GVF Ptah
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
$Application: FS2_Open
+
Name:         GVS Nephthys
$On Mission End:
+
Detonation Radius Multiplier:   0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
[
+
Name:          GVT Isis
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.10
 +
Blinding Effect Duration:    1000
  
-- kill the arrays...
+
Name:          PVFR Ma'at
if boolflashfileOK then
+
Detonation Radius Multiplier:   0.5
   arrayShipName = nil
+
Detonation Effects:        2, 3
  arrayShipW = nil
+
Detonation Multiplier:        2.0
  arrayShipH = nil
+
Flash Radius Multiplier:      1.0
  arrayShipL = nil
+
Flash Effect:              1
  arrayShipDetRadius = nil
+
Blinding Effect Intensity:    0.15
  arrayShipDetEffects = nil
+
Blinding Effect Duration:    1500
  arrayShipFlsRadius = nil
 
  arrayShipFlsEffect = nil
 
  local n_effects = #arrayDetEffects
 
  for j=1,n_effects do
 
      arrayDetEffects[j]:unload()
 
   end
 
  arrayDetEffects = nil
 
  
   floatCounter = nil
+
Name:          GVFr Bes
  arrayFlashShipList = nil
+
Detonation Radius Multiplier:   0.5
  arrayFlashShips = nil
+
Detonation Effects:        2, 3
  arrayFlashShipClass = nil
+
Detonation Multiplier:        2.0
   arrayFlashShipPosition = nil
+
Flash Radius Multiplier:      1.0
  arrayFlashedShips = nil
+
Flash Effect:              1
 +
Blinding Effect Intensity:   0.15
 +
Blinding Effect Duration:    1500
  
   boolflashfileOK = nil
+
Name:          VAC 5
end
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:   0.15
 +
Blinding Effect Duration:    1500
  
]
+
Name:          VAC 4
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
#End</pre>
+
Name:          GVFr Satis
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.20
 +
Blinding Effect Duration:    2000
  
==expl_flashes.cfg==
+
Name:          GVG Anuket
Please note that the following list isn't complete yet.
+
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.30
 +
Blinding Effect Duration:    3000
  
<b>Name:</b> defines the ship for which this entry is made for<br>
+
Name:         GVC Aten
<b>Width:</b> & <b>Height:</b> & <b>Length:</b> define the dimensions inside which the detonations occur<br>
+
Detonation Radius Multiplier:   0.5
<b>Detonation Radius:</b> defines the radius (base radius) of the detonation effects<br>
+
Detonation Effects:       2, 3
<b>Detonation Effects:</b> list of ID values of the effects (defined in the other cfg file), may have multiple ones<br>
+
Detonation Multiplier:       2.0
<b>Detonation Multiplier:</b> multiplier which controls the amount of explosions triggered. 0.2 is 80% decrease, 1.2 is 20% increase<br>
+
Flash Radius Multiplier:      1.0
<b>Flash Radius:</b> defines the radius of the flash when ship actually goes away<br>
+
Flash Effect:              1
<b>Flash Effect:</b> ID values of the flash effect, as listed in line order entry in additional cfg<br>
+
Blinding Effect Intensity:   0.30
 +
Blinding Effect Duration:     3000
  
<pre>
+
Name:         GVC Mentu
==Terran==
+
Detonation Radius Multiplier:   0.5
Name: GTDr Amazon Advanced
+
Detonation Effects:       2, 3
Width: 80
+
Detonation Multiplier:        2.0
Height: 100
+
Flash Radius Multiplier:     1.0
Length: 200
+
Flash Effect:             1
Detonation Radius: 100
+
Blinding Effect Intensity:    0.30
Detonation Effects: 2, 3
+
Blinding Effect Duration:    3000
Flash Radius: 750
 
Flash Effect: 1
 
  
Name: GTFr Triton
+
Name:         GVCv Sobek
Width: 110
+
Detonation Radius Multiplier:   0.5
Height: 130
+
Detonation Effects:       2, 3
Length: 250
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 750
+
Blinding Effect Intensity:    0.35
Flash Effect: 1
+
Blinding Effect Duration:    3500
  
Name: TC-Tri
+
Name:         GVD Typhon
Width: 110
+
Detonation Radius Multiplier:   0.5
Height: 130
+
Detonation Effects:       2, 3
Length: 250
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 750
+
Blinding Effect Intensity:    0.40
Flash Effect: 1
+
Blinding Effect Duration:    4000
  
Name: GTFr Poseidon
+
Name:         GVSG Ankh
Width: 35
+
Detonation Radius Multiplier:   0.5
Height: 30
+
Detonation Effects:       2, 3
Length: 60
+
Detonation Multiplier:        2.0
Detonation Radius: 25
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 700
+
Blinding Effect Intensity:    5
Flash Effect: 1
+
Blinding Effect Duration:    500
  
Name: @GTC Fenris
+
Name:         GVSG Edjo
Width: 150
+
Detonation Radius Multiplier:   0.5
Height: 200
+
Detonation Effects:       2, 3
Length: 250
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1000
+
Blinding Effect Intensity:    5
Flash Effect: 1
+
Blinding Effect Duration:    500
  
Name: GTM Hippocrates
+
Name:         GVEP Ra
Width: 80
+
Detonation Radius Multiplier:   0.5
Height: 275
+
Detonation Effects:       2, 3
Length: 375
+
Detonation Multiplier:        2.0
Detonation Radius: 200
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1700
+
Blinding Effect Intensity:    5
Flash Effect: 1
+
Blinding Effect Duration:    500
  
Name: GTC Leviathan
+
Name:         GVA Setekh
Width: 150
+
Detonation Radius Multiplier:   0.5
Height: 200
+
Detonation Effects:       2, 3
Length: 250
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1000
+
Blinding Effect Intensity:    0.25
Flash Effect: 1
+
Blinding Effect Duration:    2500
  
Name: GTSc Faustus
+
Name:         GVD Hatshepsut
Width: 95
+
Detonation Radius Multiplier:   0.5
Height: 85
+
Detonation Effects:       2, 3
Length: 160
+
Detonation Multiplier:        2.0
Detonation Radius: 50
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 800
+
Blinding Effect Intensity:    0.40
Flash Effect: 1
+
Blinding Effect Duration:    4000
  
Name: GTG Zephyrus
+
Name:         SF Dragon
Width: 80
+
Detonation Radius Multiplier:   0.5
Height: 70
+
Detonation Effects:       2, 3
Length: 255
+
Detonation Multiplier:        2.0
Detonation Radius: 80
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 800
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTA Charbydis
+
Name:         SF Basilisk
Width: 60
+
Detonation Radius Multiplier:   0.5
Height: 90
+
Detonation Effects:       2, 3
Length: 110
+
Detonation Multiplier:        2.0
Detonation Radius: 75
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 600
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTD Orion
+
Name:         SF Manticore
Width: 500
+
Detonation Radius Multiplier:   0.5
Height: 500
+
Detonation Effects:       2, 3
Length: 1900
+
Detonation Multiplier:        2.0
Detonation Radius: 500
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 2500
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTD Hecate
+
Name:         SF Aeshma
Width: 700
+
Detonation Radius Multiplier:   0.5
Height: 500
+
Detonation Effects:       2, 3
Length: 1900
+
Detonation Multiplier:        2.0
Detonation Radius: 500
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 2500
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTD Hades
+
Name:         SF Mara
Width: 700
+
Detonation Radius Multiplier:   0.5
Height: 500
+
Detonation Effects:       2, 3
Length: 3200
+
Detonation Multiplier:        2.0
Detonation Radius: 800
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 4000
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTI Arcadia
+
Name:         SF Astaroth
Width: 1000
+
Detonation Radius Multiplier:   0.5
Height: 1200
+
Detonation Effects:       2, 3
Length: 800
+
Detonation Multiplier:        2.0
Detonation Radius: 1000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 5000
+
Blinding Effect Intensity:    0.10
Flash Effect: 1
+
Blinding Effect Duration:    1000
  
Name: GTVA Colossus
+
Name:         SB Nephilim
Width: 10000
+
Detonation Radius Multiplier:   0.5
Height: 12000
+
Detonation Effects:       2, 3
Length: 8000
+
Detonation Multiplier:        2.0
Detonation Radius: 10000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 50000
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: GTCv Deimos
+
Name:         SB Taurvi
Width: 350
+
Detonation Radius Multiplier:   0.5
Height: 400
+
Detonation Effects:       2, 3
Length: 750
+
Detonation Multiplier:        2.0
Detonation Radius: 200
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1500
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: GTC Aeolus
+
Name:         SB Nahema
Width: 80
+
Detonation Radius Multiplier:   0.5
Height: 90
+
Detonation Effects:       2, 3
Length: 275
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1000
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: NTF Iceni
+
Name:         SB Seraphim
Width: 400
+
Detonation Radius Multiplier:   0.5
Height: 450
+
Detonation Effects:       2, 3
Length: 1000
+
Detonation Multiplier:        2.0
Detonation Radius: 300
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1500
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: NTF Boadicea
+
Name:         ST Azrael
Width: 10000
+
Detonation Radius Multiplier:   0.5
Height: 12000
+
Detonation Effects:       2, 3
Length: 8000
+
Detonation Multiplier:        2.0
Detonation Radius: 10000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 50000
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: @GTT Elysium
+
Name:         SFr Dis
Width: 35
+
Detonation Radius Multiplier:   0.5
Height: 45
+
Detonation Effects:       2, 3
Length: 35
+
Detonation Multiplier:        2.0
Detonation Radius: 25
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 500
+
Blinding Effect Intensity:    0.30
Flash Effect: 1
+
Blinding Effect Duration:    3000
  
Name: @GTT Argo
+
Name:         SAC 3
Width: 95
+
Detonation Radius Multiplier:   0.5
Height: 70
+
Detonation Effects:       2, 3
Length: 160
+
Detonation Multiplier:        2.0
Detonation Radius: 75
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 600
+
Blinding Effect Intensity:    0.30
Flash Effect: 1
+
Blinding Effect Duration:    3000
  
Name: GTI Ganymede
+
Name:         SFr Mephisto
Width: 10000
+
Detonation Radius Multiplier:   0.5
Height: 12000
+
Detonation Effects:       2, 3
Length: 8000
+
Detonation Multiplier:        2.0
Detonation Radius: 10000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 50000
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: Knossos
+
Name:         SC 5
Width: 10000
+
Detonation Radius Multiplier:   0.5
Height: 12000
+
Detonation Effects:       2, 3
Length: 8000
+
Detonation Multiplier:        2.0
Detonation Radius: 10000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 50000
+
Blinding Effect Intensity:    0.15
Flash Effect: 1
+
Blinding Effect Duration:    1500
  
Name: TC-Meson Bomb
+
Name:         SFr Asmodeus
Width: 10000
+
Detonation Radius Multiplier:   0.5
Height: 12000
+
Detonation Effects:       2, 3
Length: 8000
+
Detonation Multiplier:        2.0
Detonation Radius: 10000
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 50000
+
Blinding Effect Intensity:    0.25
Flash Effect: 1
+
Blinding Effect Duration:    2500
  
==Vasudan==
+
Name:          SAC 2
 +
Detonation Radius Multiplier:    0.5
 +
Detonation Effects:        2, 3
 +
Detonation Multiplier:        2.0
 +
Flash Radius Multiplier:      1.0
 +
Flash Effect:              1
 +
Blinding Effect Intensity:    0.15
 +
Blinding Effect Duration:    1500
  
Name: PVFr Ma'at
+
Name:         SC Lilith
Width: 20
+
Detonation Radius Multiplier:   0.5
Height: 20
+
Detonation Effects:       2, 3
Length: 55
+
Detonation Multiplier:        2.0
Detonation Radius: 25
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 600
+
Blinding Effect Intensity:    0.30
Flash Effect: 1
+
Blinding Effect Duration:    3000
  
Name: GVFr Bes
+
Name:         SC Rakshasa
Width: 25
+
Detonation Radius Multiplier:   0.5
Height: 15
+
Detonation Effects:       2, 3
Length: 60
+
Detonation Multiplier:        2.0
Detonation Radius: 25
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 600
+
Blinding Effect Intensity:    0.30
Flash Effect: 1
+
Blinding Effect Duration:    3000
  
Name: GVFr Satis
+
Name:         SD Demon
Width: 45
+
Detonation Radius Multiplier:   0.5
Height: 50
+
Detonation Effects:       2, 3
Length: 110
+
Detonation Multiplier:        2.0
Detonation Radius: 50
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 800
+
Blinding Effect Intensity:    0.40
Flash Effect: 1
+
Blinding Effect Duration:    4000
  
Name: GVG Anuket
+
Name:         SD Ravana
Width: 85
+
Detonation Radius Multiplier:   0.5
Height: 80
+
Detonation Effects:       2, 3
Length: 350
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 900
+
Blinding Effect Intensity:    0.40
Flash Effect: 1
+
Blinding Effect Duration:    4000
  
Name: GVC Aten
+
Name:         SD Lucifer
Width: 150
+
Detonation Radius Multiplier:   0.5
Height: 50
+
Detonation Effects:       2, 3
Length: 240
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1000
+
Blinding Effect Intensity:    0.40
Flash Effect: 1
+
Blinding Effect Duration:    4000
  
Name: GVC Mentu
+
Name:         SSG Trident
Width: 180
+
Detonation Radius Multiplier:   0.5
Height: 140
+
Detonation Effects:       2, 3
Length: 325
+
Detonation Multiplier:        2.0
Detonation Radius: 100
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 800
+
Blinding Effect Intensity:    5
Flash Effect: 1
+
Blinding Effect Duration:    500
  
Name: GVCv Sobek
+
Name:         SSG Belial
Width: 275
+
Detonation Radius Multiplier:   0.5
Height: 275
+
Detonation Effects:       2, 3
Length: 620
+
Detonation Multiplier:        2.0
Detonation Radius: 200
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 1500
+
Blinding Effect Intensity:    5
Flash Effect: 1
+
Blinding Effect Duration:    500
  
Name: GVD Typhon
+
Name:         SSG Rahu
Width: 700
+
Detonation Radius Multiplier:   0.5
Height: 300
+
Detonation Effects:       2, 3
Length: 2200
+
Detonation Multiplier:        2.0
Detonation Radius: 500
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 2500
+
Blinding Effect Intensity:    0.30
Flash Effect: 1
+
Blinding Effect Duration:    3000
  
Name: GVA Setekh
+
Name:         SCv Moloch
Width: 100
+
Detonation Radius Multiplier:   0.5
Height: 100
+
Detonation Effects:       2, 3
Length: 200
+
Detonation Multiplier:        2.0
Detonation Radius: 75
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 600
+
Blinding Effect Intensity:    0.35
Flash Effect: 1
+
Blinding Effect Duration:    3500
  
Name: GVD Hatshepsut
+
Name:         SJ Sathanas
Width: 700
+
Detonation Radius Multiplier:   0.5
Height: 600
+
Detonation Effects:       2, 3
Length: 2200
+
Detonation Multiplier:        2.0
Detonation Radius: 500
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 2500
+
Blinding Effect Intensity:    0.45
Flash Effect: 1
+
Blinding Effect Duration:    4500
  
Name: GTSG Mjolnir
+
Name:         Shivan Comm Node
Width: 100
+
Detonation Radius Multiplier:   0.5
Height: 110
+
Detonation Effects:       2, 3
Length: 90
+
Detonation Multiplier:        2.0
Detonation Radius: 40
+
Flash Radius Multiplier:     1.0
Detonation Effects: 2, 3
+
Flash Effect:             1
Flash Radius: 500
+
Blinding Effect Intensity:    0.35
Flash Effect: 1
+
Blinding Effect Duration:    3500
 
</pre>
 
</pre>
  
 
==exp_ani_flashes.cfg==
 
==exp_ani_flashes.cfg==
 +
This file needs to be placed into '''''../data/config/''''' directory.
 +
 
Contains an '''ordered''' list of animations. First defined effect gets ID number 1, second gets ID number 2 and so on. These ID numbers are used in '''Detonation Effects:''' and '''Flash Effect:''' entries to define the desired animations.
 
Contains an '''ordered''' list of animations. First defined effect gets ID number 1, second gets ID number 2 and so on. These ID numbers are used in '''Detonation Effects:''' and '''Flash Effect:''' entries to define the desired animations.
  

Latest revision as of 19:29, 18 April 2010

New version of the flashy deaths effect by Wanderer. You may wish to check out the script's thread on HLP.

Please note that this script requires two additional files in .cfg format whose specs can be found below.

NOTE THAT .CFG FILES GO TO DATA/CONFIG DIRECTORY

Table Entry

We'll call this deto-sct.tbm - it needs to be placed into ../data/tables/ directory.

#Conditional Hooks
 
$Application: FS2_Open
$On Mission Start:
 
[
 
----------------------
-- parser functions --
----------------------
 
--- get newline and make sure its lowercase
function get_next_line(nfile)
   -- read the line
   nline = nfile:read("*l")
   -- change to lowercase
   if nline ~= nil then
      nline = nline:lower()
   end
   return nline
end
 
--- find keyword and return the place where it ends
function find_keyword(line_to_parse, keyword)
   -- find any instances of the keyword
   keyword = keyword:lower()
   local key_s, key_e = line_to_parse:find(keyword)
 
   -- if we cant find a thing
   if key_s == nil then
      return nil
   end
 
   -- check if the line has been commented away
   local comment_s, comment_e = line_to_parse:find("--")
 
   if comment_s == nil then
      return key_e
   elseif comment_s < key_s then
         return nil
   end
 
   return key_e
end
 
--- function to initialize the vars
function init_entry(name)
   arr_SD_rad[name] = 1
   arr_SD_eff[name] = { }
   arr_SD_m[name] = 1
   arr_SF_rad[name] = 1
   arr_SF_eff[name] = 0
   arr_SB_int[name] = 0
   arr_SB_dur[name] = 0
   arr_SB_time[name] = 0
   arr_SB_dist[name] = 1
end
 
--- specific parsing funcs to make things easier to read ---
--- string or rather substring parser
function parse_string(start_key, line_to_parse)
   local substring = line_to_parse:sub(start_key)
   -- remove empty spaces
   local substring_start = substring:find("%a")
   substring = substring:sub(substring_start)
   return substring
end
 
--- function to parse numbers
function parse_number(start_key, line_to_parse)
   local result = line_to_parse:sub(start_key)
   local r_value = result:match('[0-9%.]+')
   r_value = tonumber(r_value)
   return r_value
end
 
--- function to parse arrays of numbers
function parse_number_array(start_key, line_to_parse)
   -- stuff the array
   local r = { }
   local p
   for p in line_to_parse:gmatch('[0-9%.]+') do
      p = tonumber(p)
      p = math.floor(p)
      table.insert(r, p)
   end
   return r
end
 
--- function to parse things
function parse_entry(keyword, flashfile, type, use_same_line)
   local new_entry = nil
   local return_val
   local return_array = {}
   local c_line
   if use_same_line == false then
      c_line = get_next_line(flashfile)
      if c_line == nil then
         -- end of file
         return -2, false, return_array
      end
      while c_line:len() == 0 do
         c_line = get_next_line(flashfile)
         if c_line == nil then
            -- end of file
            return -2, false, return_array
         end
      end
      new_entry = find_keyword(c_line, "Name:")
      current_start_line = c_line
   else
      c_line = use_same_line
   end
 
   -- check if we found a new entry
   if new_entry == nil then
      local c_key = find_keyword(c_line, keyword)
      if c_key == nil then
         -- we didn't find the thing...
         return -1, c_line, return_array
      end
      if type == "n" then
         -- soo... parse a number
         return_val = parse_number(c_key, c_line)
         return return_val, false, return_array
      elseif type == "array_n" then
         -- soo... parse an array of numbers
         return_array = parse_number_array(c_key, c_line)
         return_val = #return_array
         return return_val, false, return_array
      end
   else
      -- found new entry instead...
      return -2, c_line, return_array
   end
end
 
-----------------------------------------------
-- loading the flash animations
function parse_flash_ani_file(n_file)
   local something_to_parse = true
   while something_to_parse == true do
      local c_line = get_next_line(n_file)
 
      -- if we are at end of file, stop the loop
      if c_line == nil then
         something_to_parse = false
         break
      end
 
      local entry_start = find_keyword(c_line, "Filename:")
 
      -- if we found something else, try next line
      if entry_start ~= nil then
         -- ok... so we should have a good entry candidate and all that
         local current_entry = parse_string(entry_start, c_line)
         local animation = gr.loadTexture(current_entry, true)
         table.insert(arr_D_eff, animation)
         if animation:isValid() == false then
            ba.warning("Animation defined in " .. filename_flashani .. " " .. current_entry .. " is invalid")
         end
      end
   end
end
 
-- actual flash effect parsing function
function parse_flash_file(flashfile)
   -- pick first line
   entries_left = true
   use_same_line = false
   while entries_left == true do
      -- find ship name
      if use_same_line == false then
         use_same_line = get_next_line(flashfile)
      end
      if use_same_line == nil then
         -- end of file
         entries_left = false
         break
      end
      if use_same_line:len() == 0 then
         use_same_line = false
      else
         entry_start = find_keyword(use_same_line, "Name:")
         current_start_line = use_same_line
         if entry_start ~= nil then
            local not_new_entry = false
            -- insert while loop here to enable breaks as next statements
            while entry_start ~= nil do
               if not_new_entry == false then
                  current_entry = parse_string(entry_start, use_same_line)
                  -- init the entry
                  init_entry(current_entry)
                  use_same_line = false
                  ba.print("\nClass: " .. current_entry .. "\n")
               end
 
               local temp_val = nil
               local temp_arr = nil
               entry_start = nil
 
               -- detonation radius
               temp_val, use_same_line = parse_entry("Detonation Radius Multiplier:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("DRM: " .. temp_val .. "\n")
                  arr_SD_rad[current_entry] = temp_val
               end
 
               -- random detonation effects
               local temp_arr = {}
               temp_val, use_same_line, temp_arr = parse_entry("Detonation Effects:", flashfile, "array_n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("DE: " .. temp_val .. "\n")
                  arr_SD_eff[current_entry] = temp_arr
               end
 
               -- multiplier for the detonation occurrance
               temp_val, use_same_line = parse_entry("Detonation Multiplier:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("DM: " .. temp_val .. "\n")
                  arr_SD_m[current_entry] = temp_val
               end
 
               -- final flash radius
               temp_val, use_same_line = parse_entry("Flash Radius Multiplier:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("FRM: " .. temp_val .. "\n")
                  arr_SF_rad[current_entry] = temp_val
               end
 
               -- flash effect
               temp_val, use_same_line = parse_entry("Flash Effect:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("FE: " .. temp_val .. "\n")
                  math.floor(temp_val)
                  arr_SF_eff[current_entry] = temp_val
               end
 
               -- blinding effect
               temp_val, use_same_line = parse_entry("Blinding Effect Intensity:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("BE: " .. temp_val .. "\n")
                  temp_val = temp_val + "0"
                  if temp_val < 0 then
                     temp_val = 0
                  elseif temp_val > 100 then
                     temp_val = 100
                  end
                  arr_SB_int[current_entry] = temp_val
               end
 
               -- blinding duration
               temp_val, use_same_line = parse_entry("Blinding Effect Duration:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("BEDu: " .. temp_val .. "\n")
                  arr_SB_dur[current_entry] = temp_val
               end
 
               -- blast effect delay
               temp_val, use_same_line = parse_entry("Blast Effect Delay:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("BEDe: " .. temp_val .. "\n")
                  arr_SB_time[current_entry] = temp_val
               end
 
               -- blast effect delay
               temp_val, use_same_line = parse_entry("Blinding Effect Distance Multiplier:", flashfile, "n", use_same_line)
               if temp_val == -2 then
                  break
               elseif temp_val ~= -1 then
                  ba.print("BEDM: " .. temp_val .. "\n")
                  arr_SB_dist[current_entry] = temp_val
               end
 
               if current_start_line == use_same_line then
                  use_same_line = get_next_line(flashfile)
                  local temp_string = find_keyword(use_same_line, "Name:")
                  if temp_string == nil then
                     current_start_line = use_same_line
                     entry_start = use_same_line
                  else
                     entry_start = nil
                  end
 
                  not_new_entry = true
               end
            end
         else
            use_same_line = get_next_line(flashfile)
         end
      end
   end
end
 
----------
-- main --
----------
 
-- init arrays
arrayShipName = {}
arr_SD_rad = {}
arr_SD_eff = {}
arr_SD_m = {}
arr_SF_rad = {}
arr_SF_eff = {}
arr_SB_int = {}
arr_SB_dur = {}
arr_SB_time = {}
arr_SB_dist = {}
arr_D_eff = {}
 
-- open reference file, if any
-- if failed... pass the script
filename_flash = "exp_flashes.cfg"
filename_flashani = "exp_ani_flashes.cfg"
if ((cf.fileExists(filename_flash, "data/config/", true) == true) and (cf.fileExists(filename_flashani, "data/config/", true) == true)) then
   boolflashfileOK = true
end
 
if boolflashfileOK then
   -- open to read the contents
   flashanifile = cf.openFile(filename_flashani, "r")
   -- parse contents
   parse_flash_ani_file(flashanifile)
   -- close the file
   flashanifile:close()
 
   -- continue with the rest in similar manner
   flashfile = cf.openFile(filename_flash, "r")
   parse_flash_file(flashfile)
   flashfile:close()
 
   -- setup rest of the required stuff
   math.randomseed( os.time() )
   f_counter = {}
   v_null = ba.createVector(0,0,0)
   v_temp = ba.createVector(0,0,0)
   v_rnd_sphere = ba.createVector(0,0,0)
   arr_FS_List = {}
   arr_FS = {}
   arr_FS_Class = {}
   arr_FS_Pos = {}
   arr_FS_done = {}
   arr_FS_time = {}
   bl_int = 0
   bl_end = 0
   bl_max = 0
   bl_start = 0
   bl_int_init = 0
else
   ba.warning("Failed to initialize flashy deaths script")
end
 
----------------------------------
-- functions for later sections --
----------------------------------
 
function blinding_effect(intensity, duration, time)
   bl_int_init = bl_int
 
   if (intensity < bl_max) then
      if intensity > bl_int then
         local effect_time = bl_end - bl_start
         local delta_time = time - bl_start
 
         if effect_time == 0 then
            bl_max = intensity
            bl_start = time
            bl_end = time + (duration / 1000)
         else
            local pct_time = (effect_time - delta_time) / effect_time
            if pct_time < 0.85 then
               bl_max = intensity
               bl_start = time
               bl_end = time + (duration / 1000)
            end
         end
      end
   else
      bl_max = intensity
      bl_start = time
      bl_end = time + (duration / 1000)
   end
end
 
function process_blinding_effect_frame(time)
   if bl_max == 0 then
      return
   end
 
   local effect_time = bl_end - bl_start
   local delta_time = time - bl_start
   local pct_time = (effect_time - delta_time) / effect_time
   local case_time
 
   -- lets go case by case
   if pct_time < 0.0 then
      -- effect has faded away
      bl_int = 0
      bl_max = 0
      blindint_intensity_start = 0
   elseif pct_time < 0.85 then
      -- effect is still fading away
      case_time = 1 - (pct_time / 0.85)
      bl_int = bl_max * math.pow(((1 + math.cos(case_time * math.pi))/2),3)
   elseif pct_time > 0.90 then
      -- effect is still getting stronger
      if pct_time == 0 then
         case_time = -1
      else
         case_time = -1 * ((pct_time - 0.9) / 0.1)
      end
      bl_int = math.pow(((1 + math.cos(case_time * math.pi))/2),2) * (bl_max - bl_int_init) + bl_int_init
   else
      bl_int = bl_max
   end
 
   if bl_int ~= 0 then
      a = bl_int * 255
      gr.flashScreen(a,a,a)
   end
end
 
function do_death_flash(name, number)
 
   -- death flash explosion
   arr_FS_List[name] = 2
   local v_F_pos = arr_FS_Pos[name]
   arr_FS_Pos[name] = nil
   local str_F_class = arr_FS_Class[name]
   arr_FS_Class[name] = nil
   local l_f_model_r = tb.ShipClasses[str_F_class].Model.Radius
   local n_F_rad = 1.5 * (math.random() + 0.5) * l_f_model_r * arr_SF_rad[str_F_class]
   local l_anim_flash = arr_D_eff[arr_SF_eff[str_F_class]]
   if l_anim_flash:isValid() then
      ts.createParticle(v_F_pos,v_null,f_F_time,n_F_rad,PARTICLE_BITMAP,-1,false,l_anim_flash)
   end
 
   -- death flash blinding effect
   if arr_SB_int[str_F_class] > 0 then
      local coord_x
      local coord_y
      coord_x, coord_y = v_F_pos:getScreenCoords()
 
      if coord_x ~= false then
         local l_f_dist_mult = 1
         local l_player = hv.Player
         if l_player:isValid() then
            local l_v_plr_pos = l_player.Position
            local l_n_distace_fls_plr = v_F_pos:getDistance(l_v_plr_pos)
            local l_n_max_fls_distance = 2 * l_f_model_r * arr_SB_dist[str_F_class]
            if l_n_distace_fls_plr > l_n_max_fls_distance then
               local l_n_exp_dist_mult = l_n_distace_fls_plr / l_n_max_fls_distance
               l_f_dist_mult = 1 / math.pow(l_n_exp_dist_mult, 2)
            end
            blinding_effect(arr_SB_int[str_F_class] * l_f_dist_mult, arr_SB_dur[str_F_class], f_M_time)
         end
      end
   end
 
   -- purge from the list
   table.insert(arr_FS_done, number)
end
 
function check_flash(name)
   local class = arr_FS_Class[name]
   if arr_SB_time[class] > 0 then
      if arr_FS_time[name] <= f_M_time then
         return true;
      end
   end
 
   return false;
end
 
function add_to_flash_list(name, class)
   arr_FS_List[name] = 1
   arr_FS_Class[name] = class
   if arr_SB_time[class] > 0 then
      local temp_time = math.random() + 1
      arr_FS_time[name] = arr_SB_time[class] * temp_time / 1000 + f_M_time
   end
   table.insert(arr_FS,name)
end
 
function get_rnd_vector_sphere()
   local l_bool_ok_to_pass = false
   local l_get_rnd = math.random
 
   while (l_bool_ok_to_pass == false) do
 
      -- get random vector (cube, -1 to 1)
      v_rnd_sphere[1] = (2* (l_get_rnd() - 0.5))
      v_rnd_sphere[2] = (2* (l_get_rnd() - 0.5))
      v_rnd_sphere[3] = (2* (l_get_rnd() - 0.5))
      local l_n_mag = v_rnd_sphere:getMagnitude()
 
      -- accept only values within a sphere (uniform)
      if l_n_mag <= 1 then
         v_rnd_sphere = v_rnd_sphere / l_n_mag
         l_bool_ok_to_pass = true
      end
   end
   return v_rnd_sphere;
end
 
function get_ray_collision_pos(ship, v_ray, num_tries)
   local l_or_ship = ship.Orientation
   local l_m_model = ship.Class.Model
   local l_f_radius = 30000
   local l_v_pos_mod = v_null
   local l_n_has_tried = 0
   local l_c_ray_pos
   local l_get_rnd = math.random
 
   while (l_n_has_tried < num_tries) do
      if l_m_model:isValid() then
         l_f_radius = l_m_model.Radius
         for i=1,3 do
            local l_rnd = (2* (l_get_rnd() - 0.5))
               if l_rnd >= 0 then
                  v_temp[i] = l_m_model.BoundingBoxMax[i] * l_rnd
               else
                  v_temp[i] = l_m_model.BoundingBoxMin[i] * l_rnd * (-1)
               end
            end
         l_v_pos_mod = l_or_ship:unrotateVector(v_temp)
      else
         l_v_pos_mod = v_null
      end
 
      local v_ray = v_ray * l_f_radius
      local l_v_end_pos = ship.Position - v_ray + l_v_pos_mod
      local l_v_start_pos = ship.Position + v_ray + l_v_pos_mod
 
      l_c_ray_pos = ship:checkRayCollision(l_v_start_pos, l_v_end_pos)
 
      if l_c_ray_pos ~= nil then
         l_n_has_tried = 3
      else
         l_n_has_tried = 1 + l_n_has_tried
      end
   end
 
   return l_c_ray_pos
end
 
function get_number_of_explosions(attempts)
   local l_n_partials
   local l_n_full
   l_n_full, l_n_partials = math.modf(attempts)
 
   if l_n_partials ~= 0 then
      if math.random() > l_n_partials then
         l_n_full = l_n_full + 1
      end
   end
 
   return l_n_full
end
]
 
$State: GS_STATE_GAME_PLAY
$On Frame:
 
[
 
f_M_time = mn.getMissionTime()
 
if ((f_M_time ~= nil) and boolflashfileOK) then
 
   f_F_time = ba.getFrametime(true)
 
   f_rnd = math.random()
   n_ships = #mn.Ships
 
   for h = 1, n_ships do
      o_ship = mn.Ships[h]
      str_S_class = o_ship.Class.Name:lower()
 
      --ONLY SHIPS WITH EFFECTS--
 
      if ((arr_SF_rad[str_S_class] ~= nil) and (arr_SD_rad[str_S_class] ~= nil)) then
         str_S_name = o_ship.Name
         floatHP = o_ship.HitpointsLeft
 
         if floatHP <= 0 then
 
            v_S_pos = o_ship.Position
 
            if arr_SF_rad[str_S_class] > 0 then
               if arr_FS_List[str_S_name] == nil then
                  add_to_flash_list(str_S_name, str_S_class)
               end
            end
 
            if arr_SD_rad[str_S_class] > 0 then
               arr_FS_Pos[str_S_name] = v_S_pos
 
               if f_counter[str_S_name] == nil then
                  f_counter[str_S_name] = 0
 
               end
 
               f_rnd = math.random()
               local l_n_SD_eff = #arr_SD_eff[str_S_class]
 
               while f_counter[str_S_name] > f_rnd do
                  f_counter[str_S_name] = f_counter[str_S_name] - f_rnd
                  local n_attempts = get_number_of_explosions(arr_SD_m[str_S_class])
 
                  for n = 1,n_attempts do
                     local l_bool_ok_to_pass = false
 
                     local l_v_rnd = get_rnd_vector_sphere()
 
                     local l_c_pos = get_ray_collision_pos(o_ship, l_v_rnd, 3)
 
                     -- check if the ray actually hit anything even after three tries
                     if l_c_pos ~= nil then
                        local l_m_model = o_ship.Class.Model
                        local l_f_det_r = (2* math.random() + 0.5) * l_m_model.Radius * arr_SD_rad[str_S_class] * 0.1
                        local l_arr_SD_eff = arr_SD_eff[str_S_class]
                        if l_n_SD_eff == 1 then
                           local l_anim_det = arr_D_eff[l_arr_SD_eff[1]]
                           if l_anim_det:isValid() then
                              ts.createParticle(l_c_pos,v_null,f_F_time,l_f_det_r,PARTICLE_BITMAP,-1,false,l_anim_det)
                           end
                        elseif l_n_SD_eff > 1 then
                           local l_n_rnd_id = math.random(l_n_SD_eff)
                           local l_anim_det = arr_D_eff[l_arr_SD_eff[l_n_rnd_id]]
                           if l_anim_det:isValid() then
                              ts.createParticle(l_c_pos,v_null,f_F_time,l_f_det_r,PARTICLE_BITMAP,-1,false,l_anim_det)
                           end
                        end
                     end
                  end
 
                  if f_counter[str_S_name] <= 0 then
                     f_counter[str_S_name] = 0
                  else
                     f_rnd = math.random()
                  end
 
               end
 
               f_counter[str_S_name] = f_counter[str_S_name] + f_F_time
            end
 
         end
 
      end
 
      n_FS = #arr_FS
 
      for x=1,n_FS do
         name = arr_FS[x]
 
         if arr_FS_List[name] == 1 then
 
            if mn.Ships[name]:isValid() then
               if mn.Ships[name]:hasShipExploded() == 2 then
                  do_death_flash(name, x)
               else
                  -- randomized flash explosion
                  if check_flash(name) == true then
                     do_death_flash(name, x)
                  end
               end
            end
 
         end
 
      end
 
      n_FS_done = #arr_FS_done
      if n_FS_done > 0 then
 
         for o=n_FS_done,1,-1 do
            table.remove(arr_FS,arr_FS_done[o])
 
         end
 
         arr_FS_done = nil
         arr_FS_done = {}
 
      end
 
   end
 
   process_blinding_effect_frame(f_M_time)
 
end
 
]
 
$Application: FS2_Open
$On Mission End:
 
[
 
-- kill the arrays...
if boolflashfileOK then
   arrayShipName = nil
   arr_SD_rad = nil
   arr_SD_eff = nil
   arr_SF_rad = nil
   arr_SF_eff = nil
   arr_SB_int = nil
   arr_SB_dur = nil
   arr_SB_time = nil
   local n_effects = #arr_D_eff
   for j=1,n_effects do
      arr_D_eff[j]:unload()
   end
   arr_D_eff = nil
 
   f_counter = nil
   arr_FS_List = nil
   arr_FS = nil
   arr_FS_Class = nil
   arr_FS_Pos = nil
   arr_FS_done = nil
   arr_FS_time = nil
 
   boolflashfileOK = nil
end
 
]
 
#End

expl_flashes.cfg

This file needs to be placed into ../data/config/ directory.

Please note that the following list isn't complete yet.

  • Name: defines the ship for which this entry is made for
  • Detonation Radius Multiplier: defines the multiplier applied for the radius (base radius) of the detonation effects
  • Detonation Effects: list of ID values of the effects (defined in the other cfg file), may have multiple ones
  • Detonation Multiplier: multiplier which controls the amount of explosions triggered. 0.2 is 80% decrease, 1.2 is 20% increase
  • Flash Radius Multiplier: defines the multiplier applied to the radius of the flash when ship actually goes away
  • Flash Effect: ID values of the flash effect, as listed in line order entry in additional cfg
  • Blinding Effect Intensity: value from 0 to 100, sets the intensity of the blinding effect - requires flash effect to be defined
  • Blinding Effect Duration: sets the duration of the blinding effect in milliseconds
  • Blast Effect Delay: sets the base time for flash & blinding effect to appear in milliseconds
  • Blinding Effect Distance Multiplier: defines the multiplier applied to the blinding effect attenuation distances

Table allows for lines to be commented using '--' as comment marker

Name:          GTF Ulysses
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Hercules
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Hercules Mark II
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Ares
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Erinyes
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Loki
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Pegasus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Perseus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTF Myrmidon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Mara (terrans)
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTB Artemis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTB Artemis D.H.
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTB Medusa
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTB Ursa
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTB Zeus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTB Boanerges
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTDR Amazon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GTDR Amazon Advanced
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GTS Hygeia
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTFR Triton
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          TC-TRI
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTFR Poseidon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          TC 2
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          TSC 2
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          TAC 1
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          TTC 1
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTC Fenris
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTM Hippocrates
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          GTC Leviathan
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTSC Faustus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTG Zephyrus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTA Charybdis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GTD Orion
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GTD Hecate
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GTD Orion#2 (Bastion)
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GTD Hades
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GTI Arcadia
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GTVA Colossus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.45
Blinding Effect Duration:     4500

Name:          GTCv Deimos
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          GTC Aeolus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          NTF Iceni
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          NTF Boadicea
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          GTT Elysium
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GTT Argo
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GTI Ganymede
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          Knossos
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.45
Blinding Effect Duration:     4500

Name:          GTSG Watchdog
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GTSG Cerberus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GTSG Alastor
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GTEP Hermes
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          TC-Meson Bomb
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GTSG Mjolnir
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GTSG Mjolnir#home
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GVF Seth
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVF Horus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVF Thoth
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVF Serapis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVF Tauret
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVB Sekhmet
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVB Osiris
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVB Bakha
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVF Ptah
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          GVS Nephthys
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVT Isis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          PVFR Ma'at
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVFr Bes
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          VAC 5
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          VAC 4
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          GVFr Satis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.20
Blinding Effect Duration:     2000

Name:          GVG Anuket
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GVC Aten
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GVC Mentu
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          GVCv Sobek
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          GVD Typhon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          GVSG Ankh
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GVSG Edjo
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GVEP Ra
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          GVA Setekh
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          GVD Hatshepsut
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          SF Dragon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Basilisk
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Manticore
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Aeshma
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Mara
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SF Astaroth
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.10
Blinding Effect Duration:     1000

Name:          SB Nephilim
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SB Taurvi
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SB Nahema
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SB Seraphim
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          ST Azrael
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SFr Dis
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          SAC 3
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          SFr Mephisto
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SC 5
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SFr Asmodeus
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.25
Blinding Effect Duration:     2500

Name:          SAC 2
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.15
Blinding Effect Duration:     1500

Name:          SC Lilith
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          SC Rakshasa
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          SD Demon
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          SD Ravana
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          SD Lucifer
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.40
Blinding Effect Duration:     4000

Name:          SSG Trident
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          SSG Belial
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    5
Blinding Effect Duration:     500

Name:          SSG Rahu
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.30
Blinding Effect Duration:     3000

Name:          SCv Moloch
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

Name:          SJ Sathanas
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.45
Blinding Effect Duration:     4500

Name:          Shivan Comm Node
Detonation Radius Multiplier:    0.5
Detonation Effects:        2, 3
Detonation Multiplier:        2.0
Flash Radius Multiplier:      1.0
Flash Effect:              1
Blinding Effect Intensity:    0.35
Blinding Effect Duration:     3500

exp_ani_flashes.cfg

This file needs to be placed into ../data/config/ directory.

Contains an ordered list of animations. First defined effect gets ID number 1, second gets ID number 2 and so on. These ID numbers are used in Detonation Effects: and Flash Effect: entries to define the desired animations.

Filename: EXP_flash
Filename: exp04
Filename: exp05

Notes

As stated above the shiplist isn't complete yet, meaning that the destruction of any ships other than the ones specified in the current expl_flashes.cfg will not trigger any effect.