catoni0 / vrmod-x64

Optimization project aimed to create stable all in-one-package for gmod x64/Linux
Other
3 stars 0 forks source link

attempted to compare two nil values. #1

Closed jurassicjordan closed 1 month ago

jurassicjordan commented 1 month ago

error occurs after doing vrmod_start and unpausing the game, it immedialy spits out these errors and fails to run vrmod.

[vrmod-x64-addon] addons/vrmod-x64-addon/lua/autorun/vrmod_init.lua:9: attempt to compare two nil values
    1. unknown - addons/vrmod-x64-addon/lua/autorun/vrmod_init.lua:9
        2. sort - [C]:-1
            3. unknown - addons/vrmod-x64-addon/lua/autorun/vrmod_init.lua:9
[vrmod-x64-addon] addons/vrmod-x64-addon/lua/vrmod/base/vrmod.lua:327: attempt to call global 'VRUtilLoadCustomActions' (a nil value)
    1. VRUtilClientStart - addons/vrmod-x64-addon/lua/vrmod/base/vrmod.lua:327
        2. unknown - addons/vrmod-x64-addon/lua/vrmod/base/vrmod.lua:146
catoni0 commented 1 month ago

try renaming "vrmod-x64-addon" folder to something without "-"

jurassicjordan commented 1 month ago

try renaming "vrmod-x64-addon" folder to something without "-"

Just gave it a try still erroring.

this first error occurs while the game is starting a map

[vrmodx64addon] addons/vrmodx64addon/lua/autorun/vrmod_init.lua:9: attempt to compare two nil values
    1. unknown - addons/vrmodx64addon/lua/autorun/vrmod_init.lua:9
        2. sort - [C]:-1
            3. unknown - addons/vrmodx64addon/lua/autorun/vrmod_init.lua:9
[vrmodx64addon] addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:327: attempt to call global 'VRUtilLoadCustomActions' (a nil value)
    1. VRUtilClientStart - addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:327
        2. unknown - addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:146

forgot to also mention, this is the output from the console:

] vrmod_start
vrmod: attempting startup when game is unpaused

[vrmodx64addon] addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:327: attempt to call global 'VRUtilLoadCustomActions' (a nil value)
  1. VRUtilClientStart - addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:327
   2. unknown - addons/vrmodx64addon/lua/vrmod/base/vrmod.lua:146

Timer Failed! [vrmod_start][@addons/vrmodx64addon/lua/vrmod/base/vrmod.lua (line 143)]
catoni0 commented 1 month ago

this first error occurs while the game is starting a map

looks like init does not load all the files for some reason. In order to confirm this let's add couple of prints to vrmod_init.lua

AddCSLuaFile()

include("vrmod/base/vrmod_api.lua")
include("vrmod/base/vrmod.lua")

local paths = {}

