Log in to reply
 

ScriptHookV dotNet doesn't recognize my scripts anymore



  • Hi people. I'm having a weird problem. Yesterday I was working on a little mod, and everything was working fine. I compiled some code before going to bed, so I couldn't test it. Today I test the dll and notice it doesn't work. It does nothing, and when I check the ScriptHookVdotNet.log, the line where it loads my dll says "[DEBUG] Found 0 script(s)". I tried to reduce my code to the minimum, and recompile it to test if something in the code is causing this, but none of the dll's I compile work in game. I tried this simple script:

        public Class1()
        {
            UI.Notify("Create");
            LoadSettings();
            Interval = 10000;
    
            Tick += OnTick;
            KeyDown += OnKeyDown;
        }
    
        private void OnTick(object sender, EventArgs e)
        {
    
        }
    
    
        private void OnKeyDown(object sender, KeyEventArgs e)
        {            
            if (e.KeyCode == MenuKey)
            {
                UI.Notify("Doing stuff");
            }
        }
    
        void LoadSettings()
            {
            try
            {
                ScriptSettings config = ScriptSettings.Load(@".\scripts\Config.ini");
            }
            catch (Exception e)
            {
                UI.Notify(e.Message);
            }
        }
    }
    

    And it doesn't work either. It doesn't throw any error while compiling, and the SHVDN log doesn't show anything either. I don't know whats going on.

    I'm using the Doomsday update (because SHV isn't updated yet), GTA5 steam version. All my other mods work normally, only the ones I compile don't work. Any ideas?


  • MODERATOR

    @MaxShadow The first place I'd look is your Hint Path; aka, are you sure you are linking against the current ScriptHookVDotNet2.dll?



  • This post is deleted!


  • Yes, the hint path is ok.

    Reference Include="ScriptHookVDotNet2">
    <HintPath>............\Program Files (x86)\Steam\steamapps\common\Grand Theft Auto V\ScriptHookVDotNet2.dll</HintPath>
    </Reference>

    I removed NativeUI.dll (I wasn't using it yet), tried to change the compile architecture to x64 and dotNet 4.5.2. It still says 0 scripts. I don't know what's going on.



  • @MaxShadow The class must inherit from Script.
    Like

    public MyScriptCore : Script
    {
       ...
    }
    

    Also make sure you have set the project properties to RELEASE.



  • Yeah, it was inherited from Script. Anyway, I think I found the problem. A copy of ScriptHookVdotNet2.dll got somehow placed inside my scripts folder, which makes some scripts not load. My mod manager is probably bad configured, and it installed that dll in the wrong folder.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.