#help with messages

1 messages · Page 1 of 1 (latest)

woven patrol
#

i'm making jokers that create a tarot card when blind is selected, hand played, hand contains x, card is of (suit/rank), etc.
for all of them, when i use message = localize('k_plus_tarot') to display the tarot creation message, the message always appears in the top left of the screen and not directly below the joker that created the tarot card
i genuinely have no idea to fix this
is it possible?

wary tangle
#

add card = card

#

set the card element in the table to the card you want to attatch the message to

woven patrol
#

it didn't work unfortunately
i tried

card = 'name of joker'
extra = {message = localize('k_plus_tarot'), colour = G.C.PURPLE}

card = 'name of joker',
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_plus_tarot'), colour = G.C.PURPLE})

card = 'name of joker',
message = localize('k_plus_tarot'),
colour = G.C.PURPLE

nothing puts the message in the right place for some reason

wary tangle
#
card = card,
message = localize('k_plus_tarot'),
colour = G.C.PURPLE
woven patrol
#

oh so it's just card = card and you don't replace any fields
ok

woven patrol
#

still didn't work ;-;

wary tangle
#

can you send the whole calculate_joker function

woven patrol
#

SMODS.Joker {
key = 'jokername',
config = { extra = { odds = 3 } },
loc_vars = function(self, info_queue, card)
return { vars = { (G.GAME and G.GAME.probabilities.normal or 1), card.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.joker_main then
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
if pseudorandom('jokername') < G.GAME.probabilities.normal / card.ability.extra.odds then
card = card,
message = localize('k_plus_tarot'),
colour = G.C.PURPLE
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
func = function()
focus = self
card = self
local card = create_card('Tarot',G.consumeables, nil, nil, nil, nil, nil, 'jokername')
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0
return true
end}))
end
end
end
end
}

maybe the odds have something to do with it but idk

wary tangle
#

your message should be returned from calculate

#

so

return {
  card = card,
  message = localize('k_plus_tarot'),
  colour = G.C.PURPLE
}
woven patrol
#

thanks, this works