Skip to content

Commit

Permalink
Adding Kaineng Skiffs, SotO orb hunting (courtesy of Luaren), additio…
Browse files Browse the repository at this point in the history
…nal PSNA billboard locations, PSNA scripting functionality (courtesy of Teh), and updated credit for Unskippable Cutscene's resin run. Removed work for map comp compass, as this is now covered by Teh's script for dynamic arrows.
  • Loading branch information
Metallis committed Oct 15, 2023
1 parent 897659d commit e2893b7
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 278 deletions.
Binary file modified Data/Icons/ring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Data/Icons/starter.txt

This file was deleted.

Binary file removed Data/Trails/echovald_resin.trl
Binary file not shown.
13 changes: 0 additions & 13 deletions Scripts/compass_pointer.lua

This file was deleted.

7 changes: 3 additions & 4 deletions Scripts/mmmmenu.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-- What a glorious filename

-- Generic Menu Function
local function togglePSNA(menu)
MMM_TogglePSNA()
local function copyPSNA(menu)
MMM_CopyPSNA()
end

-- Construct Menu
local root = Menu:Add("Metal Marker Myriad", nil)
local psna = root:Add("Show/Hide PSNA Marker", togglePSNA, false, false, "Shows/Hides a marker with today's PSNA waypoint codes")
local root = Menu:Add("MMM - Copy PSNA WPs", copyPSNA, false, false, "Copies today's PSNA waypoint codes")
93 changes: 28 additions & 65 deletions Scripts/psna.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
MMM.psna = {
activeMarkers = {},
shown = false,
origin = nil
}
MMM.psna = {}

Debug:Watch("MMM_PSNA", MMM.psna)

-- #region Constants

local MARKER_TEXTURE = "Data/Icons/psna_clipboard.png"
local MARKER_ATTRIBUTES = {
type = "other.psna",
["schedule-duration"] = 1440,
iconSize = 3,
heightOffset = 3,
iconSize = 0,
["copy-message"] = "PSNA Waypoints copied to clipboard!",
triggerRange="5"
triggerRange="1",
autoTrigger="1"
}
local MARKER_COPIES = {
{ "0 8 * * 1", "[&BIgHAAA=][&BEwDAAA=][&BNIEAAA=][&BKYBAAA=][&BIMCAAA=][&BB4CAAA=]" },
Expand All @@ -24,67 +18,36 @@ local MARKER_COPIES = {
{ "0 8 * * 4", "[&BH8HAAA=][&BF0AAAA=][&BEUDAAA=][&BO4CAAA=][&BJcBAAA=][&BOQBAAA=]" },
{ "0 8 * * 5", "[&BJcHAAA=][&BNUGAAA=][&BKYCAAA=][&BMwCAAA=][&BHsBAAA=][&BNMAAAA=]" },
{ "0 8 * * 6", "[&BH8HAAA=][&BB8DAAA=][&BNMCAAA=][&BFMCAAA=][&BJIBAAA=][&BF8BAAA=]" },
{ "0 8 * * 0", "[&BIYHAAA=][&BDoBAAA=][&BO4CAAA=][&BKcBAAA=][&BIUCAAA=][&BCECAAA=]" },
{ "0 8 * * 0", "[&BIYHAAA=][&BDoBAAA=][&BO4CAAA=][&BKcBAAA=][&BIUCAAA=][&BCECAAA=]" }
}

-- #endregion

-- #region Local Functions

-- Hides (removes) any active markers if they are currently shown
local function hidePSNA()
if MMM.psna.shown then
-- Loop through all active markers and remove them
for _, marker in ipairs(MMM.psna.activeMarkers) do
marker:Remove()
end
MMM.psna.activeMarkers = {}
MMM.psna.origin = nil
MMM.psna.shown = false
end
end

-- Shows (creates) a set of PSNA markers at the players current location
local function showPSNA()
-- Get and save current player position
MMM.psna.origin = Mumble.PlayerCharacter.Position

-- Create generic marker attributes and add in coordinates
-- Generates PSNA markers at the players current location until finding the current one, then copies it to their clipboard
function MMM_CopyPSNA()
-- Get current position
local origin = Mumble.PlayerCharacter.Position

--Create generic marker attributes and add in coordinates
local newMarkerAttributes = MARKER_ATTRIBUTES
newMarkerAttributes.xpos = MMM.psna.origin.X
newMarkerAttributes.ypos = MMM.psna.origin.Z
newMarkerAttributes.zpos = MMM.psna.origin.Y

-- Create all 7 of the PSNA markers with their respective attributes, and add to the active markers table
for i, copyAttr in ipairs(MARKER_COPIES) do
newMarkerAttributes.xpos = origin.X
newMarkerAttributes.ypos = origin.Z
newMarkerAttributes.zpos = origin.Y
-- Loop through all markers until we find the one that isn't filtered by schedule
for _, copyAttr in ipairs(MARKER_COPIES) do
newMarkerAttributes.schedule = copyAttr[1]
newMarkerAttributes.copy = copyAttr[2]
MMM.psna.activeMarkers[i] = Pack:CreateMarker(newMarkerAttributes)
MMM.psna.activeMarkers[i]:SetTexture(MARKER_TEXTURE)
end

MMM.psna.shown = true
end

-- Tick handler to check if the player is within a certain distance of the created markers. If not, hides them
local function psnaTickHandler(gameTime)
if MMM.psna.shown then
if (Mumble.PlayerCharacter.Position - MMM.psna.origin):Length() > 40 then
hidePSNA()
local newMarker = Pack:CreateMarker(newMarkerAttributes)

if (newMarker.BehaviorFiltered == false) then
-- Once we find the non-filtered one, it'll copy itself to clipboard, then we remove it and break from the loop
newMarker.Interact(true)
newMarker:Remove()
break
-- Otherwise delete the marker we just created
else
newMarker:Remove()
end
end
end

-- #endregion

-- Global function to toggle the PSNA markers
function MMM_TogglePSNA()
if MMM.psna.shown then
hidePSNA()
else
showPSNA()
end
end

-- Assign tick handler
Event:OnTick(psnaTickHandler)
end
56 changes: 0 additions & 56 deletions echovald_resin.xml

This file was deleted.

8 changes: 1 addition & 7 deletions pack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@ MMM = {}

Debug:Print("Loading Metal Marker Myriad...")

Pack:Require("Data/Scripts/compass_pointer")
Pack:Require("Scripts/psna.lua")
Pack:Require("Scripts/mmmmenu.lua")

local function tick(gameTime)
local playerPos = Mumble.PlayerCharacter.Position
local target = World:MarkerByGuid(guid)
end
Pack:Require("Scripts/mmmmenu.lua")
Loading

0 comments on commit e2893b7

Please sign in to comment.