#EnhanceAPI - The Title Explains It All!

240 messages · Page 1 of 1 (latest)

young basin
#

Have you wanted to make your own enhancement, but found it frustrating to place your card assets and make sure it all slots in properly? Well, EnhanceAPI is the solution to your problem! All you have to do is follow the simple steps in the Github link below. Have fun with it, and let me know if it breaks somehow!

https://github.com/Numbuh214/EnhanceAPI

GitHub

Allows for the easy addition of custom enhancements - Numbuh214/EnhanceAPI

idle cypress
#

Huge

young basin
#

gonna ping some people as i remember "oh yeah, they were interested"

#

@feral crystal

#

@rose pewter

#

@granite void

polar pewter
#

@polar pewter

young basin
#

i mean, you were there when i said it's here

#

so i was prioritizing people who weren't lol

#

anyway, have fun~!

feral crystal
#

Ah ok

lament harbor
#

Oh this looks promising

pale meteor
#

yes

rose pewter
#

Let's freaking go!!

pale meteor
#

can you show an example of using this, I can't get it to work :/

young basin
pale meteor
#

thanks

polar pewter
#

cheeseburger

feral crystal
#

nvm the answer is no

#

this is hilarous imo tho well done

#

(even tho it is meant to be a test)

rose pewter
#

is this going into steamodded? 👀

young basin
#

i mean, i'd not mind in the slightest if steamo were to integrate my code in

pale meteor
#

are we allow to @ him?

polar pewter
#

i think aure handles the api stuff mostly actually but idk how busy they are
its also not like someone who knows how to use github cant make a pr to steamodded

pale meteor
#

there is one problem, it doesn't show the edition in full deck

#

oh, it also plays a sound when scrolling over a custom edition

young basin
#

@feral nymph

feral nymph
#

cool

#

thanks!

#

do you have a showcase for it?

#

