#💻・modding-dev
1 messages · Page 506 of 1
@maiden phoenix does your mod have sleeve?
hey i did that too
Mind sharing how? I just really want this to work
Or did I misunderstand what you meant?
you gotta edit the sprites first
and you have to define the atlas after that
there's the res
dont forget 2x and 1x
thx
here's the 2x
The upgrade's better
Yeah so it doesn't work apparently? I've done everything that would make sense
oh wait
i forgot the essential
put this under py
prefix_config = { key = false }
}:register()
make sure you set your mod's priority otherwise it'll clash with other mods that modifies main menu logo
thx it works now
you're welcome
how do i make a joker not show up in booster packs
in in_pool
return not args or args.source ~= "buf"
buf
buf
buf?
buf as in buffoon
in smods how do i create my own parts for pokerhands like that i can put in the evaluate?
ik i just dont understand how to define the part and how it works cause it doesnt explain it
here's an example from my mod
it works the exact same as a pokerhand but you can reference it in other hands
Yu-Gi-Oh! Mod for Balatro. Contribute to nh6574/JoyousSpring development by creating an account on GitHub.
i still dont understand
Well you will need to be more clear as to what you don't understand
i want to make a part which is like flush with 4 finger but as a part so that i can use it for a poker hand later
but i dont understand the structure and the way to define the part and the part where the cards are
no
but i dont understand what that means
It's a function that returns the list of hands that make your poker hand
ok like is there an example
you have to define the function for that specific poker hand. it gets parts (a table of all the poker hand parts contained in the played hand) and hand (a table containing all the played cards) as arguments, you have to check the hand for whatever criteria you want, and then return a table of all the cards that should score
defining a poker hand part doesn't get the parts as an argument, just the hand
but like i dont understand lua i just want the basic things needed to make the part work and a basic thing of like what it does and i can do the rest
you kind of need to understand lua to mod the lua game
Sadly, for poker hands you need to have some basic lua understanding nailed down
It's not that hard, it's just checking cards in a loop and adding them to a table but if you don't understand that there's not much we can do to help other than write the code for you
If you have any questions about the specific parts you don't understand we can help you out with that
ok what do i check for for a flush
that there are X cards of the same suit
the way this does it is it goes through every suit and counts if the cards have it and adds them to a table
this i mean
if the number is higher than the number you want you return the table with the cards
(btw you can literally just copy that code and hardcode four fingers to 4 if thats all you want)
oh
is it possible to add extra messages in 1 joker
return {
message = "message 1",
extra = { message = "message 2" }
}
is there a function that triggers after all objects are loaded into the game? for reference i want to check if a joker is from my mod and has the default Joker atlas, if it does i want to change its sprite_pos
Yes
Game:main_menu?
could this work alterantively
that gets called when a card is created, so by that point just use set_ability
what does #hand mean
in your mods folder
can someone just like. give me a brief explanation of luajit2 because im a little confused on if its meant to speed things up or help with metatable comparison or what, it seems like complicated stuff, cause the thread seems to be saying it helps with speed but when i bring up metatable comparisons i seem to get pointed to luajit2
I don't know much about it but it's luajit with some things backported from newer lua versions like being able to change the metatable stuff for comparisons
i see
what is SMODS.four_fingers() and SMODS.Suit.obj_buffer
SMODS.four_fingers() is a function that checks if you have four fingers and returns the length of the straight/flush (it's there for other mods to hook)
SMODS.Suit.obj_buffer has a list of all the suits
Yeah when I turned it off it works
where is src - utils
Idk what to put
SMODS
yea but where in smods
smods/src/utils
to_big() the two values?
hii
The G.Game.chips part?
to_big(G.GAME.chips) - to_big(G.GAME.blind.chips)?
Is there a way to check if a Joker has a certain function in its definition? for example, add_to_deck
Nope
type(joker.config.center.add_to_deck) == "function"
holy peak
Good schmorning chat
hiiii
hiiii dilly
Hello hello
to_number them instead?
to_number will probably work but break with high numbers
¯_(ツ)_/¯
to_big: number -> bignum
to_number: bignum -> number
to_number actually gives you a number.
why not just... add a to_big check...am i missing something (example image)
Makes sense
wtf does four_fingers and 1 or 0 mean
this is a problem with a return, no a comparison
well, it's a comparison that talisman hasnt patched yet
ohhh okay carry on
if four_fingers is not falsy then the value is 1 else it's 0
Im dreading attempting fridge work today
God punishes me for being free
so if its a number then its 1 otherwise is 0
0 is truthy in lua, only false and nil are falsy
like ik logic gates and boolean algebra i was just wondering why
joker is the word "joker" or would something like v replace it if it's a key in a table?
the link i sent explains how it works in lua
yeah it's the card
me when I worked with Lua that treated 0 as false.
it ltterely is if nil or fals give 0 else give 1
evil lua
and that works for joker keys or do i have to do something special?
SRB2's implementation of Lua is based on a modification of Lua 5.1 called BLUA (which stands for "bastardized Lua"...
if you have the key then type(G.P_CENTERS[key].add_to_deck) == "function"
All lua is bastardized, thats the secret
"bastardized Lua"
😭
Hmm
What do you guys think 4 equals
god i wish there was an easier way to do this /ref
i will add this to my mod https://github.com/thenumbernine/langfix-lua
I will add you to my mod
yay
win
this has +=
Nobody likes those
im nobody
Will you go see a cyclops
so something like this?
https://youtu.be/VyezQsI-v-s&t=56 is also a no body then.
Here are all scenes and quotes of the flying Mario head from Mario Teaches Typing 2.
4K 60fps Gameplay Recorded and Edited by Nintendo Unity.
Friends
Gaming Evolution: www.youtube.com/GamingEvolutionX
yeah
peak
ok if i did this right i might have just made cross ijiraq functionality
I will disable it
i will kill you i was up until 4
Fix my fridge rn
well for starters is it running
No it fell
then you bett- oh
⬜
set_blind = function(self)
local count = 0
for _, hand in ipairs(G.GAME.hands) do
if hand.played and hand.played > 0 then
count = count + 1
end
end
if count > self.config.extra.max_hand_types then
G.GAME.round_resets.discards = G.GAME.round_resets.discards - 1
ease_discard(-1)
end
end```
Any reason this doesn't work? I want to give -1 discards if number of hand types played > config
Yep, i can't understand why it doesn't work
Actually not
let me try
oh it should be pairs not ipairs
hello devs
Sorry to bother, i honestly cant remember its been so long, did i set this up right
SMODS.Joker{
key = "twitch_viewers",
config = {
extra = {
avg_viewers = 0
}
},
loc_txt = {
name = "Twitch Viewers",
text = {
"Avg Viewers: {C:attention}#1#{}",
"{C:inactive}(via TwitchTracker){}"
}
},
pos = {x = 0, y = 0},
rarity = 2,
cost = 4,
atlas = 'CustomJokers',
blueprint_compat = true,
eternal_compat = true,
loc_vars = function(self, info_queue, card)
return {vars = {card.config.extra.avg_viewers}}
end,
}
it looks correct
card.ability.extra.avg_viewers in loc_vars
did i switch the two by accident
but also you dont need eternal_compat = true because thats already the default
oh right, oops lol
wait, what is wrong with it? sorry
the config gets saved to card.ability
OH
why the hell did i put config lmao
no wonder it wasnt working
thank you so much
are my comments understandable /genq i want to make sure this isnt hard for people
I would recommend adding the comments like this so they get autocomplete
you can do that??
also your function names are maybe a bit too generic
oh or are those inside Hyperglobal
yep!
ah then it's fine
ok im gonna try the comment thing
config = { extra = { discards = 1, max_hand_types = 6 } },
loc_vars = function(self)
return { vars = { self.config.extra.max_hand_types, self.config.extra.discards } }
end,
}```
any reason this localization does not work for blinds?
if you do a --- comment above a function vscode should give you a template
ooo even better
what part doesnt work and how does the localization look
it just shows nil
bl_ina_inazuma_town = {
name = "Ciudad Inazuma",
text = { "Si has jugado más",
"de #1# tipos de mano",
"-#2# descarte" }
},```
i think blinds need a collection_loc_vars
wait since exceptions gets referenced within a different function but both are in the Hyperglobal table, would i leave it as is or do this
okay, so im making an api call, would i be printing data.body, because of right now its only returning the number 200 when it should return "{"avg_viewers":714,"avg_channels":43,"rank":230,"hours_watched":120232}"
calculate = function(self, card, context)
if context.joker_main then
-- Make the call to the fuckin website
data = https.request("https://twitchtracker.com/api/games/summary/balatro", "GET")
print(data)
end
end,
you mean commenting the field?
no i mean how to reference exceptions
but this is useful too
it has 3 returns
exceptions or Hyperglobal.exceptions
the second one i think
ima keep it a buck 50, i got no idea how to deal with 3 returns
ok got it
where am i supposed to find the code im looking for ?
local code, body, headers = https.request(url, options)
It's because it should be http.request(url, {method="GET"})
local code,body,headers=http.request(url, {method="GET"})
it works fine without it so
oh then you don't need to do that
alright so now that im back to the drawing board, you guys have any idea how to make seals work on jokers within a specific card area without patching that cardarea into joker eval?
i have seals working on jokers themselves, so i tried then integrating a cardarea check into my hook but that showed no results
wym with that?
i have a joker which stores other jokers, currently i have seals working on jokers
they do not work if stored within the joker
wait i mightve just done it
What did I do wrong?
credits to @maiden phoenix
# Sprite in description
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "elseif part.control.E then"
position = "before"
payload = '''
elseif part.control.tngt_S then
final_line[#final_line + 1] = {
n = G.UIT.O,
config = {
object = Sprite(0, 0, 7, 3, G.ASSET_ATLAS["tngt_goddamnit"], {x = 0, y = 0}), align = "cm"
}
}
'''
match_indent = true
# Sprite(px, py, width, height)
@worthy stirrup
do you have P_seals written somewhere
Thank you
ill try
Well what's supposed to replace it?
P_SEALS
I am making a custom consumable type, I have the name right and stuff, but all the cards have an 'error' type?
do you have a loc_txt or localization file? can i see it
I have a localization file
it should be en-us
in the dictionary it should have k_sanguine as well
ah, thanks
Ok what now?
please post the code as well
does return make the param return as a string? cause if i can just do thaat, then can i set these to something and them have them be taken AS strings?
Here
this is just documentation for vscode to give you warnings and autocomplete, it doesn't have an effect in the code
yes
no clue what i did but sure
i hate you for it but thank you
you wrote crad instead of card
crad shuffler
Where?
oh god damn it...
I have sure I didn't miss any
guess one slipped through the cracks...
hello, what's the atlas for planet cards ?
its because the atlas youre referencing doesnt exist
or the atlas cant be generating because you reference a file that doesnt exist
or something
i dont know how to syntax help SMODS.PokerHandPart { key = "flush4", func = function(hand) local ret = {} local suits = SMODS.Suit.obj_buffer if #hand > 4 then return ret else for j = 1, #suits do local t = {} local suit = suits[j] local flush_count = 0 for i=1, #hand do if hand[i]:is_suit(suit, nil, true) then flush_count = flush_count + 1; t[#t+1] = hand[i] end end if flush_count == 4 then table.insert(ret, t) return ret end end return {} end end }
I pu the atlas Tarot' tho
smods will append your prefix to the atlas
does it?
so if you want the default you need to remove that line
oh like that nv
yes, you can tell it to remove it tho
hello?
Now I fully don't understand, because it clearly exists?
i was going to help once i got on my pc to read the code well but you're being annoying
it has to be in assets
it needs to be in a folder called assets
sorry just my day is just horrible
and im tired
i would recommend taking a break then or doing something simpler for today
Yeah, well I got the same error again after I put it in the correct folder
i can do it also i dont have anything else to do
assets/sounds/ButterDog.ogg?
can i see the code
appears so
What part of the code?
the sound definition and when you play the sound
huh... where would one put SMODS.Sound?
anywhere
in any file that loads before the sound is used
just like SMODS.Atlas or anything else like that
i seem to have blue seal working, just red and gold not now
I can show the code if needed, wait a sec
I'm having a hard time deciphering anything here
if its just a sound all that matters should be the key (which is what youll refer to it with when you want to use it) and the file path which is just the name of the sound file
yeah remove the atlas line if you want the default
if you dont want the default then make an SMODS.Atlas
hooray
if i put default, will it be concidered as a planet or a tarot?
the atlas is just for the sprite
oh yeah so i need to put a png file for the atlas to work
better than 99% of code
no, the default is the balatro vanilla sprites
if you need a custom one you need an SMODS.Atlas
mfw I just fixed bugs while watching a class lecture 
no, you need to define an atlas with SMODS.Atlas that uses a png file in your assets 1x/2x folder, but when you put something in the atlas field it automatically puts your mod prefix behind it since it assumes you want to use one from your mod instead of a vanilla atlas
instead of SMODS.Consumable, right
ive been writing the vremade wiki during a work meeting :3
no, alongside it
no as a seperate thing
(im sorry if my questions are bothering stupid to you, im new at lua
atlas defines the file path and key for the atlas, with which you can refer to it later
There ya go lmao
and some other stuff

you can put it in any file as long as it gets loaded properly
yeah makes sence
but most people do it in main
i need to update my wiki but i cant cause the stuff isnt fully implemented 😭
example from my mod
What now? I'm so close to just scrapping it...
you have to put quotes around the key
pls post code
nvm trolled myself maybe
not relevant to this but youre using an smods version with a big bug
with deck view
i dont see an error here
oh uhhhhhh
this has all the required fields so it should work
youre missing the quotes
ain't no way I forgot that😭
oh wait here is the right code:
key = "straight4"
func = function(hand)
local ret = {}
if #hand < 4 then return ret else
local t = {}
local IDS = {}
for i=1, #hand do
local id = hand[i]:get_id()
if id > 1 and id < 15 then
if IDS[id] then
IDS[id][#IDS[id]+1] = hand[i]
else
IDS[id] = {hand[i]}
end
end
end
local straight_length = 0
local straight = false
local can_skip = next(find_joker('Shortcut'))
local skipped_rank = false
for j = 1, 14 do
if IDS[j == 1 and 14 or j] then
straight_length = straight_length + 1
skipped_rank = false
for k, v in ipairs(IDS[j == 1 and 14 or j]) do
t[#t+1] = v
end
elseif can_skip and not skipped_rank and j ~= 14 then
skipped_rank = true
else
straight_length = 0
skipped_rank = false
if not straight then t = {} end
if straight then break end
end
if straight_length == 4 then straight = true end
end
if not straight then return ret end
table.insert(ret, t)
return ret
end
end
}```
I give up now... I've tried everything and nothing works...
oh it was a comma
Where is the file itself located in your mod folder
do you have the sprites in assets
yuh uh
may i see
Also I wanna see the play_sound function cuz it could also be a lack of a mod key
it's not, because I have file extensions visible
what do you wanna see
folder structure
like this ?
I'll just give you the entire thing
2x too?
Yeah your play_sound function does not have the mod key included in the sound key
so in your case it needs to be play_sound('modkey_ButterDog')
it's weird that you can see the extension for it but not the jokers file
Also you do not need to initialize the sound with the modkey, SMODS does that automatically
i think it has a double extension
I hate this
a hate windows
works now 👌
replace modkey with YOUR mod's key
booty crumbs windows
i need to finish the wiki soon to i can just link this stuff to people
i would eat your wiki
u would gain all the forbidden knowledge
maybe itd let me cinrge ah ah shit work
key = "Gay Flush",
mult = 10,
chips = 110,
l_mult = 5,
l_chips = 45,
example = {
{ 'S_K', true },
{ 'S_J', true },
{ 'S_T', true },
{ 'S_9', true },
{ 'H_8', true }
},
evaluate = function(parts, hand)
return parts._highest -- Temporary
end
}```
is the thingy for localisation for planets is p or is it smth else (this not working atm)
c_
now we're cooking
i open a new run and opened run info and the name of the new hand was ERROR and it crashed
good news is aside of that message blue may work after all.. but red obviously for some unknown reason doesnt trigger on the fridge either, but idk how to manage that
red and gold themselves dont work inside either
youre missing the localization
oh right
I've tried the two modkeys that I think would make sense, but it still doesn't work
What is your mod key that you set in your metedata
This value
I prolly should've been saying prefix but key is close enough
I... uh... kind of don't have that?
Are you using headers...
hiii astraaa
what structure is it for poker hands?
hi tomato
hi astra
Is this what that is?
hi dilly
loc_txt = {
name = "",
description = {""}
}
i think
no like in the file but i figured it out what prefix do i need?
and what type of file is that...
.json
i think its just modprefix_key
What/Where is the function that initializes the shop?
This page will be helpful for you https://github.com/Steamodded/smods/wiki/Mod-Metadata
function Game:update_shop(dt)
I need to hook it because I can't seem to avoid an infinite event loop otherwise
So I can just hook that?
dt is the only parameter it wants? (other than self)
you can hook it, the "just" part depends on what you need to do
Ok
there has to be an easier way to do this
or if there's a harder way, at least let it be an automated one
i havent messed around with vanilla stuff sadly
for modded jokers you can just check if they have a calc_dollar_bonus
youre missing stuff in the localization
ok well i got it from vremade
oh lfg
What the hell is the problem now?
thats literally the win i needed
i actually like better
is there any way to add credits? specifically in the collabs section
i dont think ive seen any mod do that so idk if its possiblah
What does the code around line 11 of TRBMod.lua look like
wym with adding credits in collabs section
oh damn thanks
This is line 1 to line 11
i have a pokerhandpart which is four fingered flush but just not needing four fingers and another one thats the same but with straight and i want to make a pokerhand thats both of them but not on the same four like the image but i dont know how to do that
why are you calling register in atlas
is this right
whats joker
(joker is G.P_CENTERS[v])
Because that's what I got told I had to do there for something to work?
my internet slowed down so you asked before i could specify
you don't need to call register in atlas
and thats line 11
get bette rinternet
ill share mine
so I would guess the problem is you're calling :register()
unrelated but i like how these look
i think you literally only do that for the mod icon
it's only missing the colon in joker:calc_dollar_bonus(card) then
keep in mind card needs to have all the attributes the modded card needs
i dont do that for anything
ok so i had it right the first time
@red flower do you need to call register for mod icon???
thanks
you dont count
here #🎨・fan-art message
Who ever said it was for the mod icon?
you don't need to call register for anything
try removing register and see if it works
Yes I do? I had to do that so a change I made to the Balatro on the main menu worked?
then do local this_atlas = SMODS.Atlas {
key = "balatro",
path = "TRBbalatro.png",
px = 332,
py = 216,
prefix_config = { key = false }
}
this_atlas:register()
I think it should fix
It's saying you're trying to index a nil value at line 11
what
before this_atlas:register() put print(this_atlas) to check If It's a valid value
------------MOD CODE -------------------------
local this_atlas = SMODS.Atlas {
key = "balatro",
path = "TRBbalatro.png",
px = 332,
py = 216,
prefix_config = { key = false }
}:register()
Idk
@runic jay what file
He said he had to do that so a change he made to the balatro on the main menu worked
I don't think you need to do it still but not sure
i wouldnt try to help if you dont actually know how it works since thats probably only going to cause more confusion
why are there these weird thin black lines outlining the color of the cards
card shadow i think?
hm
Now it says this, so now I'm more confused...
it was pixel art smoothing
can i see the code
to the 12th line?
This is the entire lua file
remove the this_atlas:register()
yeah, but then I have the issue of the custom 'Balatro' I made doesn't show at all
no
what happens to the logo? is it the same as normal or does it disappear?
how can i detect when any joker is added similar to how hologram detects when a playing card is added
nvm, just realized I accidentally had a mod on that overrides it
if context.card_added and context.card.ability.set == "Joker"
thanks goat
aliasing
can someone tell me why?
How could I display a card in a description like how the poker hands do
main_end with a G.UIT.O node holding a card object
weird balatro things #⚙・modding-general message
(there's a solution there if you start scrolling around)

quesiton about next(), am i right in thinking that when you just call it with only the table argument, it returns the length? so if you do something like next({ item1, item2 }) it returns 2?
no, it returns the key value pair of the next value
so in that case probably 1, item1
?
but when i do
local midasMask = SMODS.find_card('j_midas_mask')
print(next(midasMask))
with midas mask in possession, the returned value is 1
yes
ah, so it
thats the key of the key value pair
so with indexed tables, it will return the index as key
yes
i see, thanks
its not guaranteed to start from 1 tho
lua is also weird and will sometimes cut off multiple returns
or maybe it is with next im not sure
aren't indexed tables always in order, though
how'd you get the screenshot, sorry if this helps
no, if you use pairs for example it doesnt guarantee order
ipairs specifically checks for 1, 2, 3 etc
that sentence didnt
sense
yimsock!
codesnap extension
okay, so where do i begin with this, sorry
i would check another mod that does it and copy it haha
i think aikoshen does
fair enough, thank you
chat where is a consumable type's primary_colour used pls and thank u
ok for some reason i cant seem to make the artist ui show up
i might be hella dumb and misinterpreting the code lol
iirc nowhere
hi eremel
tried looking at how anothe rmod does it but they do a different way and its a scarier way and its very scary
incredible
how do i have a joker destroy a card in hand whenever a hand is played
Hi dilly
secondary question: is there a way to make this text here black? (disregard the missing localization i haven't written it yet) i know i can just add the color to the localization for the name itself, but i dunno about the card counts
SMODS.ConsumableType{
primary_colour=G.C.BLACK,
secondary_colour=G.C.BLACK,
}
I think
from what im seeing you need to patch the text colour into the buildAdditionsTab function
right above me i was informed that primary_colour does nothing; i've also tested setting it to black and it does nothing
secondary_colour is the button color itself, which i want to be white (and why i need the text color black)
noted, i'll start digging around there
if context.destroying_card then
local card_to_destroy = pseudorandom_element(G.hand.cards);
if context.destroying_card == card_to_destroy then
local mult_to_add = card_to_destroy:get_chip_bonus();
local is_face_card = card_to_destroy:is_face();
if is_face_card then
card.ability.extra.Xmult = card.ability.extra.Xmult + 1;
else
card.ability.extra.mult = card.ability.extra.mult + mult_to_add;
end
if next(SMODS.find_card("j_eddy_edward")) then
local _card = SMODS.add_card { set = "Base", rank = "Ace", area = G.deck };
G.GAME.blind:debuff_card(_card);
G.deck:sort();
SMODS.calculate_context({ playing_card_added = true, cards = { _card } });
end
return {
message = "X",
remove = true,
mult = card.ability.extra.mult,
Xmult = card.ability.extra.Xmult
};
end
end
why doesnt this work (from calculate)
destroying_card is for play only, destroy_card works in hand
youre also missing the seed to pseudorandom_element
(and it will pick a card for each card)
i might be tupid i just dont know how to make da ui work... very sad
idk if its this way or where to include the code
those functions need to be inside the deckskin definition im pretty sure
Is there a reasonable way to loop through this table and apply the modifiers to a table of cards, or should I just do each one manually
local enhancements = {c.ability.extra.enhancement, c.edition.key, c.seal}
Or like, as a case switch using the index of a for loop
whats the goal?
Apply enhancements from destroyed cards onto random cards in the deck
does the generate_ui function support UI structure
wait
its ui, of course it will
you would loop through each random card and do
random_card:set_ability(enhancements[1])
random_card:set_edition(enhancements[2])
random_card:set_seal(enhancements[3])
if i understand correctly
generate_ui is called when the ui of the card is being generated so it depends on what you're modifying
put it both inside deckskin and then inside the palettes stuff and the former crashes and the latter doesnt do anything very scary
can i see the code again
i think i know whats wrong
ye gimme a sec
generate_ui doesnt go inside text and doesnt work like that
why are you calling the function inside generate_ds_card_ui
actualyl yea why am i doing that wtf
lol
thought itd read the base values from that func #fail
fuck.
yuh that was the reason that was silly
sorry, could i get a tiny example, is it like loc_vars = {main_end = {}}
thank you vro
i have to thank toma whenever shes here bc i managed to kinda get my rarity code basing itself off of flags
Im running into a new issue, does every node need to have a color?
now that thats done is there a way to make a rarity not spawn at all if there are no more available cards in that rarity
you would need to check that in get_weight and return 0
okay, i am now able to spawn a game object like cardarea, but how would i put something into that cardarea
i suppose i could try and pair the flags with the cards they have but i feel like that would fuck up showman
how do i check for it
put something like this as your object Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS["S_A"], G.P_CENTERS['c_base'])
ill try that out, thank you again, i assume "S_A" is a ace of spades?
buildAdditionsTab is only called for the additions tab in the mod menu; it does work there, but not in the collection menu. i'll go look for the collection's UI function(s)
YES, ITS ALIVE
something like what rare tag does https://github.com/nh6574/VanillaRemade/blob/014b0b0c62a3cd7bccd04872b84fc572a52f8fe4/src/tags.lua#L41
yeah
Lostman? From SAGE Demo?
you can change c_base for an enhancement
thank you so fucking much, i would never have been able to do this my self
the one and only
Okay, i think i'm misunderstanding what pseudorandom_element provides, since i thought it provides a table
if context.remove_playing_cards then
for _, c in ipairs(context.removed) do
-- Put all enhancements into a table
local enhancements = {}
if c.config.center then
enhancements[1] = c.config.center.key
end
if c.edition then
enhancements[2] = c.edition.key
end
if c.seal then
enhancements[3] = c.seal
end
print(enhancements)
-- apply enhancements to random cards in deck
local target_cards = {}
for _, d in ipairs(G.deck.cards) do
table.insert(target_cards, d)
end
G.E_MANAGER:add_event(Event({
func = function()
for index, e in ipairs(pseudorandom_element(target_cards, pseudoseed('the_crow'))) do
if index == 1 and enhancements[1] ~= "c_base" then
e:set_ability(enhancements[1])
end
if index == 2 and enhancements[2] then
e:set_edition(enhancements[2])
end
if index == 3 and enhancements[3] then
e:set_seal(enhancements[3])
end
end
return true
end
}))```
pseudorandom_element gives you a random element
how many random cards do you want to change
max of three, but it's supposed to be random each time
Okay, hopefully last question, how can i get the next card that will be pulled from the deck
oh it divides the enhancement, seal and edition in 3?
Please give me the answer to my question, what is your opinion on the community for the hit game “Italian fatass climbs up the tower”?
scary
yes
G.deck.cards[#G.deck.cards]
small clarification but joker.config.center.rarity can be == 'raritykey' right? or does it need to be == 'modprefix_raritykey'
thank you once more
Why so
ah cool, i can just define it in the consumabletype's definition itself
local amount = pseudorandom("seed", 1, 3)
for i = 1, amount do
local playing_card, index = pseudorandom_element(target_cards, 'the_crow')
if enhancements[i] then
if i == 1 then
playing_card:set_ability(enhancements[i])
end
if i == 2 then
playing_card:set_edition(enhancements[i])
end
if i == 3 then
playing_card:set_seal(enhancements[i])
end
end
table.remove(target_cards, index)
end
to be sure, if i add one, it will give me the second card
== 'modprefix_raritykey'
alr cool
Hi i'm making a balatro music pack mod and idk what are in-game musics key
if you subtract 1, it goes backwards
nope that's for once you have the submenu for that specific consumable already open
thank you
i mean, i guess it does show you it
lol
suits me right for trying to make a shortcut by doing object = G.deck.cards[#G.deck.cards]
i also wouldnt do that because it might get destroyed when you close the description
you would need to make a copy
Is it possible to make a code for “spawn a random joker from joker pool, ignore flagged jokers, jokers from two different rarities are flagged”?
oh, now i see what you mean, damn it. i guess i do actually gotta try
I’m not returning to modding yet, I’ve still got to finish a drawing prompt.
i feel like theres an easier way to get the card's G.P_CARDS["S_A"], G.P_CENTERS['c_base'] other than grabbing the card and translating it with a table of all options
card.config.center.key for the enhancement
seems easy for that :3
i dont remember for the suit and rank let me check
Okay, i figured as much- This crashes when there's fewer than 3 cards remaining in the deck. If that happens, the effects are supposed to overload onto other cards if the seed says that card happens twice- they shouldn't be removed from the pool
oh then remove the table.remove
very big
Community is big?
ye
I think it still indexes all three so it still crashes. I think I could probably just do bounds checking, yeah?
oh, i just realized im gonna need to make sure it hides the card if theres not a card in that area
it didnt work apparently
card.config.card_key for the front
THANK YOU
idk if its bc it counts cards in a rarity as being part of the rarity pool despite in_pool being false for those cards or if its smth else
sorry caps
okay, so ive got this, if the player has no cards in their pile, how can i make sure the card just doesnt show up or am i good?
{n = G.UIT.O, config = {align = "cm", object = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.deck.cards[#G.deck.cards].config.card_key, G.P_CENTERS['c_base'])}},
wait no, i broke something 1s
G.deck.cards[#G.deck.cards] and {n = G.UIT.O, config = {align = "cm", object = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.deck.cards[#G.deck.cards].config.card_key, G.P_CENTERS['c_base'])}} or nil,
yeah youre also missing the p_cards thing
so i put p_cards[G.deck.cards[#G.deck.cards]]?
G.P_CARDS[G.deck.cards[#G.deck.cards].config.card_key]
stupid formatting question but between param1 and (param2 or not param3) and param1 and (param2 or (not param3)) which of these actually gets read properly in code
both are equivalent
(i know how to properly write this just gonna simplify rq) so i could write flag_check and (showman_check or not flagcard_check) and that would check if the flag is true and either showman is there or the associated card is not there
yes
god this codes gonna be a mess but hopefully it will work
why isnt this importing the card into the table am i doing this wrong
the exceptions one works fine
idont understand what this does lol
What is the Hollow Knight deckskin from if you got the link?
it's SUPPOSED to make it so if the card has a calcdollarbonus thing, then it'll format it and add it to the table
and what is it doing
not adding it
i have no idea and i had to install it by going directly into the games files
Ah
sorry
i know it has nine sols with it so id look for a pack with that
does it do the second print
is it true?
im assuming the second argument is k and the third is v?
maybe its backwards?
i mean i know it is
that's why i made sure to import in reverse too
at least i
think i did?
no i mean in here
local P_CENTERS = obj??
no lol
ok good lmao
G.P_CENTERS[k]
this table exists so i dont have to list each individual card key like i used to, and support modded jokers
in the example jokers, the og does not calculate dollars, but the fake one does
ohh
Is there a function I can use to trigger a game loss?
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
Thanks!
oh n already
nvm
no idea, i would try printing all the values and see what they give
like printing obj
can i do that from console do you think
i would do it in the function
welp
yippee :3 works in the collection and the mod additions list
now to figure out the badge text
maybe one of the keys is nil?
What's the difference between G.GAME.round_resets.ante and G.GAME.round_resets.blind_ante?
no those are fine,,
Is there any guide on custom seal, bosses or decks? Or tags?
I’ve already did stuff with jokers and consumables but can’t find anything about how to start with those, if there’s not I’ll just check code of existing mods, thanks!
The SMODS wiki has information about those (although not as much information as about Jokers)
there are not many guides on most stuff other than the documentation
you can check this for examples https://github.com/nh6574/VanillaRemade/tree/main/src
Anything with a calculate() function can use nearly all of the contexts in the Calcuate Functions page I believe
n. it isnt loaded at that point
i figured it out
and i know exactly why
i think
I’ll check, thank you!!
Oh yeah that’s stuff from the base game “turned” into mod right? Thanks!!!!
how do I check a context during calc_dollar_bonus without context being nil
you can't, calc_dollar_bonus is never called with a context
it also doesnt need to because it only gets called at one specific point of time
but I need to check if the blind beaten was a boss blind
I want this to give end of round money only if it was a boss blind that was beaten
G.GAME.blind.boss
whats the crash
something adjacent to G.GAME.blind.boss is nil I won't be able to recreate it reliably
In calculate set a flag on your joker to be active at end of round, in calc_dollar_bonus check that flag and set it to false once you give money
it only happened to me once but someone using my mod ran into it way too much
I wonder if thats a reloading on cashout issue
let me try that
this feels awful but i'm trying it
it annoys me because I don't know what is actually causing the crash
and I won't know if it is fixed or not until either me or that guy randomly crash
it might be some mod doing something weird
I doubt it
the only mod I have that does anything with boss blinds is morefluff adding the DX boss blinds for ante 8 if you redeem its funny voucher
0 other modded blinds and nothing like bonus blinds
Do you have the crash log from when it happened
i'll check
I don't think I have a crash log for it no
I clear my logs when i update smods (probability update required me to do a stability patch)
it's not an easy crash to run into in a regular run
Can anyone help me out with this error? I'm trying to hook onto Game:start_run() so that I can run an apply function for my challenge
you need a specific legendary fusion with 1 of 2 boss blinds to even get the effect that is causing the crash
You need to pass self to the old function
this method at least didn't crash immediately on beating a boss
so I guess this crash is going with that chie crash where I have no idea if I've fixed it or not until someone reports the crash to me
Its not working
is the next(SMODS.find_card for Showman just ("j_Showman"))?
It looks like Showman's internal name is 'j_ring_master' for some reason?
im not entirely surprised given canio is 'j_caino' but it still feels weird
there's also SMODS.showman() for a better mod inclusive check
would that just check if you have a card that uses a showman effect
it checks for showman and then any mod can hook it to pretend that theres a showman
it'd check if the showman effect should apply, for whatever reason that might be
by default only if you own showman
Music must start with "music" for the key.
So what's the "proper" way to spawn in a Joker? Because I know there's several functions that add cards
i cannot wait to show yall how bonkers this code will look at the end of all this
To spawn one ingame?
Yeah, that's what I meant to say
SMODS.add_card { key = "j_prefix_key" }
my shift key is not working im going to throw this keyboard out a window
you have two shift keys don't you
i dont wanna use right shift..
time to use right shift
also all the keys at the bottom are working kinda badly
Do you throw your keyboard out the window often
thank you
Cus that'd explain it
that was the problem
if i wanted to have a calculate thing that runs specifically when a challenge is active (basically just a deck modification like anaglyph deck) what would the process be for this
i had this and i had high hopes but nothing is running
I have three jokers that share a mechanic, causing the game to crash whenever they get spawned in. I've got a single lovely log that's implying it's an issue with it getting stuck in recursion, but I can't figure out why. The calculate of the joker's only check for joker_main, so shouldn't do anything weird. This is the config for one of them, which is very similar to the other two jokers. I'm kind of at a loss for what could be going on.
Is there a way to spawn the joker at a specific location in the roster? In my case, I want to spawn it to the left of the joker responsible for spawning it, instead of at the end of the stack.
a challenge calculate would be cool
Also JokerForge is pretty cool and surprisingly versatile. I've been able to do some weird effects with it without having to modify the Lua much at all.
theres no main_eval in calculate_context
oh is that all thats missing?
is this the one similar to what i showed you?
dunno
yupppp
how are you creating the codex itself? is that just generated within or are you going the lovely file route
is this all i need to do to fix that? ill be honest i dont fully understand all of this code i got it from somethingcom515
Dunno, never tried to do that
It's probably possible
https://github.com/icyethics/Kino/blob/v0.10_dev/src/codex.lua
the create_codex function here! But codex's are only created when the joker is first calculated. Originally, I had it create one upon add_to_deck, but I incorrectly assumed that may have been the issue
does the crash happen when another card already calculated the codex?
what are games original music keys?
It can, but no other card needs to be present
it is not 💔 ill keep looking
gotta love fucking up code because i forgot which joker to actually look for
If I want to make a set of consumable enhancements ( i.e. stone cards that trigger an effect and self-destruct when scored ), should I make each effect its own enhancement or have an enhancement with subtypes?
oops no nevermind, the code's in this refactor https://github.com/icyethics/Kino/blob/v0.10_dev/src/codex_rework.lua
that original code didn't seem ot have this issue, but had a bunch of other ones
I should start using this myself
nothing is jumping directly out at me, let me try and download this, which branch should i download to test it out
is it this v0.10
do 'or' specifiers prefer whatever would make the if statement true
like if i did not (param1 or param2) would it see if either one is false and use that 'not' to make the statement true
no it evaluates (param1 or param2) first
yup
I truly am at a loss as to what it could be, haha
so if either parameter in the parenthesis is true the not would make the statement false
yes
well i spawned it in fine, but how do i solve it?
playing cards, but once it's in your possession, it doesn't cause any crashes, as far as I know
when does the crash occur, in shop?
so the only time the statement would be true is when all parameters in the parenthesis are false
Part of the issue is that I can't easily reproduce the contexts of the crash, haha. If you just play a run, the game will crash to desktop upon rerolling or leaving the payout screen
correct
when you reload your run, it will work, and one of the spawned jokers will be Oppenheimer, Zodiac, or Arrival
i rerolled the shop, and did cash out for no crash
yeah, it's not consistent
It relates to the save system, but I haven't figured out how exactly
let me grab some logs that make me suspect this is the issue
this one was send to me today. It's got a bunch of mods, but it was an issue in the collection, and you can see that if you ctrl-f Oppenheimer, that after that it starts getting stuck into a copy_table loop it can't break
this is a lovely log of my own crash, which you can see also gets stuck in that same issue and was for Arrival
im guessing the inverse of this would be not (param1 and param2) where the and makes it so that every parameter has to be true in order for the statement to be false
(6586) 😭
i guess that's where infinity ends
lot lower than i was expecting tbh
but yeah, I wouldn't actually peruse them too much, if you ctrl f for arrival or oppenheimer, you can see where the behaviour changes and the loops starts
people should start naming hooks with real names
How can I add a custom button to cards with its own callback?
Old_FunctionThatWasNamed_Card_Colon_IsSuit = Card:is_suit(suit)
spades_slick = Card:is_suit(spades)```
oh i know what it is
this will crash because youre saving cards to it
or not?
it says that it has cards in the log at least
I wouldn't think so, it seems fine
It is apparently on card creation in shop or though tarot cards or etc
as well as in the collection, apparently
it's when set_ability is called
I have an autoclicker running through shop right now with its weight up and it hasn't crashed yet
Haven't crashed in collection yet either
can you send me whats at 377 in card.lua
but yeah the problem is that its trying to copy cards in codex_lastplayed
I should check my code better than, because I was under the impression that I didn't store cards, but only a rank and a suit, haha
yea actually thats exactly what it is, i played a test hand and then went into shop and insta crashed
thats what im seeing too but thats not what the log says haha
i thought the dummy table is what it pulls from until you played a hand and it was in your deck, is it not pulling from there?
That should be how it works, yeah
oh does this update the dummy table
but I guess that explains it, that it improperly stores the last played hand somewhere?
i did suggest that he may be storing things in the dummy table and changing it somehow
but i didnt think so
it shouldn't, but that might be where I fucked up
i would try making the dummy table into a function that returns a new table
yea that would make sense
I'll do that, yeah
i should trust myself more if thats the case cause i told you in dms i was thinking it was the dummy table lmao
That makes so much sense, as well. I'll let you know if it works after investing 10k into rerolls, haha
i still dont know why its saving cards tho
probably to display it on the codex
no i mean i dont see it i the code
oic
I think the issue is that I set the dummy codex up to also be the global that stores the last hand, so it'd get overwritten 🤔
last played becomes the dummy doesnt it
oh yeah this will do it
probably. I suspect it writes into the dummy, with the way I've set it up
I'll try that out after my cat's bored so I don't have to type with one hand while I flail a toy around with the other, haha
but really appreciate the help guys, that was driving me ab-so-lutely crazy
hell yea animals are awesome
yall wanna see the worst coded if statement ever
ugh
badges don't get text styling codes so i can't just duct tape it in localization, but setting a set_card_badge_type function for the consumable type is throwing the badge in the top left corner
i sure do love lovely patching dead~1 maybe i'll try to make this more general eventually, but for now it works
heyo!
i have this code here
Straight works correctly with Valant Gramarye
however, Straight Flush doesn't
oh i see
wait
right, i see, a Straight Flush is also a Straight, which is now a Straight Flush
mm. annoying
i feel like i'd break something if Straight Flushes no longer contained Straights
how would i make a suit act like 2 suits at once?
gonna give it a go anyway ^^;
probably a hook on the is_suit function; I'm away from my computer but I can take a look in a couple of minutes. what exactly is your goal?
i added 6 "dual suits" (Spearts, Spaimonds, etc), and i want them to act like both suits at once
yea that should be a fairly simple (albeit a little tedious) hook
So if something triggers spades, it would trigger:
- Spades
- Spearts
- Spiamonds
- Splubs
how does one patch other mods? im not sure of the syntax for it
nvm i think im an idiot and forgot quotes somewhere
okay i've figured out what's wrong!
no clue how to fix it!
so, the Joker makes Straight Flush evaluate as Straight
however
a Straight Flush contains a Flush, which ranks higher than Straight -u-
so it turns Straights into Straight Flushes and Straight Flushes into... Flushes 😭
i'm just gonna change the ability because i cannot be arsed™
flush > straight flush > flush
thats so real
you can use the new context for this
oh?
oh. -u-
gosh the hoops i went through for this to be more easily doable 😭
thanks ^U^ lifesaver
could anybody help me edit is is_suit() hook?
(I'll be able to help soon, didn't mean to leave you hanging)
(youre fine dwdw)
what do i do for the context? i've done it incorrectly ;u;
what's it supposed to do?
Straights count as Straight Flushes and vice versa
this maybe?
oh part of me assumed that was localised
so if it was different in a different language then it wouldn't work
but that might not be the case
so i'll try it
oh it's not localised ^u^ okay good
thanks!!!!
context.scoring_name
oh i didnt read lol
^u^



