#💻・modding-dev

1 messages · Page 69 of 1

stiff locust
#

which one between k and v would i put in the find_joker function

maiden phoenix
#

v

stiff locust
#

okay i will try that

#

that worked

#

thank you

maiden phoenix
#

👍

stiff locust
#

a different issue has just occured to me

#

my joker says it gives +5 mult per unscored card played
and the message text it outputs correctly identifies how much mult it should give
but it actually gives 5 mult if there's at least 1 unscored card

#

i still don't understand how jokers giving mult works

maiden phoenix
#

I don't understand the issue

stiff locust
#

it says +5 mult per extra scoring cards but the code checks if there is at least 1 unscored card and outputs +5 mult if there is at least one

#

so the effect is actually +5 mult if there is at least one unscored card

maiden phoenix
#

It checks if there's at least one so it doesn't have to do all the calculation if there's none

stiff locust
#

but it only ever outputs +5 mult

#

regardless of how many unscored cards you play

maiden phoenix
#

If you have 3 extra cards it doesn't give 15?

stiff locust
#

nope

#

it says it gives +15 on the message it outputs, but it only gives +5

#

???

#

well yeah it looks like it works on the message dont it

maiden phoenix
#

Oh nvm you're right lol

stiff locust
#

easy to miss on high speeds

maiden phoenix
#

I pushed a fix

stiff locust
#

wow that fast

#

ig it was an easy fix

maiden phoenix
#

Yea a quick copy paste

stiff locust
#

what part of the ability triggers it to give mult

maiden phoenix
#

the returned mult_mod

stiff locust
#

okay

maiden phoenix
#

Some context return different values so be careful

#

Like it's not the same between context.individual and context.joker_main

#

You just need to check vanilla code to be sure

stiff locust
#

makes sense

stiff locust
#

wait i know why it is

#

it's because i'm still fucking testing with ripple

#

and not my joker

#

lmao

maiden phoenix
#

Mult_mod needs the var directly

stiff locust
#

hold on

#

oh yeah it crashed this time

stiff locust
#

so would this work

maiden phoenix
#

No stop trying to send mult_mod a localized value lmao

stiff locust
#

oh

maiden phoenix
#

mult_mod, most of the time, should be equal to what's in your vars

stiff locust
#

what happens if it's not

maiden phoenix
maiden phoenix
stiff locust
#

ok

maiden phoenix
#

Otherwise it will give you nothing (or crash maybe)

stiff locust
#

so what about xmult mod

#

is that just returning xmult_mod instead of mult_mod?

#

(same for chips would that just be chips_mod)

maiden phoenix
#

yea

#

chips is chip_mod actually

stiff locust
#

okay

#

that's quite easy actually

maiden phoenix
#

Not sure if it's case-sensitive but it's Xmult_mod too

stiff locust
#

so if i wanna increment my joker's value

maiden phoenix
#

You mean sell value?

stiff locust
#

no i mean like

#

scale its +mult

maiden phoenix
#

A scaling

#

Yea

stiff locust
#

that'd be card.ability.extra = card.ability.extra + value

#

?

maiden phoenix
#

Just look how Trousers do it

stiff locust
#

okay

#

okay so it is like that

#

makes sense

#

alright next step

#

how do I apply an effect (like a retrigger or permanent +chip increase) only to cards scored by splash

maiden phoenix
#

Idk if there's a way to differentiate scored card and scored card by splash effect

stiff locust
#

be it that I have to recalculate what hand should have played by checking the ranks and suits of each played card to find out which ones don't match the played hand

#

this is very important to a lot of my fusions

opal spade
#

then it inserts splash cards and stone cards into scoring_hand before doing any calcs

stiff locust
#

if so then when the joker effect goes through i'd just have to check if the card doesn't have that flag

opal spade
#

you can just rerun the G.FUNCS.get_poker_hand_info(G.play.cards)

stiff locust
#

oh

#

that's convenient

#

i'm not really sure what that does though

#

what does it return (if anything)

opal spade
#

it returns 5 different values, the 4th being the scoring hand before splash/stone

stiff locust
#

ah

opal spade
#

its from the very top of G.FUNCS.evaluate_play = function(e) in functions/state_events.lua

stiff locust
#

but how does one value hold 5 cards

opal spade
#

the value is a table

stiff locust
#

okay that makes sense then

#

so that returns each card from the original hand

#

which then means I have to compare that to the table containing every card in the entire hand?

#

which would be scoring_hand

#

and if a card isn't shared between scoring hand and this other table then it's a splash scored card

#

but then how do I apply an effect to those cards

brisk rose
#

I'd guess some flavor of nested loops and if statements

opal spade
stiff locust
opal spade
#

context.individual is for individual card interactions and it comes with context.other_card which is the card currently being scored

opal spade
stiff locust
opal spade
#

first you check if the context is individual and within G.play but then ye

stiff locust
#

you lost me on that

opal spade
#

if context.individual and context.cardarea == G.play then

stiff locust
#

oh

opal spade
#

ye

stiff locust
#

alright

opal spade
#

then u check if context.other_card is a part of the 4th value returned by get_poker_hand_info

stiff locust
#

how do I get specifically the fourth value

opal spade
#

tbh no idea but you can probably just get all 5 the way vanilla does it

opal spade
#

if you just copypaste that line then you'll have a non-splashed hand as scoring_hand

