#đŸ’»ăƒ»modding-dev

1 messages · Page 28 of 1

zealous glen
#

hmmm, I overwrite the line that checks for Plasma Deck to also check for my own Joker (though theoretically it could find a similar Joker from another mod). I did consider making an API that allows any mod to also add their own condition to that check

wintry solar
#

I added it after the plasma balance

frosty dock
#

also those who will be confused, I can't unconfuse no matter what

wintry solar
#

So I call calculate joker with a custom context

zealous glen
wintry solar
#

I just check if it’s already been balanced

zealous glen
#

What do you check exactly?

wintry solar
#

Pretty sure it was the existence of nu_mult

zealous glen
#

I think that only works with vanilla and could have unexpected behaviour with other mods

#

But tbh so can my overwrite, since perhaps multiple mods can’t overwrite the same line (?)

wintry solar
#

Why would other mods have assigned a value at that step other than to balance?

zealous glen
wintry solar
#

Yes but nu_mult is created where I’m injecting

#

And I can’t think why you’d inject at the balancing point other than to balance

#

And if the score is already balanced, balancing again doesn’t really matter other than animations

zealous glen
wintry solar
#

But wouldn’t you just hook into the current line that evaluates the deck?

zealous glen
#

I’m just saying it’s possible

wooden nexus
zealous glen
#

Anyways, I wonder if adding a calculate_joker with context.balance is a good API idea

wintry solar
#

It could probably be included yeah

long ruin
#

💀

wintry solar
#

I’d probably suggest it coming after the deck evaluation and checking for the existence of variables and whether they are already equal before calling it

frosty dock
#

you're using 1.0 code on 0.9.8 steamodded

#

make up your mind

zealous glen
long ruin
#

je vais tout wippin

wintry solar
zealous glen
#

Any effect that sets new Chips and Mult value could reasonably have the same name

wintry solar
#

But surely balancing would always be the last event?

zealous glen
#

Or before

wintry solar
#

People will always be able to hook after it, you have to design it with what is already there

zealous glen
#

So it could happen OTHER HOOK -> YOUR HOOK -> VANILLA, or VANILLA -> OTHER HOOK -> YOUR HOOK, or OTHER HOOK -> VANILLA -> YOUR HOOK

#

Although if the variables are local you shouldn’t see them between arrows.

wintry solar
#

Well if you have a way of doing it, go for it

rough furnace
#

I think maybe a warning for a while as a lot of people do do that (maybe show in the mod list too) but then later it can be removed

frosty dock
#

"a lot of people do that" isn't really an argument when almost all mods have to adapt in order to be usable

#

but yeah, most example mods are single file and whatnot

edgy reef
#

The only one that I use that's one lone lua file is AchievementsEnabler.

mellow sable
#

I think my mod SeedUnlocker also does that

rough furnace
zealous glen
#

But I guess Steamodded would read it as a single file?

rough furnace
#

also do we allow nested files?

mellow sable
#

PLEASE NO

frosty dock
mellow sable
#

detect them and give a warning

rough furnace
#

I was thinking about it and it's a bad idea

#

But I was thinking having some kind of config file for steamosded might be cool

zealous glen
rough furnace
#

Like where we could just point it to the entry point wherever we want to store it realistive to the mod root

rough furnace
zealous glen
#

I guess it’s fine to prevent that

#

I have a top level file that requires the other files that are in lower levels

#

In separate folders or sub folders

frosty dock
#

eh, forcing entry points to be at 2 depth should be fine

#

what's a useful but concise warning message for nested files though?

#

like Mods/MyMod-main/MyMod/mymod.lua

#

happens quite easily when downloading source from github

maiden phoenix
#

"You nest get suplex"

frosty dock
#

eh, this mostly happens due to incorrect installs by users

#

for which I don't think this makes a lot of sense

#

fair

rough furnace
#

I would just if anything, show a warning somewhere if it does happen, to make troubleshooting easier

wintry solar
#

is ther ean easy way to print jokers in the current shop pool?

maiden phoenix
wooden nexus
#

What you all think? gonna change the blue to match the suit

iron sphinx
#

The color is too flat i think

wooden nexus
#

I could detail it more

hushed estuary
#

tryna do something, the fifth one wont show up

#

ok this is kinda better?

iron sphinx
#

Probably need to make them smaller

hushed estuary
#

I'VE DONE IT

stiff locust
#

not even a dollar for tiny blind

hushed estuary
#

now gotta figure out the tags and shrink them a bit

stiff locust
#

smh

hushed estuary
#

actually yeah the original intention was to shrink a blind with a consumeable but now a dollar is probably needed

#

This sure is a long stake I'm making...

mellow crag
hushed estuary
#

oh yeah

hallow forge
#

skip the ante

mellow crag
#

my favorite ante

#

or

hushed estuary
#

skips work perfectly now

#

just gotta sort out the select buttons text and frame color

royal ether
#

im bouta come back after a month and be super lost

zealous glen
hushed estuary
#

ok so

#

i just need to change "when a boss blind is defeated" to "when blind in boss position is defeated" in the function responsible for raising the ante

#

imma do some stake sticker sprites now

zealous glen
hushed estuary
#

is this sarcastic or..?

#

i genuinely can't tell

zealous glen
#

I’m wondering if it can be an API

hushed estuary
zealous glen
#

I can see reasons to not want the position of the Blind dictate when the Blind increases so maybe it could be a separate variable

hushed estuary
#

by the way when this comes out don't ask me why the second boss position is called ''preboss"

zealous glen
random sleet
#

why is the first boss position called boss

hushed estuary
#

now i have to answer

#

at first i thought it was easier to make a thing between boss and big blind, then i moved it after boss and at that point i used the variable enough that it wasn't worth changing

zealous glen
#

Find and replace is your friend

#

Text editors for coding might have a refactor that’s similar to find and replace

hushed estuary
#

Alright yeah I probably should make it something like “boss2”

royal ridge
#

thanks mr. balatro! i love you

#

<@&1133519078540185692> i think

livid scroll
#

đŸ”«

grand violet
#

Thanks cool

#

got to it before I could

worldly sapphire
#

đŸ‘»

#

Boo

zealous glen
#

Make a mod to learn how to mod

#

hmmm

wintry solar
#

oh god finally some progress

#

porting the work I'd done on edition api to 1.0 but badges and tooltips are being a nightmare 🎉🎉

frosty dock
wintry solar
#

maybe I just don't understand how to call them

zealous glen
wintry solar
#

is it on 1.0?

zealous glen
#

But I forgot

#

Also lack of time during the evenings

wintry solar
#

I get double tooltips for default editions so it's just the way I'm putting data into the tables I think

zealous glen
#

I had some issues with them until I realized I needed to add the folder to lovely otherwise it wouldn’t inject

zealous glen
#

The INIT function might be empty since all I’m doing in the main file is adding a localization entry for the tooltip actually

#

In which case I reckon it should be inserted into some function (loc_def?) to work with 1.0

wintry solar
#

well at least this is different

#

it's just an error now rather than a ui error!

regal shoal
#

There is a loc_txt variable in Rank Game obj. How do you use it ?

#

You can't put a description text in it ?

frosty dock
#

it's just a string

#

(or a table of strings indexed by locale)

regal shoal
#

Thx

hushed estuary
#

I see there’s talk about tooltips

#

how do I even make them work

#

(on SM 1.0)

zealous glen
frosty dock
#

for centers, you can use a loc_vars function you can use, anything added to info_queue will be processed as a tooltip

