#💻・modding-dev
1 messages · Page 355 of 1
config = {extra = {is_doctor = true}}
config = { extra = { mult = 10, is_doctor = true } }
(Or yeah is there a reason it has to go in config?)
in the config extra
or something
I think it's just the standard place, and config fields already exist on jokers
did in fact not work
so soemthing like this?
I only ask because stickers like eternal and perishable are just variables on card.ability
gotta move the is_doctor tho
if context.other_card.ability.extra.is_doctor then
oh yeh
You are no longer checking the key
is doctor a joker or
Also in general the yellow underline is worth paying attention to
it's for a doctor who related mod
This joker is checking to see if other jokers are doctors
Oh right
So context.other_joker
yeah
Right?
p sure
i think that's because they're built in to the game and smodded
using this joker to create a negative hash brown joker at the end of round, works entirely without the negative part if i remove ".edition.negative" so all i need is the correct way to actually make it negative
they already have places on the joker object
wait, is this sticker related somehow? that has an api in smods so you'd not need to do this stuff manually
the yellow underline has just been "SMODS" or the "G" but haven't given any problems yet
I mean.... it depends on how you jave things set up, but tbh with how much of smods and ba;atro code relies on outside functions / variables it's inevitable, lol
SMODS.add_card({ set = 'Hash Brown', area = G.jokers, edition = 'e_negative', key = 'j_norm_hashbrown' })?
so this would be right then
my friend said this would be more balanced if it also added a random edition
i disagree
I'll test and see how it goes
context.post_trigger doesn't include context.other_joker... context.other_card is included.
okaaaaay, still nothing
ohhhh
context.post_trigger with never equal G.play
so what would it be then
if context.post_trigger then
The get_id returns a number...
You'd probably want to store the .key to the .currentrank/.newrank variables whilst using .id in the check...
Or compare SMODS.Ranks[context.other_card.base.value].key to card.ability.extra.currentrank?
i have no idea how id do either
Replace context.other_card:get_id() == card.ability.extra.currentrank with SMODS.Ranks[context.other_card.base.value].key == card.ability.extra.currentrank?
would i be able to just do SMODS.Rank ==
is add_to_deck triggered when a joker is duplicated through ctrl + D?
uvubg this back
giving*
...what's that exact line in the Mods/lovely/dump/card.lua?
oh thats related to flipping now, means the context is working
gonna comment those out for now
:flip(), by the way.
🤝
First time modder here, following the artmuncher video tutorial now
is there a method for coding cards that each have their own individual sprite file? The tutorial doesn’t seem to be doing it that way unless I’m mistaken
Been looking at the layout and files of the Cardsauce mod and their main.lua is completely different
...do you mean splitting by type of card or per-card splitting?
Like joker.lua, spectral.lua...?
i mean you just put the sprite name in the atlas right?
I’m on that rn
I mean, you kinda just do it, you can make the atlases as a loop based on the filename
and the pos would always be 0,0
I have both split atlases and files for stuff added, if that helps any to check out?
oh man the beginner’s anxiety is already kicking in aaa 😅
I think they mean one image per card
which you really don't have to do
i mean you can do it any way
just depends why you want that really
yeah it helps a lot for adding more things i'm sure
like especially if you also have the jokers on a per-file basis
you can in theou just drop in the new joker lua and image png and not have to touch anything
So you would more recommend having all of the joker assets on one sheet?
It’s hard to figure out exactly since the video tutorial only uses one as a demo
i personally find it easier to do that
I mean, that's eaiser in a lot of ways for not having to either load a lot of files manually or construct your atlas objects in a loop
It's like storing tools individually in boxes vs. storing a bunch of them in one large toolbox.
makes sense, especially if I’m just starting out with the basics
this is what mine looks like rn, when i make a new joker i just make the file longer and add the jokers atlas key to the atlas
quite intuitive once you have it set up
Is that sixth one an Alone in the Dark reference?
I think there's some limit to width
so you're gonna have to use more rows at some point
😭
my current idea is just go along the x axis and use the 2nd row for soul sprites
just look at how wide the all-in jest atlas is and stop there, lol
i'll keep going till it stops working smh
they get auto assigned x coord values based on atlas key
well if i counted right you can have at the very least 25 wide
so no need to worry for some time
i dont plan on have an absurd amount so
should be alr
at most ill have to add a second index for a new row
se, if i was doing shit progranmatically i'd probably just have one joker per image and name them their key
the idea of writing a list of my jokers by hand and mainting it sounds worse than the actual coding ngl
i just add the key to the end of that list when i add a new one, not much effort
and having the jokers file name decoupled from its keys means i can change the order they appear in the collection super easy
I'm not the type of raccoon to pace myself
which is smth i care about
this is true
and fair
bc i just load my whole jokers folder so whichever appears first alphanumerically shows up first in the collection, it isnt pretty but this is what i have rn lol
hi, quick question, i want a message to appear on context.other_card which does (using card_eval_text) although it appears under the card instead of above; any idea on why?
How would i replace the current high contrast colors with different colors? Made this and i kinda wanna make it into a mod haha
If its not possible i’ll just make it a texture pack
I mean this wouldn't matter anyway, there's no need to like... even refer to the filenames in code
the thing i said to name like the keys was using individual pngs
because that way you can make the atlas objects with a loop
oh right mb
Can you tell me how to delete some cards in SMODS.Deck?
i mean you should let uses choose from multiple
from this and the original i mean
it isn possible to do, lemme look at smth
oh yeah i think bunco adds a third coloring option
'emhamced contrast'
might wanna do smth like that
wait it does?
recast contrast actually
oh i didnt know
I mean it's not bad to do a similar thing
fair
i mean im not planning on making it have a gradient
and this is more like "okay colors still look nice and are still easily destinguishable"
idunno i just dont like the colors on high contrast
yeah i think most people do like... exactly the colors from the sinful jokers if they do something like this, so eyeballign it is unique in a good way
I want to create my own deck that would not have 2,3,4,5,6 in it, please tell me how to do it correctly.
oh yeah i did wanna change the sinful jokers too lol
just have the deck's calculate function destroy those cards, that can't go wrong, lol
that's a joke, i have no idea but i'[d halp if i did
deck code is kinda a pain
delay doesnt appear to be doing anything, i dont see the card backs for even a millisecond
Event?
i have never used events
Does it need to be called in calculate?
And is there any documentation on SMODS.destroy_card?
https://github.com/Steamodded/smods/wiki/SMODS.Back/
you're referecing this for the deck right?
Who's cat is this
aure's
like this?
No.
😔
Try looking in the source code for reference?
It doesn't say anything about SMODS.Deck destroy card.
There is no such thing as SMODS.destroy_card?
destrou card is a general function (presuming that's the name
there don't need to be special functions for decks
so in actuality you want to use in_pool
Well then how do you remove 2,3,4,5,6 from the deck?
@daring fern they just want a deck without those ranks
i think it's in_pool actually, right?
like make it return false for those ids?
Then you would remove those in the apply function using card:start_dissolve()?
better i think lol
oh i was getting it twisted, i missed apply
can't be this difficult to just flip a card ;-;
I have a deck that leaves only Aces remaining, if you want to look at it and adapt it to your needs?
A personal timewaster project that is a mod for Balatro. - TheOneGoofAli/TOGAPackBalatro
function combine(key1, key2)
local combined = temp_profile.joker_usage[key1]
local doner = temp_profile.joker_usage[key2]
local orig_order = combined.order
for e, r in pairs(doner) do
if type(e) == "number" then
if not combined[e] then combined[e] = 0 end
combined[e] = combined[e] + r
end
end
for e,r in pairs (doner) do
if type(e) == "table" then
if not combined[e] then combined[e] = r
end
if combined[e] ~= r then
for t, y in pairs(e) do
if not combined.e[t] then combined.e[t] = 0 end
if type(t) == "number" then combined.e[t] = combined.e[t] + y
end
end
end
end
end
combined.order = orig_order
return combined
end
combine("j_mf_couponcatalogue", "j_mf_coupon_catalogue")```
so now that this is actual real lua, can anyone help me figure out why it doesn't appear to do anything?
it's meant to be evaled in the debugplus console and combine the given 2 entries in the profile table so that the stats for the joker are reflected accurately
yknow what i dont need delays on my flips, this'll do for now
but when i eval print(G.PROFILES[1].joker_usage.j_mf_couponcatalogue) before and after, it doesn't change
I have a joker that does essentially the same thing as mr bones, how do I stop them from both activating if you have them both?
if not next(SMODS.find_card('j_mr_bones'))?
that mostly works however it makes mr bones allways take priority, can I make it so the first joker does?
No.
ok
how do you add priority to a mod? is it in the json file or the lua? im using the example smods mods for bases for my jokers but they dont have a bit about priority anywhere
In the JSON you put "priority": number
alright thanks much! im gonna see if i can get the mod running now i know that
alright im getting the atlas working. do the key and path have to be the same?
No.
I FINALLY GOT MY FIRST JOKER UP AND RUNNING
it was like the most basic +chips/mult thing but i don't care, JOKESTAR RUNNER IS ALIVE
Nice
HOW THE FUCK
DO I GET
A JOKER
TO GIVE A RANDOM ENHANCEMENT AND SEAL
TO A CARD
BEFORE SCORING
IM GONNA LOSE IT
THERE IS NO DOCUMENTATION
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
how do you guys figure this stuff out
where do u get the information
Have you tried looking at Grim/Familiar/Incantation and Certificate?
wut
what does that mean 😭
look where
Code of the vanilla
card.lua?
Jokers are in card.lua i think?
oho k
ok now i got my first crash
added a second joker and the atlas just randomly doesn't work anymore. it worked perfectly when i only had one joker. when i add a second it dies
after i get this fixed highkey im just goin 2 bed its like 5AM but im up off a combination fo a new medication and hype for actually getting a Balatro mod working
on the bright side i do think the joker itself is gonna work im just having some issues with atlas
genuinely ive checked around and around my atlas and ive come up utterly clueless. i have no clue why it's trying to index the atlas as a field. i have never seen this error before in my entire life
INFO - [G] Table:
order: 289
losses: Table:
1: 7
losses_by_key: Table:
stake_white: 7
bunco_loaded: true
count: 93
wins: Table:
1: 2
wins_by_key: Table:
stake_white: 2
INFO - [G] < nil
INFO - [G] > eval print(G.PROFILES[1].joker_usage.j_mf_couponcatalogue)
INFO - [G] Table:
order: 338
losses: Table:
2: 1
1: 6
losses_by_key: Table:
stake_white: 6
stake_red: 1
bunco_loaded: true
count: 573
wins: Table:
2: 5
1: 19
wins_by_key: Table:
stake_white: 19
stake_red: 5
INFO - [G] < nil
INFO - [G] > eval temp_profile = G.PROFILES[1]
function combine(key1, key2)
combined = temp_profile.joker_usage[key1]
local doner = temp_profile.joker_usage[key2]
local orig_order = combined.order
for e, r in pairs(doner) do
if type(r) == "number" then
if not combined[e] then combined[e] = 0 end
combined[e] = combined[e] + r
end
end
for e,r in pairs (doner) do
if type(r) == "table" then
if not combined[e] then combined[e] = r
end
if combined[e] ~= r then
for t, y in pairs(r) do
if not combined[e][t] then combined[e][t] = 0 end
if type(y) == "number" then combined[e][t] = combined[e][t] + y
end
end
end
end
end
combined.order = orig_order
return combined
end
combine("j_mf_coupon_catalogue", "j_mf_couponcatalogue")
INFO - [G] < nil
INFO - [G] > eval print(G.PROFILES[1].joker_usage.j_mf_coupon_catalogue)
INFO - [G] Table:
order: 289
losses: Table:
2: 1
1: 13
losses_by_key: Table:
stake_white: 13
stake_red: 1
bunco_loaded: true
count: 666
wins: Table:
2: 5
1: 21
wins_by_key: Table:
stake_white: 21
stake_red: 5
INFO - [G] < nil ```
@rough furnace I think I got it working
heres both of my atlas stats and the atlas at the top. PLEASE tell me this is an easily fixable issue, its like 5AM and im getting tired
function combine(key1, key2)
combined = temp_profile.joker_usage[key1]
local doner = temp_profile.joker_usage[key2]
local orig_order = combined.order
for e, r in pairs(doner) do
if type(r) == "number" then
if not combined[e] then combined[e] = 0 end
combined[e] = combined[e] + r
end
end
for e,r in pairs (doner) do
if type(r) == "table" then
if not combined[e] then combined[e] = r
end
if combined[e] ~= r then
for t, y in pairs(r) do
if not combined[e][t] then combined[e][t] = 0 end
if type(y) == "number" then combined[e][t] = combined[e][t] + y
end
end
end
end
end
combined.order = orig_order
return combined
end
combine("j_mf_coupon_catalogue", "j_mf_couponcatalogue")```
here's the code I ended up with
```order: 289
losses: Table:
1: 7
losses_by_key: Table:
stake_white: 7
bunco_loaded: true
count: 93
wins: Table:
1: 2
wins_by_key: Table:
stake_white: 2
The original entry for the new key
losses: Table:
2: 1
1: 6
losses_by_key: Table:
stake_white: 6
stake_red: 1
bunco_loaded: true
count: 573
wins: Table:
2: 5
1: 19
wins_by_key: Table:
stake_white: 19
stake_red: 5
the original entry for the old key
losses: Table:
2: 1
1: 13
losses_by_key: Table:
stake_white: 13
stake_red: 1
bunco_loaded: true
count: 666
wins: Table:
2: 5
1: 21
wins_by_key: Table:
stake_white: 21
stake_red: 5
and the new combined entry on the new key
first three joker drafts are done (if you can guess the theme you're very subjectively cool)
Lua is case sensitive.
i recognise 2 of those jokers arts i think
oh wait yeah that'd do it
last one is obra dinn
ayyy
I’m not great at sprite art so I started with ones that were easy to recreate or assemble from the original assets
alright thats 2 jokers done im gonna head to bed
it. its a mkv it wont play
whatever just download it im too tired to re-export
does somone know how can i make my joker always go to righmost position. Like the Ceremonial Dagger in the 'On a Knife's edge' challenge whos goes always to the leftmost position.
and it will pin to the rightmost position ?
Look at how pinned works?
what I think would be cool is a BetterStats mod, that shows 2 pages of all the card stats and a lot more of the other valuesstored on the profile
Is it "the number it lands" or "the number it lands on"?
G.jokers.cards?
I suggest you to make a global function, do the counting inside, and then call it in debug console.
I can just write it in notepad, paste it in and eval it all at once
notepad because i'm on windows atm and am a lazy fuck
that's how i did this one
lol
I just eval'd that whole thing
this is how i code
wow ngl im kinda good at the coding thing actually. i've gotten one crash and it's from something being case sensitive.
granted im just kinda fishing through vanilla joker implementations and fiddlign with the numbers rn but it's something
that's for your owned jokers
I mean all the jokers in the whole game
Then that would be for k,v in pairs(G.P_CENTERS)do if v.set=='Joker'then.
thank you :3
Ah, right, G.P_JOKER_RARITY_POOLS, almost forget about that one.
So the answer you need would be eval #G.P_JOKER_RARITY_POOLS[(rarity)].
am i doing this right? cause it's not really doing anything
i want to remove jokers and consumables from the shop but keep vouchers and boosters in my challenge
is there a way to call a precise poker hand without the other hands that include it?
or do i have to manually exclude the others?
count = 0
rartable = {}
for i,v in pairs (G.P_CENTER_POOLS.Joker) do
if not rartable[v.rarity] then rartable[v.rarity] = 0 end
rartable[v.rarity] = rartable[v.rarity] + 1
end
return rartable
end
print(counran()) ```
this is how i ended up deciding to do it
local ret = ch_start_challenge(e, args)
if G.GAME.modifier.no_shop_items then
change_shop_size(-2)
end
return ret
end```
the count=0 is something i forgot to remove
context.scoring_name == "name of the poker hand here"
wdym exactly
like trigger on two pair and not full house
will try this
curious what anyone else with a shitton of jokers would get if they ran this
context.scoring_name?
oh yeah what bepis said then
also i had this issue, it's not a problem within booster packs but within a blind it looks ew
this works, thank you very much !
I suggest using SMODS.calculate_effect instead of card_eval_text.
why don't you return the message instead?
return had the same issue
in which context
in a context from when i hook / patch playing card (not necessarily when playing, the type "playing card") destroy
if context.sdr1_cardtryingtobedestroyed then
if not context.other_card.seal then
local seals = {}
for k, v in pairs(G.P_SEALS) do
table.insert(seals, k)
end
context.other_card:set_seal(pseudorandom_element(seals, pseudoseed('seal')))
end
return{
message = 'Transmutation!',
colour = G.C.MULT,
message_card = context.other_card
}
--card_eval_status_text(context.other_card, 'extra', nil, nil, nil, { message = 'Transmutation!', colour = G.C.MULT })
end
and weirdly also the seal appear before the effect takes place (like visually the seal appear but not yet used (which is fine for functionality, but idk how to not have the seal appear before))
hmm im not sure how to specify where the attention text goes
you can use events
bcs of the trigger after?
nope. there are still 2 cards in the shop
so.... i think I can code actually and I've just been a lazyass for the last year
because this shit was not hard
Maybe hook G.shop_jokers.emplace and make it do nothing?
well... how do i detect entering the shop to do that?
I don't think you need to.
[Insert "That's the neat part: You don't!" meme here]
try G.GAME.shop.joker_max = 0
(just guessing by looking at the change shop size code)
lol
i think i only use it for the hand size
for the rest i modify the limit directly
although..
i still wonder whats real_card_limit is used for
the problem might be that that function is too early?
have you tried doing change_shop_size in an event?
yep
.
in an event, yes
like overstock
can you put multiple names in author?
yea
this seems to call Game:start_run in an event
maybe try hooking that instead?
self instead of e
another day another coder falling for a crash due to lack of self
how would i make a joker that gives x2 chips but gets destroyed after 5 rounds?
I'm... confused by how this code is causing that error
is it when you try to start the run?
or on boot?
on boot
and the crashgoes away if you remove that code?
it started happening when i did this
wait... aren't you erasing the rest of the function?
you don't seem to be retyping or returinng it
isn't that how hooks work?
i dunno how they work either, but 'return
ret' should be it
gimme a moment
oh its because the reference is wrong
of course it had to be weird and quirky
does anyone know how i can make a joker that gives x2 chips but gets destroyed after 5 rounds?
I've redeemed it 132 times, lol
use context.joker_main for chips and context.end_of_round for the timer
no whee near as much as blank though. always gotta go for the chance of antimatter
always
then check if it's 0 and destroy it
also betmma's does weird things with blanks
this is what i have rn
calculate = function(self, card, context)
if context.after and context.main_eval and not context.blueprint then
if card.ability.extra.chips - card.ability.extra.chip_mod <= 0 then
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
}))
return {
message = localize('k_Extinct!_ex'),
colour = G.C.FILTER
}
else
card.ability.extra.chips = card.ability.extra.chips - card.ability.extra.chip_mod
return {
message = localize { type = 'variable', key = 'a_chips_minus', vars = { card.ability.extra.chip_mod } },
colour = G.C.CHIPS
}
end
end
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
end
}
(just a retexture of ice cream rn)
you can look at my popcorn example 🙂
https://github.com/nh6574/VanillaRemade/blob/64936206517d5cc132b14a117c15e1473e460a06/src/jokers.lua#L2804
i'm pretty sure steamodded allows you to do XChips = card.ability
"XChips" doesn't work but "xchips" does
yeah i just need to figure out where
and how to make it not give less chips per hand
you want to replace after with end_of_round if you want it each round
context.after and context.main_eval? Is that a thing? Because iirc it is not.
(Unless it's another smods update thing)
like this?
no
card.ability.extra.xchips = card.ability.extra.xchips - card.ability.extra.xchip_mod
xchips = card.ability.extra.xchips
calculate = function(self, card, context)
if context.end_of_round and context.main_eval and not context.blueprint then
if card.ability.extra.chips - card.ability.extra.chip_mod <= 0 then
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 = "end_of_round",
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true
end
}))
return true
end
}))
return {
message = localize("k_Extinct!_ex"),
colour = G.C.FILTER
}
else
card.ability.extra.xchips = card.ability.extra.xchips - card.ability.extra.xchip_mod
return {
message = localize { type = "variable", key = "a_chips_minus", vars = { card.ability.extra.chip_mod } },
colour = G.C.CHIPS
}
end
end
if context.joker_main then
return {
xchips = card.ability.extra.xchips
}
end
end
}
``` like this?
yes
how do i make it not decrease chips tho
it works, idk if its needed
calculate = function(self, card, context)
if context.end_of_round and context.main_eval and not context.blueprint then
if card.ability.extra.chips - card.ability.extra.chip_mod <= 0 then
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 = "end_of_round",
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true
end
}))
return true
end
}))
return {
message = localize("k_Extinct!_ex"),
colour = G.C.FILTER
}
else
end
end
if context.joker_main then
return {
xchips = card.ability.extra.xchips
}
end
end
}
``` like this?
yes but also delete the else
now you need to change if card.ability.extra.chips - card.ability.extra.chip_mod <= 0 then to your counter logic
also are you adding "k_Extinct!_ex"?
because the key is k_extinct_ex
thats just the message for when it breaks after 5 rounds
that wasnt my question :3
did you add xchips to the config?
have you made a joker before
barely 😔
you know how the things in card.ability.extra have to be initialized in config.extra
that
where do i add it then?
like this?
yes
still doesnt work
what doesn't work
it doesnt trigger
did you restart a run
how difficult is it to make achievements
oops
MoreFluff has, just take it from morefluff
How can i force a joker to always be a certain edition?
set its edition during set_ability
Cryptid has)
set_ability is run when the joker is first spawned
that includes when it appears in packs and the shop
i think that'll also set its edition like that in the collection
the edition can technically still be removed but i doubt you're trying to make an edition generator so set_ability is fine
hmm, I wonder if it is possible to make it so editions with set_ability, and when add_to_deck is taken away
it should be
when should Set ablity be ran?
for me its saying unknown global
set_ability = function(self, card, initial, delay_sprites)
---set edition here
end,
happens
like this?
set_ability = function(self, card, initial, delay_sprites)
Card:set_edition(hiss, true, true)
end,
because the effect isnt showing up in the collection
or do i include its prefix?
calculate = function(self, card, context)
if context.end_of_round and context.main_eval and not context.blueprint then
if card.ability.extra.chips - card.ability.extra.chip_mod <= 0 then
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 = "end_of_round",
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true
end
}))
return true
end
}))
return {
message = localize("k_extinct_ex"),
colour = G.C.FILTER
}
end
end
if context.joker_main then
return {
xchips = card.ability.extra.xchips
}
end
end
}
``` works but crashes after it calculates, also is there any code here that's unnecesary
card lowercase, also the edition has to be a string with the prefix
the edition should be "e_negative" for example
if it's a modded edition then it should be "e_modprefix_negative"
ah okay
hm?
i fixed it but now it crashes
set_ability = function(self, card, initial, delay_sprites)
card:set_edition("e_CTRL_hiss", true, true)
end,
it's a set_edition thing idk
fair
:set_edition({ negative = true }, nil) this is how I do it apparently? try that method
yes
it counts the rounds and then when if counter >= 5 (pseudocode, do not use) you destroy it
so what should i change?
the problem here is that if i tell you then i just made your whole joker for you lol
fair enough
look at how popcorn decreases mult and change that to increase a counter
whats the difference between that and :set_edition("e_negative", true), actually?
I have no idea
both should work
like, if its using a table then is it possible to add more than one edition 🤔
o
no afaik
it seems to be the shader probably
problem being i have no idea what to put where
Quantum enhancements are broken enough
-# except they dont work
Like... as in they make the game crash by existing broken
broken in two meanings, literally
Unfortunately busted has the sane 2 meanings
So there's no way to disambiguate
chat is this hand hard to make (ignore the description)
wh
what hand is that??
😭
honestly, not too hard except for the negative playing card
Those some fancy lookin gold cards
it's a gold card with gold seal, holo stone, negative, red seal with an unscored bonus
yes
could anyone help me on how i can make my joker destroy itself after 5 rounds?
use context.end_of_round to increase a value
then when its at a certain value, use :start_dissolve()
Those gold cards look funky
oh, i actually just remembered that you can have :start_dissolve() effect colored
Someone know how i can make a joker stay on the rightmost position ?
🤔
where do i put that?
in the joker's calculate
Recreate pinned maybe
oh yeah, use context.main_eval too, or it might trigger more than 1 time
here?
yeah yeah that
Heres the crashlog and files, if anyone wants to take a crack, be my guest, any help is very much appreciated
:3
so do i put it instead of context.end_of_round?
not instead, you put your code inside that block
it works when i turn disable_base_shader = true, to false
but then that causes the shader to not do anything
so like this?
if context.end_of_round and context.main_eval and not context.blueprint and not context.retrigger_joker then
card.ability.extra.elapsed_round = card.ability.extra.elapsed_round + 1
if card.ability.extra.elapsed_round >= 5 then
--the event + card:start_dissolve()
end
end
you probably want to do something like that
there r two context.main_eval
is that a problem?
Why not be retrigger compatible?
🤔 idk, depends on whether you want the retrigger to affect the speed of the joker being destroyed i guess?
i dont
yeah, add that then
it works the same as one context.main_eval
and theres no context.end_of_round there, too
thats like saying "hey thats an apple" compared to
"hey thats an apple"
"hey thats an apple"
what is this analogy
fair
hey thats an apple
so like this?
up there
if context.end_of_round and context.main_eval and not context.blueprint and not context.retrigger_joker
like this?
yes
dont forget to add elapsed_round = 0 to config extra too
-# and remember to spawn that joker again, if you already have it in a run
do i need multiple configs or just add it to the one i have
yes
add it to the one you already have
like this?
put it next to xchips
you could always add your own context if none fits the timing :p
No, I'm trying to do this for a custom seal.
can someone tell me why this no workie
like this?
yes
it still crashes
Share the crash log.
i have a joker print the table and nothign comes out of it
It should be self.ability.set and self.config.center.key and self.config.center.rarity
Remove the top if
which one?
The top one.
top one of the whole joker?
No:
works now but it does it after 1 round and it doesnt get to the next round
Show current code?
calculate = function(self, card, context)
if context.end_of_round and context.main_eval and not context.blueprint then
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 = "end_of_round",
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true
end
}))
return true
end
}))
return {
message = localize("k_extinct_ex"),
colour = G.C.FILTER
}
end
if context.end_of_round and context.main_eval and not context.blueprint and not context.retrigger_joker then
card.ability.extra.elapsed_round = card.ability.extra.elapsed_round + 1
if card.ability.extra.elapsed_round >= 5 then
end
end
if context.joker_main then
return {
xchips = card.ability.extra.xchips
}
end
end
}
Remove everything that is in the top if including itself.
the destroy code works unconditionally
And put card:start_dissolve() in the empty if.
hm??
Remove all of this:
it doesnt show the message anymore now
you still need to manually add the message
mb yeah
Put SMODS.calculate_effect({message = "message"}, card) in the if with the start dissolve.
i mean this works
does it?
it does
that works?
yeah, it only works when you are returning that
i suggest going with somethingcom's approach instead
how do i make the description be "x2 chips for (however many rounds left) rounds"?
and like, make it update
as in, however many rounds until it destroys itself
loc vars
how do i do that?
Hi all, what's that funciton we call to proc a random message from a joker? I woke up and can't remember what it's called and can't find it in my own jokers!
I've got an example for you
you could use pseudorandom_element to determine which message the joker should send
Guys does retriggering a joker also retrigger it's edition
nope afaik
it doesnt
Okay phew
@daring heron
This card has 6 uses, store under its card.ability.remaining
loc_txt = {
['name'] = 'Fickle Fox',
['text'] = {
[1] = '{C:attention}Applies gold seal randomly to cards played',
[2] = 'Has a {C:green}#1# in #2#{} chance to bless',
[3] = 'Has a {C:green}#1# in #3#{} chance to vanish with the wind',
[4] = 'Flees after 6 seals applied, {C:red}#4# seals remaining ',
}
},
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = { key = "artistcredit", set = "Other", vars = { "Linzra" } }
info_queue[#info_queue + 1] = G.P_CENTERS.m_gold
return { vars = { G.GAME.probabilities.normal, card.ability.oddsToBless, card.ability.oddsToFlee, card.ability.remaining } }
end,
See line 4 in it's loc_txt. It is taking in a variable.
loc_vars is where you send vars into loc_txt
I am sorry! I phrase my question really poorly. I meant to send a message from the joker without using the return{message="Blah} capability
ahhh
^ here lol
you still need that
just add card.ability.extra.elapsed_round in there
Ah, it was card_eval_status_text I was thinking of
they should work the same, so you can use either
Hey y'all, is it possible to add an extra blind to an Ante using something like the opposite of G.GAME.round_resets.blind_states.Small = 'Hide', or would I have to build the UI and stuff from scratch?
it doesnt display the number of rounds left
changed it to destroy if <= 0, starts at 5 and -1 each round so itd look good in the game
I think it's because there's a missing } after C:attention
im sorry, i cant remember, but you will need to hook, patch the code that creates the blinds a lot
yeah that might be it
Hey guys, anyone know what this object is?
The deck object shown in the Deck Collection list, and also shown when you're playing the game
is that obelisk the tormentor
works now exept for that it just says "message" when it gets destroyed
which is a problem on my part
somehow didnt see this 😭
🥀
how can i make a joker use an effect of other joker if it has it's key
I do have Yugioh themed elements but no Obelisk. This background image is from an overseas set I saw online. English language, asian market only cards!
how can i make it so it says rounds in the description if its more than 1 and round if its 1?
look at this
but like, in the description
very cute
does anyone know how?
tried making it a loc_vars but i don't know how i could set it to either round or rounds
change rounds to #4# (or the number it should be) and add elapsed_rounds == 1 and 'round' or 'rounds' to loc_vars
I found it, it's called Bonus Blinds by mathguy (it's an old mod)
ahh i see
does this make sense
like this?
in loc_vars
also it should be card.ability.extra.elapsed_rounds
te values
-# seriously though, i think its clear enough personally
good
i will have it as a note at the bottom in the examples
te N'
Has anyone done the "Suit convert Tarot cards in your consumeable area give X1.5 Mult for their specified suit if played hand contains a Flush" voucher idea? Like "Observatory" but suits?
like this?
it should be card.ability.extra.elapsed_rounds
like this
you shouldnt be woried about accidentally having a similar effect with other mods, its not like players will always play both of that and your mod at the same time lol
the idea is cool tho :3
oh it's elapsed_round without the s sorry
that's okay dw
I need wording and naming advice.
no-suit cards will be represented by The Tower, and all-suit cards The Lover.
should probably be "most common suit"
Change rounds to round(s)
@potent drift i did the thing
it worked perfect
after a lot of tweaks
a
and then i did another random thing
whuh
@rough furnace
xd
Ok
lmfao i don’t care it’s good
debug
does fit your pfp really well though
I also adjusted the width.
How about the names? They're inspire by Flower Pot, but I think it's kinda not enough... vibe? impact? idk.
Thank you
so if i have multiple of my joker at the same round number it destroys them all instantly instead of 1 for 1, how do i change that?
like this
i want it to destroy them 1 for 1 instead
do it in an event?
hm?
I think trigger = after? with delay set to about 0.1.
honestly either before or after with delay should work just fine 🤔
like this?
Nooo, not like that lol.
hi i have a problem detecting stone cards or idk whats the problem
Did you click the link I send?
yeah
use SMODS.has_enhancement instead
G.E_MANAGER:add_event(Event({
func = function()
card:start_dissolve()
return true
end
}))
theres no other_card in before
where do i put that?
replace card:start_dissolve()
oh yeah, just noticed
what's the effect?
when a stone card is played the joker win x0.25
There are ways to set up your modding environment so that it recognizes all the balatro and SMODS functions instead of warning you that you're using an undeclared global
you can do it in context.individual
also, you can just return xmult = card.ability.extra.x_mult, you don't need all of the Xmult_mod and message stuff
oh ok thats different, then yeah use context.before and loop through context.full_hand
or scoring_hand
what's the sound called that gros michel uses when it goes extinct?
tarot1
Is there a context for probabilities similarly to the likes of Business Card or Reserved Parking?
how do i play a sound again, i forgot 😔
context.other_card only exists for context.individual (I think), but you don't want to increase for every single stone card played, do you can't use context.individual. So instead you'll have to iterate through the hand manually and see if there's a stone card
I don't think so.
What is the effect you want to code?
I want to invent a way for that context to exist now that someone told me about metatables
Generally, I just need to know how to put "x in y chance" in an ability.
like this?
Usually we do pseudorandom("string of seed of your choice") < G.GAME.probabilities.normal * x / y.
pseudorandom gives you a random number from 0 to 1, and it has x in y chance to be less than x/y.
Is there a way to change the base probability to make an unusual probability stat like "4 in 1003 chance"?
Well that's going to increase the mult for each stone card that is played
I think I just showed you how.
Also you're calling has_enhancement twice
Ah, I didn't notice the edit there.
my mistake, i remove the twice has_enhancement but when i play with the joker this error appears
Oops! The game crashed:
[SMODS _ "src/utils.lua"]:971: attempt to index local 'card' (a nil value)
SMODS.has_enhancement(v, 'm_stone')
Although that would make your joker "gain X0.25 mult for each Stone Card you played"
ty
Quick question, do you want the ability to be "gains 0.25x mult per stone card played" or "gains 0.25x mult if played hand contains a stone card"
per stone card played
Because the way to do those is different and your current code is halfway between them
Mmk so you probably do want to be using context.individual and context.other_card instead of the loop
Unless you really need this effect to be in context.before
No, that would become "On Scored" instead of "On Played".
You need to consider retriggers.
what exactly do context.before, im new in this modding
Not necessarily because doesn't context.individual get run for unscored cards as well?
Whatever, the current effect is fine
Picking the right context depends on when you want your effect to happen
context.before is before scoring. There are a couple contexts for different moments during scoring. context.after is for after scoring, etc
not unless you specify it
And then there are contexts for when the round starts or ends, when a card is destroyed, etc
Do you mean the optional setting
There's an incomplete explanation about joker timings:
https://balatrogame.fandom.com/wiki/Activation_Type#Joker_activation_types
Cause I haven't looked into that
no just context.cardarea == 'unscored'
I thought that context only existed if you enabled it or something
i think it did at the very beginning but it's not performance heavy so it didn't make sense
ohh, okay
in the moment the joker do a weird stuff, first work with all cards no only with stone cards and later it multiplies like exponentially
when i play first stone card give the multiplier, then any card y play give the mult
Do we have a "Show us your code" emote or something on this channel?
Anyway, show us your code.
So, G.playing_cards is your full deck, but according to our previous conversation, I assume what you need should be context.full_hand.
Also I'd recommend you using for _,v in ipairs(context.full_hand) do in this case.
pairs iterates through table, and ipairs iterates through list.
Hi folks, has anyone successfully epplied a shader or edition to the G.deck object?
I see that it is definted in Globals as a CardArea type, so I might have a lot of heavy lifting to make this work.
I'm like 95% sure I've seen it
print(G.PROFILES[1].voucher_usage.v_betm_vouchers_collector)
print(G.PROFILES[1].voucher_usage.v_collector)
for i,v in pairs(temp_profile.voucher_usage) do
if string.find(i,"v_betm_vouchers") then
old_key = "v_"..string.sub(i, 17)
if temp_profile.voucher_usage[old_key] then
v.count = v.count + temp_profile.voucher_usage[old_key].count
end
end
end
print(G.PROFILES[1].voucher_usage.v_betm_vouchers_collector)
print(G.PROFILES[1].voucher_usage.v_collector)
``` ayyy got another thing working, to account for the fact that betmma couchers used to not have a prefix due to how they were added (I think the mod predates smods.voucher)
There's a 5% chance I either hallucinated or misunderstood what was being shown
Trying to call draw_shader on the G.deck.cards[1].back or config doesn't seem to work.
Amusingly this actually sets polychrome on the top card in your deck
G.deck.cards[1]:set_edition('e_holo')
This makes sense, G.deck.cards is just the list of cards
im like hey whats up hello chat 
Hi Dilster
I would probably start by looking at where the selected back sets the sprite or something and see if you can get a shader in there somewhere
hey fox, i hope all is well
I want to apply a shader to the back of the card I have a cool shader I love and want this special deck to have it applied
But my experience in this arena is actually less than negative infinity
Doesn't that buffer underrun back around to make you a god expert bearded wise one?
insted of the plating cards i nead the context.full.hand?
I AM BECOME INTEGER UNDERFLOW
Yes
G.playing_cards is every playing card the player owns
context.full_hand, not context.full.hand
So by using that, it's checking the player's whole deck for a stone card
Which is not right
ohh, okay
I dumped out the full table of my G.cards[1] object, to see where the sprite is set. If there is a sprite, shaders are apply-able (like skew, when you move your mouse over it).
Meaning I can apply a shader to it! Now what will happen when 52 cards are running a shader on their front and back?
so, it will look like this?
If love2d is a smart game engine shader should only render if the sprite is visible and facing the camera
So hopefully only the backs will be getting rendered
Unfortunately still none are high enough to show in stats... but at least thru have a better shot now
Is there a way to test what you're doing with a new profile?
I only vaguely understand what you're doing
I mean... it acts on like a year of sloppy profile data, lol
But I think you can load my profile back into a jkr file
Before I made these changes
Or I could just send the jkr
Yeah that's allowdd
Oh I just meant like how there's profiles 1 2 and 3
I wasn't sure if your stats carried over between them
Nvm, I'm probably misunderstanding what you're doing
nah the stats are profile specific, that's why it's G.PROFILES[2]
Does love even have the concept of a camera?
No idea, I've only used it in the context of balatro modding
what I'm doing is combining entries in the profile for objects that are the same object but have used multiple keys over the months
I come from a unity background
Love is more so a framework and not an engine
I add everything to the newest version of it
Balatro's ui system is written entirely by 
So could you test it by writing two versions of a mod that have different keys and then playing those mods in profile 3 or something like that?
I mean, yeah but it doesn't apply until i send a couple additional commands
so it can't mess it up
Or just using it on something that isn't actually a duplicate
i keep it backed up anyway
so contex.full_hand is when the hand that i play?
Apparently it's originally from another game he developed
tbh both scripts, the first time they did anything they did the exact right thing
so i didn't have to reload the game to reload my profile
(or force reload in colsole)
I did restard the game and do them again anyway, with the commands that save it, just because
G.FILE_HANDLER.force = true``` those commands being
last question, when the joker is x1 it show in the game x1, is any form to not show this message? only when >1
You can wrap a if card.ability.extra.xmult > 1 then around your return, but usually we just let it X1.
I know they work even if the stats screen doesn't change because i can print the valeus, if that's something you were also wondering
Oh ok, I thought you were saying you weren't able to test it because they weren't showing up in collection
nah i it's just that i was dissapointed that my stats screen is still just vanillia vouchers
That'd probably involve an another localization entry.
why do you want that? i mean it's possible just nonstandard and i don't get it
That's what I thought they were saying at first but I think they're referring to when it's scored
But yeah not sure which they mean
do you mean there or the little popup?
for example, when yorick is use when is x1, dont pop out the x1 message
ah yeah the pop-up
Can be condensed to just
return { x_mult = card.ability.extra.x_mult > 1 and card.ability.extra.x_mult }
-# Adjust the .extra.x_mult to what you have assigned.
does anybody know exactly how the context.check_enhancement works? i have code to send a traceMessage as soon it enters the context but my traceMessage never gets sent from my testing. not during playing the hand nor when i add an enhancement
ty
It appears only once so far in SMODS entirely - most likely, it's a safeguard against stack overflow where it keeps recursing into itself.
What's the goal?
Stupid question for those who make mods, but is it legal for me to access the source code and use it for myself? I've never modded anything before lmao
wait how do i destroy cards like gros michel? (it flips them instead of burning)
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
thank you 🫡
is it remove_card(self)?
it's the entire event
Oh the smods example also has this one https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua#L379
Is G.jokers:remove(card) nessicsary?
I thought card:remove handled that
How do you link to a specific line?
im trying to make a joker that makes wild cards act like a random different enhancement. i got it working in a really poor way by immitating the effect haha but then i found this code that allows gold and steel cards to act like eachother. i tried this before but it didnt work on the version i had of steamodded but now on the latest release i have (0506a) it doesnt work either https://github.com/GuilloryCraft/ExtraCredit/blob/main/src/essay.lua#L2914
thats something i wanted to test later actually
click the line number in git
You can also shift click a second line to select a range
didnt know that, that's cool too
You can just copy the URL from your broeser
I've never used that context menu before
I guess I should say I've never tried clicking a line of code on mobile so it's never changed the url
disregard what i said, figured it out. i need to enable SMODS.current_mod.optional_features = { quantum_enhancements = true }
yeah it's actually really simple now. very cool however
The shader it self isn't crashing, but when the card tries to apply Hissing to it self it causes a crash.
I think its work nothing that It works when i turn
disable_base_shader = true,
```to false
chat why does my antivirus have a stroke while making a mod
so how do i make a card flip instead of burn whilst being destroyed? this doesnt work
You mean like how Cavendish does? I might be misremembering what that effect looks like
Actually how does Cavendish disappear...?
But doesn't it shrink out of existence?
i mean it kinda gets squished idunno
I would look at X-ray challenges code
yeah it does
That's the card.T part you didn't copy from above iirc
Mr DebugPlus, while youre here do you think you have a guess for why this occurs?
I dont think its the shader causing it, the game can render the shader without a crash
i linked it to you
you missed the rest of the event
but when its applied with the set_ablity, it crashes
oh, mb
i can give more info about anything you need
Idk am on phone
remove the line that says play_sound?
no that's not the message sound
mmm maybe in the args of calculate_effect you can do sound = nil?
idk if the return table is the same for that as it is for calculate
it is
this doesnt work sadly
this mod making me go mad, idk why my game crashes when im trying to apply the effect to a card
if it does then I think the only way to have no sound be played is to create a sound effect that's just silence
or volume = 0
I think that's inevitable with the calculate_effect function
just return the message instead of using calculate_effect
hi n
How can i make it so it applies to a random joker?
calculate = function(self, card, context)
if context.ending_shop then
card = G.jokers[math.random(#G.jokers)]
card:set_edition( {CTRL_hiss = true}, true, true)
end
end
}
if context.ending_shop then
pseudorandom_element(G.jokers.cards, pseudoseed('insertseedhere')):set_edition('e_CTRL_hiss', true, true)
end
?
Doesn't math.random take in 2 arguments?
Could also work
-# It's not advised to use math.random for gameplay, anyway.
Aight
0, 1, or 2
oh
random float [0,1), random int [0, n1], random int [n1, n2]
hi dilly
how are you faring my friend
how?
oh, it seems to apply the effect, but its seemly not affecting the appearnce of my joker?
return { message = "aijks", ... } after the event
also why doesnt this put a space between X2 and mult?
hello!! just popping into the server to ask: how do i alter the sprite for playing cards? not suits, but specifically the blank sprite they're overlaid onto. from what i can tell, the actual sprite itself is located in the decks/enhancers sprite sheet and i've altered that.
however, malverk doesn't seem to be changing anything despite successfully altering both deck and enhancer sprites, and the source code of the mods i've looked at that do change the playing card sprite haven't been informative as to what line of code does the job
You’re changing the enhancements too?
yup
Add this anywhere
local keys_table = Malverk.keys.Enhanced
table.insert(keys_table, "c_base")
And add this in the enhancement alttexture
keys = keys_table,
original_pos = true
That should work
i want to have a joker (legendary) that gets x1 mult from one source and x2 mult from another. i know how to do the variables but how would i do multiple valuables that give the same thing, like xmult in this case?
Can you tell me what's wrong?
actually does any joker do this? get one source of points from one thing, and more points from another?
can you give me a specific example?
what do you mean by that? i dunno how to explain it that's not just saying what i want the joker to do again
like what specifically gives the joker the xmult
do you mean for example it gains X1 when you play an Ace and X2 when you use a tarot or something like that?
right yeah i didnt specify. played straights gain x1 mult and played straight flushes gain x2
(yes this is the Homestar legendary from my mod. Homestar jokers are very straight-dependent mostly off the strength of Runner lol)
how do i set the hand a planet card represents (blue seals crash my game when i play custom hands)
I mean you can just check for each situation and update card.ability.extra.xmult (or whatever) accordingly
config = { hand_type = 'key', },
i thought that card.ability.extras could only have one number assigned? im rlly confused
im doing okay, just ordered myself 2 pizzas and alfredo pasta and an artichoke and spinach dip!
looking forward to it
no, you can assign whatever to it, like a table of values
Can you tell me what's wrong?
oh great do i have to figure out tables now
elseif instead of else if
thats the most important part of lua yes
ive just been modifying vanilla jokers and pasting stuff around is there like a good tutorial out there? im really in over my head with lua i think
it says attempt to index nil center
this is what the error looks like
do i have to return it in locvars?
whats the code
the consumable code or the common_events code
consumable
SMODS.Consumable{
key = "c_thesun",
set = "Planet",
config = { hand_type = 'JCJ_flushsix', },
loc_txt = {name = "The Sun", text = {
"{S:0.8}({S:0.8,V:1}lvl.#1#{S:0.8}){} Level up",
"{C:attention}Flush Six{}",
"{C:mult}+#2#{} Mult",
"{C:chips}+#3#{} Chips"
}},
loc_vars = function()
return {
vars = {
G.GAME.hands["JCJ_flushsix"].level,
G.GAME.hands["JCJ_flushsix"].l_mult,
G.GAME.hands["JCJ_flushsix"].l_chips,
colours = {
G.GAME.hands["JCJ_flushsix"].level == 1 and G.C.UI.TEXT_DARK
or G.C.HAND_LEVELS[math.min(7, G.GAME.hands["JCJ_flushsix"].level)]
}
}
}
end,
atlas = "Planets",
in_pool = function(self, args)
return G.GAME.hands["JCJ_flushsix"].played > 0
end,
pos = {x = 4, y = 0},
cost = 3,
pools = {
["Default"] = true,
["Dwarf Planet"] = true
},
discovered = false,
unlocked = true,
config = {},
use = function(self, card, area)
update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
handname = "Flush Six",
chips = G.GAME.hands["JCJ_flushsix"].chips,
mult = G.GAME.hands["JCJ_flushsix"].mult,
level = G.GAME.hands["JCJ_flushsix"].level,
})
level_up_hand(card, "JCJ_flushsix", false, 1)
delay(0.1)
update_hand_text(
{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
{ mult = 0, chips = 0, handname = "", level = "" }
)
end,
can_use = function(self, card) return true end,
set_badges = function(self, card, badges)
badges[1] = create_badge("Kinda Spicy (Star)", G.C.BLUE, G.C.WHITE, 1.2)
end
}
ok so the tables work like
define the name of the table, then list the compatible hands, and then say "if hand is this hand, add to table?" and then call the table? i m getting a headache even typing this ngl
you have 2 configs
oh shit yeah youre right
i dont know what you're talking about sorry lol
yeah i dont know what im talking about either im just gonna drop it for now
i think i just need an example of a table that has multiple hand types in it?
thx
Tables are just storages for variables and other object
In fact you can store anything in a table, either by an index(number starting from 1 to almost any number) or key (a word to access the value)
You can also loop through a table by using for loops
ok coming back to this, how would i add a delay in here?
As in just the names?
no, in a table that can be pulled from
like if this value then give this much mult, if this value then give this much
Ok so a storage of hand types, with hand information?
events
yeah. bascially what i want to do is store straight and straight flush, and then make it so that when straight is pulled, it adds x1 mult, and when straight flush is pulled, it adds x2
Only straights and straight flushes?
yep just those
If context.poker_hands[hand_name] then
Be wary, a straight flush contains a straight too
Hand_name is the name of the hand, as in "Straight Flush"
Just check context.scoring_name
Oh yeah
how do i check if a card is a wild card?
so like
if context.scoring_name[Straight] then [code to add +x1 mult]
if context.scoring_name[Straight Flush] then [code to add +x2 mult]
something like that?
dont forget the quotation marks!
alright i think i can handle that then
Anyone know how to resolve this?
dont use context inside an event, store it somewhere else first
so js somewhere else put variable = context.other_card?
ye
aight ty
suit = card.base.suit
table.insert(accepted, card)
elseif card.base.value ~= rank or card.base:is_suit(suit) then
would this snippet of code work? (im trying to make my hands wild-card compatible)
me when i couldnt think of a variable name lmao
this is what i have for the xmult code. still unsure of what i have to do to make it so that i can have 2 xmult values
config = { extra = { Xmult_gain = 1, [do something about the Xmult gain 2 variable] Xmult = 1 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult_gain, card.ability.extra.Xmult } }
end,
rarity = 4,
atlas = 'hsr',
pos = { x = 2, y = 0 },
soul_pos = { x = 3, y = 0 },
cost = 3,
calculate = function(self, card, context)
if context.before and context.main_eval and context.scoring_name == "Straight" then
card.ability.extra.Xmult = card.ability.extra.Xmult + #context.cards * card.ability.extra.Xmult_gain
end
if context.before and context.main_eval and context.scoring_name == "Straight Flush" then
card.ability.extra.Xmult = card.ability.extra.Xmult + #context.cards * card.ability.extra.[second xmult gain variable]
end
end
}```
apologies for the terrible formatting idk how to put it into a box like this
the lack of xmult gain 2 variable is intentional because i dunno how to define it
use 3 of the `