local _, folders = file.Find("vrmod/*","LUA")
PrintTable(folders)
table.sort(folders, function(a,b) return tonumber(a) < tonumber(b) end)
for k,v in ipairs(folders) do
    paths[#paths+1] = "vrmod/"..v.."/"
end
paths[#paths+1] = "vrmod/"

PrintTable(paths)
for k,v in ipairs(paths) do
    for k2,v2 in ipairs(file.Find(v.."*","LUA")) do
        print(v2)
        if v2 ~= "vrmod.lua" and v2 ~= "vrmod_api.lua" then
            AddCSLuaFile(v..v2)
            include(v..v2)
        end
    end
end

Gmod should reload the file as soon as you save the changes and you should see the output in the console. If not reload map.

we can try loading files manually, then vrmod_init.lua should be following

AddCSLuaFile()

include("vrmod/base/vrmod_api.lua")
include("vrmod/base/vrmod.lua")
include("vrmod/base/cardboardmod.lua")
include("vrmod/base/vrmod_changelog.lua")
include("vrmod/base/vrmod_network.lua")
include("vrmod/ui/vrmod_actioneditor.lua")
include("vrmod/ui/vrmod_addmenu.lua")
include("vrmod/ui/vrmod_arcmenu.lua")
include("vrmod/ui/vrmod_dermapopups.lua")
include("vrmod/ui/vrmod_halos.lua")
include("vrmod/ui/vrmod_hud.lua")
include("vrmod/ui/vrmod_mapbrowser.lua")
include("vrmod/ui/vrmod_menu.lua")
include("vrmod/ui/vrmod_ui.lua")
include("vrmod/ui/vrmod_ui_buttons.lua")
include("vrmod/ui/vrmod_ui_chat.lua")
include("vrmod/ui/vrmod_ui_heightadjust.lua")
include("vrmod/ui/vrmod_ui_quickmenu.lua")
include("vrmod/ui/vrmod_ui_weaponselect.lua")
include("vrmod/ui/vrmod_worldtips.lua")
include("vrmod/io/vrmod_climbing.lua")
include("vrmod/io/vrmod_doors.lua")
include("vrmod/io/vrmod_dropweapon.lua")
include("vrmod/io/vrmod_flashlight.lua")
include("vrmod/io/vrmod_input.lua")
include("vrmod/io/vrmod_locomotion.lua")
include("vrmod/io/vrmod_manualpickup.lua")
include("vrmod/io/vrmod_melee_global.lua")
include("vrmod/io/vrmod_physhands.lua")
include("vrmod/io/vrmod_pickup.lua")
include("vrmod/io/vrmod_pickup_arcvr.lua")
include("vrmod/io/vrmod_seated.lua")
include("vrmod/io/vrmod_steamvr_bindings.lua")
include("vrmod/view/vrmod_character.lua")
include("vrmod/view/vrmod_character_hands.lua")
include("vrmod/view/vrmod_pmchange.lua")
include("vrmod/view/vrmod_viewmodeledit.lua")
include("vrmod/view/vrmod_viewmodelinfo.lua")
include("vrmod/view/vrmod_weaponreplacer.lua")

Also need some more info: OS, Gmod Version, If you running native or under proton

jurassicjordan commented 1 month ago

oh, my apologies. here's the info on my system: OS: Linux EndeavourOS (arch essentially) Kernel ver 6.10.10-zen1-1-zen Gmod version: Exe version 2023.06.28 (garrysmod) Exe build: 16:22:33 Sep 23 2024 (9452) (4000) GMod version 2024.09.25, branch: x86-64, multicore: 1 Linux 64bit (native, not proton)

not sure when the prints are supposed to occur so I'll try to be thorough and send the whole console output.

first attempt after adding the prints: https://pastebin.com/Mqcku9dB

second attempt adding the includes for all files: (oddly this time gave me the ability to use the command "vrmod" instead of "vrmod start". I typed the command just "vrmod" and finally got the menu when unpausing, but then I start VR and my headset gets no picture, the game seems to not recive tracking data, and theres a wooden box dragging sound in the background. I ensured the original vrmod isnt enabled, however it is installed and could be pulling from it)

https://pastebin.com/TCWQX8fP

I then fully restarted the game and uninstalled the original VRMod completely. ITS NOW WORKING! okay, I think that was my fault for not uninstalling the old mod. The combination wiping away the old mod and forcing the includes seems to have fixed it.

Is there a possiblility to put your version of the addon on the workshop?

anyway, feel free to close the issue here, unless theres more tests you want me to try.

catoni0 commented 1 month ago

I wanted to ask if you uninstalled any other vrmod versions, but thought that it's too obvious :D

Now I wonder if the original vrmod_init will work. Would be nice if you can test.

I would eventually post it in workshop, but now it's a bit too early. Work in progress

jurassicjordan commented 1 month ago

Awesome, well keep up the great work! I’m happy to help test and play further and report issues to you! Closing this issue now