wintry solar
#

what exactly needs passing to info_queue?

frosty dock
#

check generate_card_ui

#

can be a set and a key, or just a center object

native osprey
#

im not familiar with the balatro modding community, question I have are there a lot of artists who do joker art? and do they do it for free or for a price

zealous glen
#

I’ve mostly seen people make their own art or collaborate with each other

native osprey
#

thanks for the information

robust coral
#

any good resources to learn the basics of creating a joker mod?

maiden phoenix
robust coral
#

i'm currently just looking at the source of another mod and using what i can see to make a very basic mod

zealous glen
#

Also I have a single Joker mod lying around that people have used as reference before

void spear
#

Hi!
I would like to add a draggable object/sprite -a card (69x93)- for a mod, can someone explain me how to do it?
I want the same effect as the Blind icon that you can drag and that comes back to its original position when you unclick it.
I know the function is somewhere in the moveable.lua file, but not sure which function exactly and how to apply it for my sprite.

zealous glen
void spear
#

thanks for the response. I want it for a new sprite (so "new type" just composed of one picture)

zealous glen
#

I mean, I think if that new type had its own CardArea it would behave like that by default

#

I don’t know if Blinds and Tags are stored in something that isn’t a CardArea, but I don’t see why it couldn’t be a Card variant

#

Unless you want to animate it, I guess

#

But only because there’s quirks to work out with animated Cards

#

Although maybe if nothing else interacted with it it could work? I’m not sure what’s the issue with animated Cards since I haven’t dabbled into them myself

void spear
#

No, no animation, just be able to click on it, and drag it around, and when I unclick it it goes back to its initial position

#

I will take a look in the code about the CardArea, thanks

zealous glen
mellow crag
#

Someone messaged me?

zealous glen
void spear
#

Hi itayfeder, I'm just fooling around with the code for a mod, and I wanted to be able to drag an object (sprite) the same way it's possible to drag the blinds, and it goes back to the initial position when I unclick it. No other interaction.

#

So I was asking it there is a function I can call for that (and if yes, with which parameters), or if I need to create a new function for that

#

And Victin was telling me to look the the CardArea (function CardArea:init I guess?)

wintry solar
#

@zealous glen are you home and able to send your negative playing card code my way?

wintry solar
#

no worries

zealous glen
#

I’ll possibly just go to sleep when I get there

frosty dock
#

i may have done a thing

zealous glen
frosty dock
#

let me try

zealous glen
#

How long until they’re smaller than a single pixel

frosty dock
#

that's 631

mellow sable
#

The .

frosty dock
#

i should make it have more rows

mellow sable
#

All .s are debuffed

frosty dock
#

thunk..

worldly sapphire
#

i can't make soul_pos work idk why

