#đ»ă»modding-dev
1 messages · Page 36 of 1
other_card is a single card
I thought it was 32 by 32
it works for me, so size might not matter
Still somewhat unfamiliar with Lua's for loops, I'd assume it's something like for k, v in ipairs(context.other_card[v]) do, or is that completely off? Or, should I be searching through cardarea instead?
Neither
I think thereâs a context.individual at the end of round that automatically iterates over cards in hand
Trying this, and now it doesn't activate at all, not sure context.individual works.
if context.cardarea == G.hand and context.individual then
for k, v in ipairs(context.other_card) do
if v:is_suit('Hearts') then
self.ability.extra.Xmult = self.ability.extra.Xmult + self.ability.extra.Xmult_add
return {
message = "Upgraded!",
colour = C.G.MULT
} end
end
end
end```
basically, ccontext.end_of_round is already called multiple times
and when it is called, it passes a singular card in context.other_card
so you dont need the loop
Heavily cleared things up - It's getting further, but, somehow, it's saying that ability is nil - succeeding the if statement, but now, I have no idea what the issue might be. Here's how I changed the code. Any suggestions from here?
if context.end_of_round and context.cardarea == G.hand and not context.blueprint then
if context.other_card:is_suit('Hearts') then
self.ability.extra.Xmult = self.ability.extra.Xmult + self.ability.extra.Xmult_add
return {
message = "Upgraded!",
colour = G.C.MULT}
end
end```
im genuinely confused since this works fine in lobotomy corp but not mine ;<
Did you define mod_path
yeah
What does the file look like
The code
the ones in indiv_jokers i think
Youâre calling NFS.load on some file
You should check if the load was successful before calling.
Like this.
Would let you have an easier time bugfixing since you'd know what the loading issue is
No checking if the load was successful we die like giant golden babies
it looks like the issue is just that either one of the files is empty, or incorrectly defined
Or maybe the key v is different from the file name
yea thats incorrectly defined
this is code, sorry took a bit i was checking stuff.
The one on the left isnât defined properly but shouldnât break anything
What are v and what are the file names youâre loading?
Just the Joker names for the files and v is just what was in the lobo corp code
Show them please
can someone make suggestions for my mod
What about v?
I don't have anything about v in my code other than that bit, its not in lobotomy corp either other than that code part
unless im just blind... (< about looking in lobo corp)
Yes, show me what values v takes
Wait itâs here
look at this
Cards
Card type,Name (You),Name (Card),Rarity,Effect(s),Ye or Ne,Art (if Ye),Description,Cards required,Unlock conditions,Name (you),Name (feature)
Joker,AlexZGreat,Arson,Rare,Destroy Joker to the left and to the right when full house is played, gain 0.25x mult per destroyed joker,Meh
Joker,Ale...
@cobalt nexus (Cont. from previous channel) The best way to get started with modding is honestly to just get started. It's programmed in Lua, which is very simple, and the source code for any mod is available just by downloading the mod and looking through its files (and the base game source code isn't difficult to get either)
I'd recommend reading the Steamodded documentation and looking at and/or editing the source code for my mod, then trying to make a mod following the same style as mine.
Figured all the abilities out, most of it is working, but pool flags appear to do nothing. Also tried using add to deck = function() return{add = false} end to try removing it, but, neither seems to have any affect. Also tried moving the remove from pool function to activate at different times. No idea how to approach it from here.
where are you initialising the flag?
The first line after calculate, I tried bringing it out of the code, but it crashed because it couldn't index GAME.
and do you ever add the flag to the joker?
The second comment under calculate, I tried adding it at the end of round since that's when Gros Michel does it, and it used to be at the bottom, right before the message that says "Broken".
No not like that, you need yes_pool_flag = joker_broken. in your joker object
I think your code should change the flag correctly but you havent assigned it
It's within config.extra - I'll check and see if Gros Michel has it out of extra.
nah it needs to be outside that
Indeed it does, looks like that'll probably fix it, thanks for pinpointing it.
Did not fix it.
it's not removing it?
Wait - might've been dumb, moved it out of extra, not out of config - I'll try another time.
also
you set the flag to false every time calculate is called
but you don't set it to true in the calculation that destroys the joker, so I'm pretty sure it'll always be false
That'd make sense. I'll try a few more things, might come back for a bit more help.
Alright - either I'm incredibly unlucky, or I've figured it out - I'll make a quick test joker that has yes_pool_flag and see if it appears.
Seems to be perfect, thanks for all the help. And, while I have you, O' magical wizard of the shaders, do you have any recommendations on resources to go to to learn how to create shaders with custom patterns, or just try and figure it out from the source code?
You could look at the book of shaders
But I mostly just figured stuff out and trawled the internet for forum posts
i read that before, and i couldnt fivure out how to get the files from Balatro (I'm on Mav BTW). I copied the Balatro app, and turned it into a .zip, but it just said that the file couldnt be read
when i'm making different card types
do i make different lua
like stupidity jokers and stupidity vouchers
or do i just make a megapack
Unfortunate that it doesn't seem like the obj pool I set up doesn't remove duped cards but it's functional at least.
Maybe because the cards don't have center.name?
That's probably it.
Well that's one way to do deck thinning
That might actually be kinda interesting as a temporary effect from a consumable
No
but what about yes?
Can you please do a cosplay of the hanged man
Very creative insult
Truly
Can you please do a cosplay of "speak no evil"
Let's not go too crazy with the jokes, folks
Can you please stop doing a cosplay of The Fool?



at least it isnt ai generated like the other guy?
the source material is worse
e
e
e
why is my consumable causing a crash on boot when it's assigned a modded consumable type?
attempt to index local 'ref_table' (a nil value)
functions at which the crash occurs at shown below
consumable type definition:
i feel as though i've got everything right, something tells me this might be a bug with the modloader but i'm not sure at the moment
have you got the consumable definition handy?
hold on
Youâre missing undiscovered.
you don't need undiscovered
And also âLabelâ is so longer used as of current commit.
i've tried adding that though, both in the table itself and nested within loc_txt.
(note: i've been working on the mod a bit more so some variables like the consumable type name have changed from last screenshot, though the same issue still applies)
what's the current name?
oh, i must have misspelt it last time lol
we're good
because i did try that and it still crashed, but clearly i must have done a spelling mistake
how to randomly create a joker of certain rarity đ€ how to support rarities in other joker mods
How does Soul does it
this rarity parameter is a fraud
do that
_legendary
ohh đ€
I want to generate a joker that has same rarity as a given joker, so I inject into it and set _starting_pool to G.P_JOKER_RARITY_POOLS[card.ability.rarity]?
If that code is like vanilla then you donât need to inject
You just need to use the right input
I'm actually working through a very similar problem right now for my Gatito jokers
I'm pretty certain from what I've seen you do need to inject code into that function
At least, that's what I'm doing right now
Iâm pretty sure you should be able to force a specific rarity pool as it would be a required feature for Riff-Raff to work.
And 0 and common
that's also rare
Also the rarity tags
Wait are you making a new rarity or forcing it to generate an existing rarity?
this is not good, what if cryptid lowers the chance more
Oh I misread the Cryptid check
existing
Ah okay that's easy then
Thatâs Cryptidâs fault. But also you can do what the base game does for Uncommon and Rare tags
G.E_MANAGER:add_event(Event({func = function()
local newCard = create_card('Joker', G.jokers, nil, 2, nil, nil, nil, 'strongHeart')
newCard:add_to_deck()
G.jokers:emplace(newCard)
return true end }))
This is the code I'm using to get a random rare joker
the issue here is that you pass the chance roll for a rarity and not the rarity itself
The 2 there represents the rarity (it's rarity minus 1, so 0 is common, 1 is uncommon, 2 is rare) (I think)
Iâm also interested to learn from what you do because Iâm considering similar things. But why are you creating a custom rarity? This should be doable without
if a chance roll of 0.9 no longer results in an uncommon joker, then uncommon tags will be broken
I want to support mod rarities
like cry_epic
Yeah, without a consistent API for new rarities I think that's going to be tricky to support all modded rarities that way
The chance of new rarities should follow the model of Edition API
While choosing a specific one should be done by index (not integer indices)
So youâd need to replace every base call that specifies a rarity by float with a string
I don't want the Gatito jokers to show up in the standard pool, so I'm giving them a custom rarity that will never show up. The only way to get them will be from Gatito packs (which will have a very low chance of spawning normally, and a very high chance of spawning if you have an incomplete Gatito set)
You can disable Jokers from appearing by passing no_pool_flag = true
Either ânoâ or âyesâ I forget which is which
Cavendish moment
why rare tag checks if rare jokers in G.jokers are less than number of all rare jokers and doesn't generate if not satisfied
I think it looks nicer if it's got a fully custom rarity. They kinda occupy a similar design space to the Legendary jokers, so I want their rarity to reflect that
and uncommon tag doesn't do that
I can understand wanting a token rarity though I personally likely wouldnât for this mechanic
What rarity would I give them if not a custom rarity? Do I say they're "common" because they all have terrible effects (actually most of their effects are worse than Common jokers), or do I say they're "rare" or "legendary" because they have game-warping effects once you get the whole set?
Iâm going to guess itâs to avoid Double Tag shenanigans but this seems rather silly since itâs not explained anywhere
Iâd make at least one Common or Uncommon. The rest can match
I have a Joker that increases the chance of itself spawning and even at 1 in 12 itâs kinda rare to see
Oh, but youâre going to have packs, right?
Yeah, they only way to get them is through packs
The rarity would just be a visual thing
Then choose the rarity of whichever one you can find naturally and the rest can match
As in, in the shop
None of them will show up in the shop naturally, they're only going to be in packs
If none are in the shop they can all be Rare or Legendary as per your preference. Iâd do Rare
I think fully custom rarity gives a better indication that they have their own unique design space
I think you can indicate it through other ways
Again, it's just a visual thing, so it really doesn't matter that much
Rarities do have mechanical impact
Baseball moment
Idea: for effects that donât normally use calculate, call calculate with a custom context named after the Joker(âs key) to make it interactable
I had had an idea for a Joker that doubled the effect of Common Jokers by calling calculate twice, but it wouldnât work with e.g. my Cows, so doing this would make the Cows work
Having said that I donât know how the doubling Joker would work with a calculate call rather than being hardcoded đ€
Unless someone else has a better idea of how to retrigger Jokers
I donât know an available mod with that mechanic
cryptid
try looking at canvas from cryptid
it retriggers jokers to the left of it once for every non-common joker to the right of it
đ€
I had started working on it before ejwu took over the calculation stuff
this works (not card.ability.rarity it's card.config.center.rarity)
I plan on eventually putting that API into Steamodded
I do think in my case hooking calculate would be enough, since I only want it to repeat once
Something like
function calculate(context)
if bool and not context.loop then
context.loop = true
calculate_ref(context)
calculate_ref(context)
else
calculate_ref(context)
end
It being what?
Small issue I've been running into with custom rarities
I've got the rarities set up in the bottom level of my main code (copied from the init function of Fusion Jokers, which is a 0.9.8 mod)
table.insert(G.P_JOKER_RARITY_POOLS, {})
table.insert(G.C.RARITY, HEX("CC9977"))
local gatitoRarity = #G.P_JOKER_RARITY_POOLS
loc_colour("mult", nil)
G.ARGS.LOC_COLOURS["gatito"] = G.C.RARITY[gatitoRarity]```
This works exactly as expected for the most part, except for when I try to reset my save file. If I do that, it throws an error when adding jokers into the new rarity pool that it can't find the pool. When I open the game up again after that crash, it works fine again.
Wait didnât Steamodded have custom rarity support? I donât remember
on putting joker repetition into the evaluate stack
Ah, as I said I was going to be hacky and just hook calculate
Wait hold up maybe you're right
It looks like it has this, which isn't quite a custom rarity but it's definetely close enough for my purposes
yeah your way looks like it would work
Since my way is only working 99% of the time, and I don't want to try debugging it if there's an easier and better supported way that will work 100% of the time, I'm going to just replace this with the set_card_type_badge function
has anyone ever made a joker that can turn into a random joker?
You could just make it create a new joker and then dissolve
i have never heard about dissolve
I'm trying to make a joker that creates a random joker (like judgement) but better
Here's my code for one of my jokers. It destroys itself and creates a random rare joker after playing a certain number of Hearts
calculate = function(self, card, context)
if context.individual
and context.other_card:is_suit("Hearts")
and context.cardarea == G.play then
card.ability.extra.heartsLeft = card.ability.extra.heartsLeft - 1
if card.ability.extra.heartsLeft == 0 then
card_eval_status_text(card, 'extra', nil, nil, nil, {message = "+1 Joker!"})
destroyCard(card)
G.E_MANAGER:add_event(Event({func = function()
local newCard = create_card('Joker', G.jokers, nil, 2, nil, nil, nil, 'strongHeart')
newCard:add_to_deck()
G.jokers:emplace(newCard)
return true end }))
return {}
end
if card.ability.extra.heartsLeft > 0 then
return {
extra = {
message = card.ability.extra.heartsLeft.." left",
},
card = card
}
end
end
end
Yeah you can just remove the reference to hearts, the inner part where it destroys itself and gives a new joker is the important part
Oooh actually I forgot that destroyCard(card) is a custom function I built
function destroyCard(card)
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
end
do i just add this to my code?
Yep, that should work.
Good luck!
shoutouts to joker self destroy code
Fun fact: v = nil is useless
Just in case a Joker is extra determined
just in case...
all it does is get rid of your local reference to the object
it doesn't actually kill the table
parchment engineer isn't 2 uncommon?
For some reason the code uses rarity-1 instead of rarity
So 0 is common, 1 is uncommon, and 2 is rare
at least 0.7 but below 0.95 is uncommon, and 0.95 or above is rare
not sure how you'd get 1 being uncommon, but that case doesn't work
so i change the G.jokers value to 0.95
after rolling for rarity, it converts that to the pool
I guess I saw 0 was common, tried 2 as rare and that worked, and incorrectly extrapolated to 1 = uncommon
it doesn't roll if you put in a rarity
Never actually put that theory to the test
steamodded pool stuff should patch this to use rarity keys instead
so the number is the chance?
yeah it uses it as a result for a non-existing chance roll
otherwise it generates a number from 0 to 1 and determine the rarity the same way
Just use these three values I think:
0 - Common
0.7 - Uncommon
1 - Rare
Should be easy enough to remember
Is it > or >=?
Reak quick, was looking for this through the base game and steamodded's source code, but couldn't find anything about it. The only place I haven't checked is through the steamodded .tomls, but there's a chance I completely missed it somewhere.
it's > last I checked
yup it's >
You said at least 0.7
not at my PC rn, I had it backwards
@solemn coral 0.7 might not work
the patch files are pretty much the backbones of it all, most API functions are put into use somewhere in there
I usually look through lovely dumps instead of source files when I'm searching something
card_eval_status_text(card, 'extra', nil, nil, nil, {message = "+2 Jokers!"})
destroyCard(card)
G.E_MANAGER:add_event(Event({func = function()
local newCard = create_card('Joker', G.jokers, nil, 1, nil, nil, 'strongHeart')
newCard:add_to_deck()
G.jokers:emplace(newCard)
return true end }))```
I removed all of the heart stuff
And adjusted it
I can't deal with this
I've been thinking about literally writing some sort of "read this first" for questions I'm tired of answering
At this point I think i need it
also you have visual studio code so install the Lua extension
I did
at this point what it will tell you is "learn lua"
you must've disabled the syntax checking or something
no docs on SMODS.Challenge yet right
no, but that one shouldn't be too much work
guys wanna see how much suggestions a few people made for my mod?
no
"you do the programming, i'll do the ideas"
me who can do programming but have no ideas
no i will not program for your mod
Im the opposite
No seriously look how much ideas they given Red Joker
Blue Joker
Yellow Joker
Green Joker
Black Joker
Magic Joker
Nebula Joker
Ghost Joker
Abandoned Joker
Checkered Joker
Zodiac Joker
Painted Joker
Anaglyph Joker
Plasma Joker
Erratic Joker
ok
I may need tips on how to handle something that has been bothering me since the beginning of the developement of my mod.
I add 150 ranks, where should I make the changes so there is only one Jkr short ?
we had 60 suits, now get prepared for 150 ranks
definitely lol
I'm all ears
now we have a total of 9000 cards in our decks
Your ideas are so creative (intentional ping)
I also don't need to have them at the beginning of a game in a Deck. So that makes total sense if they're only created by trigger
I think Bunco does that
wait does this mean the challenge doesn't get prepended with the mod prefix
Ty, Bunco is 2500 lines of code, any idea what the name of one of them so I don't read everything ?
there's a reference at the top for a reason
Oh wait Bunco was suits not ranks
But maybe it will help anyways
@night pagoda how did you hide suits?
__call does that, not register
I injected into the function that creates tallies for the suits. It's in lovely toml, labeled under "UI suit hiding" or something
Oh ty a lot, I'll look if there's something for ranks too then. But what I want to achieve is to make all 150 ranks "count as one" for the UI
I think ranks are counted in the same place, so yeah
})) <-- Syntax error
Cryptid compat 
why does get_current_pool even use chances instead of just the rarity key
why is })) a syntax error
it isnt, youre having a syntax error somewhere else
that is STILL not a screenshot
Use prt scrn
You probably have an useless ')'
Easiest shortcut ever
Also use windows shift s
The best tool
You're missing a 'end' after the return
Move one of the ends to there
oh nice challenge unlocks works properly... if the challenge.toml worked properly
aure does a little trolling
And because it's a function in G.E_MANAGER you probably need to do return true end
I'm trying but I'm not getting images
it's in your clipboard, paste it
Also, I dunno how kind lua is, but having a missing parameter after a coma in "create_card" isn't something you should do
Why does the message say +2 Jokers when thatâs not what the concept does đ
Loop
Im stupid
Also why are you forcing a rare/epic joker
Random
ok
That was my idea
Maybe you could make it uncommon or higher but it just spawning a random rare (epic with Cryptid) is kinda stupid
But this is the stupid mod
So itâs up to you
imma stick to your version
And you may want to hover errors that shows up in VSCode and try to learn what you're doing incorrectly to make your code cleaner and working !
What you should do to implement is modify add_to_deck to replace the Joker when it is created
_card = create_card('Joker', G.jokers, nil, nil, nil, nil, nil, 'cry_vermillion_virus_gen')
G.jokers.cards[idx]:remove_from_deck()
_card:add_to_deck()
_card:start_materialize()
G.jokers.cards[idx] = _card
_card:set_card_area(G.jokers)
G.jokers:set_ranks()
G.jokers:align_cards()
i had a stroke
Here is a similar section of code from Cryptid, only difference is youâre replacing card instead of G.jokers.cards[idx] and you should use a different name for the RNG (instead of cry_vermillion_virus_gen)
either root or in the lovely folder i believe
Either in Mods/Mod/lovely.toml or Mods/Mod/lovely/*.toml
Where Mod is your mod name
Ty !
so you want me to replace the card code with yours
Basically
You donât need to use calculate though, it should be in the add_to_deck function
with this
And with these changes
Also you donât need to check the context
remove context
ok
bye math
Does the modifications you're doing in a ".toml" file appear in the lovely/dump/ folder ? Because if it does, I'm clearly doing something wrong
i'll let you figure it out
yes
hmm, ty
unless you specify not to dump_lua
lol, just in case
might be a regex pattern issue then
can you show your patch?
Yes !
Did you specify the folder the file is in?
[[patches]]
[patches.pattern]
target = 'main.lua'
pattern = "local rank_name_mapping = {}"
position = 'after'
match_indent = true
payload = '''
local mjst_joker_id = nil
'''
That's only one of the four
Also the pattern needs to match the whole line
oh hm
Not the indent right ?
No
this one doesn't work because that code you're trying to patch comes from Steamodded's lovely patch
Do I need to change the priority then ?
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
Iâm not sure you can patch a patch
Ok I'll try that and see
Problem solved
maybe just try patching a line thats in the same area but not in a smods patch
unless the entire thing is a smods patch
In another patch I must modify a SMODS patch
I'll try changing the priority
i see
Having a bit of trouble updating my mod to steamodded 1.0. Reassigning the atlas of the planet works, but the renamed loc_txt is showing up blank
I feel like I'm missing something obvious
only the description, or both desc and name?
Looks like this.
Ah, I see, I'll give that a shot.
will this work to add a deck with a enternal madness and riff-raff?
object_type = "Back",
name = "Insanity Deck",
key = "insanity",
config = {
jokers = {
{id = 'j_madness', eternal = true},
{id = 'j_riff_raff', eternal = true}
}
},
pos = {x = 0, y = 0},
loc_txt = {
name = "Insanity Deck",
text = {
"Start with an eternal {C:attention}Madness Joker{} and eternal {C:attention}Riff-Raff{}"
}
},
atlas = "budget_decks"
}
local deck_sprites = {
object_type = "Atlas",
key = "budget_decks",
path = "decks.png",
px = 71,
py = 95
}```
you tell us đ
Ok just for information, I found my mistake,
my mod is in "Balatro/Mods/Modpack/MyMod/main.lua" and Steamodded doesn't seems to look from a relative path so my "lovely.toml" in "Balatro/Mods/Modpack/MyMod/lovely/lovely.toml" wasn't called
Now my mod is in "Balatro/Mods/MyMod" and it's working fine
oh yeah that's a Lovely quirk
Ty for help, Now i'll try to see if I achieve to apply my patch on a patch :/
wasn't added
trying to make fluorescent shader attempt 3
some jokers got eaten (shader is too hungry)
fix:
Having some difficulty trying to set up a booster pack
table.insert(stuffToAdd, {
object_type = "Center",
prefix = 'p',
key = 'gatitoPack',
name = "Gatito Pack",
weight = 3000,
kind = "Gatito",
cost = 1,
discovered = true,
alerted = true,
set = "Booster",
atlas = "jokers",
config = {extra = 4, choose = 1},
loc_text = {
name = "Gatito Pack",
text = {
"Choose {C:attention}1{} of up to",
"{C:attention}4{C:joker} Gatito{} cards"
}
}
})```
I feel like I've gotten this somewhat right, but every time I mouse over the pack, it gives me an attempted to index a nil value in the localize function.
i got the deck loading but the jokers aren't added
key = "insanity",
name = "Insanity Deck",
loc_txt = {
name = "Insanity Deck",
text = {
"Start with an eternal","and negative {C:attention}Madness Joker{}","and an eternal","and negative {C:attention}Riff-Raff{}"
}
},
pos = {x = 0, y = 0},
discovered = true,
unlocked = true,
config = {
consumables = {},
starting_jokers = {
{key = "Madness", eternal = true, negative = true},
{key = "Riff-Raff", eternal = true, negative = true},
}
},
atlas = "budget_decks"
}
SMODS.Atlas {
key = "budget_decks",
path = "decks.png",
px = 71,
py = 95
}```
thanks for the help, adding the description didn't work unfortunately but what did fix it was creating a localization file, as below
only thing I can't quite crack is changing the labels (ie "Dwarf Planet", "Planet?"), but that can wait.
I think since you overwrote loc_text, you overwrote the part that contained the original description
Those are badges
I think you're right yeah. On 0.9.8 I was directly accessing loc_text.name instead of setting loc_text to a new dictionary.
Look at these fusion jokers from Marie
It's possible you can still directly access loc_text.name in code, but ig using a localization file is cleaner.
I think you can but it's recommended to do it inside a specific function
process_loc_text perhaps yeah
can anyone help with this please i'd really like how to get deck effects working
wrong keys probably
look at vanilla for the right keys
i used the keys from the card.lua file and they're still not added
{key = 'Madness', eternal = true, negative = true},
{key = 'Riff-raff', eternal = true, negative = true},
}```
Those aren't keys
Those are names
I find it easier to peruse the localization files
so this?
{key = 'j_madness', eternal = true, negative = true},
{key = 'j_riff_raff', eternal = true, negative = true},
}```
probably
still didn't work
Success ! (It's not sorted anymore but that's an easy fix)
Why are they in that order
pairs?
Buffon packs đ€
I added 150 ranks and made it just one in the UI but by doing so I've destroyed stuff
True ! My bad (I'm not english)
all good
nice!
I haven't changed the preview and it's what it looked like before :
And it was laggy af
cool.....
Cannot!
Woah
A rival fluorescent edition!
how do i make rng manipulation
If I want to start modding this game (having 0 prior knowledge to modding) where would I begin to learn?
Learn lua
Then learn steamodded
Then reference other mods and the games source code (very important) to code your jokers and other stuff
Awesome thanks!
Trying to start out simple, how do we add a joker that gives flat +mult and a joker that gives flat +chips?
Using 1.0.0 Steamodded
Look at the gameâs code
https://github.com/Steamopollys/Steamodded/wiki/01.-Getting-started steamodded wiki too
Specifically card.lua, you can find jokers using ctrl + f
trying to wrap my head around this in card.lua
so for base joker it pulls from loc_vars whichhh I'm assuming is the same vars found in game.lua?
meanwhile mods from others (TWEWY, Cryptid, Bettmas) have all sorts of different ways they add jokers...
What's all this about SMODS-
fwiw I have very little lua knowledge and basic coding-
Cryptid is not really the best example as I use my own wrapper around the Steamodded API to enable/disable items when loaded
Are you using Steamodded 0.9.8 or 1.0.0?
Steamodded 1.0.0 over here
Idea is to make different tiered jokers, like an uncommon sly joker or a common stuntsman. Throw em into the pool and see what happens-
flourescent is very cool, but it might be better if the darkened bits were made transparent
i had a concept
Name: Metal Fool's Cap
Effect: All played 6 and 4 cards become Steel when scored.
welp it loads to title screen now so we're getting somewhere-
now to find out how to actually make it work
please use a different font...
No monospace hurts my brain
The font is peak wdym
font dont matter jus if the joker works
and it doesnt still so-
What editor are you using?
I like the font, just not for code
Notepad++
that's good- I was just asking in case you were completely new to coding. Try looking at SDM0's stuff, each joker there is added directly
that should get you started. code should look like just SMODS.Joker{...}
Where's SDM0's stuff?
We sort of are figuring the SMODS.Joker thing out, we just don't know how to make it actually appear in the collection
if you register the jokers, they should appear in the collection automatically
to be precise: SMODS.Joker{...} doesn't just define the joker, it automatically adds the joker into the game
For all mods the process is the same, search or scroll down in modding until you find it. sorry, it's very disorganized in here
can link SDM0
HE EXISTS
Oh is this for 0.9.8 or 1.0.0
btw when is the steamodded alpha going to be a release, ive had multiple people complain about how its confusing when i told them to download my mod
bcoz the readme is shite
cool
i realise my message was a bit rude, didnt mean to be pushy, appreciate the work everyone does here <3
All good ^^
also just ironing things out and adding things we can't do down the line because they're breaking changes, such as most recently the update to pools
đ€âđ»
At last I became a reference for 1.0.0 joker creation đ«Ą
Does anyone know how bosses are determined? I made a patch to force get_new_boss to give me Showdown Blinds but after the first two it stopped working
That might be because I rerolled the boss
But I started a new run and it didnât work either
Also I think the ante 1 boss is determined separately
rerolling shouldn't affect boss rotation?
hey does anyone know how to cause a game over at any state during the game, not just at the end of a round?
check lobcorp's punishing bird for reference
if you sell it you instantly get a game over
Somehow I get a normal boss instead of a showdown boss
Oops I pinged
fueled by bobmâąïž
don't think i can help without seeing what changes you made
Wait, I think I understand. I always add the showdown bosses to the pool, but I didnât remove normal bosses from the pool.
I think thatâs what I did now that I thought about it. Iâll check later
has anybody here encountered this? is this caused by setting incorrect resolution? it doesnt happen to me but for somebody else its fucked
you need 1px transparent border
around your voucher sprite
i believe thats the issue
it happens when pixel smoothing is on? i think?
aha! thanks a lot
Anyone have any idea where I can find the function randomizing the main menu card ? I want it to display a random joker on every launch.
I can't find it in the source code !
thanks a lot
Look at Brainstorm mod older versions
Does anyone know off the top of their head if I can find what card area a card is in without going through every card area and checking if the card is in it?
I alter the card on main menu in there
card.area
yea its usually card.area
i think there can technically be edge cases where a card is in an area, but card.area is a different area
but those should really only be happening in modded card areas that are incorrectly implemented
(because cardarea:emplace(card) doesnt set card.area to the cardarea you just emplaced to)
wait
it does nvm
lmao
ok i think i just misremembered oops xdd
Okay
Yeah I just hard coded the copy for Debug plus based off card type but this means things like shop cards go to their respective slots, and then some things like boosters don't work, and then I was thinking playing cards in shop might crash the game so I was thinking maybe there's a better way to get the area
does anyone know how the particle system works
i just wanna make a square that moves from one point to another
the particle system is something i've never touched
oh gog...
you're up first
If it's anything like the ui system, my condolences
Sin wave
then you can sit on all my tangents
what
reference to a banger
i'm mildly concerned
It took you this long?
i always have been, just thought that now was as good a time as any to mention it
I need the basics on how to make enhancements
It does
SMODS.Enhancement
You can find the params by looking in core/game_object.lua in steamodded
And then ctrl f for enhancement
chat does alpha=1 mean its transparent or opaque
actually lemme just test it
alright according to my scientific method, alpha=1 is transparent, and alpha=0 is transparent
(i think im doing something wrong)
Try alpha 0.5
I've have concluded that it's always transparent
true!
The thing is how do I stop cards from being changeable (rank+suit)?
Patch the functions that change rank and suit?
Use a lovely patch on the set_base function
Not sure where it is
i just realized im the use case for bounding rects, holy moly
Just like stop it from working if your desired condition is met with an if statement
â ïž(FLASHING COLOURS WARNING)â ïž
hey i got it to draw the particle
Let me just tell you that I have no idea what's happening
there are not one, not two, not three, but FOUR red squiggly lines
YES I KNOW THAT
there are also two red curly brackets
I haven't put in the function yet
how do i fix the squiggly lines?
I used the same stuff as a joker and apparently there's no problem with it
i gotta change the text
yeah so inside the games code where could i find the red seal?
yippee! green square! dunno why the bounding rect is incorrect tho
GREEN SQUARE!!!
GREEN SQUARE!!!
Myst how do i find the red seal within the games code
Uh oh
I didn't ping
Go into card.lua or common_events.lua and search for red seal
Most things in the game are those two
MAN
nvm theres a calculate_seals function in card.lua
But im making an enhancement
i just remebered that red seal isn't the only thing that can retrigger
Yeah, an enhancement can prob trigger
I believe the enhancement api lets you hook onto eval_card if im not mistaken
oh my god i have to do vector math
Poor you
Theres an eval card function in card.lua
The enhancement api lets you add your enhancement to it
do i add it like eval_card_function
No
Its a calculate like the jokers
Also the calculate seal is just a subfunction of eval card so all the things done there should work for enhancements
is there a way to modify the amount of chips that a card scores once? (To get a 10 to score as 5 but not have it be permanent)
my current solution isnt really elegant since you see two separate chip messages
so do i add function
Yes
Its not self,card,context though
Its self,context,effect
No
Just the red seal effect
For the immutability effect, that one is quite a bit harder though
You would have to do a lovley patch to set_base in card.lua
A bit if then that takes up the whole function that only lets it play out if the card isnt laminated
That is uhhhh not it
oh
Just use the entire return
Look at the toml files of mods
They have the oath of the file where the patching is being done
The pattern, which is used to identify the patch region
The position, which is before, after, or at (replace)
And then the code you are adding
good god
ok
The toml must be called lovely.toml or in a folder called lovely
Id reccomend the latter as its easier to organize
Cryptid also has toml files
i don't have it
Theres more but they are more concise
You can look at the github files
holy shit open the game's source code in visual studio code please
Itâs probably easier to wait for enhancement calculation to be implemented properly
look at green square go...
holy shit...
maybe because it's posted in their lua file LMAO
bruh
Uh put that in a seperate .toml file not a .lua
Also you arent patching eval_card
You are patching set_base
And making it not trigger of the card is laminated
my dumb ass just searched up "find hypotenuse from 2 sides" (the answer is pythagoras) (4th grade math)
Ok, make the actual patch now
apparently mathisfun said that the thing isn't supposed to be a patch
he said it was supposed to be something like this
v
ok i got moving from point A to point B (and speed)
yippee!
would something like this work
What
sorry ignore that
:3
i was frustrated because of math
(i thought math.arctan would only return positive numbers but it was doing negative sometimes)
now i have to figure out how to move things in an arc... oh gog...
ok
Just replace all the placeholders
what
Theres a ton of placeholder values
You have to replace them with information from the functious you are overriding
Also class.function
And class:function
Then you have to basically rewrite the function
Well not exactly
I think theres a technique where you can add your code at the start or end of the function
By saving the function to a variable before the override and then inserting it inside the override
It's called hooking
You could probably stop the function from happening by putting a return before the original function
Ik im just explaining in laymans terms
or you can just override the original
one at a time please
You are a saint, alex
huh
hey, my game keeps crashing and idk what to do. heres my crash log
looks like an archipelago issue to me, go ask in their thread
alright, thanks for the help
Imagine you want to stuff some code at the end of eval_card
like how i want it to retrigger but ranks and suits cannot be changed
You would do
local temp_variable = Card.eval_card
function Card:eval_card(card, context, effect)
some code
return temp_variable
end
Well thos kind puts it at the beginning lol
But its fine
Thats what youre going for
What you want to do with your hooks is to end it prematurely with a return if the card is laminated
Just use the default calculate for the retrigger
its return temp_variable(self, card, context, effect), but yea
Sorry, im on mobile
Cant look at the source code
all g
Ranks and suits needs to hook a disable into set_base and change_suit
Seal hooks into set_seal
like make it false?
No
You are ADDING CODE
this is directly inserting your code into the base games code to obtain desired functionality
so I have to make it a patch?
Patches give you more functionality
You can insert anywhere
But hooks are good for the start or end of a function
You need the start here
Literally this
Just change the functions to the functions that you need
And change the arguments to match
Then add the code
eval card is the one that's in the game right?
Yeah
BUT YOU ARENT HOOKING IT
HOOK SET_BASE
CHANGE_SUIT
AND SET_SEAL
please
I would do that if I understood what is a "hook"
this
this
basically you replace a function with something else while calling the original function somewhere inside
what do I write to replace it
this means adding code before or after the function and/or modifying the return value
It has been explained to you 5 times
alright I get it
Ok
Now for what do you write
Use your head
Is there some property of a card that can tell me its edition?
wait
Card.edition.type
I need to breathe for a moment
Im back
as for the actual enhancement itself
how's it looking
It looks like you have no idea how to use an api đ
đŠ đ
Get rid of = SMODS.Center:extend
Honestly my suggestion is to go and read a load of code and understand it before trying your own
Please seperate your text into multiple lines
this fr
Put a comma after each one (except for the last one)
If you need people to spell out every single step you donât have a good enough base understanding to work from
I think sdmâs stuff has some examples of hooks
MAKE SURE YOU USE THE 1.0.0 BRANCH
What's that log thing from?
balamod's console
Oh Intresting
I've been thinking about making a console
Good to know someone made one already
balamod console is highkey the best reason to use it
makes development so much easier
time to steal take inspiration from that
Does it let you run code?
I also wanted to do that
I probably would've made a console by now if it wasn't for lovely's
is this it
no, these are API functions
where do they keep the hooks
yea, although its only one line at a time, and you have to save variables globally
but its usually for debug anyways so it doesnt really matter
i mean, technically you can write more lines if you use semicolons
Maybe try to search for code that looks like the examples given already
that's what i was trying
The code is not gonna be in a table
Find a pattern that looks similar in the top scope
im pretty sure those are just normal functions rather than hooks
AAAAAAAAAAAAAAAAAAAAAAAA
What I was showing you before is basically a hook
You have so many syntax errorsp
Your if statement is missing a then and end
its self.name and not self name
Laminated is a string
Make sure its in the top scope pleaeeeease
Arguments need to be edited
First function needs arguments and the others need arguments that are from the source function
Also uhhhh you arent patching eval card
YOU ARE PATCHING SET_BASE CHANGE_SUIT AND SET_SEAL
Alex you are sounding less like a saint now
AI gen goku you should look up a Lua tutorial
And learn the syntax
And if you get red lines you should listen to them
Have you done any coding before?
At all?
does steamodded support custom enhancements now?
nope
Yes
Yes but calculation is still wonky
Time to learn some lua bro, you're effectively asking people to make your mod for you using step by step pictures
Then go spend a few days watching YouTube
ok
does that include seals
Seals are not enhancements
Not yet
But Iâm pretty sure seals are already in too
oh
Iâm not sure what functionality is there
But you can create them for the collection at least
can you apply them to cards?
Probably, Iâve not tried though
that's like pretty crucial
I think so
k ty
alright so our lil brain cant figure out how SMODS.Atlas works, but we know there's a key, size, path, etc...
Do we gotta define a local as SMODS.Atlas {blahblahblah} then, put that as the pos/key in the Joker? Or
The pos is the position in the atlas where the sprite is
Itâs calculated as multiples of px and py
Increasing x moves right and increasing y moves down
K6BD PFP
Based
Yeah so pos in the joker def would refer to the base sprite sheet, so how would we get it to refer to our sprite instead? We suspect using the Atlas
I still need to make K6BD Jokers
The Atlas object serves to register the texture. Thereâs an argument to the Joker constructor to configure the Atlas via the key. Remember that Steamodded automatically prepends your modâs prefix to the key
Check out some mod like Cryptid or Mystâs to see the format, I donât remember exactly where you need to add your prefix and where you donât
atlas = modprefix_atlaskey iirc
Demiurge Jokers when-
I want a cycle of legendaries of them
I have some ideas for them but not many
finally he exists
Tryna think of how we'd configure this. Basically makes cards act as wild cards? Got the smeared joker source code on the right, at least what we've found
Just a question; Why are you putting their rarity in the name when it has a badge for that?
does anyone know a mod including a xchips joker for me to cross reference?
cant figure out how to multiply chips
Well how do you add chips. Then just add chips*mult.
How do you add a Mod Icon in steamodded 1.0.0? Like what's the register function?
I think you just register a regular atlas with key = "modicon"
I'm sorry if what I am about to ask is stupid but
when i put ease hands are the values able to be negative?
Yes
For a lot of simple programming questions like that, the simplest way to get an answer is usually just to try it and see what happens
Ah, okay
it's ease_discard
That looks like it crashed for a different reason (you typed ease_discards instead of ease_discard)
not ease_discards
huh
ty mods
scam message
oh
Had to get the ban hammer out
the 50$ thing
It was a fake Steam link
The official video for âNever Gonna Give You Upâ by Rick Astley.
The new album 'Are We There Yet?' is out now: Download here: https://RickAstley.lnk.to/AreWeThereYetFA/itunes
âNever Gonna Give You Upâ was a global smash on its release in July 1987, topping the charts in 25 countries including Rickâs native UK and the US Billboard Hot 100. It...
Thank god i didn't click the link
They used this trick
But no embed
Looked like a genuine gift link, led to something nefarious
is ease_joker_slots a thing
Wait why does Discord allow you do even do that?
I literally just took a cybersecurity class that talked about how risky those types of links are to use
it shows a popup for links like that with the real address