#Icon Badges Installation / Troubleshooting

1 messages ยท Page 1 of 1 (latest)

worldly shoal
#

Let's see if we can get it working for @rancid minnow

rancid minnow
#

oooh, cool

worldly shoal
#

What have you done so far, and what are your goals?

rancid minnow
#

honestly just wanna add my own IB's, and change vanilla ones to fit my mod

#

i tried a couple things to no avial, but this is what i had last

worldly shoal
#

Do you want to use csv-style tables for the data, or Lua?
Do you want to have user settings for language, eg Fe vs I for iron?

#

You need to call BuildBadge.

#

It's been a while, so this is a good test of the documentation.

rancid minnow
#

and the bottom one, i havent really touched settings so im gonna leave it

worldly shoal
#

That's Lua. It's a good choice if you don't have too many icons to deal with.

#

Ok, so we'll use Icon Badges without the IconBadgesGroups additions.

rancid minnow
#

sure

#

and yeah, like it'd be around the same as normal IB calls which is where i got that code from ๐Ÿ˜ญ

worldly shoal
#

Galdoc's instructions miss a key step.

rancid minnow
#

~~what is that key step ๐Ÿ˜ญ ~~

worldly shoal
#

Build_badge( prototype, ib_data)

#

prototype = data.raw.ammo['high-densith-magazine']

#

local ib_data = { ib_let_badge = v.badge, ib_let_corner = 'right-top' }

#

Reverse those lines.

#

IIRC Build_badge is a global function, so no fancy steps to be able to access it.

rancid minnow
#

cool cool

#

like this? ๐Ÿคจ

worldly shoal
#

Reverse the lines. I did them in the order I thought of them.

rancid minnow
#

so

  1. ib_data
  2. prototype
  3. Build_Badge
#

?

worldly shoal
#

Yes.

rancid minnow
#

cool

worldly shoal
#

How much programming do you do? So I know how much to break it down.

rancid minnow
#

...trianglepupper

brittle geyser
#

He treats the prototype definition as json

#

Or kind of like json

rancid minnow
#

i know jack about using lua, or scripting

#

i dont program much apart from using the API ๐Ÿ˜ญ

worldly shoal
#

Ok, I won't assume much then.

brittle geyser
#

I'm the one who turned his ingredient definitions into functions so he could continue using the shorthand with 2.0 removing it

rancid minnow
#

exactly

worldly shoal
#

Shifting to notepad for thinking out loud, then.

rancid minnow
#

๐Ÿ˜ญ all good

worldly shoal
#

NP. We have to start somewhere!

rancid minnow
#

exactly!

worldly shoal
#

If we don't start where we are, then it's really hard to move forward.

rancid minnow
#

ofc ofc, completely understand

#

wait, because it has prototype = data.raw.blah.blah["high-density-ammo"], does that mean i have to do that for everything i wanna add IB's for?

worldly shoal
#

typing out an example in notepad. I do it in a strange order, confusing to others.

rancid minnow
#

e.g



prototype = data.raw.ammo["ammo-name"]
prototype = data.raw.item["item-name"]
etc etc
worldly shoal
#
-- DRAFT!!!!
my_data =
{
    {type = 'ammo', name = 'pm-high-density-magazine', badge = 'HDR'},
    {type = 'item', name = 'iron-ore', badge = 'I'},
    
}

for _,i in pairs(my_data) do
    Build_badge(data.raw[type][name], badge)
end
rancid minnow
#

ooooh

#

neat

worldly shoal
#

@brittle geyser Does that look right?

rancid minnow
#

imagine it needs penny-inatoring trianglepupper

brittle geyser
#

I'm just going to complain before I interpret that

worldly shoal
#

To access a prototype in data.raw, you need to give the type and the name.

rancid minnow
#

oh yeah, i know that

brittle geyser
#

Make it a lua code block so it actually is readible D:

rancid minnow
brittle geyser
#