#
{
        name = "Energy Fuse",
        slug = "fuse",
        config = {},
        rarity = 2,
        soul_pos = {x=0, y=1},
        cost = 5,
        set = "Joker",
        blueprint_compat = false,
        eternal_compat = true,
        loc_txt = {
            name = "Energy Fuse",
            text = {
                "After 5 {C:attention}Four of Kind's{} played",
                "destroy itself and create a",
                "{C:attention}Energy Core",
                "{C:inactive}--------------------------",
                "{C:green}(0/5 - Four of a Kind's played.)",
            }
        },
    },```
#

the code

#

the image

zealous glen
#

see the wiki

worldly sapphire
#

like

#

i'm using only one image

#

does this still work?

rancid imp
#

you just have to treat it as a spritesheet, not a single image

worldly sapphire
#

i tried using a atlas

#

but idk how it works

zealous glen
#

@solar vale I explained it to someone else recently, but the issue is that the game can store individual variables for Jokers and instructions for what the Jokers do
 but there's no way to look at the variables and know what they do.

worldly sapphire
zealous glen
worldly sapphire
#

i still didn't got the point

zealous glen
worldly sapphire
#

the custom atlas part.

#

idk what i need to put there

#

because my mod loads jokers sprites via slug

zealous glen
#

An atlas is an image file which can contain multiple sprites (or frames) in it

#

Which tends to save memory

#

Compared to having individual .pngs for everything

worldly sapphire
#

so do i just put the image name there?

#

its like this rn

random sleet
#

are you on 1.0?

mellow crag
random sleet
hushed estuary
#

(placeholder stats)

#

yeah

#

trying to

rancid imp
random sleet
#

feder's already got Ore Of A Kind

frosty dock
#

I'm not going to recommend an in-development version that is still receiving breaking changes to everyone

#

there is no released 1.0.0 version

#

and I recommend 1.0 ports of mods should release when there's at least a beta release

#

what already has documentation will probably stay as is, but having at least some modders test the APIs is something I appreciate

frosty dock
#

I can't do all the testing myself or we'd be here forever

frosty dock
#

I thought you'd care

crisp coral
#

oh no

frosty dock
#

same deal of passing self as the first argument everywhere

random sleet
#

aure should i start a new mod for 1.0

frosty dock
#

sure

random sleet
#

oh ok

#

will tags/blinds/other noncenters have mod badges

long ruin
#

i dont know how to change the 1.0 to 0.9.8 or vice versa

#

okay thanks !

hushed estuary
#

hehe😈

#

i'm having way too musch fun with this

frosty dock
random sleet
#

suits/ranks i could understand, but at least having blinds have mod badges in collection would be a good compromise for them not having a standard uibox

frosty dock
#

suits/ranks aren't too bad to implement, I'm just a little worried about cluttering the UIBox with badges from suits/ranks, enhancements, editions and seals of you know what I mean

random sleet
zealous glen
worldly sapphire
random sleet
#

are you actually setting soul_pos in your constructor

worldly sapphire
#

In the right joker

zealous glen
#

Do you register the sprite?

worldly sapphire
#

Yes

worldly sapphire
zealous glen
#

Check Polydactyly and

#

idk then

worldly sapphire
zealous glen
#

@fast badge [
] Four Leaf Clubber

#

it's missing the assets but it works in 0.9.8

#

By the way there's some unnecessary stuff there

worldly sapphire
zealous glen
#

You don't need the name check

random sleet
zealous glen
#

SublimeText but vsc works too

#

I just had Sublime on my laptop

worldly sapphire
#

Oops

#

As i said, i can't mess with this right now bc i will not be home

#

So, later today i will take a look

regal shoal
#

This works amazing but then get overwrite by something when SMODS init. Does someone knows how localization works in 1.0.0 ?

local loc_additions = NFS.load(SMODS.current_mod.path .. 'localization/' .. 'en-us' .. '.lua')()

local function update_language(old, new)
    for k,v in pairs(new) do
        if type(v) == "table" then
            if type(old[k] or false) == "table" then
                update_language(old[k] or {}, new[k] or {})
            else
                old[k] = v
            end
        else
            old[k] = v
        end
    end
    return old
end

G.localization = update_language(G.localization, loc_additions)

init_localization()
#

By creating a challenge where you start with it

random sleet
regal shoal
#
SMODS.Challenge {
  key = "key",
  loc_txt = {
    name = "name",
    text = {
      "text"
    }
  },
  jokers = {
    "j_joker"
  }
}
#

Something like that

regal shoal
random sleet
#

SMODS.current_mod.process_loc_text can handle any general loc entries you need to make

regal shoal
#

Amazing

#

❀ thx

#

btw, a while ago I've made an Autumn Joker. You might just have the copyright of it

zealous glen
#

Not Debug mode?

zealous glen
#

AFAIK Debug mode just sets a single variable to true

#

so you can do it yourself manually

#

@mellow sable DebugMode port when

#

I think it's tab

#

Did you hold it?

royal ridge
#

are blind chips 22 frames or 21 frames?
there are 22 frames in source images, but mystblinds uses 21

zealous glen
royal ridge
#

😭

zealous glen
#

Balatro players versus basic arithmetic

frosty dock
#

it's in the docs

#

self, card, dt

#

..

#

you're missing the self argument

#

it's not passed implicitly when defining functions this way

#

hm

#

make sure you're not using the card in one place and self, i.e. the center in another

#

aight

mellow sable
crisp coral
#

debugmode port: literally remove the init function

#

😭

mellow sable
#

Meth already wrote a lovely patch that would still work

crisp coral
#

it's funnier this way

mellow sable
#

The funny method is to make it more complex

#

Write an if statement that checks if you’re running in 1.0, and if false it’ll run the code in an INIT function, otherwise it’ll set _RELEASE_MODE instantly

crisp coral
#

here's a version that specifically does not run in 1.0.0

frosty dock
#

yeah

#

just go to the mods menu and disable + re-enable anything

#

as long as that mod doesn't use lovely, it'll quick reload mods as soon as you exit the mods menu

#

uh right

#

it also does that if you have it at top level in your Mods dir

#

I'll probably deprecate that completely though, given it also doesn't behave correctly with disabling mods

#

disable one, and it'll disable all mods with lone files at top level

#

yeah

#

it's a flaw with my implementation tbf

#

it could be resolved by using a settings file, maybe I'll change to that when I add more options for mod settings

#

possible

#

there's a bug with that where the name doesn't get changed, I totally forgot 💀

hexed coyote
#

Are there any tips for finding things within the Balatro source? I'm trying to find the 'quick restart' code (i.e. the thing that happens when you hold R)

mellow sable
#

search across files is goated

hexed coyote
#

That would probably be a good idea, I was just looking through the files in 7zip lol

zealous glen
#

But yes VSC, SublimeText, Notepad++, etc. probably make it easier

frosty dock
#

what do you have so far?

#

if you use generate_ui, you need to do the localize call yourself

#

In this case I'd use loc_vars and return { main_end = ... }

regal shoal
#

Is this wrong ?

--- main.lua
SMODS.process_loc_text(G.localization.descriptions.Other, "joker_deck_jokers_Joker", {
    text = {
        "{C:mult}+#1#{} Mult"
    }
})

--- generate_ui()
localize{type = 'other', key = 'joker_deck_jokers_Joker', nodes = desc_nodes, vars = {4}}
frosty dock
#

it needs to be repeated on each injection, else it will get overwritten

#

Also you can use loc_vars and return a key field instead of hijacking the localize call

regal shoal
#

Thanks ! I'll try that

#

@frosty dock It's working wonderfully ty

frosty dock
#

great, np

hidden cargo
#

when nativefs mod is installed, love.filesystem can't read my file, but when i remove it, it is fine, why would they do that ?

regal shoal
#

Progress !

frosty dock
#

of Jokers

hidden cargo
#

wow

regal shoal
frosty dock
#

sounds fun

regal shoal
worldly sapphire
#

ok i'm back, how do make a soul_pos work in 0.9.8?

zealous glen
#

How do I make a Joker with different dimensions from a standard Joker?

#

I mean, I can see Wee Joker and Morefluff's CSS

#

I'm just trying to wrap my head around it

#

so if my Joker has width my_width, if I multiply the base width by my_width / 71 it should work?

worldly sapphire
zealous glen
#

But there's also some scale manipulation

#

There's no default way to verify a Joker is in the collection AFAIK, but I made my own

#
is_in_your_collection = function(card)
    if not G.your_collection then return false end
    for i = 1, 3 do
        if (G.your_collection[i] and card.area == G.your_collection[i]) then return true end
    end
    return false
end
#

I'm not sure that works while in-game

#

I mean during a run

#

Interesting

#

Because G.jokers should exist during a run

#

so it should never be nil

#

Actually

#

I'm not even sure if a == nil is correct Lua syntax

#

Because sometimes it throws an error when you try to compare with nil

#

by the way

#

if it's only for tooltip reasons

#

you can check it when generating the tooltip

#

which is why I created this function in the first place

#

I'm hooking Card.generate_UIBox_ability_table

#

and inside I do

#

I mean, you do

#

you're generating a tooltip

#

That's generate_UIBox_ability_table

#

Yeah but the game calls that function

#

huh???

#

That seems wrong

#

That seems like it could cause breaking changes

#

I think if you call my function inside your loc_vars it should work

#

huh

#

@frosty dock I'm curious why

worldly sapphire
#

i'm trying to make this soul_pos work for a long time now

{
        name = "Energy Fuse",
        slug = "fuse",
        config = {},
        rarity = 2,
        cost = 5,
        set = "Joker",
        atlas = "j_fuse",
        soul_pos = {x=0, y=1},
        blueprint_compat = false,
        eternal_compat = true,
        loc_txt = {
            name = "Energy Fuse",
            text = {
                "After 5 {C:attention}Four of Kind's{} played",
                "destroy itself and create a",
                "{C:attention}Energy Core",
                "{C:inactive}--------------------------",
                "{C:green}(0/5 - Four of a Kind's played.)",
            }
        },
    },```

And idk if its because of this:

```Lua
for _, v in ipairs(jokers) do
        SMODS.Joker:new(v.name, v.slug, v.config, { x = 0, y = 0 }, v.loc_txt, v.rarity, v.cost, true, true, v.blueprint_compat, v.eternal_compat, "", "j_" .. v.slug):register()
        SMODS.Sprite:new('j_' .. v.slug, SMODS.findModByID("RookieJokers").path, "j_" .. v.slug .. ".png", 71, 95, "asset_atli"):register()
    end```
#

i tried setting an atlas

#

but it doesn't work

zealous glen
#

You don't

#

You just need to update it when it's hovered on

zealous glen
#

This is a test I had made to see how Soul Sprites worked a while ago

#

I'm also trying to make Soul Sprites work ATM

#

but w i d e

worldly sapphire
#

W I D E ?

#

H M M M M

zealous glen
#

I managed to make the card wide but not the Soul Sprite wide

#

I want a normal sized card, though off center

#

I have a file to store some utility functions which I require

#

huh

#

Misc is just an array that contains the function

frosty dock
zealous glen
#

the file misc_functions.lua returns an array

frosty dock
#

generate_ui is called from generate_card_ui, which calls loc_vars in its default implementation

#

they tried to override that default implementation, but didn't call localize, which is part of what that function is expected to do if it exists

frosty dock
zealous glen
#

I know you can't compare order

frosty dock
#

a < nil or b > nil will cause issues

#

a == nil doesn't care about order

#

So it's fine

zealous glen
#

hmmm

zealous glen
frosty dock
worldly sapphire
#

i think its wrong:

