Advertisement
Guest User

example of how to add an extraction point in a modded map

a guest
Jul 16th, 2023
1,284
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. function WQS_ModdedMapExtractionZoneInit()
  2.     local ModMapId, ZoneLabel, ModMapFolder, ExtrPointX, ExtrPointY, ExtrPointZ, PrefSpawnPointsPerc
  3.     local PrefSpawnPointList = {}
  4.  
  5.     local MainModIsActive = ActiveMods.getById("currentGame"):isModActive("WolfExtractionQuest")
  6.     if not(MainModIsActive) then
  7.      return
  8.     end
  9.  
  10.     --REQUIRED DATA - change to these values results in the need to request a new extraction from headquarters
  11.     ModMapId = "RavenCreek"                --the mod id taken from mod.info map mod
  12.     ZoneLabel = "Raven Creek Medical Center EXAMPLE" --the name of the extraction point for the extraction tracker gui
  13.     ModMapFolder = "media/maps/RavenCreek" --the folder inside the mod folder where we can find map data
  14.     ExtrPointX = 3991                      --x coord of the center of the extraction area
  15.     ExtrPointY = 11732                     --y coord of the center of the extraction area
  16.     ExtrPointZ = 4                         ---z level of the extraction area
  17.  
  18.     --OPTIONAL DATA
  19.     --- Preferred extraction points is a non-random chosen list of spawn points for the extraction event
  20.     --- Those points are used (instead of the standard random ones) to compensate for the
  21.     --- stupidity of the AI and the occasionally weird pathfinding
  22.     ---if the chosen point is visible to the player at the time of spawn it will not be used
  23.     ---Recommended at least 4 points in different (opposite) positions
  24.     PrefSpawnPointList = {
  25.         { x = 3999, y = 11722, z = 4 },
  26.         { x = 3994, y = 11719, z = 4 },
  27.         { x = 3983, y = 11718, z = 4 },
  28.         { x = 3990, y = 11720, z = 4 }
  29.     }
  30.     --- PrefSpawnPointsPerc is the percentage by which preferred extraction points will be chosen
  31.     --- instead of the standard random ones, do not put this over 80
  32.     PrefSpawnPointsPerc = 70
  33.  
  34.     WQS.AddModdedMapExtractionZone(ModMapId, ZoneLabel, ModMapFolder, ExtrPointX, ExtrPointY, ExtrPointZ,
  35.         PrefSpawnPointList, PrefSpawnPointsPerc)
  36.  
  37.   --minimal use:
  38.   -- WQS.AddModdedMapExtractionZone(ModMapId, ZoneLabel, ModMapFolder, ExtrPointX, ExtrPointY, ExtrPointZ)
  39.  
  40. end
  41.  
  42. Events.OnGameStart.Add(WQS_ModdedMapExtractionZoneInit);
  43.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement