Thread Tools Display Modes
Prev Previous Post   Next Post Next
06/21/24, 02:56 AM   #1
Dragona7Power
Join Date: Jun 2024
Posts: 1
edit BMU, don't show leads with complete codex

Hello everybody, I'm new to modifying addons and even more new to LUA. I'm trying to modify the Beam Me Up addon in a way that it doesn't show in my UI the leads that have completed codex.

In the following image, I'd like for Sacred Resin to be displayed, but not Draoife Storystone.


The issue is that I can't find a way to tell the addon to filter the results of the search by codex entries. If I try the addon crashes ^^"

In a very generic question, how would a beginner tackle this? How do I find functions/methods to lookup what I need?

In my search I found just two snippets of code that handle antiquities, but modifying either leads to an addon crash on menu opening so I'm sure I'm doing something wrong.

Code:
if BMU.savedVarsChar.displayAntiquityLeads.scried or BMU.savedVarsChar.displayAntiquityLeads.srcyable then
		-- seperately: go over all leads and add them to "portalPlayers" and "unrelatedItemsRecords"
		local antiquityId = GetNextAntiquityId()
		while antiquityId do
			if DoesAntiquityHaveLead(antiquityId) then
				local zoneId = GetAntiquityZoneId(antiquityId)
				local achievedGoals = GetNumGoalsAchievedForAntiquity(antiquityId)
					-- leads that are already scried (at least one "achieved goal" in lead scry progress)
				if (BMU.savedVarsChar.displayAntiquityLeads.scried and achievedGoals > 0)
					or
					-- leads that are are scryable (no progress)
					(BMU.savedVarsChar.displayAntiquityLeads.srcyable and achievedGoals == 0)
				then
					-- check if lead can be matched to an entry in portalPlayers table
					local isRelated, updatedRecord, recordIndex = BMU.leadIsRelated(portalPlayers, antiquityId)
					if isRelated then
						-- lead is related and connected to an entry in portalPlayers table
						-- update record in portalPlayers
						portalPlayers[recordIndex] = updatedRecord
					else
						-- lead cannot be assigned to an entry in portalPlayers table
						-- check if a record for the zone already exists
						local record = unrelatedItemsRecords[zoneId]
						if not record then
							-- create new record
							record = BMU.createClickableZoneRecord(zoneId)
						end
						-- add lead to the record
						record = BMU.addLeadInformation(record, antiquityId)
						-- save record
						unrelatedItemsRecords[zoneId] = record
					end
				end
			end
			antiquityId = GetNextAntiquityId(antiquityId)
		end
	end
Code:
-- count leads
	local antiquityId = GetNextAntiquityId()
	while antiquityId do
		if DoesAntiquityHaveLead(antiquityId) then
			counter_table["leads"] = counter_table["leads"] + 1
		end
		antiquityId = GetNextAntiquityId(antiquityId)
	end
	
	local list_counters = {counter_table["alchemist"], counter_table["enchanter"], counter_table["woodworker"], counter_table["blacksmith"], counter_table["clothier"], counter_table["jewelry"], counter_table["treasure"], counter_table["leads"]}
	local text = string.format("|t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_alchemy.dds|t: %d   |t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_enchanting.dds|t: %d   " ..
	"|t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_woodworking.dds|t: %d   |t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_smithy.dds|t: %d   " ..
	"|t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_clothier.dds|t: %d   |t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_jewelrycrafting.dds|t: %d   " ..
	"|t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_bank.dds|t: %d   |t<dim>:<dim>:esoui/art/icons/servicemappins/servicepin_antiquities.dds|t: %d", unpack(list_counters))
Edit: Quick edit just to add that this change is intended for personal use, I don't want to publish this anywhere, if it's important.

Last edited by Dragona7Power : 06/21/24 at 03:02 AM.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » edit BMU, don't show leads with complete codex


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off