Scooty's Armor Swap


Adds a key binding (default: the "\" key) that equips the next armor in your inventory and sets your player color to the color that was last used with that armor. Rapidly cycle among color-coded armors specialized for different purposes!

Content
9 months ago
1.1
4.20K
Armor

b ✅ [CRASH] Error while running event scootys-armor-swap::on_player_armor_inventory_changed (ID 37)

9 months ago

4810.125 Error MainLoop.cpp:1391: Exception at tick 15579584: Мод Scooty's Armor Swap (1.3.0) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event scootys-armor-swap::on_player_armor_inventory_changed (ID 37)
scootys-armor-swap/control.lua:148: attempt to index local 'luaPlayer' (a nil value)
stack traceback:
scootys-armor-swap/control.lua:148: in function 'getArmorInfo'
scootys-armor-swap/control.lua:114: in function 'dyePlayerFromArmor'
scootys-armor-swap/control.lua:72: in function 'callback'
scootys-armor-swap/event.lua:14: in function <scootys-armor-swap/event.lua:12>
4810.125 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "Мод Scooty's Armor Swap (1.3.0) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event scootys-armor-swap::on_player_armor_inventory_changed (ID 37)
scootys-armor-swap/control.lua:148: attempt to index local 'luaPlayer' (a nil value)
stack traceback:
scootys-armor-swap/control.lua:148: in function 'getArmorInfo'
scootys-armor-swap/control.lua:114: in function 'dyePlayerFromArmor'
scootys-armor-swap/control.lua:72: in function 'callback'
scootys-armor-swap/event.lua:14: in function <scootys-armor-swap/event.lua:12>"

9 months ago

This is fixed in v1.4.0, released today. Thanks for your help!! Could you please download the update and let me know if it's working for you?

9 months ago

Installed the updates and the crash when enabling jetpack is gone, thanks.

I want to clarify, do you feel more comfortable when crash reports are written here or on GitHub?

9 months ago
(updated 9 months ago)

when jetpacking or unjetpacking while anywhere near a spacecraft,

The mod Scooty's Armor Swap (1.4.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event scootys-armor-swap::on_player_armor_inventory_changed (ID 37)
real number expected got nil.
stack traceback:
    [C]: in function 'set_color'
    __scootys-armor-swap__/control.lua:158: in function 'dyePlayerFromArmor'
    __scootys-armor-swap__/control.lua:77: in function 'callback'
    __scootys-armor-swap__/event.lua:14: in function <__scootys-armor-swap__/event.lua:12>

mod authors, please wrap your non-critical things in exception handlers so that it doesn't destroy 30 minutes of a player's time

9 months ago

Installed the updates and the crash when enabling jetpack is gone, thanks.

I want to clarify, do you feel more comfortable when crash reports are written here or on GitHub?

I have a slight preference for github, but either is fine.

9 months ago

@naiad - I'm sorry for that! I know how frustrating it is to lose progress, especially in SE. I'm pretty new to Lua; outside of some basic scripting back in my WoW days, this mod is my only usage of the language and thus far it's been a very frustrating experience for me. The lack of what I'd consider to be proper nil-coalescing, optionality handling or a decent guard-let combined with very fussy type specificity feels like the worst of both a scripting language and a high level language. I'm honestly not sure yet how folks write anything of complexity in this language! You seem to be pretty decent with lua yourself, given your contributions on the jetpack coloring fix, and I'd welcome any advice or resources on learning the language you might have.

9 months ago

@naiad - The crash involving jetpacking near a spaceship has been fixed in 1.4.1

9 months ago
(updated 9 months ago)

there's also a bug in 1.4.0 where there's lag of like 400ms when unjetpacking. is it fixed too?

search lua exception handling ->
search lua pcall stack trace ->
think about local ok, res = xpcall(f, debug.traceback, args...) ->
ugh ->
ask factorio devs to provide a stack trace mechanism that doesn't crash, for parts of mods where errors do not mean an invalid game state

i don't know lua, i just know programming in general. every programming environment has many extremely frustrating failures, like... if it's not like haskell, you're running blind; if it is like haskell, you're constantly in conflict about whether to laboriously work the non-turing-complete half of the language or to laboriously plead the language to let you run blind. if it's not like C, you're at the mercy of an opaque runtime that will only perform well if you write like it's corporate-style java; if it is like C, i hope you like writing the guts of a language interpreter because you're going to need them

i have no advice on programming

9 months ago

I've not noticed any additional lag when using Jetpack with Scooty's Armor Swap. It may be because Jetpack deletes and re-creates the character along with your armor, generating a new Item ID for it, which triggers the onArmorChanged event. The maintainers of the Jetpack mod say that they are fixing this in the next version of Jetpack, so I think I'll wait and see on that. Please let me know if you find anything.

New response