#💻・modding-dev
1 messages · Page 581 of 1
gg
thank you a million
you do
i might change the colours
I never tested it with inactive
it used to use red but it was hard on the eyes
inactive is a bit hard to see
wh-
okay i scared myself for a sec there i'm just an idiot ignore that
you scared me too
i thought it crashed or something
i also need to align the other buttons but thatll take like 30 seconds
coming soon to a jokebox near you
yooooo
cyberpunk themed mod goes hard
its not a themed mod
ah
I just had a cool idea to make this after I figured out the dark arts of UI
its going in jokebox with all my other experimental and wacky bullshit
mhm
regardless thank you I can finally move on to the next joker
Okay so, is_face() is what Canio uses for removed cards, how do I... call for if any playing card at all is removed?
I just realized how similar this Joker actually is to Canio, wow.
I'll worry about that later.
my code probably sucks buuut
if (context.cards_destroyed and (context.glass_shattered and #context.glass_shattered > 0))
or (context.remove_playing_cards and (context.removed and #context.removed > 0)) then
this will do it
context.removed is a table containing all the destroyed cards
in case you need that
i mean looking at how VanillaRemade does Canio i think its pretty easy to adapt
I'm quite actually staring at it right now, yeah.
why does my enhanced card display "error" as the card type?
it is so liberating to be done with the UI code finally
everything else is gonna be so easy compared to that
nvm i forgot to set the name variable
Can someone help me with my config menu? I managed to get it working, but due to me not really understanding config menus and blindly copying code I can't really figure out how to get these last few quirks worked out. (also should I send this in here or in another chat?)
Currently the config menu isn't center and the corners arn't rounded like other config menus that I've seen, is there an easy fix to this?
SMODS.current_mod.config_tab = function()
return {
n = G.UIT.ROOT,
config = { align = "cm", padding = 0.1, colour = G.C.BLACK },
nodes = {
{
n = G.UIT.R, config = { align = "cl", padding = 0 },
nodes = {
{ n = G.UIT.C, config = { align = "cl", padding = 0.05 },
nodes = {
create_toggle{
label = "Weston Mode",
active_colour = G.C.GREEN,
ref_table = CFG,
ref_value = "weston_mode"
}
}
},
{ n = G.UIT.C, config = { align = "cl", padding = 0.05 },
nodes = {
{ n = G.UIT.T, config = {
text = "Restart Required",
colour = G.C.UI.TEXT_LIGHT, scale = 0.4
}}
}
}
}
}
}
}
end```
the lowermost config should have an r=0.1 in there for the roundedness
and also emboss = 0.05
by lowermost i mean the outermost table
idk
language is hard
how would i add a joker to the shop when the shop is entered? specifically in this case any uncommon or rare that's negative
i know the base context of starting_shop but adding things to the shop independently of adding an extra actual shop slot is something I haven't messed with
Ok, I figured out how to do it, I'm just a fool.
hey t while you're still here
One more thing though - when this Joker procs when you remove a card, it's supposed to tell you how much it's value increased by, right? but it just says error?
return { message = localize { type = 'variable', key = 'chips', vars = { card.ability.extra.chips } } }
is there a way to pass func in a ui node and have it accept arguments
am I writing this wrong??
unfortunately no
yeah fair
or you could just store values in global tables and access them from the function
ig its not that big of a deal for now.
no but I need this to be run in a specific situation
I want my buttons to turn red if you dont have enough vram for their hack
but they all have diff values for that
and the code that makes the buttons is a function so I'd need it to use a value passed inside the function for making the button
you are allowed to put things like
store_val = ....
in the config and it wont break
and the function can check if the child has this config field
well the function can't do that
fair
I tried it and it gave me attempt to index a nil value
so im just gonna store it in padding
i wasnt using it for these buttons anyway
and I can just set the padding to 0 when i'm done checking it
im such a smart
no
Thank You! That got the corners rounded, but do you know how to make the space after the toggle the center, rather than the toggle?
and it worked on the first try and I didn't put the > symbol the wrong way around
i have this so far but its causing a crash which i did expect
i'm trying to do SMODS.calculate_effect and SMODS.score_card stuff from a sticker on a playing card. if i do it in context.main_scoring, the other cards are visually scored before the actual played card is scored, which is not what i want. but if i put the calculate_effect/score_card call in an event, it happens all the way after the hand is done playing
is there a way to make draw_to_hand run everytime an individual card is drawn to hand?
i may be stupid nvm
maybe look what the wheel boss does in vanilla remade
different question, is there a way to grab the rank that comes before a different rank?
kinda like un-strengthing somthing
oh, nvm its right there in vanilla remade
It's all in vanilla remade, always has been
Okay, what in the world does this mean.
actually nvm I'm just gonna go to sleep
maybe I can figure it out tomorrow lol
look what it does in vanilla remade
Oh awesome
is it possible to make an enhancement that always scores as a specific rank
possibly? there are modded enhancements that count as unique ranks (see abstract card in cryptid/ceramic card in entropy iirc?) at least
yes
it's not too difficult
you'll have to hook card:get_id()
inside your hook, check if card has your enhancement
and if it does, return an integer which is the rank you want
thx
this will apply to scoring and joker effects
guessing I'd have to do that if I want to make 2s count as queens in my mod then
with a joker
ok the enhamcement im currently working on isnt working :(
if you want cards to count as multiple ranks at once, you should wait for the quantum ranks PR to be merged
yeah
what does vanillaremade mean by "the functionality comes by default by setting highlighting and enhancement" in the commenrs
if you want them to count as both it's hard
but if you want 2s to count as queens you can make them do that, but they won't count as 2s anymore
(i.e. they'll stop retriggering hack, fibonacci, etc)
wee?
I'll just wait for quantum ranks 😔
yea anything that's looking for a 2 will no longer find 2s if you do the hook get_id() approach
please can we call it anything other than quantum ranks
im sorry
we already have quantum enhancements tho
and quantum enhancements are dumb and stupid
anything preceded by "quantum" is automatically dumb and stupid because of it
quantum mechanics
that's just better sounding frfr
it is though but it's still going to end up being called quantum ranks >:(
thatsjust double dna
-# ignore the hypothetical in which i take a quantum physics course next year at uni
also this is a stretch but deck sleeves is technically a limited quantum deck feature
Can anyone help? I made a new edition that basically does what negative does without the shader effect. I have my custom joker set to always have that edition. The only problem is that the shop wont spawn them with the edition (even though the collection shows it as having it. Here is the code for the edition:
Yes, because the weight is 0
unfortunately, that was the first thing I tried changing and it made no difference. I don't want any other jokers (besides what I have set to always have it) to have or obtain the edition, so I changed it back to 0.
Then why do you want it to show up in the shop?
becuase players wont be spawning in jokers during normal gameplay. The jokers that I have set to always have it don't when they show up in the shop.
I have joker1 and joker2 coded to always have the edition using set_ability, and it shows up in the collection when when I use debug plus to spawn them in, but when they natrually come up, they don't have it.
set_ability = function(self, card, initial, delay_sprites) card:set_edition('e_TYN_caseEdition', true, true) end,
put on the top layer of the joker (same layer as cost and rarity)
Try not making it immediate, 2nd argument to false
SMODS.Consumable {
key = "frost",
set = "Tarot",
atlas = "item",
pos = { x = 0, y = 0 },
config = { max_highlighted = 3, mod_conv = "m_nflame_snow" },
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = G.P_CENTERS[card.ability.mod_conv]
return { vars = { card.ability.max_highlighted, localize { type = 'name_text', set = 'Enhanced', key = card.ability.mod_conv } } }
end
}``` hey is there anything that stands out as to why this isnt working
everything is working except the use button
tarot cards should auto-handle it based on the config values sometimes
max_highlighted is self explanatory, and mod_conv converts all selected cards into the listed enhancement
no dice, weirdly enough, when I tried to use a base game edition it still didn't work. The card shakes like it got an edition but nothing happened.
it fixed itself ig
how would i modify a context
for example, what would i have to hook/patch to make context.ending_shop, say, only trigger when a global variable is a certain value
how to use manipulate function from cryptlib?
SMODS.calculate_context
wdym
hook the function SMODS.calculate_context, and only run the reference function if it's not about to trigger ending_shop or if the global variable is a certain value
alright
ok how would you get what set a card is from
card.ability.set
either Default or Enhanced
oke
does SMODS.add_card have any side effects or can the return value be saftely discarded
so I found this https://github.com/Somethingcom515/SealsOnJokers/blob/main/main.lua#L3593-L3617
how to use this function?
I can't seem to understand its parameters
modify_joker_values(card, {["*"] = 2}, {x_mult = 1, x_chips = 1}) would multiply all values on a joker by 2
?
It's the card.
what is the last table for?
Pretty sure it returns the card it creates
But that can be discarded if you don't care about it
oke cool bc im doing something very dumb
That makes it so it doesn't change the default x_mult and x_chips values on a card if they are 1
ok got it thanks
so I got an error about trying to perform on chips which is nil do I add more exceptions or is there another solution?
ok adding more exceptions didn't work
Code?
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] ~= card then
local mult_rand = (0 + (0 - 5) * math.random())
mult_rand = math.floor(mult_rand * 100 + 0.5) / 100
return{
SEALS.modify_joker_values(G.jokers.cards[i], {["*"] = mult_rand}, {x_mult = 1, x_chips = 1}),
message = 'X' .. mult_rand .. " Values",
colour = G.C.XMULT
}
end
end
here
Firstly, move it out of the return, Secondly, G.C.XMULT doesn't exist.
nope still the same error
ok is there like an extra secret function other than
SEALS = SMODS.current_mod
SEALS.perform_operations
SEALS.modify_joker_values
that I need to add to my code?
No, but you should remove SEALS and just have it be function modify_joker_values and function perform_operations
found anything?
Update SMODS
how?
thank you
When does the crash happen?
when I play a hand
What is the full code?
calculate = function(self, card, context)
if context.joker_main then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] ~= card then
local mult_rand = (0 + (0 - 5) * math.random())
mult_rand = math.floor(mult_rand * 100 + 0.5) / 100
modify_joker_values(G.jokers.cards[i], {["*"] = mult_rand}, {x_mult = 1, x_chips = 1})
return{
message = 'X' .. mult_rand .. " Values",
colour = G.C.MULT
}
end
end
end
end
do you need the whole joker or does this suffice?
Are you sure the problem is from this joker?
I don't even know the problem
maybe this happens because of the context bc I looked inside the lua file where this thing happens and it tries to add chips? so is there any better context to use?
What is line 803 in Mods/lovely/dumps/functions/state_events.lua?
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blocking = false,
ref_table = G.GAME,
ref_value = 'chips',
ease_to = G.GAME.chips + math.floor( SMODS.calculate_round_score() ), <- 803
delay = 0.5,
func = (function(t) return math.floor(t) end)
}))
A mod is trying to call a context outside of a game.
ip grabber
I can't still find the problem
man troubleshooting is fun
ok found the problem nvm its not in the code of my mod bc when I tried working on another joker it still gives me the same error so what do I do when my lovely/dump is not working?
does deleting file fix it?
ok deleting it still gave me the same problem
help pls
ok deleting the whole entire joker fixed it so there is definitely something going one there
trying to make a joker that checks for common jokers, but its not noticing them at all if anyone has any insight
also, im curious how i would create a specific tarot card on a condition with a joker since thats the last joker idea i have left before ive made all of them
G.jokers.cards[i]:is_rarity("Common")
Guys, how do i have custom tool tips?
if condition then SMODS.add_card({key = 'c_modprefix_key'}) end
wow i disappear for a billion years come back and this guy still knows everything youre actually so cool tysm !!
trying to not have this whole text wall
how would i find the key for specific vanilla tarots?
oh sick
Add an info queue #💻・modding-dev message
ah very nice
this is probably way too complicated of a joker to be my first 😭
Info queue goes in loc_vars
ok this is crashing when i mouse over the joker for some reason, any clue whats going on here
Because the G.jokers space doesn't exist outside the game
ohhhh its just one of those
Update SMODS
oh yeah that makes sense its been a bit
{ n = G.UIT.T, config = { text = 'X', colour = G.C.IMPORTANT, scale = 0.32 } },
{ n = G.UIT.O, config = { object = DynaText({ string = r_mult, colours = {G.C.IMPORTANT}, pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.5, scale = 0.32, min_cycle_time = 0 }) } },
{ n = G.UIT.T, config = { text = ' All values', colour = G.C.BLACK, scale = 0.32 } },
{ n = G.UIT.T, config = { text = ' insert new line here Warning: very unstable', colour = G.C.BLACK, scale = 0.32 }}
how to insert a new line? when I put \n it inserts a new line but doesn't reset the position
is there a way for the thing to just be plain text?
wdym
actually i think i figured it out
Yes
nvm figured it out
you need the info queue things in the Other tab, you can use loc_txt with it still
oh alright
wanted to just bring everything to the file instead if having loc_text
that's fair
i dont get why the joker isnt getting it tho
it just sorta
all jokers start with j_
oooooh-
Info queues don't have mod prefix
ah mb
Unless you make the key for it have the mod prefix
consumables start with c_ and enhancements start with m_ for some reason
Because e_ is edition
ou
n_ for enhancements would be better in my imo
true
actually how would i use {V:1}s in the localization file since i dont have the vars
v is the variable color marker
or in the tool tip rather
i also think its m which stands for modifier(?)
you return a color in loc_vars
conflict + modifier is a word that makes sense
yah
the variable color works iwth the joker, but i dont know how i could carry it over to the tooltip
what's the loc_vars look like in your joker
you could try setting it to a table ig
⬆️
Nice, BTW you need a name for it to not say ui error
modify_joker_values(G.jokers.cards[i], {["*"] = mult_rand}, {x_mult = 1, x_chips = 1}) ok this thing multiplies the value card limit when a joker is negative how to fix it?
ui error is my favorite
alr
Add card_limit = true, extra_slots_used = true to the exclusions.
ok that one worked thx
m_ prefix for enhancements means modifier btw
ohh
makes much more sense
at least that's what thunk wants it to be
nowadays, modifier usually refers to any modifications on a card (enhancement, edition, seal, custom modifiers added by mods e.g. Ortalab curses, maybe stickers too)
how to create a shader for an edition?
Pretty hard actually
It uses glsl and f#
You can find more on that in SMODS.Edition
I’ve done som shaders in the past but it wasn’t a pleasant experience
Feel free to use anything
Pins
Tho i don’t recommend it i don’t think ai knows anything about balatro shaders Lol
The usage of ai is not prohibited however the discussion of it is banned due to people arguing a lot about it
so I put a bunch of random values in https://patriciogonzalezvivo.github.io/glslEditor/ how do I export it and use it?
Balatro uses glsl and f#
A simplified version of glsl
This won’t work , you need to format it to work
Start by looking at other shader examples in smods/examples
The examples use F# aren't there anyones that us glsl bc that is what the website uses
They use a simplified version of it
As i said
What makes i hard is the lack of documentation
then why does the SMODS documentation recommend?
Because it somewhat translate
welp time to watch random playlist of F# tutorial from 12 years ago
nvm it is not for shaders
Look at love2d shader documentation
how to make the edition do stuff?
You can check the edition example in vanilla remade
how to get the joker that has the edition on it
how to fix the Error where the edition is supposed to appear?
nvm fixed it
but I can't still seem to get the edition to work
calculate = function(self, card, context)
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
end
return SMODS.blueprint_effect(card, other_joker, context)
end
How am I supposed to add a button to the option screen
what are you trying to do
what does missing position or effect function error mean in NewShader
how can i create a shallow copy of a value so it doesnt get overwritten while im doing something
Depends on what value you want to copy
If it's any primitive just store it somewhere
If it's table - well, make deep copy if possible
If cant - make object immutable for period of time
Is there a list of numbers that talisman changes into tables? I wish to add talisman compatibility to my mod before it's too late.
how can i poll enhancements? because vs tells me it doesnt exist
why is this not working this is an edition btw
the issue is that SMODS.blueprint_effect function is not working
nvm i read teh code wrong
did you look at the code for blueprint?
search for blueprint
this is the code I copied
oh
from blueprint
everything works the loop the check the other_joker value it is the function that is not working for some reason
i thought blueprint doesnt retrigger edition effects
I did on a joker it works fine
i think hes making an edition that retriggers jokers
ohh like quantum
It's SMODS.poll_enhancement
oh ty
No, because that doesn't exist.
oki
I making an edition that makes the joker act like blueprint
ok how about this how do I make the joker next to it retrigger?
I mean that is similar to blueprint sort of
ok I managed to do it just had to add context.other_card == other_joker
i got this code that transorms played cards into stone card, how could i change it into transforming heart cards into a custom suit (or should i just change it completely)
Change suit like how the star card does it for example
And use your custom suit key
yh just im working on smth real quick might have figured it out
SMODS.change_base(card, 'modprefix_key')
sooo i got this but it doesn't do anything except trigger the message
card is the joker.
Card refers to the joker card
yeah i got it, been a long time since i've been doing stuff
still wtf should i do T-T
Save the c variable of the for loop after finding it
In another variable
mmmmmhhhh
So I've just gotten started poking around, and I've things I couldn't seem to find documented if anyone could answer for me.
-
Is there any way to access LÖVE's functionality from inside a mod with steamodded? Like, the underlying engine - not Balatro's data. (I don't think I want lovely? I want to call things arbitrarily, not as a patch, I think is why?)
-
Is there any way to react immediately to a mod's config change? The only option I'm finding so far is reinit of all mods.
-
Tied to 2, what is the actual mod lifecycle here? I've been trying to trace it through mod load (during "boot") and up into gameplay for the example custom deck mod. [Late edit: 2 has been answered below. I believe I can disregard this for the time being if nobody answers it but I am still curious.]
1: Yes, love functions are in love
Ah! Thank you! I'm not sure how I missed that one. That's one of three 😄
2: Yes, the callback function.
i thought i understood but not visibly 😭
-# im a begginer btw don't expect me to code cryptid
I don't think the function is necessary
if context.joker_main then
local targets = {}
for _, c in ipairs(context.full_hand) do
if c:is_suit("Hearts") then
targets[#targets+1] = c
end
end
if next(target) then
for _, c in ipairs(target) do
SMODS.change_base(c, "parj_bugged")
end
return {
message = "aww man :("
}
end
end
this is how I would do it
ok but i still need a calculate right ?
(and thanks a bunch btw <3)
im just missing an end x)
yes, the snippet above is meant to be inside calculate
also
I suggest context.before if you expect the suit change to affect other joker calc in that hand
how to register a card in-game time through code?
Can someone help me with this talisman crash? #⚙・modding-general message
Like, on config? It showed in the guide only something like:
return {
["setting_1"] = true,
}
Or is it something like, well, hold on. Let me search here...
- one search later -
So then it's more like, for example
create_toggle(
{
-- stuff here and
callback = (function() end) -- or however a function is done, or really any function
-- rest of the stuff here
}
)
In the current_mod.config_tab(), right? That makes so much more sense, omg. Here I was trying to find it on the config.
where is G.STATES set
got a little problem tho, your code only changes the suit of only the first played
sorry for the usless ping but i gotta go (got told rn sooooo)
globals.lua
oops, your previous snippet confused me for a bit
there, updated
bump
what version of Talisman?
The newest 2.5
Okay, don't know what though :(
I mean, I already tried it with and without other mods and it still happens
Is it because there is no config?
I don't know but is there a channel/server for talisman?
in the cryptid server, for example
Is there a way to prevent a list of jokers to be replicated by Invisible Joker?
By invisible joker specifically or copied at all?
More like, restrict players to have only one of that joker in a run.
all while blueprint compatible
In add_to_deck you would check if it already exists and if it does, destroy it.
Operating the restriction inside add_to_deck method, got it (Kronk face).
anybody know any mods that have jokers with advanced spriting shenanigans? i want to see if i can combine two joker textures into one dynamically
blueprint
the one that gives blueprint a custom texture that copies the joker its copying
oh yeah i know that one
but thats just copying the texture and applying a shader no?
is it
uhhh cryptid has error ig
ill look at it anyway i dont know how to do textures dynamically yet anyway lol
You mean like this?: #💻・modding-dev message
indeed
it would be a godsend if you just happen to have this laying around
if G.P_CENTERS[key].pos then
G.shared_fractioned_cards[fractions][fraction][key].center = Sprite(0, 0, 71, 95, G.ASSET_ATLAS[G.P_CENTERS[key].atlas or v.set or 'Joker'], G.P_CENTERS[key].pos)
local x, y, w, h = G.shared_fractioned_cards[fractions][fraction][key].center.sprite:getViewport()
local fractionedw = w / fractions
G.shared_fractioned_cards[fractions][fraction][key].center.sprite = love.graphics.newQuad(x + (fractionedw*(fraction-1)), y, fractionedw, h, unpack(G.shared_fractioned_cards[fractions][fraction][key].center.image_dims))
end
``` This is the part that fractions the sprites.
You would just have to draw the fractioned sprite on the card.
If you're only doing jokers and doing only 2 it would be less complicated.
where would i put this?
Then fractions would be the number of fractions on the card, and fraction would be the current fraction.
In a SMODS.DrawStep
okay then let me see
im a novice when it comes to drawsteps but i think i know what i can do with this
how do i initialize G.shared_fractioned_cards properly?
G.shared_fractioned_cards = G.shared_fractioned_cards or {}
G.shared_fractioned_cards[fractions] = G.shared_fractioned_cards[fractions] or {}
G.shared_fractioned_cards[fractions][fraction] = G.shared_fractioned_cards[fractions][fraction] or {}
where is the ui structure for this
is that v.set supposed to be key.set?
no not key.set
No, v was the value of a table that has information about all the merged cards.
i see
G.ASSET_ATLAS[G.P_CENTERS[key].atlas or 'Joker'], G.P_CENTERS[key].pos)
oh cmon
Did you define key?
local key = G.maxboism_merged_area.cards[v].config.center.key
let me check if that actually defines it though
key is supposed to be smth like j_greedy_joker right?
what's the key for mega spectral pack
Yes.
p_mega_arcana_1 is for mega arcana but what about mega spectral
p_mega_spectral_1 probably?
p_mega_spectral or p_mega_spectral_1?
p_spectral_mega_1
Also no, it's p_arcana_mega_1 and p_arcana_mega_2
okay so key is nicely defined but it still crashes
Why are you putting merged cards in a card area?
because my bum ass was unable to create fake cards so into a card area they go to be called when needed
It's different if you want it to keep editions and seals.
saving this
to consider later rn i want to get the rendering working
context for using a specific consumable
context.using_consumeable and context.consumeable.config.center.key == "c_modprefix_key"
Did you define G.shared_fractioned_cards[fractions][fraction][key]?
= or ==?
.. i may be smart :clueless:
almost there
What is the issue?
the right side is the default texture, and the second half is actually rendered under the first half
i probably fumbled the texture application
Yes, you need to offset it's x by ((G.CARD_W/fractions)*(fraction-1))
yuup how do i make them glue instead of having their own rotation
sorry for asking 20 dumb questions in a row btw
What do you mean glue?
as in inherit the rotation from where its applied
i thought set_role({major = self, role_type = 'Glued', draw_major = self}) would work
This only fixes some of it:
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = '''
love.graphics.translate(
moveable.VT.x+moveable.VT.w/2 + (offset and offset.x or 0) + ((moveable.layered_parallax and moveable.layered_parallax.x) or ((moveable.parent and moveable.parent.layered_parallax and moveable.parent.layered_parallax.x)) or 0),
moveable.VT.y+moveable.VT.h/2 + (offset and offset.y or 0) + ((moveable.layered_parallax and moveable.layered_parallax.y) or ((moveable.parent and moveable.parent.layered_parallax and moveable.parent.layered_parallax.y)) or 0))
'''
position = "at"
payload = '''
love.graphics.translate(moveable.VT.x+moveable.VT.w/2, moveable.VT.y+moveable.VT.h/2)
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = '''
love.graphics.scale(moveable.VT.scale*scale)
'''
position = "after"
payload = '''
love.graphics.translate(
(offset and offset.x or 0) + ((moveable.layered_parallax and moveable.layered_parallax.x) or ((moveable.parent and moveable.parent.layered_parallax and moveable.parent.layered_parallax.x)) or 0),
(offset and offset.y or 0) + ((moveable.layered_parallax and moveable.layered_parallax.y) or ((moveable.parent and moveable.parent.layered_parallax and moveable.parent.layered_parallax.y)) or 0))
'''
match_indent = true
am i tripping or is something up with the top
Yes, as I said it only fixes some of it.
goddamnit every time you chime in to help i become a bumbling buffoon
tysm
amazing
god damn
michendish
grovendichel
Cool trainer.
tmtrainer
What the...
god bless 515 for just having this on hand i wouldnt be able to figure this out for a long while
isn't there a tool somewhere that lets you apply any balatro edition shader to a sprite and export it as an image? can't find it anywhere
damn it still runs
(i stacked it like 5 more times)
taking a while though
Did you switch to fake cards?
not yet
but its also calling the same two cards as i directly copied the joker
so theres a chance im just reapplying drawstep too many times maybe?
based on the fact the game still lags after the joker is sold i am under the suspicion that im fumbling the drawstep
it does work again if i start a new run
how do I spawn a ethernal joker for a deck
in the apply function
Yes, hook G.UIDEF.use_and_sell_buttons
oh hey its the joker from before
im working on it actually working as intended now
which is alot more difficult than i thought
is there a downside for it being left in charge mode constantly
it doesnt do anything
at all
neat
or like campfire kinda
looks cool
yeah kinda
yeah ik but I have that and it crash
Ethernal
its "eternal"
also i think youre supposed to put it in an event
How do i make a card shake for the first hand
You mean like DNA?
yea, it works exactly like dna except it doesnt matter the hand type
look in vanilla remade
I mean the card is generate but the ethernal isnt there
wth is this
eternal
abomination
Yes, it's stickers = {"eternal"}
Estradiol: On first hand, turns all face cards into queens
so i want it to shake on first hand like DNA
oh ok thx
does anyone know how i can replace blue stake's -1 hand with an extra showdown blind
like one showdown blind on ante 4 and one on 8
elaborate?
etc etc
Take ownership of it, and hook/patch get_new_boss
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
hey question how to make consumable give mult like a joker when in a consumable slot?
Use the calculate function.
erm i think its peam
game code remade by smods
anything more detailed than that?
No.
yeah doesnt seems to work too
force_stickers = true
well then i have no idea how i could do that, never done anything like this before
Yes.
so does anyone else know how??
yeah but like
:clueless:
i have no idea how tf i do that nor do i know what that means
i cant code i just want blue stake to be cooler 😭
Right, I concede, I actually need help.
https://github.com/Steamodded/smods/wiki/API-Documentation#taking-ownership https://github.com/nh6574/VanillaRemade/wiki#whats-a-hook https://github.com/nh6574/VanillaRemade/wiki#whats-a-patch
I'm trying to make two jokers merge with each other.
Currently I'm doing that by making a card delete another when it exists, then add the new card before deleting itself?
but I'm not sure how this works, so.
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove("j_tica_unus")
SMODS.add_card("j_tica_unusannus")
card:remove("j_tica_annus")
return true
end
}))
end
end```
where i can read about using that?
Pain of not knowing anything about lua.
Nowhere.
wait whuh
(
so where do I actually send these things?
because I've been told to redirect convos about this both ends now.
That's for merging the cards.
I meant specifically about adding buttons
Yes, there is no documentation on that.
Oh wait, this line of code is to actually merge cards automatically?
No, it makes it so a joker can also act as another joker.
Ive already figured it out(((
Oh, huh.
I was more so thinking along the lines of two jokers deleting themselves and adding a new joker, but I guess that works.
Can you change the name of the Joker when it 'merges'?
Yes, but you would have to hook generate_card_ui
so does anyone know how i can make blue stake do a showdown blind every 4 antes instead of the usual -1 hand
cuz i'm stuck
how does get_new_boss work?
yo wait
It's called when the boss blind is chosen.
ok, then what?
hey i just need some quick help. my balatro is silently crashing now that i've updated some mods. i think this is the error? it would be nice ty
INFO - [G] Error: [love "boot.lua"]:48: Failed to initialize filesystem: already initialized
stack traceback:
[C]: in function 'init'
[love "boot.lua"]:48: in function <[love "boot.lua"]:42>
[C]: in function 'xpcall'
[love "boot.lua"]:357: in function <[love "boot.lua"]:355>
[C]: in function 'xpcall'
still here lol
You hook it.
ok is it this??
{
modifiers = function()
get_new_boss
end
},
true
)
cuz i dont think so
but thats all you gave me
i figured
that's all the information i have
was about to ask you something tho
ps it's balatro multiplayer causing this. does some1 know a fiix?
No, it's not, I gave you 3 links.
you still can
i know
which subreddit is your mod, r/balatro or r/okbuddyjimbo
how would i have the text be below the joker instead of above the current scoring card?
Patch card_eval_status_text
r/balatro is what we mostly see and have feed on
sweet
i was about to like
work on the same thing like you
but for r/okbuddyjimbo
i thought youve done it first
so i was like, okay maybe not
how do i change an entire played hand's rank
what do you ened
Try focus = card in the return
i would assume you can look at that one spectral card
im blanking out on the name
ouija
yah
i want blue stake to make showdown blinds appear every 4 antes instead of 8
and remove the -1 hand
i tried, and the code is confusing. I assume cuz its an entire hand thing and not a played hand so you cant do for k,v inpairs stuff
im using midas mask as a base cuz its supposed to only replace face cards, i just dont know how to replace the "make gold" with "make queen"
Yes, you would take ownership of it, and hook/patch get_new_boss so that showdown blinds show up double as often.
thats a cool rebalance idea, tho hopefully you have more showdown blinds
is there an easy way to tell which set a held consumable is in in code
Yes, card.ability.set
not currently
just smth small i wanted to make
does anyone know how? is it like scored_card:set_rank('m_queen', nil, true) or something
ok but like, i have absolutely no idea what this means
so it's not helping
try searching in the chat 'take ownership' and see if someone else has explained that
or that yeah
i literally just told you i looked through that and it didnt help either
@daring heron
i just dont know how to make showdown blinds appear twice
i'm trying to stay calm but as i told you, this isnt helping
well look at the base code for get_new_boss and look for the number 8, if you find it try patching it to 4 and see if it works
i know how to take ownership of stuff
nope
someone explained it to me b4 hold on, lemme try to get an explanation
nevermind, i honestly don't care anymore
ok so first make a file called lovely.toml in the same location as main.lua
and paste this code into it:
version = "1.0.0"
priority = 0
# Define a var substitution rule. This searches for lines that contain {{lovely:var_name}}
# (var_name from this example, it can really be anything) and replaces each match with the
# provided value.
# This example would transform print('{{lovely:var_name}}') to print('Hello world!').
#
# USEFUL: For when you want to reduce the complexity of repetitive injections, eg. embedding
# release version numbers in multiple locations.
[vars]
var_name = "Hello world!"
# Inject one or more lines of code before, after, or at (replacing) a line which matches
# the provided pattern.
#
# USEFUL: For when you need to add / modify a small amount of code to setup initialization
# routines, etc.
[[patches]]
[patches.pattern]
target = ""
pattern = ""
position = ""
payload = '''
'''
match_indent = true
times = 1```
it has a comment explanation
its really simple enough
i could try doing it for you but im not the best coder so idk if itll work
im just bad with execution lol
im just a girl lalalalalalalala
i mean you're free to try
cebee and their problems...
bro 💔
whatd i do this time
anyway how do i actually make it so blue stake does that
code it yourself 💔
i'm TRYING
patches are bad
You can do anything you'd do with patches with "hooks"
hey there hum what should I hook if I want to modify the final score of each played hand by a set coefficient modified by a consumable
No, that's the entire point of patching, you can't do them with hooks.
all i saw you do is paste take ownership code and add a function into it's modifiers
AND NOT CALLING IT
mom and dad are fightinggggggg
mood
Well they are not exactly hooks
i have no idea how hooks work
It's just overwriting a function and then recalling the upvalue of the previous function
https://github.com/nh6574/VanillaRemade/wiki#how-do-i-give-a-card-a-random-enhancementeditionsealetc
thats a hook
like local function a()
print('b')
end
local last_a = a
local function a()
print('a')
last_a()
end
it allows you to add stuff to a specific existing function
its when you do things to functions
that's not a hook though
It's just calling upvalues of previous functions
hooks are set with debug.sethook and are a bit more complex
No, that is a hook.
https://www.lua.org/pil/23.2.html this is a hook
as you can see they are much different
according to smods documentation there are
yeah but according to the creator of the LUA programming language that's not a hook
now yeah
Perhaps, but that is still a hook.
maybe lua has a base hook idea
Not really
he's not pivoting his foot correctly
where's the pivot
also his chin is up
always keep your chin down when boxing
or you'll get koe'd
no
whats the file that controls when boss blinds show up?
is it blinds or game or a secret third thing
You can and patches breaks way easier cuz you're just doing string replacements
No, you can't.
ok seu i think the fact theres an argument to begin with means that they both have merit so it doesnt matter which is used
can we move on to helping instead of arguing
Ok give a example
cuz theres a few people who still need help but the chat is being filled
you mean in original game code?
yes
UI?
Don't look there
Are you talking abt the boss blind UI
oh
WAIT
NVM I JUST REMEMBERED A MOD THAT DOES THIS ALREADY
HAHAHAHAH I LOVE STEALING THINGS I LOVE TAKING THINGS THAT ARENT MINE
ok mae
:b
just see in vanilla remade...
ok but counterpoint
no counterpoint
dog deck from undertale mod changes when boss blinds show up so i could just look at that deck's code and change the number from 9 to 4
ez pz lemon greazy
Or you could look at the function called get_new_boss() at common_events.lua
it isn't exact as nh needs to work on it but he spent a long time translating the vanilla items into smod code as a good way to learn and reference
i was asking which file has get_new_boss
No one knew cuz you didn't specify it
sure bud okay
you asked the file that controls when boss blinds show up
cool
why would i mean ui man.....
OH
OH WAIT I JUST GOT IT WRONG
I MEANT SHOWDOWN BLINDS
IM SAYING BOSS BLINDS I MEAN SHOWDOWNS
silly meeeeee
code:gsub(...,"...")
i think there's a value boolean i think they makes it a showdown boss blind
Lua parser and abstract syntax tree in Lua. Contribute to thenumbernine/lua-parser development by creating an account on GitHub.
what abt this
@daring heron i have an untested hook
local new_boss_ref = get_new_boss
function get_new_boss()
if G.GAME.stake == 5 then
local old_win_ante = G.GAME.win_ante
G.GAME.win_ante = 4
local ret = new_boss_ref()
G.GAME.win_ante = old_win_ante
return ret
end
return new_boss_ref()
end
if it works you just have to remove the -1 discard
whats that for
Read the code and understand :3
you can change it to number 3 without patching
nvm it changes when the win ante is
3??
there's a better way to do that
ok
from that statement alone
i know what you mean
By replacing the abstract syntax tree then converting it back to code
doesnt this make the game win at ante 4?
i think cebee wanted ante 4 to be showdown but ante 8 to win still
i don't think it should?
i mean i assume, it says G.GAME.win_ante
it just changes it temporarily and then restores it
OH MY GODDDDDDDD
Cuz patches can break easily
Wym???
@ocean sinew @daring fern can yall pls take this into dms or something. Its clogging the channel
me and him are talking abt patches
ppl are trying to get help and its hard when we get washed over with continuous hook v patch arguments
Patches are fine, hooks are fine
ok, now that thats over i think
I only just recommend to not be like me and be over reliant on patches
I had over like 1300 lines once and not ideal
Im down to like 700 something now
bump
I am just bad at what I do :b
its programming, whaddyagonnado
Thats what im sayin
theres always SOMETHING a coder's over reliant on
SMODS.change_base(card, nil, "Queen")
ty ty
function get_new_boss()
if G.GAME.round_resets.ante%4 == 0 then
local showdown_bosses = {}
for i,v in pairs(G.P_BLINDS) do
if v.boss.showdown then
showdown_bosses[i] = true
end
end
end
use that to get all showdown bosses for example
???
thats just wrong
how
why would you mod a stake by 4
he said he wants showdown bosses to appear every 4 antes instead
.
The ante is not the stake.
wouldnt you mod 2 then since its halving 8
or am i stupid
hey real quick, anyone know what G.consumeables.cards.ability.edition will return for a normal planet? And if I even did that right lol
ok fixed
%4 == 0 means It's a multiple of 4
%2 == 0 means It's a multiple of 2 and vice versa
it overrides the function, doesn't do anything with the values, doesnt handle banned keys, etc.
🥺
nil because G.consumeables.cards is a table of cards.
It's almost like It's a example and not the full function
.
so sassyyyy
It would still return nil even if it was a card.
ok sweet thx
so to double check, this should replace face cards with queens?
local faces = 0
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_face() then
faces = faces + 1
SMODS.change_base(card, nil, "Queen")
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end```
I assume it would return an edition if it had one though?
No, card.ability.edition doesn't exist.
No, card is the joker.
SMODS.change_base(scored_card, nil, "Queen")
scored_card
gotcha
@daring heron
when you loop through a table the first thing you put as a arg is the index and then in the second It's the value
its here cebee
not anymore
WTF
<3
why are you so meannnnnn
sweet
local new_boss_ref = get_new_boss
function get_new_boss()
if G.GAME.stake == 5 then
local old_win_ante = G.GAME.win_ante
G.GAME.win_ante = 4
local ret = new_boss_ref()
G.GAME.win_ante = old_win_ante
return ret
end
return new_boss_ref()
end
SMODS.Stake:take_ownership('blue',{
modifiers = function()
-- Look get_new_boss hook
end,
loc_txt = {
name = "Blue Stake",
text = {
"bla bla",
"bla bla"
}
}
},true)
would I use like center? sorry I just don't know what to reference that checks editions of consumables
card.edition exists if the card has an edition.
calculate = function(self, card, context)
if context.first_hand_drawn and not context.blueprint then
local eval = function()
return G.GAME.current_round.hands_played == 0 and not G.RESET_JIGGLES
end
juice_card_until(card, eval, true)
end
local faces = 0
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_face() then
faces = faces + 1
SMODS.change_base(scored_card, nil, "Queen")
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
end```hughgngnngnghnnrnrrgnrghnrnughrng
its not in a context checl
bad argument #1 to 'ipairs' [table expected, got nil]
🔥
yes. i know. thats why i was confused cuz i dont know what that means.
but strn explained
It expects a table but it got nil
i should change my name back
Wow! Cool! thanks for the info!
very helpful!
Yeah that's a big problem
is there a display_size for a card's front?
I KNOW WHAT NIL IS
fucking whatever dude @rotund sable already explained the problem
I almost fell for the joke
i believe normal formatting works in the name as well
like {s:2}Hi{}
I actually believed you didn't knew what nil was
not what i mean
No.
np
so now i have to believe my brain is too tired for anything
??????????????????
🤤
Code?
what in the vanilla game uses Card:explode()
its supposed to change it after scoring, but its like instantly changing it into queens
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_face() then
faces = faces + 1
SMODS.change_base(scored_card, nil, "Queen")
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
end```
also is there a context for first hand
G.E_MANAGER:add_event(Event{
func = function()
end
trigger="after",
delay=0.2,
})
will change after 0.2 seconds
Booster packs.
thats NOT WHAT IM ASKING
I WANT IT TO CHANGE AFTER SCORING
context.final_scoring_step
change them in the event
or this
ty
when scoring, the game runs through everything instantly ^u^
Which is what I said
so u need to tell it to hold its horses
Set the fourth input to true in SMODS.change_base and do scored_card:set_sprites(scored_card.config.center, scored_card.config.card) in an event.
You need to make the fourth input equal to true then set the sprites by hand
that doesn't help ;u;
thanks for just rewording what he said with no explanation. Very descriptive!
also which script handles display_size? i can't find it
np
Card:set_ability
👍
its not changing them now :(
if context.after and context.first_hand_drawn then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_face() then
faces = faces + 1
SMODS.change_base(scored_card, nil, "Queen", true)
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
scored_card:set_sprites(scored_card.config.center, scored_card.config.card)
return true
end
}))
end
end
--[[Set the fourth input to true in SMODS.change_base
and do scored_card:set_sprites(scored_card.config.center, scored_card.config.card) in an event.]]
end```
context.after and context.first_hand_drawn don't happen at the same time.
Wuh
lord what have i done
Whats the context for 'first hand only' then
G.GAME.current_round.hands_played == 0
I got that Fanta in my Balatro! Fanta in my Balatro! I gotta take a SHIT every time I wanna sell one of these FUCK!
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(self)
card:remove("j_tica_unus")
SMODS.add_card("j_tica_unusannus")
card = nil
return true
end
}))
end
end
}```
How is this written wrong actually? I feel like I'm close but I don't really understand.
What's the error
what should i have done 😭
Sorry 515, I didn't understand anything about the fusion code...
What is the goal?
make the sprite that renders on top of the card 40x taller
So it's if context.after and G.GAME.current_round.hands_played == 0 then?
also i'd love to change the position of that sprite too, to allow it to be 80x taller
Yes.
Gotcha
Why are you putting it as the front?
there doesn't happen to be something that grabs a table of your hands that have been played most? as in it'll give multiple if theres a tie. I just wrote some code to do it before realizing there might be smt built in
Aura did that 😭
there's also a bug with the fronts caused by changing deck skin, so i'd love an alternative
Also the values in T are not by pixel size.
ah icic