SMODS.Joker:new("Energy Fuse", 'fuse',{}, {x=0,y=0},{name = "Energy Fuse",text = {
        "After 5 {C:attention}Four of Kind's{} played",
        "destroy itself and create a",
        "{C:attention}Energy Core",
        "{C:inactive}--------------------------",
        "{C:green}(0/5 - Four of a Kind's played.)",
        }
        },1,5,true,true,false,false,"","joker_atlas",{x=0,y=1}):register()
        SMODS.Sprite:new('j_fuse',SMODS.findModByID("RookieJokers").path, "fuse.png",71,95, "asset_atli"):register()```
#

and probably because it is inside the same file where this guy is?

for _, v in ipairs(jokers) do
        SMODS.Joker:new(v.name, v.slug, v.config, { x = 0, y = 0 }, v.loc_txt, v.rarity, v.cost, true, true, v.blueprint_compat, v.eternal_compat, "", "j_" .. v.slug):register()
        SMODS.Sprite:new('j_' .. v.slug, SMODS.findModByID("RookieJokers").path, "j_" .. v.slug .. ".png", 71, 95, "asset_atli"):register()
    end```
zealous glen
worldly sapphire
#

i saw this image

#

i did write everything

worldly sapphire
#

now it works

#

i just deleted the joker from local jokers

#

and he works now

zealous glen
worldly sapphire
#

yea

#

can i register him inside local jokers?

#

because he feels out of place now

zealous glen
worldly sapphire
#

is there an example of this?

#

or i just use the same format?

zealous glen
#

change what needs to be changed to make it work

#

I think I see why Jokers copies have the wrong back

#

well, I don't see it, but I have a suspect

fair inlet
#

i assume it’s the same bug like what duped cards used to have

#

it’s just that the jokers were never flipped over in the demo

zealous glen
#

idk what I'm seeing or why you're asking

#

idk

frosty dock
#

looks alright, what's failing?

#

nah it should work

#

what build is this?

#

hm iunno

#

try checking the logs

zealous glen
#

Finally! WIP artwork, which I traced from the Collared MV. Well, I think the soul sprite is finished (?) but the Joker itself needs work

frosty dock
#

negate texture pack is working last I checked

#

nah

#

just can't be top level

nocturne garnet
#

cant have anything in detroit 😭

zealous glen
#

maybe they use a different atlas which you need to set

frosty dock
#

there's G.shared_seals which is initialized on load

#

just reassigning to shared_seals in the inject function of your sprite should do

zealous glen
#

Does anyone know what controls the depth of cards?

frosty dock
#

the issue there is that these objects don't hold an atlas name, but the atlas table

zealous glen
fair inlet
#

oh i remember someone else reskinning the seals with different icons

#

forgot which mod

zealous glen
#

In programming and software design, an event is an action or occurrence recognized by software, often originating asynchronously from the external environment, that may be handled by the software. Computer events can be generated or triggered by the system, by the user, or in other ways. Typically, events are handled synchronously with the progr...

#

no

#

I mean maybe but it's not the right way to do it

#

you should be able to just change the atlas Seals use before they're initialized

frosty dock
#

events mostly serve the purpose of timing things like scoring calculations to the game speed and accel

#

these sprites get initialized before load, so just doing a postfix patch to the atlas inject function has you set here

#

barely anything happens between mods loading and the splash screen

zealous glen
#

I think you could even just sprite:reset(), maybe

#

when are you resetting

frosty dock
#
inject = function(self)
  SMODS.Atlas.inject(self)
  your_code_here()
end
zealous glen
#

Congrats!

zealous glen
frosty dock
#

yeah it has to be on the same atlas

zealous glen
#

make an atlas with both

#

single atlas for all jokers

#

like the base game

#

but really if you want to do something like that find out how to pass the atlas when choosing the Joker

frosty dock
#

no

#

one png = one atlas

#

put things in the same png

#

simple

#

put one next to the other

#

like the literal atlases the game uses

mellow sable
#

Copy the game’s atlas and add your joker

#

It won’t work with modded jokers but it should work with any vanilla jokers

#

(or just add soul_atlas compatibility in 1.0 balatrojoker)

#

It’s hardcoded I think

frosty dock
#

yeah it's hardcoded for soul for some reason

#

i don't wanna add soul_atlas compat because it encourages individual files

mellow sable
#

That made it so fun to add it to Gateway 😅

#

So that not everyone’s mod directories look like this

#

Inefficient for the game I think

#

It’s good practice to not do that (even though I do that)

#

I don’t see why it needs to be barred for that reason

#

If it limits what mod devs can do (even in just edge cases like this)

#

Yep (without the overwriting part)

#

You can use your own atlas and it’ll map to the same sprite

frosty dock
#

it's just how it's handled by the game

#

no...

#

it can just be in the same file...

#

i don't mind adding a soul_atlas, but I don't see how it helps

worldly sapphire
#

Warning: E

#

đŸ‡Ș

zealous glen
#

you can just hook or inject some code that pulls from the correct atlas

mellow sable
#

m

worldly sapphire
#

i'm trying to create a joker that makes all the cards played a random enhancement

#

and...

zealous glen
#

injection with lovely

#

though maybe set_ability is all you need

#

set_ability

#

It's executed when the card is created

#

So you can change the artwork at the right time (once)

#

Just do the same thing but in calculate_joker

#

You do it once when it's created and then once each round

#

you'd probably want to change the registered atlas in the list the game keeps as well as its position

#

then call reset

zealous glen
worldly sapphire
#

guys how do i make this affect all cards in a played pair?

SMODS.Jokers.j_energycore.calculate = function(self, context)
        if context.cardarea == G.jokers then
            if context.before and not context.blueprint then
                if context.scoring_hand then
                    context.scoring_hand[1]:set_ability(G.P_CENTERS.m_wild, nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            context.scoring_hand[1]:juice_up()
                            return true
                        end
                    }))
                    return {
                        message = localize('k_wild'),
                        colour = G.C.BLUE,
                        card = self
                    }
                end
            end
        end
    end
carmine yacht
#

i'm trying to add some new boss blinds and the tooltip on the top left is not appearing at all, nor is the background changing color to reflect boss_colour. the sprite appears in the blind select and collection menus just fine. im really confused since this suddenly stopped working for reasons im unsure about. (using 1.0.0 alpha)

#

the blind itself is here:

SMODS.Blind {
    key = 'the_radical',
    loc_txt =      {
        name = 'The Radical',
        text = { 'All enhanced cards',  'are debuffed' }
    },
    discovered = true,
    boss = { min = 1, max = 10 },
    boss_colour = HEX("54a74b"),
    atlas = "mathblinds",
    pos = { x = 0, y = 3},
    debuff_card = function(self, card, from_blind)
        if self.debuff and not self.disabled and card.area ~= G.jokers then
            if card.config.center ~= G.P_CENTERS.c_base then
                card:set_debuff(true)
                return true
            end
            return false
        end
    end
}
fair inlet
#

maybe try reloading your game

carmine yacht
#

no dice unfortunately

fair inlet
#

damn weird

quiet hamlet
#

How realistic is it that I'd be able to make jokers on my own if I don't know how to code/script? I've got artwork done for 4 jokers but now comes the difficult part haha

slow ocean
#

you can always look at others people mods

#

you never know until you try

#

it very much is

quiet hamlet
# slow ocean you can always look at others people mods

Yep I've been doing that for the past hour or so and am still a bit lost unfortunately. Like I can track some of the ideas, but I'd have no idea how to implement something like "earn $7 if hand contains three 7s" since most of the custom jokers do wild stuff or very simple stuff

slow ocean
#

you can take a look at my mod's github, jankjonklers, a lot of the effects for the jokers tend to be on the simpler side

#

mika's is another good mod to look at

quiet hamlet
#

Thanks I'll check out the lua dings!

slow ocean
#

đŸ«Ą

quiet hamlet
#

I will likely be back here with questions at some point lol

slow ocean
#

it's not helpful to dissuade people from trying to learn regardless

quiet hamlet
#

