#💻・modding-dev

1 messages · Page 29 of 1

mellow sable
#

There's like multiple different areas

#
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

# Wee Fibonacci rendering
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'if center.name == "Wee Joker" and (center.discovered or self.bypass_discovery_center) then'
position = "before"
payload = '''
if center.name == "cry-Wee Fibonacci" and (center.discovered or self.bypass_discovery_center) then 
    H = H*0.7
    W = W*0.7
    self.T.h = H
    self.T.w = W
end
'''
match_indent = true

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'elseif self.config.center.name == "Wee Joker" then'
position = "before"
payload = '''
elseif self.config.center.name == "cry-Wee Fibonacci" then 
    self.T.h = H*scale*0.7*scale
    self.T.w = W*scale*0.7*scale
'''
match_indent = true
#

This is how I do it for wee fibonacci in Cryptid, although using soul_pos might make things trickier

#

there's also this scale factor that goes into the shader

# Draw midground layer
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.config.center.soul_pos and (self.config.center.discovered or self.bypass_discovery_center) then"
position = "after"
payload = '''
if self.config.center.soul_pos and self.config.center.soul_pos.extra and (self.config.center.discovered or self.bypass_discovery_center) then
    local scale_mod = 0.07
    local rotate_mod = 0
    self.children.floating_sprite2:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1,nil, 0.6)
    self.children.floating_sprite2:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod) 
end
'''
match_indent = true
#

This is how I draw one of the layers for Cryptid's Exotic jokers, and it doesn't move or rotate here but it's a little bigger

#

you might be able to get away with this and just change scale_mod to like -0.4 or something (along with the whole equation)

fallen tendon
#

this is getting super frustrating, im trying to make the amount of uses on a consumable refresh when you beat the boss blind, but for some reason it isnt triggering inside the calculate function. i dont know where else to put it, and i dont really know any other context that could work

frosty dock
#

yeah calculate only works for context.joker_main on consumables, unfortunately

#

you'd probably have to add those calculate calls yourself

fallen tendon
charred needle
#

yo, how do I check for what card is currently being scored, because other_card is nil ignore the spamton stuff its because the card has a section that looks like his sprite

frosty dock
frosty dock
#

sorry we're closed

#

I was about to head to bed

#

I don't

#

now gn

fallen tendon
#

im still taking a very large amount of my code from the base game

#

maybe i could just change my idea and have the gears not refresh their uses

zealous glen
#

What

zealous glen
charred needle
wintry solar
#

14

#

iirc

charred needle
wintry solar
#

Anyone know why context.poker_hands["Pair"] only contains the 3oak in a full house?

zealous glen
#

Presumably because the 3OAK contains a Pair. Maybe it’s not an exhaustive search?

#

or maybe because aure changed how it’s calculated, IIRC?

wintry solar
#

it finds both in a two pair though

charred needle
#

is there a way to get the cards in the hand and score them AND the cards played?

zealous glen
#

Isn’t that Splash

charred needle
#

What I was thinking was if you play a royal flush, the cards played score twice, and your hand (the cards at the bottom of the screen you can play from) get scored before they all get destroyed

zealous glen
#

I’d probably check for a royal flush then add a variable that triggers a repetition while also setting an internal variable that makes cards in hand score, and then destroy them, and reset the internal variable afterwards

#

Maybe a hook/lovely patch to score cards makes more sense than doing it inside calculate

charred needle
#

Final Qs before I end the project work for the day.

  1. How do I display two messages if the card gives both chips AND mult, since this code (attached) doesnt show two message prompts

  2. What do I call to check if certain jokers are in the joker slot?

zealous glen
#

If 1.0, use eval_this

#

Otherwise, either do it manually or use…

#

eval_this

charred needle
#

So in return, call eval_this(self, mult, chips)?

sturdy glen
#

my mod keeps crashing and I don't know why... I took bits and pieces from another mod and the games code :P
the steamodded wiki was confusing to me so I might have skipped over something important on accident

charred needle
#

