Colorization and Ironman-related Script Help

I've been trying to make a lua script that applies the colorization effect to the player when transformed into another character via the SF_IRONMAN flag. No errors show up when the addon is loaded, but the colorization lua does not work properly. Are there any variables or factors that determine if the player is copying a random character? Please let me know.

Colorization.lua:
// Colorize Script
// This script can be used for whatever mod you're making (it's reusable after all)

addHook("ThinkFrame", do
    for player in players.iterate
        if not (player.mo and player.mo.skin == "tellware") then continue end
        
        if player.pflags&SF_IRONMAN
            player.mo.colorized = true
        else
            player.mo.colorized = false
        end
    end
end)
 
An ironman's player and mobj will have different skin values. continue if your player skin isn't tellware, then check to see if the mobj has a different skin.
 
An ironman's player and mobj will have different skin values. continue if your player skin isn't tellware, then check to see if the mobj has a different skin.
If I understand it correctly: player.mo represents the mobj and player.mo.skin is the character the player is currently playing as. So I'll probably need to set it so it checks if the mobj variable isn't the skin of tellware, so it applies the colorization effect. I may have gotten it wrong, though.

UPDATE: I found a way to have the character colorized when switching between characters, but there's an issue where the player, or another racer, is colorized even when the skin they're using isn't tellware. I did hear that there is a value stored for ironman characters to hold the skin name of whatever character they're playing as, but no info was given about the name of the value. Do you know anything about this?
 
Last edited:
You should probably look at player.skin which holds the selected skin of the player, instead of the currently applied skin
 
Back
Top