It's kinda fun to learn, if someone is willing to help I'm down of course but it's a fun-ish activity (at least at this point haha)

slow ocean
#

🙄

#

if you have any questions folks here are generally willing to help you as long as you explain your issue and how you got there

edgy reef
#

I exist too

slow ocean
#

ive seen many of complete lua newbies get tracked into making a mod

quiet hamlet
#

Vice-versa, I like art so if someone is looking for trade-sies I can help out!

#

I mean, when I say "I don't know" I mean I'm not fluent in any languages, I understand some basic coding concepts and have made platformers in unity and gscript before, so uneducated but sorta can parse some things out

slow ocean
#

once you figure out how stuff is formatted, a lot of it is just stringing stuff together from the game's base code

#

so, while there isn't documentation or good reference, localthunk's code is pretty intuitive to read (still spaghetti code) and you can get a good chunk of the way there simply from looking at how something else in the game does something similar

quiet hamlet
#

FYI Lyman I am absolutely ripping your code line for line all over at this point for testing purposes, I assume that's okay with open source stuff but also don't know the protocol so just letting you know

slow ocean
#

thats how i started my modding journey

#

its the cycle

wild gyro
#

i may or may not do some modding when steamodded full 1.0 and documentation drops

#

its more likely a may not but the thought that counts

quiet hamlet
#

Is there a way for me to force a card to show up? I have succesfully launched the game without breaking it and have my joker in!

#

I'd like to see if I managed to get the effect correct

slow ocean
#

you can use debug mode

quiet hamlet
#

oh ho ho, how do I enable that?

#

I'm already testing fortunately, just set it to be common and did some rerolling. It's crashing everytime I play a heart and I can use the error code to make fixes

#

also fortunately I can just reload to the moment before it crashed, so I always have the joker and a heart in my hand

#

Okay, I'm getting the following error: 83: bad argument #1 to 'insert' [table expected, got nil]

-- Heartless
    if config.j_heartless then
        local heartless = {
            loc = {
                name = "Heartless",
                text = {
                    "Destroys each {C:attention}heart card{} scored"
                }
            },
            ability_name = "Heartless",
            slug = "heartless",
            ability = {
                trash_list = {}
                },
            
            rarity = 1,
            cost = 8,
            unlocked = true,
            discovered = true,
            blueprint_compat = false,
            eternal_compat = true
        }
        -- Initialize Joker
        init_joker(heartless)
        -- Calculate
        SMODS.Jokers.j_heartless.calculate = function(self, context)
            if context.before and context.cardarea == G.jokers and not context.blueprint then
                for k, v in ipairs(context.scoring_hand) do
                    if not (v:is_suit(diamonds) or v:is_suit(clubs) or v:is_suit(spades)) then
                        table.insert(self.ability.trash_list, v)
                        local card_to_destroy = v
                        card_to_destroy.getting_sliced = true
                        card_to_destroy:start_dissolve()
                    end
                end
            end
        end
    end
end
azure wraith
#

posting this here to see if i can get another pair of eyes on it because i'm really not sure why these mods aren't working
i'm trying to play with cryptid and it's not loading the mod files correctly for some reason
file structure has been confirmed to be correct by others already, and i also have a 0.9.8 steammodded setup that works correctly and the newest version of lovely (i am using 1.0.0 for cryptid though, i swapped out the mod folder)

hushed estuary
#

how should i add loc_txt to a seal?

#

this is what the seal tooltip looks like rn

#

i found "description" and "label" in steamodded's code but it doesnt seem to work

slow ocean
#

theres a mod that enables it, and when you have it enabled, you can just hover over any joker in the collection and press 3

stray warren
#

Is this how to create a modded joker card? I see riff-raff accesses G.jokers so I thought maybe SMODS.Jokers was similar.

#

And by create I mean spawn it in the cardarea for jokers

#

Here is the rest in the block:

if self.sell_cost <= 50 then
    local card = create_card('Joker', SMODS.Jokers, nil, 2, nil, nil, nil, nil)

    card:add_to_deck()
    G.jokers:emplace(card)
end
frosty dock
#

you're on the wrong track there, G.jokers is just the card area for jokers

#

to that argument is the area to place the card into

stray warren
#

Oh, that makes sense. How would I tell it to create a specific modded joker by its name or slug?

frosty dock
#

I think there's another argument to create_card that lets you specify a key

stray warren
#

Ok, I see those spots under Riff-raff with the key_append: 'rif', but where does it get that key from?

#

I guess my question is, if I were to create my own key, where would I go to create it so that I can specify it in this function call?

frosty dock
#

key_append is an RNG thing

stray warren
#

Ok, so is forced_key just the slug of my joker? So since my slug is rooster_joker would it be j_rooster_joker or the former? Or something else lol

frosty dock
#

yep, it would be j_rooster_joker

stray warren
#

Alright, let me give that a spin

#

Sweet, it works, thanks!

#

I'm still new to this, and wrapping my head around the codebase is tough 😆 So I appreciate it a lot

long ruin
#

Okay so I read all the things and I have questions, what version do you use (smod 0.9.8 or the 1.0) and how did you do this (if you can give me the whole code it will surely help me a lot )

stray warren
#

Me? I am on 0.9.8. Here's the calculate_joker function that I modified:

local calculate_joker_ref = Card.calculate_joker
function Card:calculate_joker(context)
    local ret = calculate_joker_ref(self, context)

    if self.ability.set == "Joker" and not self.debuff then
        -- If selling "Egg", checks if its sell_value is 50 or higher
        -- If it is, creates Rooster Joker
        if context.selling_self then
            if self.ability.name == "Egg" then
                if self.sell_cost >= 50 then
                    local card = create_card('Joker', G.joker, nil, 0, nil, nil, 'j_rooster_joker', nil)

                    card:add_to_deck()
                    G.jokers:emplace(card)
                end
            end
        end
    end

    return ret
end
#

I mostly studied the source code and tried to replicate the way it worked with certain mechanics

zealous glen
zealous glen
stray warren
zealous glen
#

So nevermind

long ruin
#

@zealous glen how did you did your soul joker ?

zealous glen
#

when creating the Joker

#

You just need both textures to be in the same atlas

long ruin
frosty dock
#

.. what

#

a perfectly grammatical sentence, that is

zealous glen
#

Attacked by seagulls I was not

long ruin
#

list steamodded the pass argument, to you need ?

#

?

frosty dock
#

modded argument you need steam list, the pass to ?

long ruin
#

to pass the argument you need to steam the modded list ?

#

💀 🏯 💀
đŸ«ž ⛩ đŸ«·

#

(what is love.toml btw)

frosty dock
#

there's lovely.toml, which contains information for patches

#

i.e. changing or inserting code to the game source

long ruin
#

he said love doesnt exist 😭

#

yeah it was lovely.toml

mellow sable
#

uh

#

maybe don't retrieve the sprite every frame if you're doing that?

random sleet
#

me when i make a new Sprite object every frame

frosty dock
#

ofc it's possible by just using a hook

#

there's no api method for it as of yet

#

that, I'd have to implement

#

until I do that, you can just modify Card.draw

oblique gust
#

checked out 1.0.0 a bit. im seeing tons of require('lovely')s but where is the lovely tho. is it referring to the version.dll or a specific lua file? im not getting any crash just out of curiosity

frosty dock
#
local card_draw_ref = Card.draw
function Card:draw(whatever)
  -- code to run before the function
  card_draw_ref(self, whatever)
  -- code to run after the function
end
frosty dock
oblique gust
#