stiff locust
#

okay

glossy stone
#

what the FUCK is wrong with my hologram . wav

stiff locust
#

got a crash attempt to index field 'ability' (a nil value) when trying this

#

what's that mean

#

well i guess i can figure out what it means but why is it showing up

#

my other jokers worked fine without requiring an ability value

limpid shadow
#

is steamodded debug console still working in latest alpha? I created a sample mod that just prints Hello World! in debug, but nothing is showing up

rough furnace
#

was the console running before launching the game?

#

tbh with lovely's console and DebugPlus, theres not much reason to use the steamodded debug console

limpid shadow
#

oh I'll use that instead then

#

thanks!

opal spade
stiff locust
#

what

#

clyde

#

???
i'm posting a message here

#

strange

#

i don't know what happened there

#

let me try again

tepid crow
#

message might contain some words that are not allowed?

rough furnace
#

should use a different message then

stiff locust
#

if that happens it gets blocked by a different bot

brisk rose
#

you get a differnt error

stiff locust
#

this is the clyde message for when you DM someone who has it off

rough furnace
#

I've seen this when discord gets confused on your perms and thinks you can send a message but can't

#

but you can send a message

#

so idk

stiff locust
crisp coral
#

discord is a fuck, try again

stiff locust
#

that's the joker in question

tepid crow
stiff locust
#

i want the hiker effect to trigger a second time only on cards not scored by splash

rough furnace
#

you'll probably need a lovely patch

stiff locust
#

i already did a lovely patch to apply the splash effect

#

the hiker effect shouldn't require one(?)

rough furnace
#

in G.FUNCS.evaluate_play in state_events.lua you can save a copy of the original scoring hand somewhere your joker can access and use that

stiff locust
#

how/why would that solve the crash

rough furnace
#

theres a crash?

#

oh sorry

#

I just joined this convo halfway through

stiff locust
#

yeah there's a crash

rough furnace
#

instead of self?

rough furnace
#

I can never remeber

stiff locust
#

👀 most OCs in server huh

uneven halo
#

Hey chat rq question i want to do a meme with the Jimbo text box, is there a tool for it?

#

Just this but as a gif

#

From the actual in game Jimbo text

uneven halo
#

This one works well enough as a reaction image but I NEED to clown on people for their agendas

rough furnace
#

uhh maybe

uneven halo
rough furnace
#

I think it expands

uneven halo
#

I saw BU use one for his own messages so I want to know if there's a quick edit tool or if I should just somehow change it in specific

uneven halo
stiff locust
#

if you're gonna make a title you should check it first

uneven halo
stiff locust
#

uhuh

uneven halo
#

Anyways so so uhhh

#

If it's possible to alter the text box:
How exactly?

#

Language? Maybe a tool that just makes him say whatever you want?

#

I'm ready to make the alteration myself so long as I know where to even begin

#

All for the bit

rough furnace
#

idk I tried spawning him manually and getting him to speak but the box was empty

uneven halo
#

Thanks at least for the attempt haha, though I will make it myself as to not bother anyone else past "Hey how do I even do this" lol

rough furnace
#

oh it seems like at one point you coud pass raw strings to it but now it needs a localization key

zealous glen
#

I showcase how I did it here

uneven halo
zealous glen
#

I referenced Bunco but Bunco uses in-game code just tweaked slightly

#

And I tweaked it a bit more to change box colors, etc.

zealous glen
uneven halo
zealous glen
#

I’m not sure what you mean. I haven’t tried to manipulate those

#

If you just want to change those messages, it might be possible to just change the localization tables

uneven halo
zealous glen
#

I don’t know how different quips are selected, so I don’t know if you can extend or only replace

uneven halo
#

So long as I can get the funny joker saying the funny meme I will be good enough

zealous glen
#

Fish mod does a very simple localization replacement. That should probably be enough

opal spade
#

this is the reason of the crash

#

you're trying to look up self.ability.name in a method where that returns nil

stiff locust
#

what

#

wait did I

#

oh fuck I did

#

lmao

#

oops

opal spade
#

😭

#

it's ALWAYS the hiker

brisk rose
#

his ass hiked right over to the consumable area

opal spade
#

and to the top of calculate(self, card, context) too apparently 😭

brisk rose
#

Also the past tense of hike should be hoke

#

don't @ me /s

stiff locust
#

how did i miss that shit

stiff locust
#

did not solve the crash

opal spade
#

how's the code looking rn

rough furnace
#

also what line number does the crash point to?

stiff locust
#

the same as above without that line and with everything in the if statement indented one less so it's in the right spot

stiff locust
#

context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus + self.ability.extra

opal spade
#

the code above has like an entire chunk that doesnt belong (the hiker thing is more than one line)

stiff locust
#

which would have to mean it's self.ability.extra

should that be card.ability.extra

#

is that why

stiff locust
#

the loc_vars im guessing

#

yeah those are an artifact

stiff locust
#

and holy shit this joker actually functions now

#

i wish I could make it display "upgrade!" more than once or display something else to signal this

#

right now it displays upgrade once on the extra cards

#

but still increments them twice (intended behaviour)

#

is there a way to do that

brisk rose
#

I'm pretty certain those messages are pretty configurable. I see mods doing all sorts of things with them

stiff locust
#

they are

#

i have attempted to change it to see what happens

#

okay yeah this second one isn't actually triggering

#

