Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RLL4 Commentary Blobset Tools
#21
Works a treat thanks mate! I really wish you could find the file that triggers the surnames in the commentary. I know we've been over that before and there is no coding that part of but I could add so many more names in the game. Until then I will just add the names and to work around with the wrong surname showing!
Reply
#22
Ok I have finally figured out the commentary issue and now you can change the commentary for a player. The reason why it wasn't working original is because BigAnt was using the surname instead of the the selected commentary index.

This is what I did -

In the "identity_component.lua" class script I added this to the "initClass", which grabs all the commentary name in a indexed array.


Code:
    local commentarySurnames = assert(slot1.commentarySurnames)

    function slot0.getCommentarySurnames(slot0)
        return commentarySurnames
    end


In the "commentary_categories.lua" script I change this local function to this -


Code:
local function getPlayerCommentaryName(slot0, slot1, slot2, slot3)
    assert(commentary_helper.PlayerIdFunctions[slot0.type], "Missing player id function for event: " .. slot0.type)
    
    local playerId = commentary_helper.PlayerIdFunctions[slot0.type](slot0, slot1, slot2, slot3)
    
    if not playerId then
        return
    end
    
    local commentaryUI = assert(slot3:getGameObject(playerId):getCommentarySurnames())
    local commentaryIndex = assert(slot3:getGameObject(playerId).identity:getOption("commentaryName"))
    local plySurname = tostring(slot3:getGameObject(playerId).identity.surname)
    
    if commentaryIndex == 0 then
        commentaryIndex = false
    end
    
    return commentaryIndex and commentaryUI:at(commentaryIndex) or plySurname
end

What that function does now is if commentaryIndex = 0, which is when a player commentary is set to none it will return the player surname like it originally does, but if the index is above 0 it will set the index in commentaryUI
which holds all the player names by index and get that name instead.

I will release the files soon.
Reply
#23
Just download RLL4 Lua Config Mods 0.3 from the RLL4 Lua Config Mods thread for the commentary fix.
Reply
#24
(12-06-2019, 05:26 PM)Wouldubeinta Wrote: Ok I have finally figured out the commentary issue and now you can change the commentary for a player. The reason why it wasn't working original is because BigAnt was using the surname instead of the the selected commentary index.

This is what I did -

In the "identity_component.lua" class script I added this to the "initClass", which grabs all the commentary name in a indexed array.


Code:
    local commentarySurnames = assert(slot1.commentarySurnames)

    function slot0.getCommentarySurnames(slot0)
        return commentarySurnames
    end


In the "commentary_categories.lua" script I change this local function to this -


Code:
local function getPlayerCommentaryName(slot0, slot1, slot2, slot3)
    assert(commentary_helper.PlayerIdFunctions[slot0.type], "Missing player id function for event: " .. slot0.type)
    
    local playerId = commentary_helper.PlayerIdFunctions[slot0.type](slot0, slot1, slot2, slot3)
    
    if not playerId then
        return
    end
    
    local commentaryUI = assert(slot3:getGameObject(playerId):getCommentarySurnames())
    local commentaryIndex = assert(slot3:getGameObject(playerId).identity:getOption("commentaryName"))
    local plySurname = tostring(slot3:getGameObject(playerId).identity.surname)
    
    if commentaryIndex == 0 then
        commentaryIndex = false
    end
    
    return commentaryIndex and commentaryUI:at(commentaryIndex) or plySurname
end

What that function does now is if commentaryIndex = 0, which is when a player commentary is set to none it will return the player surname like it originally does, but if the index is above 0 it will set the index in commentaryUI
which holds all the player names by index and get that name instead.

I will release the files soon.

You sir are amazing man! It works and absolute treat! Game changer. So good! I will send you some new names once i finish them. THank you!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)