oh ok got it

frosty dock
#

omg

austere schooner
zealous glen
#

@austere schooner it’s missing the assets but you can just create whatever. The code is a bit redundant at a times since I was just starting out

austere schooner
#

👍

zealous glen
#

You don’t need to check the name of the Joker, etc.

austere schooner
#

thamk u

#

oh this is 0.9.8 code

ancient finch
#

Does anyone have a template to help mod in jokers?

frosty dock
#

what steamodded version?

ancient finch
#

0.9.8

ancient finch
#

Thank you

ancient finch
#

Thank you

zealous glen
#

I still don’t think you should need to modify draw

#

I’d start with set_ability then copying that to calculate_joker to make it work every round

oblique gust
#

is there any doc available for localizing in game texts in 1.0.0?

#

like adding support for multiple languages

frosty dock
#

in place of any loc_txt object, you can put a table that's indexed by locale

#
loc_txt = {
  ['en-us'] = {
    name = '',
    text = {''},
  },
  ['fr'] = { ... },
  -- etc...
},
wintry solar
#

How are you drawing the floating sprite?

zealous glen
#

Again, just define set_ability for your Joker

#

Configure a soul sprite that’s just the Joker itself to start with

#

Then inside set_ability change the atlas and redraw it

#

You can also change the size and position (within the atlas)

#

Well, you probably want to change the scale transform rather than the scale

#

What part can’t you follow

wintry solar
#

I mean the actual image, are you grabbing it from the main atlas and resizing it?

zealous glen
#

For changing the atlas I recommend looking at Sprite:reset

#

Look at the Steamodded wiki

wintry solar
#

And where do you draw the shader?

zealous glen
#

Wherever you define calculate_joker, there you should be able to define set_ability

wintry solar
#

Is that before you resize the sprite?

zealous glen
#

When a card is created

#

As I said

#

When creating the Joker, add the variable that tells it to create a soul sprite

#

Then define set_ability to overwrite the soul sprite atlas and its size

#

You can refer to Sprite:reset as a reference

zealous glen
#

You don’t need to change the sprite every frame, just occasionally

oblique gust
zealous glen
#

What do you want the Joker to do?

#

What am I telling you to do with set_ability?

frosty dock
oblique gust
zealous glen
#

I’m telling you how to change the soul sprite when the Joker is created

zealous glen
#

What part of programming the Joker to be created with a soul sprite doesn’t make sense?

#

The Steamodded wiki should list the soul_pos parameter or whatever 1.0 uses to define soul sprites

#

Again

  1. Program the Joker to be created with a soul sprite;
  2. Overwrite the soul sprite texture when it’s loaded;
  3. Overwrite the soul sprite texture whenever it’s calculated (as a function of context).
wintry solar
#

I think you’ll have to hook into draw regardless because you need to scale the sprite down right?

zealous glen
#

Again it should be on the wiki

#

It’s there

#

It’s clearer in the 0.9.8 wiki, but you can find it in 5. SMODS Center

#

Look at API methods

#

Or ctrl+F

zealous glen
frosty dock
#

soul_pos is literally not in there

zealous glen
frosty dock
#

should be under optional params

#

ok nvm

zealous glen
#

It’s just an API function you can define

#

Like calculate_joker

#

Or I guess it’s just calculate now

#

Well, now you know how to use it, you just define what you actually want it to do

#

Again, look at Sprite:reset

#

Yes. Importantly, it shows you how to change the atlas

#

That’s where step 3 comes in

#

Whatever you do in step 2 you also do in step 3

#

If you want the Joker to appear in the shop while showing a sprite, you can add that in set_ability, otherwise just add a transparent texture for now

#

I suggest adding a copy of the Joker’s own texture so you can see something happening

#

After all, you’ll want to do this again anyways

#

Set its position so it’s redrawn

ancient finch
#

What does "atlas" mean?

zealous glen
#

Which Joker

#

I think you changed the base Joker instead of changing the soul sprite

#

What’s your code

#

Then why are you complaining it doesn’t work if you don’t know that

oblique gust
#

just tried the new loc feature. things are going nicely. but i'll still wish for a separate lang file (which modders can obviously choose to do so but most of em havent). gotta say, now translating a mod became 3x more exhausting but at least i dont have to overwrite the english texts and pray for no crash on startup

zealous glen
#

It’s written inside the sprite definition.

#

Pretty much

#

You can also change the size of the sprite

#

I mean that’s because you set the atlas wrong

#

There's probably better ways to do this but this is just the proof of concept

#

floating_sprite is vanilla code

#

oh you probably didn't define a soul sprite

#

to create the sprite

#

oh wait I misread

#

in 0.9.8 you just pass it a soul_pos

hidden cargo
#

what UI library is balatro using, is there any documentation or tutorial on it

zealous glen
#

Aure said it was in optional params

zealous glen
ancient finch
#

Whenever I try and run this code I get "tried to index a nil value", and I have no idea what's causing it. I'm using the blank template, and this is the bit of code it doesn't like, specifically the line I marked

function SMODS.INIT.BlankJokerTemplate()
   --localization for the info queue key  
   G.localization.descriptions.Other["your_key"] = {
       name = "Example", --tooltip name
       text = {
           "TEXT L1",--tooltip text.        
           "TEXT L2",--you can add as many lines as you want
           "TEXT L3" --more than 5 lines look odd
       }
   }
   init_localization()

   --Create and register jokers
   for k, v in pairs(jokers) do --for every object in 'jokers'
       local joker = SMODS.Joker:new(v.name, k, v.config, v.pos, { name = v.name, text = v.text }, v.rarity, v.cost, v.unlocked, v.discovered, v.blueprint_compat, v.eternal_compat, v.atlas)
       joker:register()
       
       if not v.atlas then --if atlas=nil then use single sprites. In this case you have to save your sprite as slug.png (for example j_examplejoker.png)
           SMODS.Sprite:new("j_"..k, SMODS.findModByID("boltExtension-main").path, "j_"..k..".png", 71, 95, "asset_atli"):register()       [THIS LINE HAS ISSUES]
       end

       --add jokers calculate function:
       SMODS.Jokers[joker.slug].calculate=v.calculate
       --add jokers loc_def:
       SMODS.Jokers[joker.slug].loc_def=v.loc_def
       --if tooltip is present, add jokers tooltip
       if(v.tooltip ~= nil) then
           SMODS.Jokers[joker.slug].tooltip=v.tooltip
       end
   end
   --Create sprite atlas
   SMODS.Sprite:new("youratlasname", SMODS.findModByID("boltExtension-main").path, "example.png", 71, 95, "asset_atli"):register()
end
frosty dock
zealous glen
#

But I think you if you manually define a soul_pos at the right time, the game should do the work for you

ancient finch
frosty dock
ancient finch
#

Ah, no it isn't

zealous glen
zealous glen
frosty dock
#

you didn't have to ping me for that

zealous glen
#

my bad

frosty dock
#

yeah soul_pos is valid, I just forgot to add it to docs

zealous glen
#

the game should handle it, not SMODS afaik

#

how did you do it

frosty dock
#

pro tip, "doesn't work" is never specific enough

zealous glen
#

where

frosty dock
#

you don't even have your own atlas though?

ancient finch
#

How does the badge colour work?

#

What scale does it use?

frosty dock
#

like all that will do is take the upper leftmost sprite in the Joker atlas (Jimbo) and place it on top of itself

zealous glen
frosty dock
#

it's a hex code

ancient finch
#