the upgrade! shows up as normal but raft! does not show up at all

brisk rose
#

I think you have to define the loc keys somewhere

opal spade
rough furnace
#

no its returning the object with the key in it

#

but chances are theres no locale key named "Raft!"

stiff locust
#

oh

opal spade
languid mirage
#

gif I made by recording in-game jimbo from win screen

#

and cropping the video

stiff locust
opal spade
#

it returns before the context.individual and context.cardarea == G.play is checked

stiff locust
#

so why doesn't this one work

languid mirage
#

oh nvm, you wanted it in game

opal spade
stiff locust
#

ahhhh

languid mirage
#

I can't read I guess

stiff locust
#

you can only return once

uneven halo
brisk rose
#

I'm pretty sure you also need to pass it a loc key instead of a string

uneven halo
languid mirage
#

if you unzip balatro.exe with 7zip

stiff locust
#

I think I can move around the code to account for this 🤔

opal spade
uneven halo
#

I just realized I could do something similar than what bu did, alter the game loss screen, and have him say that

#

Instead of messing with a gif since that wouldn't have the font and the way the letters show up one by one

opal spade
languid mirage
stiff locust
opal spade
stiff locust
#

oh i didn't give enough arguments

#

but all these messages (the ones in vanilla) are localised

#

i need one that doesn't localise don't I

brisk rose
#

you define your own loc key I think

rough furnace
#

I think you can just not call the localize functin

opal spade
#

ye u can just pass a string instead of localizing

#

(although localizing is good practice)

brisk rose
stiff locust
#

that sounds

#

annoying to do

opal spade
#

localize with a string argument returns a string

#

so you can just put a string instead of it

stiff locust
#

this did not work

#

didn't crash but nothing showed up

opal spade
#

because youre trying to call self again

#

call card

stiff locust
#

oh

#

god damn it

rough furnace
#

what even is self in the calculat context?

opal spade
#

the center

stiff locust
brisk rose
#

ngl I still haven't figured out why some Jokers use 'self' and some use 'card' in their calculate functions that seem to do the same thing

stiff locust
#

vanillas use self modded use card

#

thats all i know

brisk rose
#

though the only mod I have expereince kinda sorta coding is DeFused which is a 0.98 mod frankensteining together the 3 fusion mods and removing the well... fusing

stiff locust
#

3 fusion mods?

opal spade
brisk rose
# stiff locust 3 fusion mods?

Fusion Jokers, Jestobiology, and the expansion to Fusion Jokers that only exists as a zip file dropped in the Fusion thread

stiff locust
#

oh i forgot there was that third one

#

i hope you don't defuse my fusions but i can't really stop you

opal spade
brisk rose
stiff locust
opal spade
#

next to the message

#

{message = <string>, colour = <colour>}

#

colour is like

#

G.C.RED

brisk rose
#

not when you have 900 jokers in game, lol

opal spade
brisk rose
#

I've seen Splash like twice in the last week

rough furnace
#

I've seen it quite a few times last night (I was going through the collection to make tags)

stiff locust
#

and i wanna make a card sleeve where the stacked effect is that all splash are negative

#

hell yknow what

#

i'll make a tarot card

brisk rose
#

I just... don't like the Fusion mechanic, but I also... have no idea how or if I'll port DeFused to 1.0

stiff locust
#

fuck it i'll make a tarot card that just
spawns splash

brisk rose
#

so it's moot for now anyway

stiff locust
#

how's that for fusion accessibility huh

#

i'll make a combustible splash

#

that burns your house down

#

aaanyway

stiff locust
#

i used the colour G.C.CHIPS like hiker's normal message uses

opal spade
#

can i see the code again

stiff locust
opal spade
#

the return message cuts off the rest of the function

stiff locust
#

no it doesn't

opal spade
#

?

stiff locust
#

the second part of the code still runs through

#

it triggers the hiker effect a second time on the extra cards, as it should

#

the message for the second one isn't showing, but everything else down there is working

#

which is what's confusing me

hardy viper
stiff locust
#

what

stiff locust
#

is return just stupid

hardy viper
#

im being rhetorical because your code is definitely being cut off

#

and any effects you think you're seeing from the second part are not actually there

stiff locust
#

it says +10 extra chips on the cards

frosty dock
stiff locust
#

.

brisk rose
#

if you remove everything after return in the function, does anything change?

#

it must be doubling for some other reason

hardy viper
#

there's no buts the second half of the code is not running its not logically possible

frosty dock
#

it might be that context.cardarea has some duplicate condition / isn't unique?

stiff locust
opal spade
brisk rose
#

isn't coding just a blast

stiff locust
#

well I heard horror stories about lua but

stiff locust
#

just into the balatro console?

frosty dock
#

ugh no

opal spade
#

into the console ye

stiff locust
#

okay

frosty dock
#

into the code you're trying to see running

brisk rose
#

not where to put it

frosty dock
#

lol I can't read either apparently

#

nvm me

stiff locust
#

oh I just realised I never actually filled in the value displayed on the text

#

oops

#

that's a text thing it's not a functionality thing

#

i haven't stylised the text properly

#

yet

tepid crow
brisk rose
stiff locust
#

alright so

opal spade
stiff locust
#
  1. I verified that the double extra chips are showing up and triggering properly they are not fake
#
  1. the print statement did not show up
#

so I'm

very confused

#

uhh

#

