-
Notifications
You must be signed in to change notification settings - Fork 20
Crash when starting Archeology Deck #77
Description
ease_ante is called before G.deck is created causing the crash.
I got it working by delaying ease_ante with G.E_MANAGER, no clue how to mod balatro or if this is how to use github but I really wanted to play this deck.
Original:
SMODS.Back{ --Archeology Deck
name = "Archeology Deck",
key = "archeologydeck",
loc_txt = {
name = 'Archeology Deck',
text = {
"Start in {C:attention}Ante 0",
"{C:attention}-1{} hand size"
}
},
order = 17,
unlocked = true,
discovered = true,
config = {},
loc_vars = function(self, info_queue, center)
return {vars = {}}
end,
pos = { x = 1, y = 0 },
atlas = "ECother",
apply = function(self, back)
ease_ante(-1)
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante - 1
G.GAME.starting_params.hand_size = G.GAME.starting_params.hand_size - 1
end
}
Fix:
SMODS.Back{ --Archeology Deck
name = "Archeology Deck",
key = "archeologydeck",
loc_txt = {
name = 'Archeology Deck',
text = {
"Start in {C:attention}Ante 0",
"{C:attention}-1{} hand size"
}
},
order = 17,
unlocked = true,
discovered = true,
config = {},
loc_vars = function(self, info_queue, center)
return {vars = {}}
end,
pos = { x = 1, y = 0 },
atlas = "ECother",
apply = function(self, back)
G.GAME.starting_params.hand_size = G.GAME.starting_params.hand_size - 1
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
ease_ante(-1)
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante - 1
return true
end
}))
end
}
Error:
Oops! The game crashed:
[SMODS _ "src/utils.lua"]:2068: attempt to index field 'deck' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0827c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
1: Mobile Compatibility by Avery [ID: mobilecompat, Priority: -10000, Version: 1.0, Uses Lovely]
2: DismissAlert by Breezebuilder [ID: DismissAlert, Priority: 100, Version: 1.0.0, Uses Lovely]
3: Saturn by OceanRamen [ID: Saturn, Version: 0.2.2-E-ALPHA, Uses Lovely]
4: Sticky Fingers by Eramdam [ID: eramdam.sticky-fingers, Priority: 100000, Version: 1.4.0, Uses Lovely]
5: Handy by SleepyG11 [ID: Handy, Version: 1.5.1i, Uses Lovely]
6: ExtraCredit by CampfireCollective [ID: extracredit, Priority: 1, Version: 1.3.0, Uses Lovely]
7: JokerDisplay by nh6574 [ID: JokerDisplay, Priority: -100000, Version: 1.8.7.3]
Lovely Mods:
Stack Traceback
(3) Lua field 'get_card_areas' at Steamodded file 'src/utils.lua:2068'
Local variables:
_type = string: "individual"
_context = nil
(*temporary) = table: 0x24c96b50 {}
(*temporary) = table: 0x257f1be8 {object:table: 0x25056c50}
(*temporary) = nil
(*temporary) = nil
(*temporary) = number: 0
(*temporary) = table: 0x252c79e0 {velocity:table: 0x250236e8, click_offset:table: 0x24eeee40, UIT:3, children:table: 0x24df3808, shadow_height:0.2, parent:table: 0x24cd58e0, VT:table: 0x261aaa90 (more...)}
(*temporary) = number: 5.40276e-132
(*temporary) = table: 0x252c79e0 {velocity:table: 0x250236e8, click_offset:table: 0x24eeee40, UIT:3, children:table: 0x24df3808, shadow_height:0.2, parent:table: 0x24cd58e0, VT:table: 0x261aaa90 (more...)}
(*temporary) = nil
(*temporary) = string: "attempt to index field 'deck' (a nil value)"
(4) Lua field 'calculate_card_areas' at Steamodded file 'src/utils.lua:1746'
Local variables:
_type = string: "individual"
context = table: 0x24f760d0 {modify_ante:-1, main_eval:true}
return_table = nil
args = nil
flags = table: 0x24f03c78 {}
(*temporary) = C function: ipairs
(5) Lua field 'calculate_context' at Steamodded file 'src/utils.lua:1834'
Local variables:
context = table: 0x24f760d0 {modify_ante:-1, main_eval:true}
return_table = nil
no_resolve = nil
has_area = nil
flags = table: 0x25bcad90 {1:table: 0x24fc3b80, 2:table: 0x24ca7b58}
(*temporary) = number: 3
(6) Lua global 'ease_ante' at Steamodded file 'src/overrides.lua:2378'
Local variables:
mod = number: -1
ante_end = nil
(7) Lua method 'apply' at file 'src/essay.lua:2978' (from mod with id extracredit)
Local variables:
self = table: 0x2502ff30 {alerted:true, loc_vars:function: 0x2502fff8, _saved_d_u:true, original_key:archeologydeck, mod:table: 0x2547f698, unlocked:true, registered:true (more...)}
back = table: 0x25056c50 {pos:table: 0x24f15be0, name:Archeology Deck, loc_name:Archeology Deck, effect:table: 0x24f89fe8, atlas:ExtraCredit_ECother}
(8) Lua method 'apply_to_run' at file 'back.lua:211'
Local variables:
self = table: 0x25056c50 {pos:table: 0x24f15be0, name:Archeology Deck, loc_name:Archeology Deck, effect:table: 0x24f89fe8, atlas:ExtraCredit_ECother}
obj = table: 0x2502ff30 {alerted:true, loc_vars:function: 0x2502fff8, _saved_d_u:true, original_key:archeologydeck, mod:table: 0x2547f698, unlocked:true, registered:true (more...)}
(9) Lua method 'start_run' at file 'game.lua:2096'
Local variables:
self = table: 0x24c8b528 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, viewed_stake:1, sort_id:68, F_DISCORD:true, STAGE:2, F_MOBILE_UI:false (more...)}
args = table: 0x255bf770 {stake:1}
saveTable = nil
selected_back = table: 0x2502ff30 {alerted:true, loc_vars:function: 0x2502fff8, _saved_d_u:true, original_key:archeologydeck, mod:table: 0x2547f698, unlocked:true, registered:true (more...)}
(10) Lua field 'func' at file 'functions/button_callbacks.lua:3021'
(11) Lua method 'handle' at file 'engine/event.lua:101'
Local variables:
self = table: 0x2575bd90 {start_timer:true, timer:REAL, func:function: 0x257a22b0, blockable:true, trigger:immediate, created_on_pause:true, delay:0, complete:false, time:63.983472400793 (more...)}
_results = table: 0x258c0808 {blocking:true, pause_skip:false, time_done:false, completed:false}
(12) Lua method 'update' at file 'engine/event.lua:185'
Local variables:
self = table: 0x25409610 {queue_last_processed:52.533333333332, queues:table: 0x25409638, queue_dt:0.016666666666667, queue_timer:52.802113415578}
dt = number: 0.0166666
forced = nil
(for generator) = C function: next
(for state) = table: 0x25409638 {unlock:table: 0x25409728, other:table: 0x254097c8, tutorial:table: 0x25409778, base:table: 0x25409750, achievement:table: 0x254097a0}
(for control) = number: nan
k = string: "base"
v = table: 0x25409750 {1:table: 0x256dabe8, 2:table: 0x2575bd90, 3:table: 0x25758ae8, 4:table: 0x24cc5e18, 5:table: 0x26135438, 6:table: 0x25bb8808, 7:table: 0x25720eb0 (more...)}
blocked = boolean: false
i = number: 2
results = table: 0x258c0808 {blocking:true, pause_skip:false, time_done:false, completed:false}
(13) Lua upvalue 'gameUpdateRef' at file 'game.lua:2586'
Local variables:
self = table: 0x24c8b528 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, viewed_stake:1, sort_id:68, F_DISCORD:true, STAGE:2, F_MOBILE_UI:false (more...)}
dt = number: 0
http_resp = nil
(14) Lua upvalue 'gameUpdateRef' at Steamodded file 'src/ui.lua:124'
Local variables:
self = table: 0x24c8b528 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, viewed_stake:1, sort_id:68, F_DISCORD:true, STAGE:2, F_MOBILE_UI:false (more...)}
dt = number: 0.0166666
(15) Lua method 'update' at line 32 of chunk '"5060"]'
Local variables:
self = table: 0x24c8b528 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, viewed_stake:1, sort_id:68, F_DISCORD:true, STAGE:2, F_MOBILE_UI:false (more...)}
dt = number: 0.0166666
(16) Lua upvalue 'love_update_ref' at file 'main.lua:1007'
Local variables:
dt = number: 0.0166666
(17) Lua field 'update' at file 'modules/controller.lua:1084' (from lovely module handy/controller)
Local variables:
dt = number: 0.0166666
(18) Lua function '?' at file 'main.lua:946' (best guess)
(19) global C function 'xpcall'
(20) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 917 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
Line 2068 in utils.lua is this
if G.GAME.blind then t[#t + 1] = { object = G.GAME.blind, scored_card = G.GAME.blind.children.animatedSprite } end