I tried hex but it stayed black

slow ocean
#

Oh, I think I've had this issue even with 0.9.8

frosty dock
#

show

zealous glen
slow ocean
#

You need to make sure you're actually defining the soul_pos at some point

zealous glen
#

That's how Balatrostuck does it

slow ocean
#

sorry i just woke up ungrogging myself

zealous glen
slow ocean
#

when i was trying to do soul_pos shenanigans back when soul_pos just got updated to work i had to tweak how i declared my jokers

#

now this is for 0.9.8, so im not sure how much of this is accurate but

#

this was my general function to initialize variables

zealous glen
#

For mine I haven't had any issues in 0.9.8

#

I just pass soul_pos and it works

ancient finch
#

I removed the # and tried FFFFFF and it was still black

slow ocean
#
local function init_joker(joker, no_sprite)
    no_sprite = no_sprite or false

    local joker = SMODS.Joker:new(
        joker.ability_name,
        joker.slug,
        joker.ability,
        { x = 0, y = 0 },
        joker.loc,
        joker.rarity,
        joker.cost,
        joker.unlocked,
        joker.discovered,
        joker.blueprint_compat,
        joker.eternal_compat,
        joker.effect,
        joker.atlas,
        joker.soul_pos // important part here
    )
    joker:register()
    if not no_sprite then
        local sprite = SMODS.Sprite:new(
            joker.slug,
            SMODS.findModByID("JankJonklersMod").path,
            joker.slug .. ".png",
            71,
            95,
            "asset_atli"
        )
        sprite:register()
    end
