#do you mind sending your code in a

1 messages · Page 1 of 1 (latest)

hallow fox
#
function Transform(card, context)
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"])
            play_sound("card1")
            card:juice_up(0.3, 0.3)
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
    return true
end
minor nebula
#

fire

#

do you mind sending the whole joker?

hallow fox
# minor nebula do you mind sending the whole joker?
G.C.IjiGray = HEX('BFD7D5')                           
SMODS.Joker{ --Misprint?
key = 'reprint',
pos = {x = 6, y = 2},
no_mod_badges = true,
unlocked = true,
discovered = true,
--no_collection = true,
config = {
    extra = {max = 23, min = 0}
},
loc_vars = function (self, info_queue, card)
    local random_mult = {}
    for i = card.ability.extra.min, card.ability.extra.max do
        random_mult[#random_mult+1] = tostring(i)
    end
    local local_mult = ' '..(localize('k_mult'))..' '
    main_start = {
        {n=G.UIT.T, config={text = '  +',colour = G.C.MULT, scale = 0.32}},
        {n=G.UIT.O, config={object = DynaText(
        {string = random_mult, colours = {G.C.RED}, pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.5, scale = 0.32, min_cycle_time = 0})}},
        {n=G.UIT.O, config={object = DynaText({string = {
            {string = 'toma()', colour = G.C.JOKER_GREY},
            {string = "#@"..(G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.id or 11)..(G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.suit:sub(1,1) or 'D'), colour = G.C.RED},
            local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult, local_mult},
        colours = {G.C.UI.TEXT_DARK}, pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.2011, scale = 0.32, min_cycle_time = 0})}},
        card.area == G.jokers and {n=G.UIT.T, config={text = '...?', colour = G.C.IjiGray, scale = 0.32}} or nil,
    }
    return {main_start = main_start}
end,
generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
    full_UI_table.name = localize { type = 'name', set = "Joker", key = card.ability and card.ability.extra.new_key or "j_hpfx_reprint", nodes = {} }
    SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
end,
add_to_deck = function(self, card, from_debuff)
    card.ability.extra.new_key = "j_hpfx_reprint_alt"
end,
rarity = 1,
cost = 4,
atlas = 'IjiraqJokers',
blueprint_compat = true,
calculate = function(self, card, context)
    if context.joker_main then
        Transform(card, context)
    end
end
}
minor nebula
#

ok, so I've been trying to run it and running into issues because this is not my mod and I need to change a bunch of stuff to make it recognize it as part of my mod

but basically, I'm getting a couple crashes and slowly narrowing it down

hallow fox
#

oh awesome

minor nebula
hallow fox
#

wait what

minor nebula
hallow fox
#

literally yes

#

how

#

tysm

minor nebula
#

so my thoughts are

#

the only thing I actually changed about the code itself is commenting out this set_ability

#

so maybe set_ability flips already

hallow fox
#

now THAT i know for SURE it didnt do before

#

that's why the flips were added

minor nebula
#

strange

hallow fox
#

maybe smods update added flips to set ability?

minor nebula
#

probably

#

does it work now on your end?

hallow fox
#

i have a slow laptop (i3)

minor nebula
#

no worries

hallow fox
#

that took way too long there's finally a pause

#

testing

#

ok no the set_ability needs the flips

hallow fox
#

it's the trigger timing

minor nebula
#

could be

hallow fox
#

ok so

#

ok no i have no idea

#

uh

#

im gonna try only having one flip

minor nebula
#

sounds good

hallow fox
#

so flip event

#

set ability

#

that's it

#

let's see if it flips back over on its own

#

THAT'S the one

#

so it isnt a toggle?

#
function Transform(card, context)
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"])
            play_sound("card1")
            card:juice_up(0.3, 0.3)
            return true
        end,
    }))
    return true
end

working code

minor nebula
hallow fox
#

idk???

#

i called it once and it did the full flip

minor nebula
#

Wacky and wild

hallow fox
#

and i already tried set_ability by itself

#

which didnt flip it at all

minor nebula
#

But the func is literally just checking “if right side up, flip upside down. Else, flip right side up”

#

That’s crazy

#

Oh wait

hallow fox
#

whuh

minor nebula
#

Nah, that’s not it

hallow fox
#

whuh

minor nebula
#

my thoughts exactly