terranova3 / hl2rp-issues

Contains all the issues for the main gamemode that need to be fixed.
https://www.terranova-rp.com/
2 stars 0 forks source link

Tab menu is broken for me #23

Open bruhTerranovaMenuIsntWorking opened 2 years ago

bruhTerranovaMenuIsntWorking commented 2 years ago

Describe the bug Whenever using the tab menu, it comes up with a script error and the text is there but the tab menu isnt,

To Reproduce gamemodes/ixhl2rp/plugins/charpane/derma/cl_characterpanel.lua:106: attempt to index local 'charPanel' (a nil value)

  1. SetCharPanel - gamemodes/ixhl2rp/plugins/charpane/derma/cl_characterpanel.lua:106
    1. SetCharacter - gamemodes/ixhl2rp/plugins/charpane/derma/cl_characterpanel.lua:42
      1. Create - gamemodes/ixhl2rp/plugins/medical/derma/cl_medical.lua:18
        1. TransitionSubpanel - gamemodes/helix/gamemode/core/derma/cl_menu.lua:121
          1. OnSelected - gamemodes/helix/gamemode/core/derma/cl_menu.lua:296
            1. SetSelected - gamemodes/helix/gamemode/core/derma/cl_menubutton.lua:171
              1. PopulateTabs - gamemodes/helix/gamemode/core/derma/cl_menu.lua:346
                1. Init - gamemodes/helix/gamemode/core/derma/cl_menu.lua:77
                  1. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:37
                    1. unknown - gamemodes/helix/gamemode/core/hooks/cl_hooks.lua:8

Expected behavior I expected a tab menu from normal helix to pop up so I could make characters

Additional context I am not using a dedicated server which could be the problem but I'm not sure and I'm trying to get some help from here. error

Jonesboyplays commented 1 year ago

I fixed this with the following code (all I added was a print function) -- Called when we are assigning all the character panel data to this panel. function PANEL:SetCharPanel(charPanel) print(charPanel) -- Prints the panel if charPanel then self.panelID = charPanel:GetID()

    self:BuildSlots();

    for k, items in pairs(charPanel.slots) do
        if (!items.id) then continue end

        local item = ix.item.instances[items.id]

        if (item and !IsValid(self.panels[item.id])) then
            local icon = self:AddIcon(
                item, item:GetModel() or "models/props_junk/popcan01a.mdl", item.outfitCategory, item:GetSkin()
            )

            if (IsValid(icon)) then
                icon:SetHelixTooltip(function(tooltip)
                    ix.hud.PopulateItemTooltip(tooltip, item)
                end)

                icon.itemID = item.id
                self.panels[item.id] = icon
            end

            self.slots[item.outfitCategory].isEmpty = false
        end
    end
end

end

Jonesboyplays commented 1 year ago

Another thing I realized that the reason that it is nil is because it can't access the database. after realizing this, I wondered what the hell a database was, and remembering I was using sqlite, I should be using mysqloo.

I downloaded mysql from the site, its confusing when setting up helix, because you install a module titled mysql, but it is only a module for the actual program. I'll link it here. This is for windows. Download the one that is for your opperating system, and when promted in the installer, download the developer version.

Also, about the theory with a dedicated server, you are correct... at least in my expiriance. Just get SCRDs, its easier to find bugs and stuff that way.

Another REALLY helpful resource is CODY, a code AI. You can give it pretty much any error and It'll give advise. You can even give it the raw code and It'll help you better.

If you have any more questions, just ask. I'm not part of the team that made this, but I'm just trying to salvage what I can (It's going really well, special thanks to Adoophus!).