hold on

#

it might actually be triggering every card twice

#

but I think that's because I did the if statement backwards

#

I checked if the cards were in scoring_hand not if they weren't

#

what's the uhh

#

symbol for not equal to again

#

!= or =!

rough furnace
#

~=

stiff locust
#

oh

#

ok

#

oh it did not like that

#

are you sure

#

it says unexpected symbol

#

oh wait

#

it's the ~

rough furnace
#

yes thats lua's not equal

stiff locust
#

i was doing -

brisk rose
#

tilde equal is a weird choice for not equal, not sure why they chose that for lua

stiff locust
#

well that should fix the logical error

#

now i have bigger problem

brisk rose
stiff locust
#

okay no you guys must've been right actually

#

the first part of the code is just triggering twice

opal spade
#

just swap what youre returning and what youre card_eval_status_text ing

stiff locust
#

I don't know what's going on with it

wintry solar
#

You check for the cardarea in context which is called multiple times

opal spade
wintry solar
#

It checks for repetitions and individual iirc

hardy viper
stiff locust
#

how do I not do that

brisk rose
#

I feel like I'm the too-manyth cook in the kitchen and well... I can barely use a microwave

wintry solar
#

Add context.individual to your initial check

stiff locust
#

okay

frosty dock
stiff locust
#

me when i fucking quit out of balatro frame 1 like an idiot

#

okay take 400

frosty dock
#

actually and isn't real either, there's always not (not a or not b)

stiff locust
#

okay so

#
  1. it's still triggering twice on every card but this time it seems to be a logical error
#
  1. is the "Upgrade!" text supposed to appear below hiker or above the card?
brisk rose
stiff locust
#

anyway now i just have a logical error to solve

hardy viper
#

it's automatically translated to that before it's compiled

#

if you gave an ~= to the compiler it'd tell you there's a syntax error peaceline

stiff locust
#

the part that triggers the effect again if the card is not found in scoring_hand is triggering on every card

hardy viper
stiff locust
#

which is strange because i thought scoring_hand would be only the non splashed cards

brisk rose
#

I still don't understand how lua is a "compiled" language, when the binaries seem to contain all the plaintext source

hardy viper
brisk rose
#

ah fair enough

hardy viper
#

i Hate you luajit

#

sincerely cg

#

(it's not that bad it's just annoying sometimes)

#

(and also slow)

brisk rose
#

I guess I should have figured that luajit means "lua just in time"

hardy viper
#

meh it's not the easiest acronym to figure out if you haven't seen it before

stiff locust
#

i thought it'd be that scoring_hand contains every card in the hand but

#

regardless of if i check if they are or aren't in scoring_hand

#

every card is triggered by this

#

okay wait

wintry solar
#

Your bottom block is never reached

#

Oh wait it is now

stiff locust
#

yeah this is fucking weird

#

so if i make the second part run if the cards are found in scoring_hand (the inverse of what I want)

wintry solar
#

It’s just bad logic

stiff locust
#

the card triggers as expected

wintry solar
#

You check if the other card is not scoring hand card 1 and if it’s not you do something

stiff locust
#

no but

#

that would mean it triggers on only one card if it's inverted

#

but when it is inverted it works properly except inverted

#

oh wait np

#

no

#

I get what you mean now

#

how do I make it not do that

#

I know how

#

hold on i need to write this down this is confusing me

#

it doesn't work because i check each individual value of scoring hand

#

to see if it's not equal to the current scored card

#

and if it's not then it goes on with the rest of the code

#

and it shouldn't do that because if the card is in scoring hand

#

then it will still get triggered because other values in scoring hand are wrong

#

okay

wintry solar
#

You need to check it’s not equal to any card in scoring hand

stiff locust
#

yeah

#

if i use break to end an if stateemnt

#

what was my question again

#

must've been stupid the answer feels obvious

frosty dock
#

break doesn't break out of an if statement, it breaks out of a loop

stiff locust
#

i see

hardy viper
#

can you structure loc_txt like

