#💻・modding-dev
1 messages · Page 573 of 1
silent param for play area status text
what would the local key be?
oh i thought this got fixed in smods lol
i dont understand the problem
obviously there are two
or it would crash
no like
Restoring the code would mean removing "Not Allowed")-- from the line.
whatever ultra necrozma uses?
oh i was making that way too complicated
yup
i thought it had to be like (right.config.center.key == "j_legendar_solgaleo" and "j_legendar_duskmanenecrozma") or "j_legendar_dawnwingsnecrozma"
is there an easier way to do this
and like more of that
ok i got a crash
and if the solution is to add another end on the same indent i will crash tf out
Code and error?
the toggles should be in row nodes
IM SO FUCKING MAD
ah
is your previous experience only python perhaps
if so i get your frustration
i love indentation
who doesnt
stop doing lua
if statements were not meant to be given "then" and "end"
🔥
fuck i havent done python in way too long
the only time i tried to learn coding is when i barely started to learn C#
it may have been C+ though
oh lua does 1 indexing i forgot
fuck 1 indexing
i hate 1 indexing
i mean it makes more sense
its more annoying code wise though
Java and C# are basically the same syntax-wise anyways.
an array of length 2 having [1] and [2] is so much more intuitive
instead of [0] and [1] 
its like 1 thing to learn
ok so the game no longer crashed but it prioritizes fusing into Dusk Mane or Dawn Wings instead of Ultra form
whats your code
that makes so much intuitive sense
yeah that's what i said in the code
that's what the elseif at the end meant 😭
"elseif left blablabla the code your already have" 😭
oh
i mean as long as it works in the end yk
the process is just the learning experience
or smth idk
yeah ig not everyone studies computer science like i've been doing for 4 years now
maybe the real code was the friends we made along the way
Any mistake you make now is a mistake you're less likely to make in the future.
WRONG
i mean i do computer science but the only shit ive had to do there is the worst programming language (python) and html
lmao
If you say so.
c, c++, python, java, ocaml, assembly, haskell, html, javascript, psql (does that count?), also whatever arduino uses i don't even know lol
im kinda tired of doing so many langages, at least half of which i never want to touch ever again 😭
im probably missing some
why the fuck did you have to do assembly thats like torture
Arduino uses a simplified form of C++
imma keep it tall i had no interest in coding until i wanted to start modding games
i always thought i was too stupid to learn a coding language
i definitely always wanted to like. do smth coding related but like i never actually started anything lmfao
and now i make balatro mods
i wanna make games in the future
i don't think i took the perfect studies for that but i could've taken much worse
Try v4.1 released just today. I tried to fix Talisman and SMODS compatibility over the last few days.
No guarantees that it won't crash randomly, though.
omg divvy thank you bless you 😭
ok this next thing i want to work on will be VASTLY easier
for me and everyone else
nws lol, lmk if you find any issues
Now I want to work on the Hoenn trio
and the three of them transform through consumables
how would i make it so i can use a specific consumable ONLY on a specific joker?
make the consumable's can_use function only return true if you're highlighting only one joker, and that highlighted card is the joker you want to be able to use it on
Thank you, but could you elaborate?
i found out why it wasn't working 😭
...the specific enhanced card i was using was from before i reworked its effect, so it didn't have an odds value
i have the stupid 🙏
Can somebody help me with my mod? It won't pop up in the mod section! Here's the zip
can you show the metadata file
The .json file
can_use = function(self, card)
return #G.jokers.highlighted == 1 and G.jokers.highlighted[1] == "j_modprefix_key"
end,
As part of the Consumable's code.
*G.jokers.highlighted tho
but yes
Fixed
Jokers aren’t in your hand
They’re in joker slots
Already pointed out
Fire code tho
hi s
That reminds me of the time eris tried to set suit to a rank
Hello meta
How are you in this fine day
Oh hell nah who’s M
how would i check if a card is being scored and not just played, i feel slow as hell right now
ello
m
doing pretty good, finally got some work done on paperback's last set of minor arcana cards. how are you?
some contexts have a context.scoring_hand table
Context.scoring_cards[i]==card
dop e
I'll just wait until everyone's done right now to ask for help
Send the .json file content please
context.individual is the context when a specific card is scoring
but yeah scoring_hand can work too depending on what you want to do
This is from their whole mod upload.
{
"id": "my_joker_pack",
"name": "My Joker Pack",
"description": "Adds custom jokers including Giygas and Example.",
"version": "0.1.2",
"authors": ["YourName"],
"priority": 0
}
Mhm you can work with individual too
Main file ?
There’s no main file
@shy sequoia you need more in the metadata
Here!
Meta please link the smods mod example
read this and add what's marked as required
https://github.com/Steamodded/smods/wiki/Mod-Metadata
Thanks meta
Ok!
meta, mmetadata haha get it i need some sleep
mmmmmmetadata
Meta stands for metaknight i think
Which is a character i pretty much hate because my and my friends like to do some couch gaming on Fridays and we play some combat games , some of those games is rivals of aether which has a mod that adds metaknight which is such a broken character that my friend likes to spam
if context.before then
if G.GAME.current_round.tdec_beast_card and G.GAME.current_round.tdec_beast_card.id then
for _, card in ipairs(G.play.cards) do
if card:get_id() == G.GAME.current_round.tdec_beast_card.id then
ngl not sure how i'd apply it in this instance since i'm already just iterating over the played cards
Do you need to do anything with unscored cards? If not, you can just iterate over context.scoring_hand instead of G.play.cards
nope i dont
indeed that's the origin, although i've mostly dropped the knight part of it nowadays
ii will do that then
You can do individual instead
how do i check if you have a certain joker?
Dropped the sword and armor
SMODS.Find_card
yup this worked thank you
ty
for more details on how find_card works, read the documentation :3 https://github.com/Steamodded/smods/wiki/Utility
It returns a table
Meta, are these all the things I could add into the valid effects?
I’m reading about tarot cards
while im still awake id like to ask again just in case if anyone knows how blinds like psychic and the mouth display their text which tells you that the hand wont score
including the stuff in the other_calculation_keys table, yes
do note that not all of them make sense to be doubled (e.g. "message" is a string), so don't just dump all of them in without making sure you know what you're doing
I have no idea , but there’s a library for making advanced blinds
Made by myst
You may wanna check it out
u got the link?
vanillaremade is also probably a pretty good resource (unless you mean you want to have that text effect come from something other than a blind)
oh no never mind it's not helpful
i checked vremade
Is it okay if I ask what the ones I don't know are? Or is that documented somewhere?
does anyone know why my hook isn't working?
Your function Card:loc_vars() line is missing the arguments.
ah ok
i mean you can just ask it here, some of the stuff i don't know either but this is a public forum and there are more people who can help
Myst is very talented so i’m very confident this is going to be useful
you can also probably ctrl-f for the key in vanillaremade's files to see how vanilla content uses it
Okay, I'll do that but give the ones I don't know still in here
still nothing
vanillaremade is a godsend for modding frfr
Okay, what do the following calculation keys do?
- p_dollars
- h_dollars,
- swap
- effect
- remove
- func
- extra
- modify
Because of the :, you don't need the self in specifically the function line. Unsure if that's the only issue but worth trying to fix first.
It definitely is
ok
still nothing
Card:loc_vars doesn't exist.
p_dollars / h_dollars are scored/held in hand dollars respectively. swap literally swaps the two values around. remove is for context.destroy_card to destroy card. func executes a function. extra contains an additional table of effects.
oh
You have to patch generate_card_ui
ok
Okay, only modify and effect left to understand. Thank you :3
where can i find that? it's not in card.lua
It's in functions/common_events.lua
Because vanilla is. Wierd
Meet LocalThunk, God of Programming.
undertale celebrated its 10th anniversary yesterday and it's held together with duct tape and if statements
Okay, I've done this now. Is there something else I need to do to make it work?
'chips', 'h_chips', 'chip_mod',
'x_chips', 'xchips', 'Xchip_mod',
'mult', 'h_mult', 'mult_mod',
'x_mult', 'Xmult', 'xmult', 'x_mult_mod', 'Xmult_mod',
'dollars',
'add_to_hand', 'remove_from_hand',
'level_up',
'numerator', 'denominator',
}```
can i use a hook or do i need to use lovely
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'for _, v in ipairs(info_queue) do'
position = "before"
payload = '''
if conditions then
info_queue[#info_queue+1] = info_queue
end
'''
match_indent = true
i know damn well this is wrong somewhere idk
ty
You can't put things after a return.
Dont return for scaling...
Also, "repitions" should instead be "repetitions"
No, move the scaling outside of the return or inside a func.
The line with the = should be placed before the return statment, not inside of it.
Its still yelling at you
For the thing i said
Also, when you're doing repetitions, you need to use context.repetition in place of context.individual
okay so i did this and now hovering over a steel/slime card just crashes the game
no error screen or anything, it just closes
Check if card exists.
ty

now that i know how to patch in custom info queue stuff, i can actually use this info to add the last thing i wanted to add to my upgrade mechanic
which is an info_queue preview of the upgraded joker
and the upgrade requirements
I'M SO CLOSE
"quest" joker 
lebron
nvm i fuckef up
: (
rip
Or can someone else help me with this too?
i don't think you need to do anything else, at least if you borrowed everything from forgery properly
I did but it doesn't work =/
is it doubling the chips/xchips/mult/xmult at least?
calculate = function(self, blind, context)
if G.GAME.blind.config.blind.key == "bl_tdec_beast" then
if G.GAME.current_round.tdec_beast_card then
self.boss_warning_text = UIBox {
definition =
{ n = G.UIT.ROOT, config = { align = 'cm', colour = G.C.CLEAR, padding = 0.2 }, nodes = {
{ n = G.UIT.R, config = { align = 'cm', maxw = 1 }, nodes = {
{ n = G.UIT.O, config = { object = DynaText({ scale = 0.7, string = "Selected Rank: " .. G.GAME.current_round.tdec_beast_card.rank, maxw = 9, colours = { G.C.WHITE }, float = true, shadow = true, silent = true, pop_in = 0, pop_in_rate = 6 }) } },
} },
} },
config = {
align = 'cm',
offset = { x = 0, y = -3.1 },
major = G.play,
}
}
end
end
This seems to be working, but the issue is the fact that the text never gets updated 
it just stacks
Here you go
I'm heading out to eat dinner rn but I'll take a look soon
have a nic meal
I'm gonna test some more things in the meantime
What is the specific issue?
It doesn't give double dollars and such, only mult and chips stuff
Wait, it just gave double dollars while copying business card
Yes, because it returns dollars.
But Faceless Joker does that too, doesn't it?
No.
oh right
faceless joker just calls ease_dollars directly instead of returning dollars
you just have to deal with it
Oh, okay
That would've been good to know earlier. But hey, it seems to work
Thank y'all :D
Only thing that I don't know is how to double retriggers
Add "repetitions" to CSTORM_UTIL.gemini_valid_effects
why am i getting this crash
where can i find more documentation on info_queue stuff?
bc i was looking at functions/common_events and it turns out u can feed a lot more into it than just a G.P_CENTERS thingy into it

Real
Is there a way to destroy cards after the first hand is drawn (like killing off a specific rank or something?)
Yes
Use the same context certificate uses
And destroy cards from G.hand
Interesting! I'll go check it out
Are there any Jokers in the game that my consumable can even use the doubling of numerator and denominator for?
alright i can go to bed now
You even highlighted them with shaders ?
Progress was made today
I’m proud
yeah, but i dont think it fits
Looks great
Why are there 100+ base events in the queue though...?
the boss phase system is holding back a lot of things

whats the difference between the effect table and the key/amount parameters in smods.calculate_individual_effect
other than the fact that the effect table can probably have more than 1(?)
why is it not the retrigger
You're misspelling "repetition"
erm u spelled repetitions wrong
-# but you misspelled it everywhere so it's probably fine
this is the thunk mindset
it's not ok when it's misspelled in the return
I doubt the game recognizes "repititions" as a return value that means anything.
"consumeable" ahh
oh i didnt see that one lmao
after i wake up im probably gonna add "boss armor" if the hand straight up just nukes the blind. Normally this would be pretty weird to have in balatro but I do want this to be a proper final boss blind
i cant fucking spell kill me now <3
does anyone else know this because i do not really feel like looking into this for the next 20 mins
it does both?
does anyone know what things i need to put in the table to make it not crash? ...or if it's possible to use an existing G.P_CENTERS thingy but change a few values without it changing the original
my mod has some jokers that scale based on nominator and denominator
I changed it to only numerator but I don't know a Joker to test it with
that should work, maybe it's missing the vars?
cavendish :3
one cavendillion banan
tried that and it still gave the same error
oops all 6s probably
you know what common_events in that line is?
he's modifying the return value of numerator or denominator, so it's stuff that interacts with mod_probability
Incompatible :(
no, because there aren't even that many lines in common_events
its still not working im going to dagger myself <3
it's in the mods folder
whats wrong
Kino and Kino.generate_ui_info or nil
youre still trying to index it at first before checking if Kino exists
no wonder the joker of pestilence is being a pest its in the name
oh so now i cant even run a if statement without it crashing.
Why are so many people using Notepad++ 😭
my c drive can NOT afford a IDE
lily gave you the answer
you can't run an if statement directly in the definition of a joker
generate_ui = Kino and Kino.generate_info_ui or nil,
VS Code isn't that big
HELP PLEASE aah
sobs
i also directly linked to me doing this for kino crossmod before btw
incredible
if i had seen that message i wouldnt have been posting again in the first place ;-;
i thinkt he glasses arent working anymore
Hi guys I'm going to sleep very soon but I really want to ask because I'm curious is it possible to make it so your hand score doesn't get added to the total under a certain condition?
If yes I might have an idea for my boss blind
How exactly do I do this?
you can always set the total to 0 in final_scoring_step
how is the score defined?
there's a context and everything , just check the wiki or how other jokers destroy cards
hand_chips * mult
ignoring any scoring_parameter shenanigans
i wrote it backwards
lol
what purpose does skip serve in here? i would assume its to skip an animation(?) but like it is also used as a number so i am a little confused
im so done w this damn joker <3
more importantly i am trying to add a global effect which allows modifying the strength of all chips/mult operations so idk if i'd need to touch skip or not if it is used as a number
What's the current issue?
its not retriggering when i play a hearts card
That's wrong
i know
It is repetition
Ah I see
also you just need context.repetition i think, don't and it with context.individual
oh my god
i am going to dagger myself
idk s said i needed it so im just testing
i dont think u need context.individual but i think the cardarea check you may need
yea just the cardarea check
[that one snapchat "killing myself" png]
i cant fucking spell ig
its spelled 'instagram'
compat with using mod_chips and mod_mult
so i should make the exponent compatible with skip too?
i've given it a not-so-empty config table and it's still giving nil values
I wouldn't touch the modify functions to do that effect I don't think
what would you recommend then
oh i see the vars table
calc individual effect
doesnt calc individual effect just
run the scoring_parameter stuff [if applicable]
which then also runs modify
yes but other stuff runs modify that I wouldn't have thought your effect should adjust
nvmd
like the base values from the hand type for example
interesting that those use modify
oh wait nvm i misunderstood
for some reason i thought u meant like
setting the base hand stats
not modifying chips with them
oh no I mean the base stuff you get from playing a flush say
ye
or like, the base chips from a playing card (thought you might want to adjust that, I don't know your efefct)
my effect is for 2 challenges [and the buffs you get on a specific deck for beating them] where all chips and mult effects are just weaker
but the base hand stats are probably not something i want to change
yeah calc individual then I would think
in calc individual is the effect table just for visuals
mostly yeah
oki cool
My mod sucks 🙌
hi
"teto" and "being bad" are diametrically opposed. ergo, your mod can't suck
the text's parsed before i can give it the values i think
surely there's an easier way to make an info_queue thingy with custom config values
I'm trying to intercept the blue seal creation making cards negative (allowing more blue seals) but blue seals are always ending after creating 2 planet cards, even though the consumable buffer increases in between the seals
any ideas on how to intercept that properly?
Fuck
You're right
also in the following round despite there being space only one planet is created by seals
if you increase the buffer in an event it will be too late
also you provide want context.main_eval in your check too
i've tried everything and it's still using nil values in the info_queue
still getting this issue
add soul_pos = { x = #, y = # }
if you want more than base and soul layer, you need a custom drawstep. reference cryptid
double checking here but is the get_id() for queens == 12?
is that the offset from the main joker
no, absolute position
yes, just like the regular pos attribute
I'm having a little trouble figuring something out. I want to make it so this consumable creates a joker and destroys the one it's used on
ah ok thx
the card in the use function is the consumable itself, you need to get to the joker with G.jokers.highlighted[1] like you did in the can_use function
in your destroy_cards call
it should be SMODS.destroy_cards(G.jokers.highlighted[1]) (i don't think you need the extra trues)
anyway i think you also need to add set = "Joker", to your add_card call
is there a context for right after the score is multiplied but before it gets tallied
for some reason Card:remove_from_deck gets called whenever jokers get rerolled or you leave the shop with jokers on it how do i make it for only when a joker gets sold/destroyed from your slots (i am hooking this function)
wait actually
i know this one nevermind
i need to check self.added_to_deck
nvm i cant read smods wiki says its context.final_scoring_step
crashed
show the new code you have
inside the {}
oh
Anyone know why spawning jokers from this object type in a booster pack keeps spawning default jokers? It seems to spawn all the jokers I added to it, but it also just throws in the default joker quite often. There's 13 jokers in it, so the pool shouldn't be exhausted, right?
SMODS.ObjectType {
key = "willatro_organ_set",
rarities = {
{ key = "willatro_Organ", rate = "0.003" },
{ key = "willatro_organ", rate = "1" },
},
}
default joker means it's spawning the default card for the objecttype, possibly because you already have all the cards from that pool. first i'd recommend setting a default card (just a default = 'full card key goes here' in the objecttype itself), but if it's spawning the default joker even when you have other cards from the pool that could've spawned, that probably isn't going to actually fix the root cause
now i'm just getting a syntax error. Can you help me find where it is?
post the code again and the error
you need a comma after the end tied to your use function (i.e. the end right before the can_use function)
gives the same error
then you probably put the comma in the wrong place, hang on
right before can_use, right?
put the comma after the end i circled in green
yeah that's where i put it
then either you didn't save the file or it's not the same error
Yeah, there are 13 cards available in the pool, and only 3 spawn in a pack, so it should not be spawning the default (setting a default just causes that particular card to show up more, not a great fix).
might not be the same error actually
no it is the same error
are you sure you saved the file
if you did, just post the code again lmao
yes i saved the file
how do you set the current hands score in context.final_scoring_step
here's the code
oh
your destroy_cards is wrong
i meant replace the entire line with SMODS.destroy_cards(G.jokers.highlighted[1])
no i mean change the actual score value after its visually multiplied but before its added
i dont think there's a step for that
oh
the score literally adds the hand score immediately
hm
so do you think a good compromise would be adding to G.GAME.chips in a joker_main step?
do you mean remove the smods.add_card function?
no
what's the intended effect?
remove the second set of parentheses on the destroy_cards line
adds to score directly
you can probably use an ease event somewhere in calculation for that but im not sure what the timings are on this
i added it to main for now ill see if that works
i think if you use an event in final_scoring_step it should be before the hand is added but im not sure
visually at least
ok new problem
new error just dropped
its visually added but it gets reset to what it would've been
after the actual hand is tallied
this line that i've circled in red needs to be ENTIRELY REPLACED with exactly this:
SMODS.destroy_cards(G.jokers.highlighted[1])
ok it seems like what toga does is just visually ease to it then set it immidietly after
yes i did that
given the error it really feels like you didn't. post the code
hm, weird
actually i think i misunderstood you earlier
you told me to delete the second pair of parentheses in that line
and i had already replaced the line with SMODS.destroy_cards(G.jokers.highlighted[1])
but you probably meant the (card, true, true)
yea that's what i meant
ok
now it's just giving me this error again
idk at this point. the last code you posted looks the most correct, i'm not sure why it was giving the error it was
can we get N to peer review it
no
aw :/
so if i return a func in a joker calculate call when exactly is it called?
looks ok to me idk
right after the other return stuff is processed
what
if you return dollars, mult and func then dollars and mult are done first and then func
so would it be after or before a manually added event in joker_main
could it be something with the use = function(self, card, area, copier)?
it will run before the event unless the func has an event inside it in which case it will run after
ok good
so im using a function to ease the ANIMATION for G.GAME.chips
but returning a function to SET it because it seems to be overriden by scoring?
that makes sense
OK ITS NOT WORKING :(
how would i go about changing the sound used by an effect (xmult for example) for a specific joker
the score is still set instantly to the new value once the calculating screen is over
should i fire two events, one to ease the score and one to set it?
i think you need to do xmult_message = { message = <whatever xmult returns>, sound = <your sound> }
i thought that's what you were doing lol
no i was doing an ease event then using the func option in the return table
would i use xmult_mod for that or would just changing the message do fine
if context.joker_main or context.force_trigger then
G.E_MANAGER:add_event(Event({
func = function()
card:juice_up(0.5, 0.5)
return true
end
}))
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blockable = true,
ref_table = G.GAME,
ref_value = 'chips',
ease_to = G.GAME.chips + card.ability.extra.score,
delay = 1,
func = (function(t) return math.floor(t) end)
}))
return {
message = "you cant say its only a half",
message_card = card,
func = (function(t) G.GAME.chips = G.GAME.chips + card.ability.extra.score end),
}
end```
try putting what you have in func in an event
a second event?
this changes the message for xmult without _mod
oh ok
yeah
idk tho i would have to test this stuff to see what the timings are lol
i randomly fixed it by messing with ends and commas
hell yea
does the order of add_event calls matter?
how would i do it for xchips
xchip_message i think
?
nevermind it's not letting me use the item
add colour to the table
yes, they're added one after the other in the queue
ok so i assume evaluate_play_final_scoring is called AFTER all the jokers calculate funcs have been called right
thank you N
ok so im going to do something verfy stupid
what if i had a context at context.before to visually reset the chip score to what it was after i set it manually in the calculate without using the event queue
AA WAIT I THINK I GOT IT WORKING
im really tired rn so i may be stupid but what am i doing wrong
What is not working?
oh sorry my bad
i kinda thought itd show the custom rule
unless i am wrong and i have to do something else as well
misc should be outside of descriptions
so I was working on trying to get Dawn Wings Necrozma to fuse with Solgaleo and I almost got it to work, but when i went to end the shop, i got this crash
here's the code
does balatro mod manager work for downloading your steam modded for making mods
return {
message = "you cant say its only a half",
message_card = card,
func = function()
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blockable = true,
ref_table = G.GAME,
ref_value = 'chips',
ease_to = G.GAME.chips + card.ability.extra.score,
delay = 1,
func = (function(t) return math.floor(t) end)
}))
end
}``` this is probabyl insanely jank
but screw it if it WORKS
it dOESNTT
RAHH
How could I make it so that jokers just don't appear in the shop? I simply returned false in in_pool, but that seems to prevent me from manipulating the rates when I try to spawn them in with a booster pack.
yo in the place where u check left.config.center.key
if it is equal to "j_legendar_solgaleo" then the or statement will return true
and you cant add a joker with key = true
same for right
to fix this add 'and "j_legendar_solgaleo' inside the parentheses to the right of left.config.center.key == "j_legendar_solgaleo"
so the line would be
local key = (left.config.center.key == "j_legendar_solgaleo" and "j_legendar_solgaleo") or "j_legendar_ultranecrozma"
because for instance
if left.config.center.key is in fact equal to "j_legendar_solgaleo" then the and statement will return the second value (in this case "j_legendar_solgaleo")
and once that evaluates since a string is always truthy the or statement will just return "j_legendar_solgaleo" so the key will always be a string
and if its not equal then the and statement will evaluate as false and the or statement will then return the value of the second piece of the or
so "j_legendar_ultranecrozma"
@charred widget
yes thank you
so would i do the same thing for the right?
yes
cool ty :3
ok one problem
now it's making it spawn Solgaleo instead of Ultra Necrozma
elseif right and (right.config.center.key == "j_legendar_solgaleo") then
ya see this line
this line is checking if right exists and the right joker's key is solgaleo
so inside the statement right will always reference a joker with the key "j_legendar_solgaleo"
oh
hmmmm.
ahhhhh
wait so you want to spawn ultra necrozma if solgaleo is to the right or left
correct?
you dont need the local key variable
oh
just put in key = "j_legendar_ultranecrozma" in SMODS.add_card
since you already know the right/left joker is Solgaleo
you can spawn the card
bump
thank youuuu !!!
btw did you get this fixed?
SMODS.Consumable {
key = 'blueorb',
set = 'item',
pos = { x = 0, y = 0 },
loc_txt = {
name = 'Blue Orb',
text = {
[1] = 'Use this {C:attention}Item{} on {C:blue}Kyogre{}',
[2] = 'to undergo {C:attention}Primal Reversion{}'
}
},
cost = 10,
unlocked = true,
discovered = true,
hidden = false,
can_repeat_soul = false,
atlas = 'CustomConsumables',
soul_pos = {
x = 1,
y = 0
},
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card {set = "Joker", key = "j_legendar_primalkyogre"}
SMODS.destroy_cards(G.jokers.highlighted[1])
return true
end
}))
end,
can_use = function(self, card)
return G.jokers.highlighted == 1 and G.jokers.highlighted[1] == "j_legendar_kyogre"
end
}
fixed it
:0
ok now my game is crashing in an explosive way? ``` calculate = function(self, card, context)
if context.end_of_round then
card.ability.extra.score = card.ability.extra.score + (G.GAME.chips / 2)
end
if card.ability.extra.score <= 0 then return end
if context.joker_main or context.force_trigger then
G.E_MANAGER:add_event(Event({
func = function()
card:juice_up(0.5, 0.5)
return true
end,
}))
-- G.GAME.chips = G.GAME.chips + card.ability.extra.score
return {
message = "you cant say its only a half",
message_card = card,
func = (function() G,GAME.chips = G.GAME.chips + card.ability.extra.score end),
}
end
end,```
when did it crash
while calc
Log?
No, that is the log.
It's G.GAME.chips not G,GAME.chips
You're setting G to G.GAME.chips + card.ability.extra.score
first off, all of necrozma's forms fuse properly now
so thank you and everyone else for your help
OHH LMAO
im assuming blue orb works now?
the devious typo lmao
nope
the game is stable, it's not crashing
but i cannot use the blue orb on kyogre
bump
return G.jokers.highlighted == 1 and G.jokers.highlighted[1] == "j_legendar_kyogre"
G.jokers.highlighted is a table, itll never equal 1
not with that attitude
SMODS.Consumable {
key = 'blueorb',
set = 'item',
pos = { x = 0, y = 0 },
loc_txt = {
name = 'Blue Orb',
text = {
[1] = 'Use this {C:attention}Item{} on {C:blue}Kyogre{}',
[2] = 'to undergo {C:attention}Primal Reversion{}'
}
},
cost = 10,
unlocked = true,
discovered = true,
hidden = false,
can_repeat_soul = false,
atlas = 'CustomConsumables',
soul_pos = {
x = 1,
y = 0
},
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card {set = "Joker", key = "j_legendar_primalkyogre"}
SMODS.destroy_cards(G.jokers.highlighted[1])
return true
end
}))
end,
can_use = function(self, card)
return #G.jokers.highlighted == 1 and G.jokers.highlighted[1] == "j_legendar_kyogre"
end
}
this should be correct
i think
still not workin
ah
im dum i forgot something
you need to check the key of the highlighted joker
man i'm sorry lmao
i dunno what i was on when i wrote the original can_use function for you but it was way off
yeah this should be correct now lmao
can_use = function(self, card)
return #G.jokers.highlighted == 1 and G.jokers.highlighted[1].config.center.key == "j_legendar_kyogre"
end
missing the # on the length check again
ahjhhh
i did it right earlier
but copied it from the temp file from when i fixed the syntax error
nighttime programming moment
it worked?
yes
bump
yayyyy
glad to have helped at least a little bit
now i can probably just copy and paste it to Rayquaza and Groudon and do some tweaks for their transformations too
return not args or args.source ~= 'sho'
so whats the context for this
and what do you need to draw the sprite for
i think i might know something about it but it depends
I'm trying to draw seals on buttons.
like the spectral kind?
so you need to have the sprite of a seal in a UI?
hmmm
i suspect G.UIT.O would be helpful
since you can insert Sprite objects
but I think there would need to be some offsets or something which im not too familiar with
since the seals arent drawn at the center of the card
the Hoenn trio can now transform!!!!! yay
neat! now add goomy
No, on buttons that already exist.
sorry to butt in, much simpler UI question: is there a UIBox or something that's exactly the entire screen? i want to be able to draw some text in the top left corner of the screen regardless of menu transitions/whatever
ah
what buttons specifically do you want to draw the seal over
The play and discard buttons, also I need to draw seals on the mult and chips.
is there a way to get rid of badges for stickers? trying to get rid of it on a joker because it's designed around pinned and eternal and their badges feel cluttering everytime i hover over it
context.before is ran before calculations start right
yes, otherwise things like ride the bus wouldn't give you the +1 that hand
is there a context that fires right before the calculate screen
actually yk what scREW THIS
i give up
im reworking this joker to instead give its chips on drawing a hand
context.press_play
ah thx
How would I move the cards held in hand back into the deck (not discards?)
chat what is this second paramater for and is it arbitrary?
pseudorandom_element(_poker_hands, 'vremade_to_do')
it's the random seed for the RNG call
Yes arbitrary
coolio thx
Did some research and saw you have to set a card's config.cycling?
No, because that doesn't exist.
huh, was trying to reference a Prism joker and that showed up.
I'll keep looking then, seems like the draw_card() function might be what I'm looking for
Yes, because they put that there in a patch.
ahh, makes sense.
TIL G.FUNCS.draw_from_hand_to_deck()
How do I put a hashtag character into my joker's name? I tried doing \# which did not work
that just makes the name not appear
Hello everyone, I do not know what I am doing. Do I use r2modmanager for this or should I get steammodded and lovely in roaming's folder instead of the mod manager's folder?
Install mods manually is better than the mod manager > also #⚙・modding-general
you want to do uhh smt like #1#, then return "#" in loc vars
How would I create a non interactable slider? I'd like to know if there's a mod that does something similar to that at least
Like a scrollbar ?
ahh the one that the volume bar has
or crt, for example
oki
Or other mods config tab
do you know a mod with that in their config? I actually don't have any that contain it
hi, i wanted to make my editor show a warning when i call an async function from sync function. tried using ---@async attr but it doesnt help, any ideas?
--- @async
--- assume this function is in coroutine
function f() end
--- assume this function is not in coroutine
function g()
f() --- how can i make this show warning????
end
holy hell sliders are evil
Sorry no clue
yeah no worries i just checked, config sliders are made by smods
Lua doesn’t have async functions can only be called from async functions
You’ll have to create it or find a plugin
Or something
If i do manage to make this work this will be so cool
Ong
Check the code of ankh to see how to remove multiple cards at once
Immolate?
oh my days
Fill the args lol
i thought i did..
yeah i have no clue what im doing
wut
i know absolutely nothing about the UI 
Where are you creating this node ?
Mint is trying to make a slider like the sound one for their config or something
the luals has an annotation for that https://luals.github.io/wiki/annotations/#async, i couldnt figure out how to use it
have you shared your ui code
ahh it's not for config actually
Custom tab ?
G.hp_ui = UIBox {
{ n = G.UIT.ROOT, config = { align = "cm", padding = 0.05, colour = G.C.CLEAR }, nodes = {
create_slider({label = "The Beast", scale = 0.5, label_scale = 0.5, ref_table = , ref_value = " ", w = 3, min = 0.1, max = 8, step = 0.1, decimal_places = 1, colour = G.C.BLUE}),
} }
}
end
I removed ref table and ref value here since I have no idea how to work with that. The premise is It just needs to appear at the start of a boss blind (i can't use context.setting_blind since it's a part of a phase) and act as a health bar
i think i got the part which spawns it under that condition
but the bar itself is uh
yea
UIBox { definition = ...
do you know a valid ref_table that I can use for this purpose?
iirc the ref table is the table the value will go to
local my_config = {}
local ui = UIBox {
definition = {
n = G.UIT.ROOT,
config = { align = "cm", padding = 0.05, colour = G.C.CLEAR },
nodes = {
create_slider({
label = "The Beast",
scale = 0.5,
label_scale = 0.5,
ref_table = my_config,
ref_value = 'beast_config', -- this will change the 'beast_config' value in your table
w = 3,
min = 0.1,
max = 8,
step = 0.1,
decimal_places = 1,
colour = G.C.BLUE
}),
}
},
config = {}
}
you can access it later with my_config.beast_config
i might get this wrong
youll need to provide the initial value for my_config.beast_config
oki
thank you for the help btw
@keen atlas you are amazing 
now i need to figure out how to make it so you can't interact with it
how would i make an info_queue entry with custom config values
info_queue[#info_queue+1] = {set = "Set", key = "j_modprefix_key", specific_vars = {var1, var2}, config = {}}
ah
uhh is there a way to make a slider just update on its own
no
if i add a config table tho it just has nil for all the listed values
What mistake am I missing 😅
What line is that in the lovely dump?
it wants a config table
No, that doesn't line up with the crash log.
You need to return to set message_card
oh right that's the line before oops
as i've said multiple times now, this is what happens if i add the config table
notice how vars isn't doing anything
normally you should just provide the info_queue entry as the center table of the thing you want displayed
otherwise if you really need to pass vars from here instead of the object itself (which you shouldn't need to), it's specific_vars
how would I hide the score requirement? Or even the entire area that contains the score requirement
G.GAME.blind.chip_text = '???'?
ty
...
specific_vars doesn't work either
fml
Mmm, this is weird. Does anyone know if I can make a value determine the slider's position instead of the slider position determining a value.
it's been a long time since i've been here gosh, anyaway i gor problem, this appeared while checking on my new deck cards (there's no end missing i just couldn't screenshot the whole thing) how could this happen ?
nvm i fixed it
and btw i have a custom suit, how could i block it on all decks ?
in_pool = function(self, args) return not args or not args.initial_deck end
thx
using a slider was probably the wrong call
I'll have to think some more..
I'm definitely not good with UI at all which is making this much slower than it should be
from what i've gathered
info_queue works VERY differently internally with modded jokers
compared to vanilla ones
with vanilla jokers you just need key, name, config, and set = "Joker"
but that doesn't work with modded jokers for some reason
is this a SMODS bug, maybe?
No, it's because the vanilla jokers loc_vars are hard coded.
I wanna do some bug fixing
This Joker is meant to retrigger a Lucky Card once only if it successfully triggers
But if the Lucky Card procs when a different Joker is retriggering it, then the Derpy does not retrigger it
Need to figure out how to calculate all of the Lucky Card procs before the Joker retriggers the card itself
I don't think that's possible
you would probably need to patch where it calculates retriggers to add more after a lucky card procs or something like that
Wow
You can refer to how vanilla Jokers like Golden Joker use calc_dollar_bonus
thx
Firstly, you should be using SMODS.has_enhancement(context.other_card, 'm_lucky')
How is it different?
It's more efficient and faster and causes less lag.
I also have a few Jokers that give different amounts of Mult depending on the rank of the highest scored card
If the highest card is an Ace, it gives +11, which is correct
But if there is also a face card scored, it gives +10, as if the face card has the higher rank
For the code, I just adapted from Raised Fist and worked backwards
Yes, because aces have a nominal of 11 and the ids of face cards are equal to or higher than that.
Also Raised Fist sets temp_Mult to the nominal, not temp_ID
Also you should be using SMODS.has_no_rank
how do you make a scored card gain XMult
thx
Return vars and state your config values as card.ability.extra.value
will the game error if i try to call draw_card on a deleted card?
Hello. Is it possible to make a joker affect specifically cards with enhancements on them? Like Vampire.
of course
Oh right, Vanilla Remade. I should have seen this, I was only looking at Example Jokers. Thanks.
No, but there will be ghost cards.
ok how should i store cards from deck to draw later
and how do i check theyre still valid to draw
what is this error about?
Can you give a bit more context? Valid to draw under what circumstances?
The label doesn't find a localization entry, so it displays ERROR
start of round, drawing specified cards set last round to hand
idk what kind of object you made, but localization for things like seals and stickers can be a bit weird when you first set them up, because you need to add a dictionary entry for the label specifically
The way I'd do this is to mark the cards with a boolean to flag it, then iterate through the deck later. I assume this is for a joker effect, right?
i've added the loc_vars like this and it's still showing nils
how do i fix it 😅
In my experience, they will persist if you set a flag! That's how I do it for a bunch of jokers, at least!
do you just set it as like card.my_joker_draw_to_hand = true or whatev
It does become a bit more annoying if you want to specifically ensure that the card knows which joker marked them if there's multiple copies of the same joker, though
Yup
ok
Depends on what kind of object you're setting up
hopefully it doesnt get too messy setting that on half the deck lol
It shouldn't, I do something like that for a boss blind that debuffs half the cards each hand, and that has been working without error so far, haha
oke ^^
seals
No, that would not persist.
Though I'm currently trying to figure out how I solve the same issue for card areas, which I've not figured out yet
I'd check the localization file in the source code and control f Gold Seal to see an example! But in your localization file, labels are set in misc.labels
but ice says it will :(
ok
im confused
oh
You would have to put it in card.ability for it to persist.
the other thing to do is to have jokers generate an ID
and mark that, so cards can find their reference again
do playing cards have a card.ability
here's an example of how I've set it up for my mod
Yes, all cards do.
and its ok to set it directly without messing with its config table?
thx
Someone had this issue before me, and it was suggested to patch SMODS.calculate_repetitions
should i put it in ability.extra?
No, you would put it in card.ability
ok
Bookmark for future reference
i still have no idea if that's the right solution
Wow! I have no idea what I'm looking at
is it bad form to call "delay" like this
if context.first_hand_drawn and (#card.ability.immutable.drawcard > 0) then
for _, c in pairs(G.deck.cards) do
if c.ability.nflame_tjdraw then
draw_card(G.deck, G.hand, nil, "up", true, c)
delay(0.5)
end
end
end```
I'm not sure how the base game handles it timing, as far as game speed goes, but in my experience using delay's most likely just going to annoy a player due to animation speeds being slow
ok so is removing the delay ok
i'm going insane what am i missing??
Wtf discord mobile
swipe right and left
didnt work, i did the labels in the localization, didnt do it before
do i need something else?
discord mobile has been held together with duct tape for years and it's been peeling more and more
potentially, I'm not sure what your current set up is. Can you show your localization entry?
and the seal's code?
one sec
is Fallen Angel not an existing jokeR? You can just pass the actual G. P_CENTERS
it is
but i want to show different values than the default ones
since this is for an upgrade system i'm making, which has the ability to carry/overwrite over certain values
is it a capitalization thing?
did that
I'm checking how seals are set up for Kino
but I don't see anything in that code specifically that should make a difference
and im looking at vremade, nothing special there too
dont know where the problem is
the mod is done tho, just the text issues
My only thing is that I think there might be some issues in the code that don't properly take care of capitalization, so it gets confused
don't know what else it'd be
i mean idc tbh, its just label, doesnt effect anything
This isn't working as I expected, and as much as I would like to figure it out myself again, I'm running out of time for today.
So, I'm trying to create a Joker which has a 1 in 2 chance to retrigger cards with enhancements, and I've kind of mashed together code from a bunch of different cards to try and do it, bloodstone, vampire, cavendish. I've never coded in lua, so, that definitely has something to do with my struggling right now.
key = 'rewindjoker',
loc_txt = {
name = 'Rewind Joker',
text = {
}
},
rarity = 3,
cost = 10,
atlas = 'Jokers',
pos = { x = 0, y = 0 },
blueprint_compat = true,
perishable_compat = true,
eternal_compat = true,
config = { extra = { repetitions = 1, odds = 2 } },
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds)
return { vars = { numerator, denominator, card.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.repetition and not scored_card.debuff and not context.repetition_only and SMODS.pseudorandom_probability(card, 1, card.ability.extra.odds) then
if next(SMODS.get_enhancements(scored_card)) then
return {
message = "Rewind!",
repeitions = card.ability.extra.repetitions
}
end
end
end
}
scored_card doesn't exist.
Yes, use context.other_card instead
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if next(SMODS.get_enhancements(context.other_card)) and SMODS.pseudorandom_probability(card, 1, card.ability.extra.odds) then
return {
message = "Rewind!",
repetitions = card.ability.extra.repetitions
}
end
end
end
I've removed the excessive context checks
this is all you need
(There's a typo on the returned "repeitions" 😬 )
Oh lmao sorry
Interesting.
Well, thanks for the help everyone, I appreciate it. I'm honestly just surprised I made it this far without asking for help until now.
looking at how vanilla jokers work is also a way of learning
Yea getting the jist of it so far without help is impressive
Also check VanillaRemade if you haven't yet, which reproduces vanilla items in a SMODS format https://github.com/nh6574/VanillaRemade/
Yes. I've just been staring at Joker code for the past three hours or so? I've also been searching up issues that other people might have had to go through as well.
Blue Seal replica isn't retriggerable by Mime btw
Yeah, this is where I got most of the code I was staring at. It's been really helpful even though I don't know how to utilize everything to it's fullest.
@red flower
Alright so, I tried it out - It doesn't seem to retrigger.
I mean it plays the card without crashing now, so it's definitely a step up.
Ik it because I have a similar seal
Did you put the probability to 1 to 1 to test it out?
Ig this alone explains everything
kind of. I did a roundabout way by grabbing oops.
and a bunch of chads.
oh
That's way smarter, though. I probably should have done that.
i changed blue seal recently does that work correctly
incredibly helpful 🤞🏽
haven't really tested that, is context.playing_card_end_of_round new?
yes
alr then
Yeah. It's not retriggering even with that.
new as in new in that code not new in smods at least
oh I see
it's just not documented 🤷
wtf
oh well
if my hook to Card:get_end_of_round_effect still works, why not leave it be
nvm I take it back
better coding practice to change it right away
going back to this, since i didn't get a reply before and am still suffering,, i want to use the actual G.P_CENTERS, but i need to change some of the config.extra values
Oh, sorry, I must've read over your reply!
So why do you want the values to be different from the joker that is being referenced?
as it's meant to be a preview for an upgrade system i'm implementing, which also has the ability to have modified config values to the default
hold on lemme record an example rq
Ah, so the values in the info_queue would be dependant on the Sophie joker's values?
A few people have tried to do this same kind of thing, none of them have figured it out
I don't know how I'd suggest setting up the info_queue directly, besides just using a dummy one, so at best I could suggest a work around
that's why i'm having a problem 😭
are those values you want in the config global?
oh yea
you could check card.fake_card in the other card's loc_vars and make it use those globals when it's in an info_queue
N i have a question
hi
well
ello, i uhh wanted to ask is there a way to turn a slider into a bar that would act as a display for data instead of something that sets said data.
i already make a proper context table with the modified entries in the patch
i just need to use thoes modified values in the loc_vars
and no matter what i put in the info queue entry i can't get it to be used
i dont understand what you mean with any of this lol
i think they mean that they want a slider to also read the value instead of just writing it
^
the localization functionality has a loooot of hardcoded stuff, so there's a lot of things going on that make you think you might be able to change certain values, but it not working that way
oh i never used sliders
ah..
i've seen smods documentation suggest duck typing
i've tried doing that but am still struggling
In this case, at least as a temporary solve, I'd use a dummy entry that just copies the display and displays what you need the value to be
i meant something like this
it has a different loc_vars when it's on an info_queue
https://github.com/nh6574/JoyousSpring/blob/075f07ed39d6d7fb49f15bc78109f733a6af9533/src/others/Enhancements.lua#L102
that's set when smods creates a fake card to get the config values for the info_queue
if it's a fake card return the globals as vars
i think you've misunderstood what my problem is
or i've misunderstood what you're telling me 😭
the problem is that you want the tooltip for your card to show custom values instead of the default ones?
i want it to show custom values instead of nil
well, it's nil because you are passing the key and set instead of the center