end```
frosty dock
cosmic kernel
#

Hellooo ! Does anyone have a premium freepik account by any chance? I have some questions!

frosty dock
ancient finch
#

This is how its written

--- BADGE_COLOR: BBBBBB
slow ocean
#

oh i figured its different now, point was that i had to add in the field for soul_pos

ancient finch
#

This is what the guide says

slow ocean
#

so id imagine maybe trying doing the 1.0 table equivalent of that of making sure the soul_pos is mentioned? shrug

#

what version are you on?

frosty dock
#

try BADGE_COLOUR

slow ocean
#

oh lmao

frosty dock
#

if so that's on me, either is supposed to work

slow ocean
#

its because its color yeah

zealous glen
#

The Bri'ish attack again

ancient finch
#

Ohhh

#

I'm british, I went with the american spelling bc its more common 😭

slow ocean
#

consumables vs consumeables moment

frosty dock
#

maybe I just don't quite get lua patterns, idk

#

nope, color works fine on my end

slow ocean
frosty dock
#

with the exact line, too

zealous glen
#

Testing a background. I think unless I add stuff to the side it won't be very visible, so I shouldn't try too hard

ancient finch
#

What does this section of the template do?

--localization for the info queue key  
   G.localization.descriptions.Other["your_key"] = {
       name = "Example", --tooltip name
       text = {
           "TEXT L1",--tooltip text.        
           "TEXT L2",--you can add as many lines as you want
           "TEXT L3" --more than 5 lines look odd
       }
   }
frosty dock
#

defines the text for a tooltip

ancient finch
#

Where does the tooltip appear, I mean, sorry

frosty dock
#

when you hover over a joker/consumable/whatever thing you put it on

ancient finch
#

Oh, so its not a necessary thing?

frosty dock
#

no, completely optional

ancient finch
#

Ah cool

#

Thanks for all this help

#

I'm gonna keep cracking at this, try adding a more complicated joker

#

How do you make a joker that doesn't add flat chips/mult, and is triggered by scoring cards akin to fibonacci or the sin jokers?

frosty dock
#

use context.individual in the joker's calculate function

ancient finch
#

Is there documentation for this, so I don't need to keep badgering people?

frosty dock
#

well it'd have been nice to have the complete definition then...

#

ok, what is that atlas then?

#

yeah, the blankjoker one

ancient finch
#

How does context.individual work?

frosty dock
#

it triggers for each scoring card, which you get passed as context.other_card

ancient finch
#

How do you check enhancements on scoring cards? Specifically wild. Would it be context.other_card.wild?

frosty dock
#

there's plenty examples for this in vanilla code

#

context.other_card.ability.name == 'Wild Card' something like this

ancient finch
#

Ah thanks

#

I have absolutely no idea what I'm doing

ancient finch
#

I'm having an issue with a custom joker. It's supposed to add 50 chips and 20 mult unconditionally, but config = {extra={chips=50, mult=20}} doesn't seem to work

zealous glen
ancient finch
#

Ah right, no worries

zealous glen
#

The game does a small number of automatic effects, but anything inside extra isn't it AFAIK

ancient finch
#

Would this work then?

calculate = function(self,context)
  if then
    return {
      chip_mod = 50,
      mult_mod = 20,
    }
  end
end,
fallen tendon
#

You still need to do the effects for adding chips and mult

ancient finch
#

I looked at stuntman, which adds unconditional chips

fallen tendon
#

Like the cosmetic dffects

ancient finch
#

Oh wait really?

fallen tendon
#

Forget the exact lines that do it tho

zealous glen
#

You need to use context to make it work at the right time

ancient finch
#

What's the context for end of hand scoring?

frosty dock
#

context.after

zealous glen
#

But I think you'll specifically want context.after and context.individual and cardarea == G.jokers

#

Not sure

ancient finch
#

context.after triggers once a hand scores, not once the cards finish scoring and the jokers start scoring

zealous glen
ancient finch
#

True, sorry for the bad clarification

zealous glen
#

maybe not context.before and not context.after and context.individual and cardarea == G.jokers

frosty dock
#

no

#

context.joker_main

#

stop making things more complicated

ancient finch
#

Is it possible to make the joker trigger twice, once to add chips, and then once again to add the mult?

#

This is what I have so far

calculate = function(self,context)
if context.joker_main then
  return {
    message = localize{type='variable',key='a_chips',vars={50}},
    chip_mod = 50,
  },
  return {
    message = localize{type='variable',key='a_mult',vars={20}},
    mult_mod = 20,
  }
 end
end,
frosty dock
#

replace the first return with SMODS.eval_this

#

Also on latest main, calculate arguments are self, card, context where self is the center object and card is the Card

ancient finch
#

What does SMODS.eval_this do?

ancient finch
#

Also, "eval_this" just crashed the game

ancient finch
#

It was working fine without card, what does that do?

frosty dock
ancient finch
#

What do I replace the 3 dots with?

frosty dock
ancient finch
#

Ah right

frosty dock
#

I'm lazy, yk

ancient finch
#

Wait, so this?

zealous glen
frosty dock
ancient finch
frosty dock
#

it's just that you can only return once, so if you need multiple status texts, you can use that function

ancient finch
#

Crashed on custom new game with the joker

#

attempt to index local 'context' (a nil value)

#

Swapped card and context around in order so it reads (self,context,card)
Lasted longer, crashed as soon as hand was played; attempt to call field 'eval_this' (a nil value)

sharp lotus
#

is there a guide for how to set this up

#

like a mod development environment

frosty dock
ancient finch
#

That's what fits on screen

frosty dock
frosty dock
# ancient finch

oh wait you had me thinking you were on 1.0 by the way that function was declared

ancient finch
#

No, you said 1.0.0 wasn't out yet didn't you?

#

I must've misunderstood

#

No, I'm on 0.9.8

frosty dock
#

its not released, but it's accessible

#

plenty of people are porting their mods to 1.0.0 already, it's easy to get confused

#

I should've asked haha

#

self, context is correct for 0.9.8, and there is no SMODS.eval_this

ancient finch
#

Ah

#

So I can't have a joker trigger multiple times with different text?

frosty dock
#

this is the function as implemented in 1.0, you can just paste it into your mod and use that

#

or use card_eval_status_text directly, but that's a bit annoying to deal with

ancient finch
#

I'll try eval_this and see if it works

#

Does it just get whacked at the top of the file?

frosty dock
#

yeah, wherever in global scope will do

ancient finch
#

Cool

#

Crashed upon playing a hand

#

Does the function need to be defined as SMODS.eval_this?

zealous glen
#

It can be defines as eval_this if you don't try to call it as SMODS.eval_this

#

Though I wonder if one mod could overwrite another mod's functions when defined in the global scope like that

frosty dock
#

it could

ancient finch
#

yaaaay

frosty dock
#

in that case local function eval_this would be safer

ancient finch
frosty dock
#

calculate arguments on 0.9.8 are self, context

#

technically card, context since self isn't a center but a Card

#

but there's no third argument

zealous glen
# frosty dock it could

It doesn't affect me much since I'd prefer to define everything inside other files then require then, which by default should have them defined locally somewhere, but it does reinforce me wanting to make people create their own tables for their own mods

ancient finch
#

I don't even know where its referencing card

frosty dock
ancient finch
#

Ok cheers

#

What about inside eval_this?

#

There's _card that appears a few times

zealous glen
#

but it's an argument

ancient finch
#

But I assume as a thing inside a function it doesn't matter

zealous glen
#

as an argument name it doesn't matter

ancient finch
#

IT HECKIN WORKS

#

THANKYOUTHANKYOUTHANKYOUTHANKYOU

#

These are the 2 simplest jokers as part of my "TTRPG classes as jokers" list. Barbarian, Paladin, Rogue, Wizard, etc.

frosty dock
#

the file itself ig

ancient finch
#

Oh, bizarre thing. When I declare --- BADGE_COLOUR: XXXXXX, the shape of the badge is rectangular, not rounded on the ends like the rarity tags, or tags for other mods

frosty dock
#

I think that happens when your mod name is too long

ancient finch
#

Oh right lmao

#

"Bolt's Extension" would probably do that

frosty dock
#

you can make it display a shorter one there with --- DISPLAY_NAME:

#

I just wanna see what's in it

#

the file is just that one sprite?

#

ok i don't see what you're trying to achieve with soul_pos then, it would just be that sprite floating on top of itself

zealous glen
#

That was my idea

#

Then override the sprite

mellow sable
#

Quarter Joker

#

Actually this is 5/4 Joker

wintry solar
#

I don’t think you need to scale the height and width

#

Let me grab how I’m doing it in edition api

stray warren
#

How do y'all scale your 1x textures up to 2x without it getting blurry? Mine are always blurry

#

Oof

wintry solar
#

most image software can upscale without making it blurry

frosty dock
#

just use nearest neighbor scaling

#

just about any image software should support that

stray warren
#

I was using GIMP and it was blurry. What software do you recommend?

#

Neighbor scaling? I'll look into it

wintry solar
#

self.children.floating_sprite:draw_shader(v.shader, nil, nil, nil, self.children.center, scale_mod, rotate_mod) this at least draws the shader directly on the floating sprite, I'm not sure what applying the hologram shader would look like but making a custom one is possible

#

I use GIMP hold on

#

just replace v.shader with "hologram" iirc

wintry solar
stray warren
#

Oh, thank you! I'm sure that has been on this whole time

wintry solar
#

it defaults to cubic

#

or at least mine does

#

what do you need to hide it for?

stray warren
#

Also I'm just curious, why does it have 2 different texture sizes anyway?

zealous glen
#

I thinkit should have a default, but I'd either use a transparent sprite or just hide it in another way

wintry solar
#

yeah a transparent would work nicely

zealous glen
wintry solar
#

Have you tried the shader? Does it apply properly or is it still too big like earlier?

#

hmmm I wonder if you need to define the things it's being passed

#

I know for a fact that what I have works

#

I mean it's slightly different because it's injected into card.lua but sure

#
if v.apply_to_float then
  if self.edition[v.key:sub(3)] then
    self.children.floating_sprite:draw_shader(v.shader, nil, nil, nil, self.children.center, scale_mod, rotate_mod)
  end
end
#
local scale_mod = 0.07 + 0.02*math.sin(1.8*G.TIMERS.REAL) + 0.00*math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
local rotate_mod = 0.05*math.sin(1.219*G.TIMERS.REAL) + 0.00*math.sin((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
#

these are the modifiers

ancient finch
#

What makes jokers shake when they trigger? For example in my case, Onyx Agate shakes when it grants +7 mult to a card, but my custom joker doesn't when it grants mult to the same card

#

I can't find what causes that

frosty dock
#

juice_up

ancient finch
#

Where do I put that?

#

Inside the return?

royal ridge
#

usually card:juice_up()

ancient finch
#

But where do I put it in the code?

frosty dock
#

keybind for reloading mods

ancient finch
#

Where do I call it though? Inside the calculate, or in the main area?

frosty dock
#

what key should this go on

zealous glen
frosty dock
#

rn it's F

zealous glen
#

To pay respects

frosty dock
#

well it's hold F

ancient finch
#

Is it a known thing that jokers do the juice_up animation while SteamModded is installed?

zealous glen
ancient finch
zealous glen
frosty dock
#

they're supposed to, only reason i could think of why they wouldn't is you're not passing the card, or you're using talisman to disable animations

ancient finch
#

No, it does it without my mod installed

zealous glen
frosty dock
#

💀

#

Perhaps ᑎ is better

zealous glen
#

what about the ~^ key?

frosty dock
#

I prefer the ../ key

#

how about no

#

hold n, press o

remote coral
#

≈

frosty dock
#

i might just put it on M

#

because yk

#

mods

#

but also

#

m

#

cryptid reference

#

the combination is holding that key

ancient finch
frosty dock
#

like it is for restarting a run

ancient finch
frosty dock
carmine yacht
#

perhaps `?

frosty dock
#

the card did indeed shake

ancient finch
#

No, that's just my shitty laptop

zealous glen
ancient finch
#

OBS barely runs on my laptop

zealous glen
#

kinda but keep in mind this doesn't preserve order

frosty dock
#

one thing to keep in mind is that util variable will be global

#

you might wanna give it a more unique name

zealous glen
#

I have this

#

The user probably does

#

You can do it the way I did

#

ipairs iterates only over integer keys from 1 to however many there are sequentially

#

(AFAIK on the sequential part)

frosty dock
#

context.selling_self

#

alpha 0530g is up

#

you can now hold M to reload mods, or hold Q to restart the game

#

context.blueprint tells you that this effect is initialized by an effect of a blueprint-like card

#

you might want certain effects not to trigger when this is the case, like the scaling part of any scaling joker

wintry solar
#

I'd start by trying not scaling the height and width first, I'd imagine that control s grabbing the soul image from the atlas

waxen turtle
#

If I'm starting a new mod now should I be using main branch (1.0?) or 0.9.8?

frosty dock
#

scale_x isn't a thing right?

#

yeah

#

idk then

wintry solar
#

in terms of the joker loading, is it possible to do

for k,v in ipairs(CONFIG) do
  if v then 
    load CONFIG[k]
  end
end
#

?

#

you could try just hardcoding them as something different to test

mellow sable
#

Take a look at how Jokers like Wee Joker do this