(Did it myself)

my_data =
{
    {type = 'ammo', name = 'pm-high-density-magazine', badge = 'HDR'},
    {type = 'item', name = 'iron-ore', badge = 'I'},
    
}

for _,i in pairs(my_data) do
    Build_badge(data.raw[type][name], badge)
end
worldly shoal
#

I often make silly typos, and don't have it setup for easy testing.

#

LOL, seconds after I fixed the original.

rancid minnow
#

๐Ÿ˜ญ

brittle geyser
#

Yeah, that would work.
You just need to do i.type and i.name etc..

rancid minnow
#

i keep the ib_data still below it all, right?

worldly shoal
#

Right! I forgot he changed it to ib_data.

rancid minnow
worldly shoal
#
my_data =
{
    {type = 'ammo', name = 'pm-high-density-magazine', ib_data = {badge = 'HDR'} },
    {type = 'item', name = 'iron-ore',  ib_data = {badge = 'I'} },
}

for _,i in pairs(my_data) do
    Build_badge(data.raw[type][name], badge)
end
#

let me edit that

rancid minnow
#

aight

worldly shoal
#

That should be it. I'm going to mark earlier versions as drafts, to avoid confusion for anyone reading later.

rancid minnow
#

fair enough ๐Ÿ˜ญ gonna test it rq, but if it works thank you so much

worldly shoal
#

Are there any parts that aren't clear? It's best if you understand each layer.

rancid minnow
#

oh no, i essentially get that

worldly shoal
#

There's also a way to tell it to ignore the vanilla set it comes with.

rancid minnow
#

the only thing i dont understand doesnt really matter to what we are doing ๐Ÿ˜ญ

worldly shoal
#

Be sure to count the {}.

rancid minnow
#

i can hear penny mentioning the nesting, a distant scream a continent away /s

brittle geyser
#

And Black. do you want me to turn that into a function like this?

PM.badge(type, name, letters, position)

Of course it'll in effect just be this:

-- Things are not final since I don't know about how icon badge works
function PM.badge(type, name, letters, position)
  if not mods['icon-badge'] then return end
  if #letters > 3 then error("Badge can only be up to 3 letters long") end
  if position and valid_positions[position] then error("'"..position.."' is not a valid position") end

  Build_badge(data.raw[type][name], {
    badge = letters,
    position = position,
  })
end
rancid minnow
#

uhhhhh, idm, its really up to you

#

it means nothing to me which i use ๐Ÿ˜ญ

#

both are equally usable

brittle geyser
#

(also I'm going to again mention that vencord's ShikiCodeBlocks are fantastic)

worldly shoal
#

That should work. I used to wrap Build_badge in pcall(), but now it's pretty stable.

brittle geyser
#

Alright, time to pull my local copy up to date with PM

rancid minnow
#

forgot to enable IB ๐Ÿ˜ญ

brittle geyser
#