So, my joker seemingly runs the upgrade under every card, and sometimes multiple times per card (it should only run once on it being scored, and the only triggering cards should be a 3,2, and an Ace.

    if context.individual then
        if context.other_card:get_id() == 2 and not context.blueprint then
         
        self.ability.extra.chips = self.ability.extra.chips + 2
        self.ability.extra.mult = self.ability.extra.mult + 2
        print("upgraded by 2")
        print(self.ability.extra.chips)

        return {
            extra = {focus = self, message = localize('k_upgrade_ex')},
            card = self,
            colour = G.C.CHIPS ,
            extra = {focus = self, message = localize('k_upgrade_ex')},
            card = self,
            colour = G.C.MULT
    } 
        elseif context.other_card:get_id() == 3 and not context.blueprint then
        
        self.ability.extra.chips = self.ability.extra.chips + 3
        self.ability.extra.mult = self.ability.extra.mult + 3
        print("upgraded by 3")
        print(self.ability.extra.chips)

        return {
            extra = {focus = self, message = localize('k_upgrade_ex')},
            card = self,
            colour = G.C.CHIPS, 
    }   
    elseif  context.other_card:get_id() == 14 and not context.blueprint then
        
        self.ability.extra.chips = self.ability.extra.chips + 1
        self.ability.extra.mult = self.ability.extra.mult + 1
        print("upgraded by 1")
        print(self.ability.extra.chips)

        return {
            extra = {focus = self, message = localize('k_upgrade_ex')},
            card = self,
            colour = G.C.CHIPS, 
    }   

end
end
    if self.ability.name == 'Destruction' and context.joker_main then
    salesman = math.random(1997)
    return {
        message = localize{type='variable', key='a_chips', vars={self.ability.extra.chips}},
        chip_mod = self.ability.extra.chips,
        mult_mod = self.ability.extra.mult,
        card = self,
        colour = G.C.CHIPS,
    }
end
end
#

sorry about the wall of text

#

any clue where I effed up in order to have it run multiple times and not even check for the card numbers?

random sleet
#

context.individual and not context.repetition for the former point

hallow forge
#

anyone know why this doesn't work, im trying to retrigger cards. (0.9.8) ```SMODS.Jokers.j_jackpot.calculate = function(self, context)
if not self.debuff and context.individual and (context.cardarea == G.play) then
if true then
return {
message = localize('k_again_ex'),
repetitions = self.ability.extra.times,
card = self
}
end
end

end```
random sleet
#

you should be checking context.repetition

stray warren
#

How do I make the text inside the red border white? This makes it black

random sleet
#

no space within {}

stray warren
#

Oh, like after the comma?

random sleet
#

mhm

#

"C" not " C"

stray warren
#

Understood, thanks

hallow forge
fallen tendon
#

does steamodded support custom sfx

fallen tendon
#

that happens a lot

stray warren
#

How do I make it so my joker will never appear in the shop? Like Cavendish pre-Gros Michel extinction

#

I can't find anything about it under the Card class in the Source Code

mellow sable
#

What’s the condition you want it to satisfy for it to appear?

#

Or do you just want it to never appear

#

I think it’s hidden = true or something, but you should check the create_card() function

random sleet
#

cavendish checks a yes_pool_flag

#

conversely, gros michel checks a no_pool_flag

stray warren
#

Yeah, I want it to never appear. I have a function that makes it appear upon selling "Egg"

fallen tendon
#

does steamodded 1.0.0 have custom sfx compatibility?

mellow sable
#

there's sound API I believe, haven't messed with it though

charred needle
#

the "2" card is card id "2", presumably, right?

mellow sable
#

ye

#

I think

wintry solar
mellow sable
#

better to do syntax like this though (at least in Steamodded 1.0)

charred needle
#

oh im still on steamodded 0.9.8 💀

mellow sable
#

idk what the equivalent is but there's probably something like that

charred needle
#

i was doing

#

whith that inside a if context.indivdual and not context.repetition satement

#

but any card seems to run that code

stray warren
#

That's under SMODS.injectJokers()

#

And actually, when I change the yes_pool_flag, will that then make it possible to show up in the shop? Because that's not what I want to happen

charred needle
#

updated steamodded to 1.0, but now my mod doesnt load saying its for 0.9.8, how do i make it 1.0 compatible?

wintry solar
#

oh you want it never in the shop?

stray warren
#

yeah

wintry solar
#
G.GAME.pool_flags.sphero_extinct = false
G.P_CENTERS['j_lea']['yes_pool_flag'] = 'sphero_extinct'
``` something similar to this should stop it from appearing in the shop
sturdy glen
#

ok so the card does work and show up in collection but now it crashes when i start the deck with it as a starter item?

#

its the game code but swapped clubs spades and black suit for diamonds hearts and red suit

charred needle
mellow sable
#

no

waxen turtle
#

Anyone else not able to run the game with 1.0? When I use the 0.9.8 tag the game launches fine, but when I switch to main branch I get this error

stray warren
charred needle
#

hmm. What seems to be happening is other_card in the way I set up checks the WHOLE HAND, not just played cards

#

heres my current code if that helps

wintry solar
charred needle
#

If a two is scored, increment the jokers chips and mult by two. If a three is scored, increment the jokers chips and mult by three. If ace, increment by one

#

but what happens is it checks the whole hand

#

e.g, the played cards and the cards in your hand (at the bottom of the screen)

#

honestly now that im thinking about that, the skill seems more "rare" or "legendary" than uncommon

wintry solar
#

what do you mean, it checks the whole hand?

charred needle
mellow sable
#

trying to override Card.use_consumable but nothing is changing

wintry solar
#

do you want it to look over the hand?

mellow sable
#

it works fine when I use a lovely patch actually, nvm; still weird though

charred needle
wintry solar
#

can you send me the calculate code in DM real quick?

sturdy glen
#

how could I make my joker do what blackboard does but for hearts and diamonds instead?

worldly sapphire
#

search for blackboard in card.lua

sturdy glen
#

i did do that but when its in my code edited to the other suits it just crashes as soon as i start a run

fallen tendon
#

gotta love it when i follow the sound api drections and like the most basic elementary function to make it all work fails

#

i dont know what doing register_sound_global() is not causing this function to happen

worldly sapphire
#

i think that there is no red_suits local in game

#

could you try with black_suits?

sturdy glen
#

sure, one sec

worldly sapphire
#

i never messed with blackboard's code so idk how to mess with it

sturdy glen
#

ok didnt crash this time

#

and there it goes (clicked start blind and crashed)

worldly sapphire
#

oh

#

now i noticed

#

there is no context for the joker

#

try putting if context.cardarea == G.jokers then before the first if

sturdy glen
worldly sapphire
#

yeah

sturdy glen
#

ok so that helped, it went until i played the first hand then crashed again.

worldly sapphire
#

did you set the extra on the joker config?

#

just to be sure

sturdy glen
#

oh shoot no, thanks for asking that lol

worldly sapphire
#

that's probably why

#

lmao

#

sometimes we can forget a thing that is so simple

#

and, idk if the extra gonna get rid of the crash message

sturdy glen
worldly sapphire
#

no problem, i tried doing my best, i'm still learning

charred needle
#

I know theres {C:attention}, but is there a thing to make it small? and is there a way to change the joker artwork while the joker is in the joker slots?

mellow sable
#

You can do like {C:attention,s:0.8}

#

and you'd need to change the pos values to dynamically change the joker artowrk

charred needle
#

thonk so if I were to put in in a spritesheet, with one right next to the other (transparent boarder intact), how would I change the POS

mellow sable
#

you could probably just manually modify self.pos.x or self.pos.y to match what you want in the spritesheet

#

not 100% sure if this would work since I haven't done something like this but it would make sense

charred needle
#

Honestly seems like a lot of work to implement a silly joke because of the way I drew a pattern looked like spamton

random sleet
#

if you change the center's pos itll change it for every instance of that card

#

you'll need to change card.children.center

#

card.children.center:set_sprite_pos({x=#, y=#}) i think

#

card.children contains all the sprites for that card, wherein center is the one you'll be concerned with for pretty much everything except playing cards

#

floating_sprite is the soul_pos, and front has the playing card suit/rank sprite

#

back is what's shown when the card is facedown, typically drawn from your deck back but you can manipulate it if you want

charred needle
#

so it would be


  card.children.center:set_sprite_pos({x=#, y=#)

end

```?
random sleet
#

yea

#

keep in mind that wont keep through save/reload iirc

charred needle
#

kewl, its just a silly easteregg anyway

random sleet
#

fair

charred needle
#

hmm. texture doesnt seem to change.

#

prob because its not being run at all

random sleet
#

i might have the arguments wrong idk, id doublecheck how basegame uses :set_sprite_pos

#

(alas i am afk for ~10 hours)

charred needle
#

thumb_up I just didnt think that the base game had texture changing jokers when conditions were met

random sleet
#

it doesnt, but the :set_sprite_pos function is used for setting up cards

#

you're basically just using a function that normally only gets called once per card

#

i forget if there has to be other stuff than just the pos, been a bit since i set up anything using that function

charred needle
#

alright, new thing. card not defined. heres the temp code to set it every time before I implement the condition

random sleet
#

oh yeah it should be self in that case

#

im used to 1.0 lol

#

(1.0 funcs get self and card, where self is the center object itself and card is the actual card)

#

excuse me x=71????

#

i sincerely doubt you have 71 cards in a horizontal line in your spritesheet, did you mean x=1? sprite pos's already account for the per-card size

charred needle
#

then probably x=1

#

do i need to set the 71 to 142 in order to have it work?

#

answer is no, it works on playing a card

stray warren
#

Is there a way to loop through each registered Joker and embed a message in their description? So if I wanted to display their current sell value in the description, and have it update when the sell value changes, which function should I start at?

#

Well, not loop through. But just somehow embed the sell value in the description on calculate

random sleet
#

sounds like something for generate_card_ui perhaps

#

or the UIBox function that calls it, which i forget the name of

#

the description window is dynamically generated on hovering over the card, the text isnt stored with the card

stray warren
#

Oh ok, that's one thing I was wondering about

#

So could I do something within the hover function? Is the hover function stored in the Card class?

#

I'm not at my computer right now or I would check

zealous glen
#

You can hook generate_card_ui or generate_UIBox_ability_table

#

I myself did the latter to display Hiker-like extra Chips and Mult on Jokers

stray warren
#

Is a hook the thing where you get the reference and then overwrite the function?

zealous glen
#

yes

stray warren
#

Could you show me the code that you did inside your function? Just so I have a reference?

random sleet
#

AtumunMood924

zealous glen
#

I wonder who that is

random sleet
#

oh for the subtitle stuff

#

i was actually like "tf is this based on of mine"

zealous glen
#

It was also my first time messing with the tooltip so I learned how to do it from your code

#

Also arachneii's a bit

#

But I'm changing the tooltip after it's created which I find easier

#

Well, after the table has been created

mellow crag
stray warren
#
local generate_UIBox_ability_table_ref = Card.generate_UIBox_ability_table
function Card:generate_UIBox_ability_table()
    local generate_UIBox_ability_table_val = generate_UIBox_ability_table_ref(self)
    
    local key = self.config.center.key


    if self.ability and self.ability.set and self.ability.set == 'Joker' and G.STATES ~= G.STATES.MENU and G.STATES.TUTORIAL and not misc.is_in_your_collection(self) then
        
    end

    main_end = {
        {n=G.UIT.T, config={text = "$", colour = G.C.GOLD, scale = 0.32}},
        {n=G.UIT.t, config={text = self.sell_cost, colour = G.C.GOLD, scale = 0.32}}
    }

end
#

so

random sleet
mellow crag
#

profile

random sleet
#

o

stray warren
random sleet
#

yeah lyman made it for me

#

:3

stray warren
#

I was able to do it by calling generate_card inside, but the loc_vars was erroring out

#

And I'm really not sure how to access loc_vars inside that function

zealous glen
#

As you can see I access the Joker's base Chips and Mult

#

that I added to all Jokers

random sleet
#

i suggest inspecting the anatomy of the original function's return value

zealous glen
#

dissecting jimbo like a frog

random sleet
#

you can print(inspect(...)) to see whats in a table

zealous glen
#

huh and I had my own stolen dump function

random sleet
#

yeah i think smods comes with an inspect implementation? or maybe its just debug stuff left over from thunk

#

its not recursive tho

zealous glen
random sleet
# random sleet this one?

chat are these readable and good, will thac be eternally hated if i ship the mod with these textures, etc

zealous glen
#

I think they’re fine and you can always change them later if you change your mind

#

I think thac will be eternally beloved if you release it

random sleet
#

ah so thatll never happen

#

sick

stray warren
#

But it doesn't appear to be showing up in-game

wintry solar
stray warren
#

What's the context for being in the booster pack screen to choose a card?

random sleet
#

fuck it im gonna make coins purple

vivid eagle
#

how about silver?

ancient finch
#

Where are the descriptions for the vanilla jokers stored?

random sleet
#

localization/en-us.lua

spice scroll
#

ok i know how id do this in the base game, but in the interest of mod compatibility id ideally want to make it check if the hand started out flagged hidden. anyone know how i can do that

ancient finch
#

Anyone know why this happens?

This is the code for the afflicted area

calculate = function(self,context)
  if self.added_to_deck then
    return {         --line 125
      G.hand:change_size(-1),
      G.GAME.round_resets.discards = G.GAME.round_resets.discards - 1,
    }
  end,
  if not self.added_to_deck then
    return {
      G.hand:change_size(1),
      G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1,
    }
  end,
  if context.joker_main then
    return {
      message = localize{type='variable',key='a_mult',vars={50}},
      mult_mod = 50,
    }
  end
end,
#

It says the { is never closed, but it is

spice scroll
#

maybe delete the commas at the end of the } ? just spitballing im not sure

ancient finch
#

Because I don't know how Lua works

#

Removed the commas after end, but no cigar

#

I copied it from stuntman and merry andy basically

#

I might've gotten it wrong though

#

Actually no, I adapted troubadour's -1 hand to -1 discard

#

I looked at stuntman for the hand size

#

It works perfectly if I remove this bit

if self.added_to_deck then
    return {         --line 125
      G.hand:change_size(-1),
      G.GAME.round_resets.discards = G.GAME.round_resets.discards - 1,
    }
  end,
  if not self.added_to_deck then
    return {
      G.hand:change_size(1),
      G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1,
    }
  end
#

But then it doesn't have the full intended effect

#

Again, that was something that Stuntman and Troubadour do. They seem to "permanently" modify your stats when they are bought, and then permanently modify them again when they're sold

#

Well, that's how it looks like

wintry solar
#

It’s not redundant?

#

If it wasn’t there you wouldn’t get the discards back

#

Oh yeah I get what you mean

ancient finch
#

I'm still having the issue of missing bracket but there is a bracket

wintry solar
#

I wonder if removing it means it always triggers though, I’m not sure how the added to deck parts trigger

#

You have a comma after end

ancient finch
#

I removed the return {} function, so its just this now

#

Still not a fan, but a different error

wintry solar
#

You have commas at the end of your lines

#

You don’t need them unless it’s inside a table

ancient finch
#

context.joker_main works when the rest is removed

wintry solar
#

That’s what the error says

ancient finch
#

And I did remove the commas

#

Oh wait, yeah ofc

wintry solar
#

They’re everywhere

ancient finch
#

That was when they were inside a return, and I forgot to remove them

#

Ok, that code above "works" without those commas now

#

However

#

It immediately sets me to 0 discards and 0 hand size

#

After I play a hand

wintry solar
#

It probably triggers for every joker calculate call because you have no contexts

ancient finch
#

Ah good shout

#

Let me check the game code

wintry solar
#

All of it obviously

ancient finch
#

3.199 mil

#

Either you win big, or its a rags to riches play

#

Whats the context trigger for when bought or sold?

wintry solar
#

Check the context stack in card.lua

ancient finch
wintry solar
#

Read through calculate_joker and figure it out

#

That’s where all the contexts are

#

It’ll serve you better in the long run to understand the contexts rather than just ask

#

The only one that’s not there is G.joker_main but that’s just the final else at the end

ancient finch
#

Right, there's about 500 "calculate_joker" bits, I don't know which to read, or what I'm looking for

wintry solar
#

And follow the tree backwards to find the contexts

ancient finch
#

The joker should add +50 mult, -1 discard, -1 hand size, similar to stuntman or troubadour

#

But neither of those jokers have their -hand size in a calculate function I can find

#

And if they do, I copied it word for word already

wintry solar
#

No you need the context

#

Not the actual calculate code

#

Go to where you found that card and examine the if-else tree it’s in

ancient finch
#

Yeah, I found that

#

What does the ease do?

#

I've seen it used for ease_money() or ease_hands_played() or ease_discards()

wintry solar
#

Are you using 1.0 or 0.9.8

ancient finch
#

0.9.8

wintry solar
#

So I think you’ll need another function like calculate called add_to_deck

random sleet
#

1.0 has add_to_deck, idr if 0.9.8 has any such thing

wintry solar
#

Yeah worst case is it doesn’t work

ancient finch
wintry solar
#

Can you show your whole code?

random sleet
#

also the latter half of that should be a remove_from_deck call i think

wintry solar
#

You also don’t need the if

random sleet
#

also im still pretty sure it doesnt exist in 0.9.8

#

and if you're in 0.9.8 then you dont have self on most functions

wintry solar
#

The syntax looks like 1.0 though 🤔

ancient finch
#

I don't know where to find 1.0.0

#

Its "not released, but available" according to Steamo

random sleet
#

yes mod in 1.0.0 join me

wintry solar
#

The most fun is modding in both

random sleet
#

1.0.0 is the current state of the repo

#

you'll use Lovely to load it

wintry solar
#

Making edition api in 1.0 and then some jokers for someone in 0.9.8

#

Best way

ancient finch
#

The latest release is 0.9.8

#

What does that mean

frosty dock
#

there's a green code button at top of the page

ancient finch
#

I don't use git

frosty dock
#

click that and download the zip file

random sleet
#

oh no aure is gonna tell us not to use 1.0.0 because theres more breaking changes coming

frosty dock
#

but it's easier to update with git

frosty dock
random sleet
#

aure the goat

frosty dock
#

kden, do better

ancient finch
#

"tags/1.x.x" is not a commit

#

I copied it letter for letter

#

This

#

I downloaded the zip

#

Steamodded-main

#

What do I do now?

wintry solar
#

Put it in your mods folder instead of 0.9.8

#

Then refactor your code 🙃

ancient finch
ancient finch
#

Same isue

#

Already cleared 0.9.8

#

The code hasn't changed

#

Where is SMODS.INIT?

#

Yeah, something called Deck Creator

#

Ah bugger

#

I'm using it to test my jokers

#

How do I move SMODS.INIT to top level scope?

#

Ah sick

#

Where do I put _RELEASE_MODE = false?

#

In my mod?

#

Same issue again

#

I have my mod

#

Steamodded

#

And lovely

#

It doesn't

#

My main.lua has 388 lines

queen scroll
#

steamodded injects an extra few thousand lines into main.lua if you're still confused

ancient finch
#

Right, so steamodded 1.0 is broken then?

zealous glen
#

Some specific commits might be broken

ancient finch
#

Will reinstalling keep my progress?

frosty dock
#

it might be two conflicting installs

#

you're not looking at the lovely dump then

waxen turtle
frosty dock
#

huh

#

maybe it's just the display?

sturdy glen
#

My mod keeps crashing as soon as I play a hand with the joker. Using base game code but edited for the ability.

#

ok so after some testing, it can detect the hand and if it has a spades or clubs but once it has only diamonds and or hearts it crashes.

fallen tendon
zealous glen
fallen tendon
#

It should just be a_mult or x_mult

zealous glen
zealous glen
#

Well, maybe not easier, but slightly faster on average?

fallen tendon
#

Also the indentation is really weird

#

And i think you could just try to find if theres any black cards and then have it fail instead of trying to see if the amount of red cards matches the total amount of cards then have ot succeed

#

Still great that you are learning though

zealous glen
#

It’s slightly different due to Custom Suits

sturdy glen
#

ty for the help, its still crashing but i think its starting to work out :) I was testing somethings so i couldnt respond earlier.

ancient finch
frosty dock
#

💀 my keyboard had a stroke

#

there's no such thing as an inject function in 0.9.8

#

best to hook into injectSprites probably

#
local inject_ref = SMODS.injectSprites
function SMODS.injectSprites()
  inject_ref()
  -- your code
end
sturdy glen
fallen tendon
#

how exactly does one create a random member of a custom consumable type?

#

and not like injecting it into the tarot or planet pools

#

like creating a new consumable pool

elfin nimbus
#

Aight, it's progress

quiet hamlet
#

don't click links folks

maiden phoenix
#

<@&1133519078540185692>

quiet hamlet
#

ty mods

maiden phoenix
#

Ty 👍

quiet hamlet
#

Now that I'm here, I have a question lol

#

I have a working joker but need some help! My code currently is written to give $7 when Three of a Kind of 7s is played, but ideally I'd like it to give $7 when a played hand contains exactly three 7s, would anyone be able to take a look at this and give me pointers on how to replays the #context.full_hand == 3 line to accomodate that?

#
-- Jackpot
    if config.j_jackpot then
        local jackpot = {
            loc = {
                name = "Jackpot",
                text = {
                    "Earn {C:attention}$7{} if hand contains",
                    "three scoring {C:attention}7s{}"
                }
            },
            ability_name = "Jackpot",
            slug = "jackpot",
            ability = {
                extra = {
                    dollars = 7,
                    poker_hand = "Three of a Kind",
                },
            },
            rarity = 2,
            cost = 7,
            unlocked = true,
            discovered = true,
            blueprint_compat = true,
            eternal_compat = true
        }
        -- Initialize Joker
        init_joker(jackpot)
        -- Set local variables
        function SMODS.Jokers.j_jackpot.loc_def(card)
            return { card.ability.extra.poker_hand }
        end
        -- Calculate
        SMODS.Jokers.j_jackpot.calculate = function(self, context)
            if context.joker_main and context.cardarea == G.jokers then
                for k, v in ipairs(context.scoring_hand) do
                    if #context.full_hand == 3 then
                        if next(context.poker_hands[self.ability.extra.poker_hand]) then
                            if v:get_id() == 7 then
                                ease_dollars(self.ability.extra.dollars)
                            end
                        end
                    end
                end
            end
        end
    end
#

Yeah misclicked my b

#

Dope! ty

#

Ahhhh that's a smart approach, I'll look into setting that up

#

And, still learning, I put # before something to get an output in numerical form I can check, right?

wintry solar
#

you should also be able to llook in context.poker_hands['Three of a Kind'] and check if the first card in it is a 7

#

like, context.poker_hands['Three of a Kind'][1][1] will give you the first card in the three of a kind

#

yeah it counts that too

#

I think the only thing that is missing from poker_hands is when you play a full house, pair only returns the set of three

quiet hamlet
frosty dock
quiet hamlet
#

Trueeeee, I bet I can set up an if / if not somehow

#

But first I want to get that working, even if it triggers sometimes I don't want it to this is a good iterative learning process

frosty dock
#

if next(context.poker_hands['Three of a Kind']) and not next(context.poker_hands['Four of a Kind']) then should do for that

quiet hamlet
#

I'm just stoked my joker is loading in game, with art, and not crashing everything hahaha

#

Okay, so all hands like 'Three of a Kind' and 'Four of a Kind' are inclusive of other scoring hand types that may include those cards?

#

very good to know, probably have to be quite careful with pairs then haha

wintry solar
#

oh you said exactly 3 sevens

#

I missed the exactly haha

quiet hamlet
#

Yeah it's a cheeky slot machine themed card, gotta hit those 3 7s lol

livid scroll
#

🔫

quiet hamlet
#

Okay one more question that isn't apparent to me after a google, when should I include "next" and when do I not need it (e.g., "if next(context..." vs "if context...")

hallow forge
quiet hamlet
#

Oh no way! Wanna use my art if you like it or anything? I'm all for not having redundant mods

hallow forge
quiet hamlet
#

Cool just offering! The idea is that it pays $7 for each hand played that contains exactly 3 scoring 7s (like hitting a jackpot on a slot machine)

hallow forge
quiet hamlet
#

l o l

#

Well I drew it on wednesday sheesh

#

Haha that's hilarious tho, something something great minds something

hallow forge
#

Lol

quiet hamlet
#

So this raises an interesting question, are there config files that can easily be edited by mod users? It would be cool to be able to toggle jokers on and off if there are redundant packs you have installed

hallow forge
#

You can put one in your mod but I don’t know if that is convention

quiet hamlet
#

I used to make stardew mods (really REALLY easy because I just basically made pixel art and then used a content patcher framework that made life so simple) and it was awesome to have config options to change the colors of different kitchen appliances, wallpapers, etc.

#

Would be really cool if easy toggles became the norm imo

#

end user friendly for ultimate customization

fallen tendon
#

anyone know how to add a pool for a custom gear type such that it functions with create_card()?

fallen tendon
#

like a mod settings button

quiet hamlet
#

Yeah if you could reference an external config.txt file or something with slugs and 1 for on and 2 for off

#

Okay I've officially broken it by attempting to simplify. this does nothing now, what did I need that I no longer have?

-- Jackpot
    if config.j_jackpot then
        local jackpot = {
            loc = {
                name = "Jackpot",
                text = {
                    "Earn {C:attention}$7{} if hand contains",
                    "exactly three scoring {C:attention}7s{}"
                }
            },
            ability_name = "Jackpot",
            slug = "jackpot",
            ability = {
                extra = {
                    dollars = 7,
                },
            },
            rarity = 2,
            cost = 7,
            unlocked = true,
            discovered = true,
            blueprint_compat = true,
            eternal_compat = true
        }
        -- Initialize Joker
        init_joker(jackpot)
        -- Set local variables
        -- Calculate
        SMODS.Jokers.j_jackpot.calculate = function(self, context)
            if context.joker_main and context.cardarea == G.jokers then
                if context.poker_hands['Three of a Kind'][1][1] == 7 then
                    if next(context.poker_hands['Three of a Kind']) and not next(context.poker_hands['Four of a Kind']) then
                        ease_dollars(self.ability.extra.dollars)
                    end
                end
            end
        end
    end
wintry solar
#

context.poker_hands['Three of a Kind'][1][1] == 7 this doesn't work

#

the context gives you the card

#

you'll need to do something with that before checking it equals 7

quiet hamlet
#

oh so I need an id or something

#

what exactly does context.poker_hands['Three of a Kind'][1][1] spit out if not the number 7?

#

(thank you for the help btw, sorry if these questions seem dense and no rush in answering or obligation to answer at all of course)

wintry solar
#

it gives the card object

#

you can run this to see what it contains

for k,v in pairs(context.poker_hands['Three of a Kind'][1][1]) do
  sendDebugMessage(k..": "..tostring(v))
end
quiet hamlet
#

❤️

#

Thanks for supplying the info in a way that helps me learn, absolute homie

wintry solar
#

@frosty dock can't get this working properly, any tips? it's in game_object.lua right now

SMODS.process_loc_text(G.localization.descriptions.Edition, "e_negative_playing_card", {
        name = "Negative",
        text = {
            "{C:dark_edition}+#1#{} hand size"
        }
    })
fast badge
#

I'm back what did I miss

zealous glen
#

It's probably some domain error I'm too tired to see

    local anim_timer = (G.TIMERS.REAL % 2)
    anime_timer = anim_timer > 1 and 1 - anim_timer or anim_timer
    local ease_num = (anim_timer < 0.5 and 4*anim_timer^3) or (1 - ((-2 * anim_timer + 2)^3) / 2)
    local red_hand_scale_mod = -0.04 + 0.16*ease_num --0.04 + 0.08*math.sin(1.8*G.TIMERS.REAL)*math.abs(math.sin(1.8*G.TIMERS.REAL))
    self.children.floating_sprite:draw_shader('dissolve',0, nil, nil, self.children.center, red_hand_scale_mod, rotate_mod, nil, 0.1 + 0.03*math.sin(1.8*G.TIMERS.REAL), nil, 0.6)
    self.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, red_hand_scale_mod, rotate_mod)
#

or a typo lol

#

"anime_timer"

#

But that makes it shrink instead of grow :<

#

I want it to pulse

wintry solar
#

should it not be anim_timer > 1 and 2 - anim_timer or anim_timer?

#

I haven't read the rest but that'll go from 0 to 1 then from 0 to -1

zealous glen
#

also @wintry solar what do you think of a HologramAPI for these kinds of shader effects? Do you think it needs anything besides an injection to Card:draw to add a check for custom shaders to apply?

wintry solar
#

does that have a shader on?

zealous glen
zealous glen
#

but Hologram's code right before does call a custom shader I think

#

It does. I inject after self.hover_tilt = self.hover_tilt/1.5

#

hence if you wanted to use a custom shader, this would be the spot

wintry solar
#

for a shader on the floating sprite, sure

zealous glen
wintry solar
#

yes it could

#

I hook in there for some jokers

zealous glen
tawny perch
#

its pretty cool tho

zealous glen
zealous glen
#

You mean the speed or the size?

tawny perch
#

speed

zealous glen
#

I wanted the size to change quickly but hold at the extremes for a little bit

wintry solar
#

I like the hold, I think the change is a little quick

wintry solar
wintry solar
#

well yeah it'd have to be optional

zealous glen
wintry solar
#

yeah that looks better imo

tawny perch
#

nice

random sleet
#

collared mention

elfin nimbus
#

No functionality quite yet, but here's my WIP

fallen tendon
#

where in my spaghetti code did i go wrong to cause this consumable which is supposed to convert 2 random cards in hand to the most common suit in your deck to do absolutely nothing

near bluff
#

I realized, in order to continue making dumb stuff I need to learn how to mod balatro for real. I really want to make a change to card stacking. With the hope that I could categorize jokers by what they mainly do (eg: mult X vs mult flat), and have those cards stack into a drop down, or sub menu.

mellow sable
#

That would be really cool

near bluff
#

essentially making it easier to view your joker cards when you have more than normal, i.e 30 or whatever

mellow sable
#

I’ve had multiple requests for a feature like that along with Cryptid (where you can get hundreds of jokers easily on some builds)

#

But it’d be very complex so I’ve been pushing it off

long gust
elfin nimbus
#

Yes

near bluff
#

since I started making joker decks of over 100 during the demo and was always annoyed by the stacking system in place rn

elfin nimbus
#

Anyone know why my Joker just isn't triggering? Been cross-referencing with a few other mods and have no idea what I'm doing wrong
Here's my calculate function:

...
calculate = function(self, context)
  if context.cardarea == G.jokers and context.joker_main then
    return {
      Xmult_mod = self.ability.extra.current,
      message = localize {
        type = 'variable',
        key = 'a_xmult',
        vars = {self.ability.extra.current}
      },
  }
  end
end,
...
elfin nimbus
#

Bump, still haven't found a solution

elfin nimbus
#

All I've really been able to gather is that with the above function definition, context.cardarea == G.jokers always returns false and context.joker_main always returns nil

#

I have no idea if this is from context being gotten incorrectly or a wrong calling of fields of context or what

#

I am very lost right now

random sleet
#

are you in 1.0.0

elfin nimbus
#

Yes

random sleet
#

calculate = functions(self, card, context) in 1.0.0

#

where self is the center object

#

rn you're essentially checking the card as if it was a context

#

im pretty sure this is consistent among all center/blind functions now

#

and maybe tags but i dont remember

elfin nimbus
#

Changing the function header to that does allow that to trigger, but now I'm getting a crash of attempt to index field 'ability' (a nil values)

random sleet
#

self doesnt have ability

#

you need to check card.ability

elfin nimbus
#

Ah

random sleet
#

self is the center object (as in, the thing you define with SMODS.Joker{...})

#

card is the actual card game object

elfin nimbus
#

That works now

#

Thank you!

spice scroll
#

not sure why its giving me this error here

#

im guessing the problem might be that the joker keeps changing them back and forth but

#

nvm i think i got it

zealous glen
#

Balatro comes with a count_of_suits(area, suit) function

frosty dock
#

load-time processing of loc text never works because it doesn't persist reloads of G.localization. One such reload is forced at start of injection

#

though I might actually change this to support loc files

wintry solar
#

Ended up wrapping it in the process_loc_text of where we take ownership of negative

zealous glen
#

You take ownership of it?

#

Why?

#

You shouldn’t need to I think

wintry solar
#

It needs things such as a weight, and also to keep the code clean by avoiding hard coded checks for base editions first

zealous glen
#

Mods might want to take ownership of it themselves

wintry solar
#

I mean it needs a weight so that poll_edition can actually function with custom editions

wintry solar
#

Yeah good job never spawning any base editions 👍

zealous glen
#

I mean but do you need to own them?

#

What if other mods want to?

wintry solar
#

How does steamodded handle multiple take ownership calls?

#

But also, I don’t know how you expect editions to work without converting the base ones into the api format

zealous glen
#

I thought it only took the first one

wintry solar
#

I can test it out in a bit

zealous glen
#

Or just add a variable to a table at runtime

#

I implemented Negative Playing cards without taking ownership

wintry solar
#

Well yeah, you don’t need ownership for that, you’re just applying an already existing edition to the card

zealous glen
#

The weights are just numbers. AFAIK there’s no Edition object that can hold anything, so the weights would be stored elsewhere anyways

wintry solar
#

No but there is an edition object now

zealous glen
#

You can use it without taking ownership

random sleet
#

multiple take ownerships work

zealous glen
#

I think they still need to change different things tho

random sleet
#

yeah

cosmic kernel
#

Anyone's using mods with the alpha of Steamodded on Mac ?

random sleet
#

but if smods itself takes ownership of something it always happens first

#

so its not unpredictable behavior

wintry solar
#

That was my understanding

random sleet
#

smods already takes ownership of Strength, Ouija, and Sigil i think

wintry solar
#

It takes ownership of stakes too iirc

random sleet
#

that makes sense, i havent checked stake api out

wintry solar
#

But it makes send right, if you’re building functionality into an api, you have to allow the base game things to have that functionality

random sleet
#

suit/rank apis

zealous glen
random sleet
#

mostly for good practice

#

since ppl might look in smods code to see how to do stuff

#

better to do it the unhacky way if possible

zealous glen
#

Hmmm

frosty dock
#

they aren't something that already exists

random sleet
#

there aure's here ask him why he took ownership of strength/ouija/sigil not me im not a mind reader

zealous glen
#

my crops are dying my land is salted aure

frosty dock
#

their effects need changing due to suit/rank APIs

zealous glen
#

my crops rise from the dead my land is cured and can be stored for later consumption

random sleet
#

i take back my previous statement, i am in fact a mind reader

frosty dock
#

same for grim/familiar/incantation

zealous glen
random sleet
#

413

zealous glen
#

Good guess but it’s actually 413 + 1E-612

#

I do tend to use 413 as RNG seed

frosty dock
#

floating point precision be like

maiden phoenix
frosty dock
#

413.000000000000000000000000000001

zealous glen
random sleet
#

ill float your point

zealous glen
#

I’ll point at a float
👉🎈

frosty dock
#

I'll float at a point

#

👇
🎈

zealous glen
#

I thought you were a cat not a ballon

maiden phoenix
#

I'll

zealous glen
#

Santa Claus moment

frosty dock
zealous glen
#

Hence dispelling the magic

random sleet
#

cats float in mercury

zealous glen
#

You’re going to space aure

random sleet
#

wrong mercury

maiden phoenix
#

Autumn going to mercury would be an.... oddity

zealous glen
#

Mercury in Autumn is a good vacation

#

The sulfur clouds just hit different during that time of the year

wintry solar
#

@zealous glen just tested taking ownership in another mod, works fine

zealous glen
wintry solar
#

Yeah the mod can change the weights

#

it can change anything about the edition

random sleet
#

negative playing cards negative playing cards oooooo you wanna release negative playing cards right now oooooo

#

(i am exceedingly impatient lmao)

wintry solar
#

I can send you the development version of edition api if you want to test it out

wintry solar
random sleet
#

unchrome

maiden phoenix
#

Monochrome

#

Glad I got this working (not sure if the colors on "duplicated" is too much)

random sleet
#

chromeless behavior

maiden phoenix
wintry solar
#

nah that's greyscale, monochrome looks different

#

I have that shader too

random sleet
#

man i wish i could shader

maiden phoenix
random sleet
#

that is a BALLER deck back sprite

maiden phoenix
#

Thanks!

random sleet
#

how tf do ppl do that shit

#

just go out and make cool stuff

maiden phoenix
#

Ngl I just slapped one my legendary's head art onto the default back deck and I just color em differently

random sleet
#

i still need to figure out arcane deck's back

maiden phoenix
#

Just put coins in cups with wands and swords on the side 😎 🧠

random sleet
#

the fronts

#

:3

maiden phoenix
#

What are their effects again?

zealous glen
#

Generally I prefer encouraging big hands

random sleet
maiden phoenix
#

So if I score 5 cups I get +5 hands? 🤔

zealous glen
#

It’s per Flush

maiden phoenix
#

OOooh

#

I can't read

random sleet
#

it is independent from the cards scoring

#

happens between played cards and hand cards

#

wands may change before release to be +chips to all pcards played and in hand

maiden phoenix
#

Are they enhanced cards or you can slap one on em?

random sleet
#

they are suits

maiden phoenix
#

Played hand of glass swords to be epic

random sleet
#

they use the same system i used for these watermarks

maiden phoenix
#

I love the steel one

#

it's clever

random sleet
#

for the jack?

maiden phoenix
#

Yes

random sleet
#

thats just what face cards have

#

theyll have that on any enhancement

maiden phoenix
#

o

#

funny deck

random sleet
#

83 kings haha

#

hologram goes kinda nutty

maiden phoenix
#

It'd be so funny if I had Baron

#

Hologram too

random sleet
#

i thought it was a neat touch :3

maiden phoenix
#

Oh yea the motif is leaking too, didn't notice that, that's cool

wintry solar
#

what were the watermark ones for again?

maiden phoenix
#

I got VV'd and lost 😔

random sleet
#

watermark is currently on the homestuck aspect suits, which there are 12 of.

#

they'll be enabled as compat features for balatrostuck in thac

maiden phoenix
#

THE DREAM IS REAL AUTUMN

#

Nvm it doesn't work somehow 😔

#

Copies don't seem to count as additions?

random sleet
#

you have to have the joker calls

#

creation/destruction effects both need to manually call for joker effects

#

i forget the function but there is one to just do that

maiden phoenix
#

Darn I didn't know that, I have a bunch of stuff to modify then

#

Found the function

wintry solar
#

can't you call calculate_joker() with the right context?

random sleet
random sleet
wintry solar
#

that seems very unlike thunk

random sleet
#

id just check dna/cryptid's code and hanged man's code but i am afk for a bit

zealous glen
#

IIRC they create a function due to Events

#

So it’s still manually calling it

random sleet
#

it's probly more to do with the fact that it is a usecase that comes up often so making a function is just simpler

#

idk why yall feel the need to psychoanalyze the man based on his code

zealous glen
#

I’m not

regal shoal
#

Getting closer and closer to a release^^

random sleet
#

me, hoping this leads to unique playing card api

zealous glen
#

@random sleet 👀

#

I could make the artwork when I’m home

random sleet
#

a what

#

the what background

regal shoal
zealous glen
#

The One

regal shoal
#

Oh yeah !

random sleet
#

oh that would be baller

#

i could try to make a watermark version maybe

#

and see how that looks

zealous glen
random sleet
#

neo

#

the one....

zealous glen
#

Chips pill or Mult pill

regal shoal
#

Amazing ❤️

random sleet
zealous glen
zealous glen
random sleet
#

the other one is estrogen

zealous glen
#

Balatrans

#

bala is candy which I guess a pill is similar to, so it works as a multilingual pun

crisp coral
#

CAN I BEAT BALATRO WHILE ONLY TAKING ESTROGEN?????

random sleet
#

ye just play queens

random sleet
random sleet
#

i wanna make an easy dynamic texture replacement mod but idk how to support animated atlases lol

#

i guess i could just Not

zealous glen
random sleet
#

also i just realized itd be annoying to support soul_pos and anything extra based on position will fail to work correctly

#

ugh actually i might avoid that headache

#

got enough garbage to make anyhow

fast badge
#

How can I scale my floating sprite

#

grrr

zealous glen
#

I did it

#

Wait do you want to render more/less texture or do you want to change the size

fast badge
#

I wanna make it smaller

zealous glen
#

I’m not sure you can do it without the shader, but you can do it with the shader

#

I think you can do without actually

#

Because I did it by accident

fast badge
#

I need to apply the hologram shader anyways, thats not working rn either

#

so

#

Will have to tackle the Shaders sooner or later

zealous glen
#

I think if you change the width of the sprite without changing the scale it will shrink

#

I think

#

Otherwise I did implement a custom soul sprite yesterday

fast badge
#

changing the T.w and T.h didnt do anything for me

zealous glen
#

I put the code here

zealous glen
fast badge
zealous glen
#

I used an injection

#

The relevant part is the scale mod

fast badge
#

Yeah, ive been using that

#

ill try it again

zealous glen
#

You can probably do 0.5*scale_mod

fast badge
#

-0.5

zealous glen
zealous glen
#

I have the feeling negative scales are clamped

fast badge
#

-0.5 was the only way it worked for me when I tried it with the other approach

zealous glen
zealous glen
#

At least it’s not like scale*visual_area

#

My suspicion was that it’s exponential but Idk I didn’t test it much

#

Maybe it’s (scale+scale_mod)*visual_area

fast badge
#

me when im fat

zealous glen
#

Lusty?

fast badge
#

Lusty is the soul sprite 🥴

wintry solar
#

Try throwing the calculations Victin did on it

fast badge
#

Which dya mean

zealous glen
#

I mean, not those specific ones because they don’t quite work

#

I think if you do sin(1.8*G.TIMERS.REAL) it will look better

zealous glen
fast badge
#

I'm not seeing any change anyways so that doesn't matter really

zealous glen
#

I replaced anim_timer with a triangle wave

zealous glen
fast badge
zealous glen
fast badge
#

In what function, I mean

zealous glen
#

I also sent you

fast badge
#

eh?

zealous glen
#

It’s inside Card:draw IIRC

fast badge
#

I don't use any lovely patches

zealous glen
fast badge
#

It worked without

wintry solar
#

There’s no reason not to use lovely patches though

zealous glen
#

The patch is also quite easy

fast badge
#

Besides not knowing how to do it, I feel like it's bad practice if there's another way

zealous glen
#

I think it’s bad practice not to do it 🤔

wintry solar
#

How are you currently doing it then?

zealous glen
#
elseif self.ability.name == “MyJoker”
--code
random sleet
#

good practice: non-overwriting lovely patch
bad practice: overwriting lovely patch
what the fuck are you doing: the other thing

zealous glen
#

That’s what my patch does

random sleet
#

compatibility

#

only do it if absolutely necessary

zealous glen
#

I do want to make my Plasma functionality into an API via overwriting the existing check

random sleet
#

not saying there arent cases

zealous glen
#

Currently I overwrite but it’s not an API

random sleet
#

just saying it shouldnt be used with abandon

fast badge
#

Still, scaling down this bozo has to work with simply adjusting the values

zealous glen
#

I agree

#

Again playing with width and children.scale.x should help

#

I just don’t remember the correct combination

fast badge
#

Adjusting scale.x and scale.y just crops the image, and T.h and T.w dont have any influence at all

crisp coral
zealous glen
#

“Wee Joker” uses width IIRC

zealous glen
#

Oops sorry

#

Ping

fast badge
#

Wee Joker ^

wintry solar
#

What is the object you’re trying to scale though? Does it have those values?

zealous glen
#

Every sprite does

#

They’re initialized with them

wintry solar
#

I see

zealous glen
#

Unless you mean they’re accessing the wrong sprite

wintry solar
#

Although if the crop changes it suggests it’s the correct sprite

fast badge
#

If changing the scale.x works I think I am accessing it correctly

zealous glen
wintry solar
zealous glen
#

(aka how some people ask for help in either of the modding chats)

fast badge
#

there's nothing to be seen really, I'm just digging through the source code to find any hints

random sleet
#

what is ability.sprite

#

have you verified that that works

fast badge
#

just saving some arbitrary values there

#

putting any hardcoded values there doesn't work either with the h and w

wintry solar
#

Have you done card.children.floating_sprite.T.h = card.children.floating_sprite.T.h * 0.5?

fast badge
#

yep

random sleet
#

is reset()... resetting the sprite :)

fast badge
zealous glen
random sleet
fast badge
wintry solar
#

Or the second line

zealous glen
#

You can change it to whatever atlas you want

random sleet
#

but it uses

#

the atlas name to set the atlas

#

to the atlas of that name

wintry solar
#

It just uses what it already has to set them again

fast badge
#

fax no printer

wintry solar
#

What is the point of the function

zealous glen
#

I mean

#

The atlas the key retrieves can be different

#

There’s two folders of assets after all

#

1x and 2x

#

Both have .pngs with the same name

#

But they’re different

#

did everyone get got by Madness

wintry solar
#

The function has broken us

#

It just finds the atlas with the same name as the one it already has, no?

fast badge
#

btw, removing the reset it still works

random sleet
#

atlases arent files

#

theyre objects with file info

wintry solar
#

The function doesn’t do anything

#

At all

#

@zealous glen do you know what the dissolve shader does?

zealous glen
frosty dock
#

lurks

wintry solar
#

Does it just draw the card?

#

I’ve not looked at the actual file, but I know it’s everywhere

#

If it does, that’ll need the scale modifier to make the sprite smaller I think

mellow crag
#

also lurks

random sleet
#

lorks

fast badge
#

I just wanna make it smaller it cant be that hard

#

Best I can get ig

zealous glen
wintry solar
#

that is exactly what it does

zealous glen
fast badge
#

^ scale.x and scale.y

wintry solar
#

I think this is going to need a lovely patch

fast badge
#

why cant I just run a shader over it tho

zealous glen
#

The shader applies every frame

fast badge
#

Yeah I need that anyways

zealous glen
#

Also I suspect maybe the floating sprite size can’t change by itself because it might be tied to the major but I didn’t test that

#

I remember accidentally making the major wide but not the soul

wintry solar
#

self.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, 0.5)

#

you could try that

zealous glen
#

I mean I already have the patch code that helps

fast badge
#

Aight whats the patch

#

how does it work

wintry solar
#

try drawing the shader in your code block instead of the reset_sprite thingy

#

I think it's unlikely to work but worth a go

fast badge
#

I tried

wintry solar
#

yeah I guess the one in the Card:draw stack draws on top of it

fast badge
#

Probably

wintry solar
#
[patches.pattern]
target = "card.lua"
pattern = "self.hover_tilt = self.hover_tilt/1.5"
position = "after"
payload = '''
CALCULATE SCALE AND DRAW SHADER HERE
'''
match_indent = true```
#

with an elseif self.ability.name="Blank Joker" at the start of the payload

fast badge
#

Where do I put that

wintry solar
#

hold on

#
[patches.pattern]
target = "card.lua"
pattern = "self.hover_tilt = self.hover_tilt/1.5"
position = "after"
payload = '''
else if self.ability.name == "Blank Joker" then
  scale_mod = scale_mod * 0.5
'''
match_indent = true```
random sleet
#

the lovely tutorial

wintry solar
#

put that in a lovely.toml in your mod folder

random sleet
#

unskippable cutscene

fast badge
#

aight thx

wintry solar
#

I think that will work

random sleet
#

needs header

fast badge
#

you didnt draw the shader

wintry solar
#

oh snap I forgot elseif will break out

#

hold on

fast badge
#

dw

#

i got it

wintry solar
#
                        self.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)``` put those in too
random sleet
#

lovely header

#

also "else if" isnt "elseif"

wintry solar
#

oh yeah I forgot the header

fast badge
#

Where head

#

⁉️

wintry solar
#
version = "1.0.0"
dump_lua = true
priority = 0```
fast badge
#

thank

wintry solar
#

aren't elseif and else if functionally the same?

#

oh no they'd need an extra end

#

nvm

fast badge
#

me when it still doesnt work

wintry solar
#

is the joker name right?

#

I don't remember what it was called

fast badge
#

I got it

#

scale needs to be * -0.5

#

and way more

wintry solar
#

*0.5 should half the scale

fast badge
#

scale_mod = -0.5

#

just saying

wintry solar
#

huh

#

oh wait yeah of course

#

because the scale_mod the game defines just pulses slightly

#

I still don't think it needs to be negative though

fast badge
#

scale = 0.5

#

lol

wintry solar
#

looks like it's an addivite modifier

fast badge
#

mhmm

wintry solar
#

did you want the hologram shader on top of it too?

fast badge
#

Now how to additionally get the hologram shader

#

Yes

#

brains = connected

wintry solar
#

copy the bottom draw shader

#

change dissolve to hologram

#

ezpz

fast badge
#

that didnt work half a minute ago, lets see

#

update, it still doesnt

#

neither with the code from the hologram shader itself

wintry solar
#

show code?

fast badge
#

code pic

#

self.children.floating_sprite:draw_shader('hologram', nil, self.ARGS.send_to_shader, nil, self.children.center, 2*scale_mod, 2*rotate_mod) doesnt work either

#

is it the ordering? or does one of them need to be replaced

wintry solar
#

try just putting the self.ARGS.send_to_shader in palce of the second nil in the screenshot you sent

fast badge
wintry solar
#

it just draws the plain joker?

fast badge
#

mhm

#

actually you can see it a bit

#

but its not how its supposed to be

wintry solar
#

that's working

#

that's what the shader does

fast badge
#

That is NOT looking like the hologram

wintry solar
#

you could replace the second dissolve shader

#

currently you draw the shader > draw the card > draw the hologram effect

fast badge
#

uh huh

wintry solar
#

so don't draw the card

#

trust

fast badge
#

uh huh

wintry solar
#

huh

fast badge
#

me when I dont draw the card:

wintry solar
#

code?

fast badge
#

"dont draw the card" - is confused the card isnt being drawn

wintry solar
#

no the hologram shader should draw the card

fast badge
#

well well well

random sleet
#

it might have to do with hologram shader expecting to be drawing the translucent joker sprite and doing it on other things doesnt quite work

#

but also you are being rather rude to people you're basically asking to code this for you so idk im probably gonna peace outta here for a while lol

wintry solar
#

oh that is correct

#

the hologram floating sprite IS slightly translucent

fast badge
#

hmmm

zealous glen
#

Isn’t that the shadow?

fast badge
fast badge
wintry solar
#

I mean

#

it is also drawing the hologram shader

fast badge
#

Yeah

wintry solar
#

the hologram shader just omits anything where the alpha is 1

fast badge
#

the shader just isnt drawing the card

#

Ahaa

wintry solar
#

are you in 1.0?

fast badge
#

Indeed I am

wintry solar
#

then there's 2 options

#

option 1 - change the shader yourself and create a new shader here
option 2 - wait for editionAPI to be finished because we have shader objects and it'll stop compat errors

fast badge
#

is it possible to inject the shader file using lovely patches?

wintry solar
#

I guess

#

although I'm not sure how it'll handle non lua files

#

I mean option 1 isn't hard

fast badge
#

Yeah I'm looking into it rn

#

if (tex.a > 0.999){tex = vec4(0.,0.,0.,0.);}

wintry solar
#

yes

#

remove that line

fast badge
#

Yeahh

wintry solar
#

G.SHADERS["key pls"] = love.graphics.newShader(SMODS.current_mod.path.."/assets/shaders/".."something.fs")

frosty dock
#

non-lua might be fine, but I'm not sure you can actually add files

frosty dock
#

you can add lua modules, which isn't of use

wintry solar
#

it'll also be easy to switch to the api when it's released

fast badge
wintry solar
#

just in top scope of your mod

fast badge
#

Just my "init"?

#

Yeahhh

#

okidoki

#

Thanks

wintry solar
#

SMODS.Shader({key = 'key pls', path = "path.fs"})

frosty dock
#

yeah that should do, injection doesn't mess with it

wintry solar
#

this'll be the api version

#

so if you put the key in the first one with your prefix at the start

#

you just need to change the definition when it's ready

frosty dock
#

could even have a draw method on SMODS.Shader that takes in the sprite to draw on

#

I don't fancy relying on hard-coded mod prefixes

wintry solar
#

but sprites already have a draw_shader method