Nameless - Hide Your Character's Nameplate

Eorzea Time
 
 
 
Langues: JP EN FR DE
users online
Forum » Windower » General » Nameless - Hide your character's nameplate
Nameless - Hide your character's nameplate
 Asura.Cariko
Offline
Serveur: Asura
Game: FFXI
user: Kariko
Posts: 43
By Asura.Cariko 2022-12-31 02:58:59
Link | Citer | R
 
Updated 0.1.4 - Removed most of the patchwork of event checks, leaving just a few in its place. Prerender triggers a per-tick invisibility status check and adjusts visibility accordingly. Zone change toggles the prerender check off until the inventory load event, which still behaves as it did before. Tested for prism powders, invisibility casts, and spectral jigging.

Spectral Jig is still annoying, but functional, as it sometimes flashes the nameplate twice instead of just once when getting the "No effect on <player>" result. Seems (just guessing, here) the animation itself is trying to apply the invisibility visual to the client a couple of times during its animation, so sometimes this triggers two ticks' worth of nameplate resets. Perhaps the player deserves it for forgetting to toggle off their sneak buff before over-zealously jigging again.

The toggle coded in prevents a strange bug with the prerender event checks that for some reason caused the player to enter a new zone transparent... sometimes. Oddly consistently with Buburimu Peninsula, but not everywhere. This issue is still somewhat present, but in a less annoying form: Sometimes you'll zone and your name plate will already be gone. Other times it will be visible until the main inventory load event. Fought with this for awhile. Still not sure why it's happening that way.
[+]
 Asura.Cariko
Offline
Serveur: Asura
Game: FFXI
user: Kariko
Posts: 43
By Asura.Cariko 2023-01-01 23:29:03
Link | Citer | R
 
Shiva.Thorny said: »
Otherwise, it's also possible to edit the code that draws your own name to begin with, so you don't have to constantly check anything or alter the entity flags.

Appreciated the feedback (lead to the 0.1.4 simplification of event checks), but I'd love to know how that would work, and if it could, why someone hadn't already gotten around to doing it. I wound up making this partly because of a much older post where someone suggested using invisibility as a workaround to achieve this result, but they explained absolutely nothing past that.

If there's a simple way to just toggle off the nameplate, I'd be happy to use that instead of what I've cobbled together largely from others' work. I know there's something for Ashita that works, but I've got too many other addons with Windower that I'm not sure I could live without anymore.
 Fenrir.Positron
Offline
Serveur: Fenrir
Game: FFXI
user: Positron
Posts: 181
By Fenrir.Positron 2023-01-02 03:55:31
Link | Citer | R
 
0.1.4 has been great so far, no issues to report.
 Bahamut.Navius
Offline
Serveur: Bahamut
Game: FFXI
user: phot0nic
Posts: 68
By Bahamut.Navius 2023-01-02 12:50:31
Link | Citer | R
 
I've been using 0.1.4 since you released it, and have done a couple Sorties with frequent prism powder use. So far no issues here, thank you.
 Asura.Cariko
Offline
Serveur: Asura
Game: FFXI
user: Kariko
Posts: 43
By Asura.Cariko 2023-01-02 14:02:02
Link | Citer | R
 
Glad to hear it. THF's Hide ability also seems to be working fine for me. Not sure if there are any other alternative invisibility sources, but was surprised that one was already working.
 Shiva.Thorny
Offline
Serveur: Shiva
Game: FFXI
user: Rairin
Posts: 2773
By Shiva.Thorny 2023-01-02 16:09:42
Link | Citer | R
 
I think you missed my point a bit, you're altering the render flags so you may as well use those to determine if you're invisible rather than trying to check buffs. Instead of relying on buffs, which come in a seperate packet and may or may not be timed the same, you can look at when the player update packet sets your model to invisible or not. Your concern is with the player model being invisible, not anything to do with the buffs. You don't really need coroutines either, one frame will always fix it, so you can just do a one-off flag to force it visible for one frame.
Code

local path = windower.addon_path:gsub('\\', '/') .. 'EntityFlagChanger.dll'
local _FlagChanger = assert(package.loadlib(path, 'luaopen_EntityFlagChanger'))()
local ForceNameVisible = false;
local RealInvisibleState;

windower.register_event('load', function()
    local myIndex = windower.ffxi.get_player().index;
    RealInvisibleState = _FlagChanger.IsEntityInvisible(myIndex);
end)

windower.register_event('prerender', function()
    --Make sure entity is valid, may not need to do this on windower..?
    local myEntity = windower.ffxi.get_player();
    if (myEntity == nil) then
        return;
    end
    local myIndex = myEntity.index;
    if (myIndex == nil) or (myIndex == 0) then
        return;
    end
    
    --If you have to show entity name for a frame, do it.
    if (ForceNameVisible == true) then
        _FlagChanger.ShowEntityName(myIndex);
        ForceNameVisible = false;
        return;
    end
    
    --Hide entity name
    if not _FlagChanger.IsNameHidden(myIndex) then
        _FlagChanger.HideEntityName(myIndex);
    end
end)

local function bitand(a, b)
    local result = 0
    local bitval = 1
    while a > 0 and b > 0 do
      if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits
          result = result + bitval      -- set the current bit
      end
      bitval = bitval * 2 -- shift left
      a = math.floor(a/2) -- shift right
      b = math.floor(b/2)
    end
    return result
end

windower.register_event('incoming chunk', function(id, data)
    --Reset invisible state on zonein..
    if id == 0x00A then
        RealInvisibleState = false;
    else if id == 0x037 then
        --This is the packet/field that sets the flag, unsure the best way to do bitwise and on windower.
        local playerUpdate = packets.parse('incoming', data);
        local isInvisible = (bitand(playerUpdate._flags3, 0x80) ~= 0);
        if isInvisible ~= RealInvisibleState then
            if not isInvisible then
                ForceNameVisible = true;
            end
            RealInvisibleState = isInvisible;
        end
    end
end


As far as altering the code to hide the draw in the first place, that would be done by reverse engineering where the client reads the flag and seeing where the draw call happens. It's not necessarily easy, just possible.
Offline
Posts: 32
By Wiking 2023-01-11 07:00:26
Link | Citer | R
 
I like this a lot. Anyway an addon could hide the party window?
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 694
By Bismarck.Xurion 2023-01-11 09:32:18
Link | Citer | R
 
Kinda semi-related - I'm interested in learning about how to create DLLs in the way you have. I've created plenty of Lua scripts and addons these past few years but never ventured into this.

Any starting pointers? Or advice on where best to start?
 Bahamut.Negan
Offline
Serveur: Bahamut
Game: FFXI
user: Negan
Posts: 2193
By Bahamut.Negan 2023-01-11 11:59:52
Link | Citer | R
 
Bismarck.Xurion said: »
Kinda semi-related - I'm interested in learning about how to create DLLs in the way you have. I've created plenty of Lua scripts and addons these past few years but never ventured into this.

Any starting pointers? Or advice on where best to start?
https://openai.com/blog/chatgpt/

[+]
 Fenrir.Positron
Offline
Serveur: Fenrir
Game: FFXI
user: Positron
Posts: 181
By Fenrir.Positron 2023-01-11 16:01:39
Link | Citer | R
 
Found a minor issue, haven't determined what causes it yet: in some cases, after losing the invisible status effect it takes a few extra seconds for the character to stop being invisible from the client's perspective. This caused an issue in Sortie when I couldn't interact with the teleporter while enemies were bearing down on me.