:(
Your formatting makes me unhappy

rancid minnow
#

HAHAHAHA

worldly shoal
#

Icon Badges Groups adds the ability to change language (eg Fe vs I), and csv-style data which is easier to edit.

#

Do the formatting BlackATM is used to.

brittle geyser
#

I'm just upset about trailing whitespace

rancid minnow
brittle geyser
#

I've wrote some regex to remove all that at one point

#

Yeah, and I don't know what setting I have to complain about it while yours doesn't

worldly shoal
#

I used to be upset with the almost-empty lines, but brackets not lining up is worse. That might change if I give the new built-in rainbow indents a chance.

rancid minnow
#

....do i need to make the file required by a data- file? ๐Ÿคจ

worldly shoal
#

The automatic formatting, ctrl-shift-f , removes trailing whitespace if the syntax is correct.

rancid minnow
#

(should specify: it is in the actual mod folder and not behind anything else)

worldly shoal
#

Is it in its own file now? If so, you need to require it in one of the data stage files, after all the icons are made.

#

The program only looks in data, data-updates and data-final-fixes. It won't look anywhere else unless you tell it to.

rancid minnow
#

hmmm

#

good point

#

that might help ๐Ÿ˜ญ

brittle geyser
#

Btw I'd personally put it in compatiblity for sorting

rancid minnow
#

true

brittle geyser
#

Before going back through it with auto-formatting. I need to figure out how to tell it how we want it formatted
I know when I went throguh it first, it turned {"something", "else"} into { "something", "else" } which annoyed black

rancid minnow
#

it said to put it in final-fixes, right?

rancid minnow
#

i dont remeber ๐Ÿ˜ญ

worldly shoal
#

To change that, you'd need to know more about VSCode than I do. It would also make their install non-standard, and harder to trouble-shoot.

rancid minnow
#

fair enough

worldly shoal
#

In this case, it was easier to retrain my brain than change how it displays. I'm new enough at it that I want to keep my installation as standard as possible so it's easy to get help.

#

Other things, though? My brain refuses to retrain.

rancid minnow
#

(this means nothing to me, i have no idea what that is telling me ๐Ÿ˜ญ )

#

yeah, mood

worldly shoal
#

should be ipairs ??

brittle geyser
#

Yeah, change that to use i.type i.name and i.badge

#

They're currently undefined

rancid minnow
#

woo!!!

#

testing now

worldly shoal
#

I keep confusing pairs and ipairs, and use trial-and-error.

rancid minnow
#

๐Ÿ˜ญ lmao

#

(use your imagination to imagine the same code as above, but with i. next to the three things mentioned)

#

oh wait, ipairs

brittle geyser
#

No, ipairs should not have an effect here

rancid minnow
#

same error

brittle geyser
#

They are functionally the same in this instance, and the recommendation is to use pairs since it's faster

rancid minnow
#

interestinggg

#

very interesting

brittle geyser
#

Oh it's now i.ib_data not i.badge

#

You see how your data defines the type, name, and ib_data?

#

That's what you're indexing into

rancid minnow
#

mhm mhm

#

so.. change i.badge to i.ib_data ๐Ÿคจ

brittle geyser
#

yeah

rancid minnow
#

cool

#

so what is the difference between ipairs and pairs

#

๐Ÿคจ

#

...do i need to actually make it not the vanilla preset for it to work? because still nada ingame

brittle geyser
#

ipairs is meant for arrays, and the order of pairs is comparatively random
Factorio has changed pairs to be determinsitic and will always be identical to ipairs for any index up to 1024

rancid minnow
#

neat, good to know

#

ty

brittle geyser
#

pairs then falls back to insert order in factorio, meaning if only add elements to the end of the array, it's still the same even after 1024

#

This is different than raw lua, where it's iterated over in hash order. Which is effectively arbituary and random.
Which, again, factorio is meant to be deterministic so that was rejected and replaced

worldly shoal
#

Yeah, I was confused for a moment, thinking of how Python does it. (Why? I haven't used Python in years.)

#

(And I probably remembered it wrong.)

rancid minnow
#

i learnt 2 years of python and dont remeber a lick of it

#

as soon as i left high school, immediantly dumped out of my head

#

gone with the wind ๐Ÿ˜”

worldly shoal
#

Leavnign the vanilla preset is fine if you don't delete any vanilla prototypes. It might crash if it tries to put a label on something that doesn't exist.

rancid minnow
#

hmmm.. then what could be causing it to not work then engithink

worldly shoal
#

show us the current code again

rancid minnow
worldly shoal
#

Add line (such as local b = 1 ) and a breakpoint after Build_badge call.

#

Then hover over the variable i, or add it to the watch screen and see what it says.

#

Change that ... add a break point just before Build_badges so we can step into it if needed.

rancid minnow
worldly shoal
#

Is pm-high-density-magazine ammo, or an item, or something else? I just assumed it was ammo.

#

Does the recipe have its own icon, or does it inherit it from main_product?

brittle geyser
#

If it wasn't an ammo, it would having an error about indexing nil

rancid minnow
#

uhhhh

rancid minnow
#

the iron plate doesnt change aswell, i just havent screenshotted it ๐Ÿ˜ญ

rancid minnow
vale lintel
# rancid minnow

(you're not stopped at the breakpoint, so these are just luals's guesses, maybe nto actual values)

#

also is the warning on that function call relevant?

rancid minnow
rancid minnow
worldly shoal
#

Hard to say about the warning. Build_badges is working for the vanilla items, eg Piercing Rounds.

vale lintel
worldly shoal
#

Argh, I"m typing too fast, not cross-checking.

rancid minnow
#

hmmm

#

that

#

might be an issue

worldly shoal
#

No s. There is no Build_Badge, or there shouldn't be.

rancid minnow
#

its still an undefined global but least its capatalised!

brittle geyser
#

I think it will always be an undefined global unless you have icon badges as an open folder next to it

vale lintel
#

probably ought to do that so it can be more helpful

worldly shoal
#

From Icon Badges mod, data-final-fixes.lua

-- Generate letter icon Badges
-- ***************************
-- Prepare badges for Vanilla
require("vanilla")

-- Iterate over all vanilla items from above and build badges for each
if Ib_global.badge_vanilla then
  for subListName, subList in pairs(Badge_list) do
    for itemName, ib_data in pairs(subList) do
      if data.raw[subListName][itemName] then
        Build_badge(data.raw[subListName][itemName], ib_data)
      end
    end
  end
end```
vale lintel
#

but mostly it seems like you just need to run in debug and see what's happening when it goes wrong

rancid minnow
#

would it matter that im testing this in editor extensions? i doubt it, but might aswell ask

brittle geyser
#

Luals :(
That's just plainly wrong :(

rancid minnow
#

AHAHA

#

gotta love luals

#

also, for the life of me i know i set up a debug factorio thingy but god knows it doesnt work now ๐Ÿ˜ญ

worldly shoal
vale lintel
#

shouldn't matter, parens around any single expression is no-op

worldly shoal
#

Gotta love Lua syntactic sugar. There are so many ways to write the same thing, I'd get caught up in that instead fo the real problem.

brittle geyser
#

Like you know there's multiple...

rancid minnow
brittle geyser
#

Nah

rancid minnow
#

might aswell let you look at it too

#

cool

brittle geyser
#

I'm just touching the library (and removing some errors in entity.lua from luals just not being that smart and narrowing)

rancid minnow
#

๐Ÿ˜ญ

worldly shoal
#

@brittle geyser How easy is it for you to look at what he's done? I'm not set up to test it.

rancid minnow
#

...should i be using ib_let_badge?

brittle geyser
#

Easy, I just gotta merge upstream main back into mine
(I probably should learn how to rebase my commits though)

rancid minnow
worldly shoal
#

(LOL -- I just got started with local Git, and yesterday forgot to start a branch for the day. Trying to merge at the end of the day was interesting.)

rancid minnow
#

oooof

brittle geyser
#

Btw Black, where are you requiring the icon-badges file?

rancid minnow
#

data.lua

#

right at the bottom of the require stack

brittle geyser
#

Ah I see it

worldly shoal
rancid minnow
#

should i switch the badge in the {{}} or the ib_data?

worldly shoal
#

Is he making any changes to icons after data.lua?

brittle geyser
#

Not that I know of

worldly shoal
#

Icon Badges just adds a layer to icons (and converts icon to icons if needed).

rancid minnow
worldly shoal
#

(So many variations in icon and icons and layers and shortcut formats!!)

#

What are the parameters for Build_badge ?

rancid minnow
#

type, name and ib_data?

#

(with an i. at the start for good luck, ofc /s)

worldly shoal
#

Close, but it' s not type and name.

rancid minnow
#

๐Ÿคจ whuh

brittle geyser
#

I feel like I need to get galdoc to become an annotation fanatic like I am

worldly shoal
#

The parameters are separated by commas. There are two of them.
The first one is
data.raw[i.type][i.name] . That's the prototype. It's one thing.

rancid minnow
#

ooooh

#

neat

worldly shoal
#

Layers on layers on layers. Not easy to break apart, but you eventually get sort-of used to it.

rancid minnow
#

woo!1 being worn down by systems!! just like real life!!

worldly shoal
#

What's the second parameter?

rancid minnow
#

ib_data?

#

๐Ÿคจ

worldly shoal
#

Copying the line so I don't have to keep scrolling up.
Build_badge( data.raw[i.type][i.name] , ib_data)

#

For the first time through the loop, where is ib_data defined and what's its value?

rancid minnow
#

uuuhhhhhhh

worldly shoal
#

It's a bit tricky, since it's a table, not a simple value.

brittle geyser
#

it's i.ib_data

rancid minnow
#

yeah, wanted to say that

brittle geyser
#

So it's also in the my_data object

worldly shoal
#

Now work up. What's it's actual value?

rancid minnow
#

the.. first thing in my_data? (HDR)

worldly shoal
#

Almost. It's actually the table { badge = "HDR" } Which is wrong. Unlike me, you read the docs, and found it should be { ib_let_badge }

rancid minnow
#

๐Ÿ˜ญ

#

woo!! i got close!!

worldly shoal
#

Do you know how tables work, and get passed? They're a bit unusual.

rancid minnow
#

uhhhh

#

probably not?

#

maybe

#

idk

worldly shoal
#

Everything inside the { } is considered one thing. In this case, it's just the name ib_let_badge and its value.

brittle geyser
#

Does factorio load icons before trying icon and icon_size?

worldly shoal
#

It could be more.
ib_data = { ib_let_badge = "HDR", ib_let_corner = "top-left" }

brittle geyser
#

:(
PM either has another file not in git or something broke

rancid minnow
#

OH

#

HR

#

loser

worldly shoal
rancid minnow
#

LR users rise up

brittle geyser
worldly shoal
#

I think that's the wrong path. Does __base__ doesn't have hr-lithium-battery ?

rancid minnow
#

it doesnt have lithium, so no

#

that is me being stupid and never testing HR ๐Ÿ˜ญ

brittle geyser
#

It's not even looking in base so idk

#

I'm just commenting out hr to see if it works

rancid minnow
#

it needs an icon

#

๐Ÿคจ

worldly shoal
#

Strange. The error says it's looking in __base__

brittle geyser
#

Yeah, and it has non-hr

rancid minnow
#

oooh

worldly shoal
#

What's hr?

rancid minnow
#

im stupid

#

high res

#

ICON BADGES WORKS

brittle geyser
#

Oh no yeah

rancid minnow
#

IM FREE

worldly shoal
#

You learned a lot today!

rancid minnow
#

i did

worldly shoal
#

Make sure you get a good night's sleep to consolidate it.

rancid minnow
#

oh i will, just finished my first week of college and already behind on work ๐Ÿ˜Ž

brittle geyser
#

Alright.. time to start telling you about every high resolution image that's failing :)

worldly shoal
#

Then try something a bit more difficult. (Then work on other things, come back to this, and realize you've forgotten everything. You'll learn it faster the second time.)

rancid minnow
#

how tf is that even failing??

rancid minnow
#

i.. forget an i in molteninator

worldly shoal
#

The first dozen times through it can be discuoraging if you don't expect it.
See also Adam Savage's video on post-project depression.

worldly shoal
brittle geyser
rancid minnow
#

but also, HUGE mf'ing thank you dudes

#

my ass would have never figured this out on my own ๐Ÿ˜ญ

worldly shoal
#

moltin / molten e/i

rancid minnow
#

me very smort ๐Ÿ˜Ž

worldly shoal
#

Entirely selfish on my part. Paying it forward, and teaching is a good way to learn/reinforce/find gaps in understanding.

rancid minnow
#

oh yeah ofc

#

i do have one thing though, it doesnt seem to be changing the iron plate badge ๐Ÿคจ

worldly shoal
#

May also be procrastinating from my own project.

#

Add a break point inside the loop and make sure it's looping.

#

Add a dummy line where you want the program to pause, eg local b=1 . Keep the cursor on that line and press F9, or move to the far left and click, to get a red dot in the margin.

#

Breakpoints are a very important tool in debugging.

#

Type a variable name in the watch window. Taht's another important tool.

#

Since iron-ore is a vanilla item, and you haven't turned off Ib_global.badge_vanilla , it might be doing both the vanilla badge and your badge, one ove rthe other.

#

Try moving yours to another corner.

brittle geyser
#

I mean, the base game seems to be adding the icon badge to iron plates at final-fixes while you're doing it in data...

worldly shoal
#

ore or plates?

worldly shoal
#

Icons for the recipes are being shown. So far, we've only changed hte icons for the items. It might be using the main_product's icon instead of the recipe's icon. Doing both HR and LowRes adds another layer of potential mistake.

#

Hmmm, how does Build_badge know if there's already a badge?

rancid minnow
#

i presume it checks the item two times, then goes "already has a badge? aight, leave it"

#

checks when base loads, then when PM loads

worldly shoal
#

I think that note is from the older version, back when users added properties directly to the prototype instead of using a function to just add layers to the icon.

#

I'm pretty sure now it just adds layers to the icon.

vast surge
#

Build Badge doesn't check for anything, I don't think

#

If you call it, it'll just add what you tell it to add

worldly shoal
#

So that bit of the doc is out of date?

rancid minnow
vast surge
#

what?

worldly shoal
vast surge
#

these are independent things?

#

I was just describing the build badge function

worldly shoal
#

They haven't de-activated Ib_global.badge_vanilla , so it's probably putting the vanilla badge on, and his badge.

rancid minnow
#

i mean, i am ahppy to just disable the vanilla preset and do the pre-existing stuff myself, i need to change it anyway ๐Ÿ˜ญ

worldly shoal
#

(Or they're dealing with main_product or HR/LR .)

vast surge
#

Oh

worldly shoal
#

May as well disable it now, get that bit out of the way.

vast surge
#

Build_badge is just a function that adds a badge, that's all. It's what's called over and over again in the Process Badge List function

worldly shoal
#

The note implies we don't have to disable badge_vanilla . The mod somehow knows that we already added a badge.

vast surge
#

lemme see

worldly shoal
#

@rancid minnow Try setting Ib_global.badge_vanilla = false in data.lua .

rancid minnow
#

aight

vast surge
#

hm

rancid minnow
vast surge
#

I may need to update the mod page

#

hang on

worldly shoal
#

The mod page doesn't mention Build_badge at all.

#

Hmmm, the way you suggest doesn't need it.

#

@rancid minnow I may have steered you wrong. I showed you how I do it, but Galdoc's way also works. (He wrote the mod, so his way should work!)

rancid minnow
#

i would hope so ๐Ÿ˜ญ /s

#

but hey, aslong as it works

worldly shoal
#

The way I do it also works, but combining the two ways won't.

rancid minnow
#

meh, im all good

#

aslong as it works and wont cause any issues

#

also, the disabling thing worked all good

#

time to rewrite it all!!

worldly shoal
#

Or not. It depends what you want to work on next.

#

Now to stop procrastinating on Nullius BioScouts.

rancid minnow
#

good luck dude

vast surge
#

If you need help setting it up, poke me tomorrow and I'm happy to go over it on stream

rancid minnow
#

ty ty

#

๐Ÿ’œ

vast surge
#
if Ib_global.badge_vanilla then
  if not mods["galdocs-manufacturing"] or (mods["galdocs-manufacturing"] and Ib_global.activation) then
    Process_badge_list(Ib_global.Badge_list)
  end
end
#

Basically, if you want to run your own badge list, just set Ib_global.badge_vanilla to false, and that won't run. Then just build your own badge list manually.

worldly shoal
#

We did it a bit differently, calling Build_badge directly, so beware of confusion.

vast surge
#

and run Process_badge_list([your list])

#

yah

#

I wanted Build_Badge in there cuz I use it for GM vanilla

#

And you can too if you want

brittle geyser
#

Doesn't Process_badge_list specifically take a dictionary of lists?

vast surge
#

It just adds little metal plate .pngs to the corners of some recipes

#

It takes a badge list specifically

worldly shoal
#

I use it for IconBadgeGroups , but in hindsight I might have been able to make a list in the right format to use Process_badge_list instead of making my own loop. Not a big deal.

brittle geyser
#

Then I must've looked at the wrong function..

vast surge
#
-- Badge List Functions
-- ********************

-- This is an optional structure to facilitate easy badging of prototypes. It's what I used for my vanilla badging. 
--   Modders may use it too if they wish, or instead use the individual function above.
-- The format for a badge list is: 
--   badge_list[prototype_group_1] = {["prototype_name_1"] = ib_data_1_1, ["prototype_name_2"] = ib_data_1_2, ...}
--   badge_list[prototype_group_2] = {["prototype_name_1"] = ib_data_2_1, ["prototype_name_2"] = ib_data_2_2, ...}
--   ...
--   where:
--     prototype_group is either fluid, recipe, item, or child-of-item in data.raw
--     prototype_name is the name of a fluid, recipe, item, or child-of-item in the prototype_group
--     ib_data_whatever_whatever is a table with icon badge properties as outline in the readme

-- Merge Badge List
-- NOTE: To remove a badge from list1 (i.e. un-badging an item from vanilla), simply set the ib_data = {} for that entry
-- WARNING: Using this function will overwrite entries in list1 with entries from list2!!!!
#

sorry -- badge list in that context meant that data structure there

#

not a flat list

worldly shoal
#

Now I remember why I did it my way. I wanted to group all iron (copper, silicon) things together, instead of all recipes (items, ammo)

vast surge
#

It's a table of {string|table} pairs

#

yah, that's entirely up to you

#

that's the other reason I split out the 'build badge' fucntion, so people could organize it how they wanted

worldly shoal
#

Just be sure you know what BlackATM has before starting to change it, to avoid confusion.

rancid minnow
#

whuh

worldly shoal
#

Comment out all but a few lines in my_data.

#

Use the watch window to see exactly what you're sending to Build_badge .

rancid minnow
#

๐Ÿคจ

worldly shoal
#

That doesn't matter unles you've unzipped IconBadges and added it to VSCode.

#

VSCode can't read zip files, or even unzipped that it doesn't know about.

rancid minnow
#

i think i found the error

worldly shoal
#

(It depends what folder you put VSCode in. It might already see it.)

rancid minnow
#

so, a code name in my mod uses '

#

trying to input that into the icon badges breaks it, because it also uses '

#

and i presume, because the names arent the sames and therefore is badging something that doesnt exist

#

its throwing a hissyfit

worldly shoal
#

You can use ' or " in Lua, but need to make sure they match. Other languages are different.

rancid minnow
#

thank god ๐Ÿ˜ญ

vale lintel
rancid minnow
#

nvm, just a concidence

#

still breaking ๐Ÿ˜ญ

worldly shoal
#

I've got VSCode up, and can share my screen if you want to see breakpoints and watch window in action.

rancid minnow
#

uhh, sure

#

sorry, was making sure everything was spelt correctly

#

hold on

#

i think it might actually because i had non-existent shit in there

#

letting it load rn ๐Ÿคจ

#

yeah no, it now loads fine ๐Ÿ˜ญ

worldly shoal
#

Make a note of taht technique. I had a list of stuff like that (which I lost, sigh).

rancid minnow
#

oh i will, defintely

worldly shoal
#

Can you see my VSCode screen?

rancid minnow
#

oh yeah no, i do not have the social or mental capacity to actually talk on call rn ๐Ÿ˜ญ

#

mhm

worldly shoal
#

And can you hear me?

#

Not a problem.

rancid minnow
#

ty

#

and yeah, i can

#

mhm mhm

#

i so need to reset that up

#

i knew i had it, but not anymore ๐Ÿ˜ญ

#

mhmh mhm

#

i mean.. hm

#

i understand everything you said ๐Ÿ˜ญ

#

idk, i get it??

worldly shoal
#

This sort of thing takes practice. It's like walking. Theory and demonstrations are good, but you need to actually do it.

rancid minnow
#

oh yeah i completely get that, its how i even learned the API

#

just keep doing it, and you get it

worldly shoal
#

I'm stil learning the API.

rancid minnow
#

i mean, im happy to help if your struggling with something

worldly shoal
#

I'm here most days, if you have questions.

rancid minnow
#

ty ๐Ÿ’œ

#

honestly though, you and penny have been massive helps

worldly shoal
#

I'll ask if I need help. Right now I'm building up my mod in tiny steps, learning as I go.

rancid minnow
#

oooh, nice nice

worldly shoal
#

I"m paying it forward. jarg and codegreen and the others have been a big help to me.

rancid minnow
#

i've always wanted IB functionality and now i finally got it

rancid minnow
worldly shoal
#

And if I can't pay it forward here, I pay it forward in other groups, eg knitting

rancid minnow
#

aww

#

butyeah, i get exactly what you mean

worldly shoal
#

Sometimes it takes a while before I can, but it balances over a lifetime.

rancid minnow
#

mhm mhm, the ability to pay it forward arrives when it arrives

#

you find it eventually

rancid minnow
#

does ib_let_inverse have to replace ib_let_badge or is it an extra thing that goes in the ib_data table?

#

nvm, figured it out

#

yipee

rancid minnow
#

hmmmmm

#

i dont have icon badges enabled trianglepupper

brittle geyser
#

Yeah

#

Just put a

if not mods["icon-badges"] then return end

At the beginning

#

Like the rest of your compatibility files shoob

rancid minnow
#

like, just at the top

#

๐Ÿคจ

brittle geyser
#

Yeah

rancid minnow
brittle geyser
#

It basically just says, hey does the mod we care about exist?
No? Okay then fuck off

#

data.lua?

rancid minnow
#

whuh

#

what do you need to see ๐Ÿคจ

brittle geyser
#

Yeah, this line should be in the icon-badges.lua file...

rancid minnow
#

yujh

brittle geyser
#

Move it >:(
This is not your place Ib_global.badge_vanilla = false

rancid minnow
#

:(

#

it fixed it!

worldly shoal
#

That flag tells Icon Badges to use its own built-in badges for everything that's in vanilla. If you want to put different badges on things that exist in vanilla, you need to make the flag false, and do them all yourself. (You can copy the vanilla set and edit it to save time.)

brittle geyser
#

The issue is where he was setting it false

#

You see the compatibility require right above it?

#

That contains the logic for not running when icon badges doesn't exist

worldly shoal
#

compatability -- is that part of BlackATM's mod? If I read the require statement right, it is.

brittle geyser
#

yeah

worldly shoal
#

Yeah, Ib_global only exists if IconBadges has been loaded.

brittle geyser
#

(Also I might go through and reformat Black's Icon badges to use the official list syntax that I made a pr to annotate into a proper class)

vast surge
#

Yah, that looks right to me