Bank Check Lady's outfit

Eggszecutor

Member
Gender
Male
Guildcard
42038428
Is it possible to change the color of the lady's outfit at the Check in counter to reflect whether you currently have access to the character bank or the shared bank?
 
You definitely can't do that in base Tethealla, as you'd need to hook the client to dynamically reload textures based on information sent by the server. You can't even dynamically pick the textures to use when you load Pioneer 2, let alone change the textures in realtime on a base client.
 
Good to know. I guess my thought here would be "Is it possible to some how have a visual reference to the active bank?" Just trying to come up with ideas on how to make the game better.
 
I was able to develop a Lua addon that could determine the active bank with fairly high accuracy. It uses the information to create a 20x20 imgui window with no border and sets the background to blue for the character bank and red for the shared bank.

The following instructions assume you have already installed the addon plugin.
https://www.pioneer2.net/community/threads/psobb-addon-plugin-lua-ui-addons.4543/

Copy/paste the following code into a file called init.lua, and put the file in its own subfolder inside your addons folder. Feel free to adjust the imgui window size and bank colors by tweaking the code at the top of the file.

Code:
local _WindowSize = { 20, 20 }

local _BankColors = {
    Character = 0x0000FF44,
    Shared = 0xFF000044,
    Unknown = 0x00000044
}

local present = (function()
    local function RGBA(color)
        local r = (math.floor(color / 0x01000000) % 0x100) / 0xFF
        local g = (math.floor(color / 0x00010000) % 0x100) / 0xFF
        local b = (math.floor(color / 0x00000100) % 0x100) / 0xFF
        local a = (math.floor(color / 0x00000001) % 0x100) / 0xFF
        return r, g, b, a
    end

    local ShipChanged = (function()
        local ShipAddress = 0x00AA6D00
        local CurrentShip = pso.read_wstr(ShipAddress, 0xFF)
   
        return function()
            local ship = pso.read_wstr(ShipAddress, 0xFF)
            local changed = ship ~= CurrentShip
            CurrentShip = ship
            return changed
        end
    end)()
 
    local NotificationAddress = 0x00AAECC8
    local ActiveBank = "Unknown"
 
    local WindowSize = _WindowSize
    local BankColors = _BankColors
 
    return function()
        local addr = pso.read_u32(NotificationAddress)
   
        if (addr ~= 0) then
            local text = pso.read_wstr(addr + 0x14, 0xFF)
            local bank = string.match(text, "Bank: (%a+)")
       
            if bank then
                ActiveBank = bank
            end
        end
   
        if ShipChanged() then
            ActiveBank = "Character"
        end
   
        local bankColor = BankColors[ActiveBank]
        imgui.PushStyleColor("WindowBg", RGBA(bankColor))
   
        local width, height = unpack(WindowSize)
        imgui.SetNextWindowSize(width, height, "Always")
        imgui.Begin("Bank Indicator", true, { "NoTitleBar", "NoResize" })
        imgui.End()
   
        imgui.PopStyleColor()
    end
end)()

local function init()
    return
    {
        name = "Bank Indicator",
        version = "1.0.0",
        author = "staphen",
        description = "Indicates which bank is active",
        present = present
    }
end

return {
    __addon = {
        init = init
    }
}

FYI, this code uses the text sent by the server in the notification area on the far right, so if you reload your addons in-game, it will forget which bank is active until the next /bank. It can also get confused if you switch to the shared bank, then use the lobby counter to change ships, but instead select the ship and block that you are currently on. This causes the server to reset to the character bank, and I couldn't find a reliable way for the addon to determine that it happened so it will still think you're using the shared bank.
 
Back
Top