(AKA the X card

young basin
#

not just yet, because i'm overhauling its straight detection coding

#

making sure it plays more nicely with shortcut and such to give optimum values

young basin
#

update: cards with custom enhancements should copy properly now

young basin
#

badge fix rolling out soon

#

props to @bleak harbor for catching this

young basin
#

@here New (small) changes: the sprite variable has been changed to atlas, and "args" support has (hopefully) been added.

TestCard has been updated to reflect this, and included in the GitHub.

warped valley
#

@young basin (Sry for the ping) Do I need to DL this to use mods that implement it? Or is it just necessary for devs?

pale meteor
#

also this didn't work as arg.vars, kept crashing on launch

#

that works tho ^^

young basin
young basin
#

however, simply putting it in its own folder is enough.

#

one and done

young basin
#

okay, custom suit compatibility is tested and committed

pale meteor
#

happens when i open enhanced cards

young basin
young basin
#

update: it did not, but now i have a standard pack to open

young basin
#

there we go

pale meteor
#

x-carding the modded suits

#

also theres this one when having test card installed and opening editions

visual beacon
#

Hi, would you want this to be merged into steamodded?

young basin
#

not until i get it working again

#

and spoilers:

#

i probably won't get it working again

#

because i'm not good enough

young basin
#

never mind, i figured it out

#

new version pushed, should be compatible with all custom suits AND ranks

pale meteor
young basin
#

if this were to be merged into steamodded, i would be fine with it

pale meteor
young basin
#

hey, that's how it works with me

#

also, you can now include an atlas_hc parameter, if you want your sprite to be different in colourblind mode

last geyser
#

thank you so much for this!

mossy crater
#

I had made this edit during the demo. Do you think it's possible to have an enhancement that looks like this?

last geyser
#

i dont know if it could go over the ace thing

#

i think it would appear behind

mossy crater
#

That's why I'm asking

#

I got this error when trying to run the API for the first time: :215: attempt to concatenate field 'name' (a nil value), which seems to happen when it tries to set the sprites for Bonus cards here:

    elseif self.base then
      sendDebugMessage(self.base.name.." has no base suit or value.")
    end
last geyser
#

i think you have to comment out line 215 in enhanceAPI

mossy crater
#

Though if I can make the burnt marks show over the face, then I think I could like without some transparency

pale meteor
#

i asked a similar question, i dont think transparency works

polar pewter
#

x-card is more like stone card, it just doesnt render the "real" card

lament harbor
#

(i think the sprite might benefit in readability by there being small traces of still-orange embers, kind of like the burning joker)

mossy crater
#

But that was during the 2023 demo

lament harbor
#

ahh

mossy crater
young basin
#

oh uhhhhhhhhhhhhhhhhhh

#

did i ever push that update?

#

yes i did

#

that bit of debug code has been removed

mossy crater
#

To be fair I wanted an enhancement that removed suits and ranks and offered no benefit so

mossy crater
#

I tried to use Death to turn a standard playing card into another standard playing card and got this error. Though to be fair I haven't updated. I think one was Clubs

young basin
#

one moment tho

#

i'll double check if i can't update it rn

#

there we go

tawdry sand
#

I'm still having a crash at boot no matter what I do, specifically with the Autumn Circus and having it's enhancement enabled. I'll report it there too.

#

Here's the traceback

#

nvm, seems to be a known issue with the mod

young basin
#

there was an update released yesterday. is this present on that version?

#

@tawdry sand

last geyser
#

oh god what happened here

tawdry sand
young basin
last geyser
#

it'll prob be fine

mossy crater
#

I haven’t tried to work on Enhancements yet, but I figured this would be a good feature for the API: pool keys like there are for Jokers and other objects that disable Enhancements from showing up naturally

young basin
#

there's already a G.CENTER_POOLS("Enhanced") that enhanceAPI adds to when newEnhancement() is called

#

is that what you're looking for, @mossy crater?

mossy crater
young basin
#

oh, right

#

from like, standard packs

mossy crater
#

Like Grim, Familiar, and the other one can’t generate Stone cards

#

Also Standard packs yes

young basin
#

yeah, i could maybe add that in at some point

mossy crater
#

Because I’d like to add bad enhancements, so it’d be good to keep them separate

#

Maybe add a separate pool for bad enhancements but for now just a flag like Cavendish and etc. would be fine

young basin
#

yeah, some flags that tells it to not spawn in certain places

#

i think i should look into that anyways

#

bc i don't think x card should spawn with grim/familiar/incantation

mossy crater
#

Unfortunately this seems like you’d either need to inject code, rewrite existing functions from scratch, or maybe there’s a way to do it that requires neither that I don’t see

young basin
#

you probably don't have to rewrite it from scratch, per se

#

but your original code does get clogged up with a lot of balatro source

mossy crater
#

Is there an option to make the Enhancement artwork work like Stone Cards where they display over the rank?

#

Also some tests with other Enhancements

last geyser
#

o

misty otter
mossy crater
#

Idk what caused this, but my suspicion would be this API. I could be totally wrong tho

#

Created with Invisible Joker. Later, Antimony also created a Joker copy that was also a 2 of Hearts

tawdry sand
#

Oh yeah I had an amoeba joker from some mod that copies itself and it did the same thing. Also 2 of hearts

#

Also suspect it's related to the enhanceapi

tawdry sand
#

I actually don't recognize any of your jokers despite having over 400 in my game, lol

mossy crater
mossy crater
mossy crater
young basin
#

really? huh.

polar pewter
#

i believe the 2 of hearts-en-ing is related to this #💻・modding-dev message
swords on my spritesheet are aligned with spades on vanilla's, so most likely whats happening here is that the "front" atlas is getting set to the vanilla atlas no matter what

bleak harbor
#

since stone cards have the specials “Stones:” part on the deck preview, will other enhancements be able to do this? if they dont have a rank/suit i mean

last geyser
#

i think you have to change the numbers at line 205, as x=0, y=0 is where the 2 of hearts shows up on the sprite sheet, so just change the numbers into like ~15 or so

#

because i think new cards that are generated use 0, 0 as the default, even if it's not a playing card.

#

with this, It no longer does the 2 of hearts thing (at least for me)

#

{duplicated with invis joker}

last geyser
#

@young basin do you think u could make that change to the code it should be pretty easy

young basin
#

and yeah, using 0, 0 is a hail-mary crash-prevention measure

#

i genuinely have the code try grabbing the suit from 3 different places

#

or... i did with x card and not enhanceAPI proper?

polar pewter
#

its a custom suit issue but one that only arises with eAPI loaded; the pos is loaded correctly but the wrong atlas is selected

#

happens whenever a custom suit card is enhanced

#

(including vanilla enhancements)

mossy crater
#

I wonder if that’s the same issue with creating copies of cards

polar pewter
#

and in that case, the wrong atlas is "any atlas at all"

young basin
#

that was because it didn't look in both the card's "base" table and "config.card" table

visual beacon
#

oh interesting

young basin
#

because there doesn't seem to be a consistent place to find a card's suit and rank values

visual beacon
#

can't you always use base?

young basin
#

surprisingly, no

#

it isn't always initialized

polar pewter
#

well, not for nonplaying cards ofc

young basin
#

okay, this should work

#

also fixed the bug of display_rank = false not working

last geyser
#

Nice

young basin
#

also, the playing_card value doesn't do anything yet

#

i just have been really reluctant to even dip my toe into

nodes

visual beacon
#

I love hate UI

polar pewter
#

same

mossy crater
#

By the way, this might be an useful reference: all card faces, overlayed on top of each other.

tardy holly
#

hey, apologies if this is already known or if its a compat issue with the other mod, but this API seems to be heavily incompatible with the deck creator mod. anytime i view my full deck while using a deck made with the mod, the game crashes, same with opening the deck editor in the mod. this stopped happening as soon as i removed enhanceAPI

i can do more testing myself if need be!

last geyser
tardy holly
#

are you telling me i need to unlock everything for this mod conflict to not happen

young basin
tardy holly
#

well yea i have like at least a good 70% of the unlocks i just wanted to try some mods for fun

#

but i appreciate the heads up on what could be causing it

#

okay wait

#

i just made a new profile and hit unlock all, the crash still happens

#

this is what the log looks like

young basin
#

that

#

shouldn't be breaking

#

but i'll add a check that should fix it

#

at the cost of potentially introducing another bug

tardy holly
#

im sorry

young basin
#

weird

#

deck creator isn't even loading for me

#

oh there we go

#

that fixed it

dim wagon
#

lol this happens when i go to my enhancements collection even after commenting out the custom one

young basin
#

there we go i got it

#

however, i think a bigger problem is with that mod

#

it's not compatible with custom suits or ranks

young basin
#

oh

#

there we go

#

my mistake

#

mistaken statement aside, it works with deck creator now

weak storm
#

is there any way to disable the test enhancement? its getting in the way of some modded "apply a random enhancement" stuff

pale meteor
weak storm
#

ty

tardy holly
young basin
#

epic

tardy holly
#

thank you for patching that so swiftly

young basin
#

no prob

#

i just can't think of everything, ya know?

tardy holly
#

yea i would imagine making things compatible is absolutely more of a reactive measure rather than a pro-active one

young basin
#

yep

dim wagon
#

i'm not sure if it's related but i'll try the update and see if it fixes the issue i was having

#

oh sick, it does

#

thanks!

#

i think i found out another reason why i was having issues, too-- in your readme, it has sprite as an arg for enhancements, but in the actual mod it's atlas

#

not sure if it's an issue on this mod's end but whenever i add this as an enhancement in debugmenuplus, the cards get 2 of hearts-ified

#

probably not an issue during normal gameplay, but it would be nice to know a karmic card's rank during testing

tawdry sand
dim wagon
#

i see

#

i may not include this enhancement in the mod if this issue remains so let me know if it ends up being fixed

young basin
#

it's because it is so hard to consistently find a card's suit and rank when it really shouldn't be

tawdry sand
#

Been getting a lot of crashes listing enhanceapi since the most recent update of it

#

I have @last geyser 's rainbow cards, and it seems like it sometimes crashes whenever it rtris to draw them

#

but not always

#

I also noticed it's doing the 2 of hearts thing when death is used on them, I don't remember that before. I only saw it on copies of jokers

young basin
#

i'll look into that after some sleep

#

this has everything to do with me not understanding loc_def at all prior to fixing up my personal mod.

#

i just don't have the energy to do that rn

last geyser
#

wait is there a function you can use for when enhanced cards are played?

young basin
#

this has everything to do with the entirely new method i made for recreating the localization process because {V:1} didn't work properly

young basin
#

proper localization is implemented

quiet granite
# tawdry sand

Running into the same crash mentioned here, exact line error and all.

Specifically rainbow cards turning to 2's and leading to a crash if moused over.

EDIT: when using spectrum

livid bloom
tawdry sand
#

Enhanceapi hasn't been working for a long time now

tawdry sand
#

Maybe @hexed birch could port it to smodded enhancementapi eventually

livid bloom
#

Ah.. I see lewxen_Teary_Laugh
-# ... any Examples for working Enhancements I could follow then?

tawdry sand
#

The new demo

livid bloom
#

Ay, Thank you! CamotTHappy CamotLove