loc_txt = {
name = "name name :3",
text = {
[[blah blah text
blah blah more text
blah blah blah]]
}

or do you absolutely have to use multiple strings in the table to utilize line breaks

frosty dock
hardy viper
hardy viper
wintry solar
#

Switch statements are just if statements in a different wrapper

stiff locust
#

my solution didn't work

frosty dock
wintry solar
# stiff locust my solution didn't work

You want a Boolean that’s set to true that you set to false (or vice versa) when you find a match, and then your if block under that dependant on the Boolean

stiff locust
#

that is what I did

#

but I think I defined the boolean inside the loop

#

so it's resetting on every trigger

#

my fault lol

#

i moved it and

#

it didn't work

#

wait i think i got it

gaunt thistle
stiff locust
#

i didn't get it

#

I think I did something stupid

#

but i don't know where the stupid is

#

okay well i noticed what I did wrong

#

the return should not be in that else

#

please work (the coding experience)

stiff locust
#

i need a fresh pair of brain bro

wintry solar
#

Where are all your ends 😭

stiff locust
#

trust me they are there

wintry solar
#

Then they’re in the wrong place 😆

stiff locust
#

what

tepid crow
#

I can't tell if you're joking or not

#

cuz that's not where they're supposed to be

stiff locust
#

what

#

but the code works fine if they're there

#

why do i need to mvoe them

tepid crow
#

just because it doesn't crash doesn't mean the code is working like you expect it to

stiff locust
#

but it is working like i expect it to 2/3 times

#

both my other jokers did this and they work flawlessly as intended

#

this one is having logic errors for issues totally unrelated to the ends

#

(i think)

tepid crow
#

well either your indentation is wrong or your ends are

#

what does this joker do again?

stiff locust
opal spade
stiff locust
#

everything works except the last part

#

ah oh wait

#

I know what it is yeah

#

writing it out made it so obvious

tepid crow
#

yeah that's how it usually goes

stiff locust
#

but i'm not sure how to fix it

tepid crow
#

I think this is what you want?

stiff locust
#

well now i wanna keep all my ends at the end for the funny

tepid crow
#

me trolling the compiler

#

(I'm the one suffering in the end)

stiff locust
#

the problem is

#

if i indent it like this

tepid crow
#

just to clarify, indentation doesn't do anything in lua

stiff locust
#

what

tepid crow
#

indentation doesn't do anything, code wise

stiff locust
#

.

#

what

opal spade
#

a lot of ui code in balatro is compressed by putting a lot of things into one line

tepid crow
#

idk, this aint python

opal spade
stiff locust
#

i'm still gonna indent for peace of mind

tepid crow
#

you should

stiff locust
#

but like

#

what the actual shit

tepid crow
#

did you use python before this or what

stiff locust
#

yeah

#

i know python

tepid crow
#

Lua's end is Python's dedent, basically

stiff locust
#

okay

#

well

#

damn.

#

i can't keep all my ends at the end anymore

#

that's really good to know and yeah that fixed my joker

#

now there is

#

one more issue i'm having

#

which is that the upgrade text appears below hiker and not on top of the scored card

#

card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex'), colour = G.C.CHIPS})
i'm guessing i change the "extra" value for this? but what to

opal spade
#

no u change card to context.other_card

stiff locust
#

oh

#

okay

opal spade
#

the first argument is the card that speaks

stiff locust
#

makes sense

#

now i just need to properly format the text

tepid crow
stiff locust
#

¯_(ツ)_/¯

tepid crow
#

there's no way those didn't need end

stiff locust
#

i mean they did need end

#

but i put them all on the end

tepid crow
#

🤦‍♂️

stiff locust
#

the jokers work as intended though

opal spade
#

then end are basically { } from other languages

stiff locust
#

well it's good to know now

#

i specifically chose these three jokers to make first though

#

because they give me all the fundamentals i need to make (almost) every other fusion

#

code wise that knocks out a lot of writing cause i can copy it over

#

thank you all for all of your help (and patience with my dumbass)

tepid crow
#

all good lol

opal spade
brisk rose
#

part of the uh... bracketing being a word just throws me off

wintry solar
#

It just needs indenting properly to be readable

brisk rose
#

looking at DeFused would probably give you an aneurysm. Due to its cobbled-together nature and me being lazy, the indenting is al over the place

stiff locust
#

i feel confident enough in progress that i am going to make a mod thread

#

but i will not have a github yet because i can't figure out how to make one and dont have enough for a beta release yet methinks

zealous glen
#

GitHub has a tutorial

#

You can create a repo from scratch or push a local one

stiff locust
#

i'm gonna wait until I have at least 10 jokers

#

then i will make a legendary and a tarot card and a github

tepid crow
#

making a thread for concepting is great, but I'd definitely recommend a github if you're planning to actually release anything

stiff locust
#

well i've already concepted almost every fusion

#

i did that a long time ago on a separate sheet

#

i will do a github when i do any releases

zealous glen
#

I probably should push what I have to GitHub and make a thread

#

So I can be motivated to continue working on it

opal spade
#

i finally got balatroAP 0.1.9 to a presentable state so burndi can release that and i can work on magictrick again w/o feeling like im slowing down another mod

#

on magictrick the big roadblock is still the custom retrigger api (unifying vanilla's playing card retriggers and smods' joker retrigger api into a singular system with depth config) but its less of a theoretical roadblock and more of a "this is very annoying to implement" roadblock

opal spade
zealous glen
#

Maybe you could help with the Better Calc branch

#

Which would help with compatibility

opal spade
#

First I'd have to learn more about what better calc was (what was the goal, what were the methods), the one thing that I do know is that it's so outdated that any attempts to continue it would have to start from scratch

#

I feel like working on better calc would be a bit out of my league (because if anything, magictrick is the "worse calc", hacking things together to make different separate systems coexist under the same hood; it allows for more flexibility, but it's far from improving anything)

zealous glen
#

I had an idea for creating a class to allow extending calculation to more objects but I never did anything with it

opal spade
#

the basic principle behind magictrick extending the default calcs to iterate over card lists instead of specific hands and then "translate" different calc types where applicable (i.e. a playing card in the joker space would call a eval_card for being held when asked to joker_main)

zealous glen
#

That was kind of the idea

#

The class would have about three properties

#

A CardArea, a Card set (or maybe a list), and a number

#

The number orders it before or after the default calculation step and relative to each other

opal spade
#

the default order of things rn
G.play -> G.hand -> G.jokers -> G.consumeables

#

with all of them having their own sets of tags related to things that need to be differentiated

opal spade
zealous glen
#

Well, rather than using tags, my idea was to have a list of CardAreas to iterate over and what to look for in each of them

#

Since you don’t need to recreate the list at runtime

opal spade
#

default response to getting cards from cardarea api is just giving a complete list of G.play -> G.hand -> G.jokers -> G.consumeables because outside of evaluate_play all one needs is just all the cards

opal spade
stiff locust
#

i am unfortunately swinging back around here again

#

right after i test a solution i just came up with

#

it says attempt to index field "extra" and crashes but i returned mult_mod = card.ability.extra.mult * modifier which is correct isn't it

#

i did define the joker's mult value with config = { extra = { mult = 3 } },
so i think somethijng went wrong there? but i can't tell what

#

the example mod does it like this and vanilla and modded jokers get this to work

wintry solar
#

Did you load a save to test?

stiff locust
#

gonna try on a new save now

#

yeah this worked

wintry solar
#

yeah if you update the config you need a new card

stiff locust
#

now i have a new problem

#

this joker does not trigger the splash effect

#

even though I added it to the same table as I used for the other two jokers

#

and the other two jokers in the table apply the splash effect as they should

graceful horizon
#

Where does one start when wanting to create mods for the game?

graceful horizon
#

ty! I'll have a look at it

solid salmon
#

nvm

#

i fixed it

rough furnace
#

Should use SMODS.load_file

solid salmon
#

just that or?

rough furnace
#

It won't fix your frash but it will make your filename more readable

hardy viper
#

rip the frash

#

will never be fixed

nocturne garnet
#

completely balanced

rough furnace
#

totallty

elder vapor
#

i want to get into developing a balatro mod as a little fun project but everything looks confusing 😭 should i look at example mods source and learn from there?

nimble sequoia
#

yes

limpid flint
#

Of course

loud citrus
#

i'm trying to edit the vers of 8 ball and it's telling me self and card is nil, dose anyone know why? (putting either card or self is nil)

stiff locust
#

this is what it'd be referring to

loud citrus
#

yeah

stiff locust
#

oh

#

well i don't know then

#

i am currently having a similar issue

loud citrus
#

balatro modding

stiff locust
#

alright i figured out the issue with my joker it is now functional

#

however it should be applying the splash effect

#

this is how i patch in the splash effect, and this method works for soaked joker and raft, but not dihydrogen monoxide for some reason? anyone know why?

stiff locust
#

regardless of its position in the table it will never trigger the splash effect but the other two will

#

this is confusing

#

wait i know why

#

nevermind i don't

wintry solar
#

Can I see the joker definitions?

stiff locust
#

this is everything before the ability

#

the ability works as intended

#

it's just not finding dihydrogen monoxide when it's in your jokers for some reason

wintry solar
#

I’d recommend using SMODS.find_card instead of the find joker function

stiff locust
#

but i am lovely patching it into the base code

#

will that work with a smods function?

brisk rose
#

Well, I'm pretty sure that's how mods are loaded in the end, so probably?

stiff locust
stiff locust
wintry solar
#

It uses keys

stiff locust
#

ah okay

#

so it's just SMODS.find_card(<joker key>)?

wintry solar
#

Yeah

stiff locust
#

okay

#

what does the next() around this do

wintry solar
#

It returns a table so it checks that there’s something in it

#

You still need that bit

stiff locust
#

okay

#

i set up a key table and changed it to use the smods find card

#

this did not solve my issue

stiff locust
brisk rose
#

I'd guess yes to the j_ no to the prefix

#

also, this is a good type of thing to reference other mods for

stiff locust
#

yoou guessed wrong

#

it is j_prefix_key

#

and that solved my issue somehow

brisk rose
#

ayyy nice

stiff locust
#

but now my joker isn't working properly

#

.

brisk rose
stiff locust
#

logic error it'll be fine

brisk rose
#

also, my guess was stupid

#

it's a global level thingy, ofc it's gonna need the prefix

stiff locust
#

changed the method and the joker works again

wintry solar
#

You almost always need the full prefix

stiff locust
#

that is a fourth fusion joker implemented

#

is there a way to reset the colour and size of text without making a new line in loc_txt

brisk rose
#

Also, random question to eremel, did mod prefixes exist in 0.98? Defused seemed to have a conflict with regular fusion until I basically manually gave it one

stiff locust
#

i'm pretty sure

#

i saw mod prefixes in jestobiology's fusion results

#

they're all j_f_key

brisk rose
#

they were named that

stiff locust
#

oh

brisk rose
#

but like... fusion's weren't

#

well "named" as in it was they key (slug?)

stiff locust
#

guess it was the slug

split jungle
#

hey what does setting atlas and soul_pos do

#

I also have problems with global var

#

how do I included these

stiff locust
#

in the assets/1x and assets/2x folders under your mod you should have your mod's sprites in there

split jungle
#

i did

stiff locust
#

the atlas refers to the name of the file

#

soul_pos is for legendaries

#

you use soul_pos to define the location of the floating front part of the card

#

makes sense?

split jungle
#

so far yeag

#

what about global part

muted pier
#

you wanna use card.ability

#

or self.config

split jungle
#

also some part of my code or smt keep saying undefinded global

#

how do I define them

loud citrus
muted pier
split jungle
#

oh ok

stiff locust
#

yeah that's normal with SMODS functions and stuff

muted pier
#

because the project doesn't know they exist, but they do

stiff locust
#

it will say undefined global but it should work fine

#

just note that if you use a global from another mod

#

you need to load your mod after that mod

split jungle
#

Damn

wintry solar
primal robin
#

Is UI supports transparency?

wintry solar
primal robin
#

Smth like CSS opacity

#

Want to create a small block which will appear and after period of time became transparent with transition

wintry solar
#

wait, G.C.CLEAR is already a transparent colour

primal robin
#

Problem is children, some text will be inside

frosty dock
#

wait so a gradient?

opal spade
wintry solar
#

the text should be fine

languid mirage
#

UI color is a table of RGBA normalized to 0..1
{r, g, b, a}

#

so color[4] is transparency

stiff locust
#

getting an error "for limit must be a number" on this line, guessing it's because of #context.scoring_hand ?

wintry solar
#

make sure context.scoring_hand exists

stiff locust
#

is there something else it should be

primal robin
#

I want to make panel animated and look similar to this.

#

Like notification

languid mirage
#

so you want opacity go from 0 to 1

primal robin
#

And backwards

languid mirage
#

over time

languid mirage
primal robin
#

Is it works for children?

languid mirage
#

if children use the same color table

#

yes

#

you can create a copy table of color

#

and use it for all nodes that need it

#

I'm not 100% sure about text nodes

#

I dont know if text opacity can be a ref_value or something

primal robin
#

So basically answer is no, only adjust color for each node "individually". Sad but it's okay

languid mirage
#

yeah, engine is rather limited in that regard

primal robin
#

At least i tried

stiff locust
wintry solar
#

if context.scoring_hand

stiff locust
#

i did that

wintry solar
#

can you show more code?

stiff locust
wintry solar
#

you have too many ends

stiff locust
#

oh

wintry solar
#

that should fix it

#

please tell me this code is indented in your editor though

stiff locust
#

i indent everything as it would be in python

opal spade
#

why dont indents get saved

stiff locust
wintry solar
#

oh, put it at the end then

stiff locust
#

i did that and got the same crash

wintry solar
#

wait hang on

#

maybe i misread your indentations

brisk rose
#

So formatting gets lost with copy/paste

stiff locust
#

(more ends and closing } offscreen

opal spade
stiff locust
#

what should I change that to then

opal spade
#

also smods has suits api

wintry solar
#

okay your for loops need ends

stiff locust
#

they did have ends

#

you told me to remove them

opal spade
stiff locust
#

okay

#

i put the ends back in the for loops

stiff locust
#

wait actually i might need it for modded suits

opal spade
#

you do because you're trying to count unique suits

stiff locust
#

i mean the method i used here counts unique suits just fine

wintry solar
#

why do you have the ssame code twice btw?

stiff locust
brisk rose
#

🍝

tepid crow
#

I've looked at flower pot before, I recall it being that way yeah

stiff locust
#

the wildcard should count as every suit

tepid crow
#

oh right

#

it's because wild "fills" any missing suits

wintry solar
#

I also think that this will just always give you the number of cards you've played, right?

stiff locust
stiff locust
wintry solar
#

oh no I am also blind

stiff locust
#

i just add together all the suit values at the end

#

and multiply that number by the card.ability.extra which is 1.5

#

and return xmult_mod with that so it should give 1.5x mult per unique suit

#

hey wait won't that make two unique suits give 3x mult

#

jesus that's strong uhh

#

i'll make it give + X0.5 mult per unique suit

#

i can modify it to do that

opal spade
#

to get all the suits (vanilla + modded) you should be able to loop over SMODS.Suits and grab their keys

brisk rose
#

Also keep in mind Fusions are supposed to be strong. It's why even I have them rarities for DeFused most ended up rare

opal spade
stiff locust
wintry solar
#

you can just loop through the hand and add the suits present to a table

primal robin
#

Which major I should use to be over all playing cards but behind G.OVERLAY_MENU?

wintry solar
#

but it'll be funky with wild cards

stiff locust
#

cause otherwise wildcards would be super broken if you had more than 4 suits

brisk rose
#

Multiplyying nstead of adding

wintry solar
primal robin
#

Thanks!

stiff locust
#

but none of this solves my problem

#

the code still isn't working regardless of its efficiency

tepid crow
#

NODE, MOVEABLE, UIBOX (with no attention_text), CARDAREA, CARD, UI_BOX (with attention_text = true), ALERT, POPUP.
ahhh, that explains why UIBOX is in there twice actually

stiff locust
#

this fucking ide make me wanna kms

#

i put a } down and it goes unexpected symbol

#

i don't put one down and it goes missing symbol }

#

opening balatro and letting it fucking crash is more informative than this

#

all that shit popped up just cause I missed an integer elsewhere in the code

#

god

crisp elbow
#

You use VSCode?

stiff locust
#

yeah

#

i have the extension

drowsy tulip
#

i wanna create a global variable to store a card like the idol how can i do that

stiff locust
#

okay

#

i don't know how it got 5.06x mult

#

but it worked

#

okay no it worked as intended

#

5.06x mult is 1.5 x 1.5 x 1.5 x 1.5

hardy viper
stiff locust
#

i figured it out

hardy viper
#

cool

stiff locust
#

joker is functional correctly now

stiff locust
#

how do I refer to only the card currently being scored

#

i don't know if that will fix this actually

#

this code is checking every card in scoring_hand every time

#

i don't want it to do that

#

i want it to only check the card currently being scored

opal spade
#

why are you looping over scoring hand

stiff locust
#

well yeah i know that's what is wrong with it

#

how would I make it only check each card once

opal spade
stiff locust
#

yeah i need it to just check the card currently being scored

#

how do I do that

opal spade
#

just don't loop

stiff locust
#

oh

opal spade
#

either that or don't check other card

#

and instead check v

opal spade
opal spade
stiff locust
#

count how many A/2/3/5/8 are in the played hand

opal spade
#

then you need to replace other card with v

#

and put it in context.joker_main

#

unless I'm misunderstanding the intended effect

stiff locust
#

fibsequence should be equal to the number of A/2/3/5/8 in the hand

which i then multiply by 3, which is how much +mult each A/2/3/5/8 gives

#

that is the intended effect

#

everything works except for counting how many fib numbers are in the played hand

opal spade
#

oh ok then you just need to replace other_card within the loop for v

stiff locust
#

so context.v:get_id() or v:get_id()

opal spade
#

v:get_id()

stiff locust
#

okay

opal spade
#

v is the value in the loop

#

the loop going over scoring hand

stiff locust
#

yeah that fixed it

#

thank you

#

that is all 5 initial jokers ready for release

stray orbit
#

anyone know how to use vars.colours for the background colour on text?

#

like the red part of xmult

#

this doesnt work

mellow sable
#

Use X:mult,C:white

stray orbit
#

nono i want to use a colour stored in vars.colours

#

V:1 sets the text colour but i want to set the colour behind the text too

wintry solar
#

you can't do it that way, you'd have to add your colour to the colours table

stray orbit
#

oh no

#

ty

earnest creek
#

are there any resources that I can look into if I wanna get into modding?

earnest creek
#

tyvm

drowsy tulip
stiff locust
#

yeah the source code is super helpful

tepid crow
#

to know what's going on yeah, not sure as example

drowsy tulip
#

trying to get text to color based on the suit picked and this aint working help

stiff locust
#

is there a way i can check what mod a joker is from

#

wait ceres does that doesn't it

earnest creek
#

yeah, im taking a look at cryptid on the side too

#

cuz math is smart

stiff locust
#

the guys at cryptid are fuckin wizards man

drowsy tulip
#

mostly what i got from looking at other mod is that shit is too complex for the effort

earnest creek
#

lmfao

stiff locust
#

looking at other mods has helped me a LOT

bleak rain
stiff locust
#

i wouldnt have known how to register fusions if i hadnt looked at the other fusion mods

tepid crow
stiff locust
#

yeah i noticed that with sdm0's splash evo code

earnest creek
#

btw, what happens if I give a joker no texture? cuz I can't be asked to do legendary joker background art

stiff locust
#

¯_(ツ)_/¯

drowsy tulip
#

probably just gonna be nothing

stiff locust
#

if you're making a legendary you can color shift the legendary background to fit your theming

#

and just change the nameplate

#

vanilla style legendary backgrounds are easy

drowsy tulip
#

ye thats true

stiff locust
#

one other thing about legendaries

#

soul_pos refers to the placement of the floating front part of the card

regal wolf
#

some mods can be really helpful to look at, others not so much

primal robin
#

Just addig small popup is such a pain JangSchna

tepid crow
#

balatro UI be like

stiff locust
#

like for my mod #tsun_jokers?

split jungle
earnest creek
#

how can I let a joker retrigger a specific card multiple times?
(for example, ace of spades)

tepid crow
stiff locust
#

code wise

tepid crow
#

joker_center.mod.id iirc

stiff locust
#

also what is this in a context

tepid crow
#

this is a sleeve center

tepid crow
#

do you know when you have a Card class?

stiff locust
#

i just want to run an if statement which goes "if joker is from x mod, do this"

#

how do I do that

tepid crow
#

from where

#

a joker calculate?

stiff locust
#

yeah i wanna give xmult to jokers from a specific mod like how baseball card does it with a rarity

tepid crow
#

context.other_joker.config.center.mod.id

stiff locust
#

so would that come out as the mod prefix

tepid crow
#

no, that'd be .mod.prefix

stiff locust
#

oh yeah right there's a mod ID section

tepid crow
stiff locust
#

i forgot about that

#

ahhh i see

tepid crow
#

might also need to double check for basegame jokers? idk if steamodded gives them a .mod

stray orbit
#

i didnt realise the first time that colours needs to be part of vars

stiff locust
#

to get the joker's name

tepid crow
#

what do you need the name for?

stiff locust
#

that very common thing everyone needs to do

#

all the time

tepid crow
#

ofc ofc

tepid crow
stiff locust
#

that works too

tepid crow
#

context.other_joker.config.center.key == "j_splash" I think

stiff locust
#

alright thanks

tepid crow
#

keys are less prone to changing and being messed up

stiff locust
#

when you run juice_up(x,y) what do the two arguments do

tepid crow
#

is it not clear from the definition in the base-game code?

stiff locust
#

i mean the only instance i've seen so far it just uses (0.5, 0.5)

tepid crow
#

I mean the function definition

#

not the call

stiff locust
#

oh

#

¯_(ツ)_/¯

#

i can't find the definition

tepid crow
#

your editor should have a "search all", use that

stiff locust
#

i am using that

#

i don't know what to search for so i'm just looking through instances of juice up and i can't find it

earnest creek
#

if I wanna check for aces, do I just go if rank == "Ace"?