#Stacked Red Seals

1 messages · Page 1 of 1 (latest)

crude flame
crude flame
#

Thought process (not anymore)

#
  1. Modify the function Card:calculate_seal(context) in card.lua:2241 to become this
function Card:calculate_seal(context)
  if self.debuff then return nil end
  if context.repetition then
    if self.seal == 'Red' then
      return {
        message = localize('k_again_ex'),
        repetitions = self.DRreps,
        card = self
      }
     end
  end
... 
#
  1. Modify the function Card:set_seal(_seal, silent, immediate) in card.lua:462 to become this
function Card:set_seal(_seal, silent, immediate)
  self.seal = nil
  if _seal then
    if _seal.ability.name == 'Red Seal' then
      if not self.DRreps then
        self.DRreps = 1
      else
        self.DRreps = self.DRreps + 1
      end
    else
      self.DRreps = nil
    end
    self.seal = _seal
...
#
  1. Modify the localization:red_seal to become this
...
red_seal = {
  name = "Red Seal",
  text = {
    "Retrigger this",
    "card {C:attention}#1#{} times"
  }
}
...
#
  1. Change the function generate_card_ui in common_events.lua:2731 to become this
if v == 'red_seal' then info_queue[#info_queue+1] = {key = 'red_seal', set = 'Other', vars = {self.DRreps}} end
#

if you got a better idea, let me know please

#

or if I forgot something, let me know as well

#

I personally don't like the modification inside localization because it would break if you use another language, but personally I don't know how to adjust it

finite gyro
#

stackable seals could be interesting, tho I'd say destroy chance should be pretty high (unless you want it to be somewhat unbalanced) because death/cryptid exist

thorn mirage
#

You’ll need to modify how to apply seals as well, I’m pretty sure they won’t let you apply it to a card already with a seal

finite gyro
#

I don't really think it would work well on blue & purple seals tho because consumable slots limit

thorn mirage
#

But I haven’t checked

finite gyro
#

also #1#{} time(s)

#

because 1 times doesn't really look good

crude flame
finite gyro
crude flame
thorn mirage
#

I mean where set seal is called

#

I’m not sure if you can target a card with a seal with Deja vu

crude flame
#

i change it do do this (kinda, not exact)

thorn mirage
crude flame
crude flame
crude flame
#

can you put #1# inside the name of the box instead of the text?

finite gyro
#

high risk high reward balatrojoker does not have to be glass card if you have like idol anyways

crude flame
#

well, i tried

#

but overall, you think it is doable?

thorn mirage
#

Yeah should be

#

Just don’t overwrite the function

crude flame
#

should i use a .toml?

thorn mirage
#

Hooking should be fine for what you want to do

crude flame
crude flame
#

I'll upload it on github

#

Stacked Red Seals

crude flame
latent berry
#

I have a feeling a random field directly on card won't persist reloading the run

#

putting it on card.ability should be cleaner

crude flame
latent berry
crude flame
#

ok, I'll try it

crude flame
#

I found a bug that makes you see different numbers in your hand and your deck (the card has been retriggered 3 times when I played it) (I used 3 deja-vu)

#

I don't know where the +1 is coming from

#

this happens as soon as you put one Deja-Vu on the card

#

started a new run, used one single Deja-Vu on this card

#

the card's SRSreps value is different between hand and deck

#

The first tprint is when the card is in hand, the second is when I view it in the deck

thorn mirage
#

I’m pretty sure the way the collection is drawn calls set seal on every card that has a seal, so you’re actually incrementing the number of seals whenever you view your deck

#

You could check that the card is in G.hand to get around this I think

crude flame
crude flame
#

is there a part of card that tells where is it?

thorn mirage
#

Just do if card.area == G.play iirc

thorn mirage
crude flame
#

I added that part and now it works

#

thanks ❤️

crude flame
#

VERSION 1.1 IS OUT

Bug fixing:

If you find any bug, please let me know by filing an issue on Github or writing here!

thorn mirage
#

This works with latest version of smods?

crude flame
thorn mirage
#

I think the new config stuff will break this

crude flame
#

i see now we're at 0723b

#

yeah it breaks, but why?

thorn mirage
#

Because smods now has config built into it and your config file isn’t set up correctly for it

#

You can circumvent it for now by changing the name of your file

#

Alternatively you can look at JokerDisplay for an example of how to do it properly

crude flame
#

so... I have to add a localization/default.lua and a config.lua?

#

and also a SMODS.current_mod.config_tab = function()?

#

too many problems, I'll set the name of the file to SRS_config.lua

latent berry
#

localization/default.lua is unrelated, it's a replacement for loc_txt

#

current_mod.config_tab also isn't required but it will allow changing settings in-game

crude flame
latent berry
#

SMODS config needs to return a table

crude flame
#

I tried with

return {
    ["SRS_RedSealsForCard"] = 1,
    ["SRS_MaxRedSeals"] = -1,
}

but obviously it was wrong

latent berry
#

wdym it was obviously wrong

#

it doesn't put these values as globals, but in your mod object's config table

crude flame
thorn mirage
#

You have to build your own page

crude flame
#

yeah

#

so I have to learn Balatro UI

thorn mirage
#

But using the return in your config lets you use it in your code

#

You can do local config = SMODS.current_mod.config

latent berry
#

this just means editing the config file directly might not work for users, they'd have to edit the corresponding <id>.jkr file in <save dir>/config/ instead

crude flame
#

for now I'm doing

local config = SMODS.current_mod.config
local RedSealsForCard = config.RedSealsForCard
local MaxRedSeals = config.MaxRedSeals
thorn mirage
#

You don’t need those red seals variables

#

Just use config.MaxRedSeals in your code

crude flame
#

yeah ik but that is easier in the moment I want to change anything in the config file

#

anyways, if I wanted to make the config page in the Mods list, where would I have to put the code for that?

thorn mirage
#

In your file

#

SMODS.current_mod.config_tab = function () —UI CODE end

crude flame
#

can I put it inside the config file before the return?

thorn mirage
#

no

latent berry
#

no

thorn mirage
#

in your mod file

crude flame
#

kk

crude flame
thorn mirage
latent berry
#

nice

#

though the title is misleading imo

thorn mirage
#

Yeah I'm gonna change the title

#

or maybe separate it into two pages

#

one for config, one for UI

crude flame
#

thanks a lot ❤️

crude flame
thorn mirage
#

you can just throw that example code in your config_tab function

#

but also, here

thorn mirage
#

this is missing any of the useful functions for actually modifying the config though 😔

crude flame
#

my computer didn't blow up. it's a win

#

the Additions tab can be removed?

thorn mirage
#

at the moment, no

#

it's on the list to add a more robust check to enable it, it currently just looks at if you create any SMODS object

#

so an Atlas will trigger it afaik

crude flame
#

I did create one, but the Additions page is still empty

#

but I don't care about that rn

#

I am making the config tab

thorn mirage
#

yeah, but in the backend we'll make a more robust check that will only make it appear if things are actually added to the collection

crude flame
#

good

#

is there a "Insert text" node type?

latent berry
crude flame
#

yes

latent berry
#

there's a function that creates one, search create_text_input in the source code

crude flame
#

and I put it inside a G.UIT.B node?

thorn mirage
#

no

#

Boxes don't have anything in

#

put it in a column or row node

crude flame
#

I'm trying to do this

thorn mirage
#

ok

crude flame
#

I'm trying to insert the text but something is wrong

thorn mirage
#

Align should be cm

#

also throw a scale = 1 in your text node

latent berry
#

you can't actually have two text inputs at the same time

thorn mirage
#

Yeah I’m taking a look at that later

crude flame
#

The max I could do is this

crude flame
#

VERSION 1.3 IS OUT

Now the mod includes a "Config" page in the game to let you tweak its settings!

If you find any bug, please let me know by writing here or filing an issue on the Github page.

GitHub

VERSION 1.3
Now the mod includes a "Config" page in the game to let you tweak its settings!
If you find any bug, please let me know by filing an issue here on Github or writing on the Dis...

#

huge thanks to @thorn mirage and @latent berry for their help

trail crypt
#
WARN - [♥] Unknown key `patches.0.?.overwrite` found in patch file at "C:\\Users\\14242\\AppData\\Roaming\\Balatro\\Mods\\StackedRedSeals\\lovely.toml", ignoring it
WARN - [♥] Unknown key `patches.1.?.overwrite` found in patch file at "C:\\Users\\14242\\AppData\\Roaming\\Balatro\\Mods\\StackedRedSeals\\lovely.toml", ignoring it
WARN - [♥] Unknown key `patches.2.?.overwrite` found in patch file at "C:\\Users\\14242\\AppData\\Roaming\\Balatro\\Mods\\StackedRedSeals\\lovely.toml", ignoring it
#

Are these normal?

finite gyro
#

yes

#

overwrite is from old lovely version, its not needed anymore as it never did anything

#

it simply warns the mod dev that the key is useless

vapid jacinth
#

i like it

vapid jacinth
#

why stop at red seals 🤔

honest mulch
#

I need help, I have put 5 red seals on the card but the text only appears "retrigger this card 1 time". what's wrong with the config?