Unable to run mod in latest build
Posted: 2014-09-05, 04:49
Hi Carsten,
I updated to the latest version of cafu, but now for some reason my mod doesn't load.
The -svGame Duel command loads up into the menu. I see the Duel Map, which is only in the Duel path, but when I load it up, although it loads up the correct map, I get an error at
HUD_main.cgui:125 - Bad Argument #1 to get:("Frags") variable frags is unknown.
This tells me straight away this is loading the script code from the DeathMatch path, as that is your code. My line 125 is updated to make use of my Score component and looks like this:
local kills = gui.Entity:GetComponent("Score"):get("Kills")
To confirm the game was running deathmatch instead of duel, I moved the DeathMatch folder, and the game crashed with a Microsoft error reporting box. once I tried to load past the menu.
It seems to be loading everything except for the scripts from the correct path. Is there any hard defined link to the script folder anywhere in the code?
I must advise this is also a brand new issue, it wasn't in the build I downloaded on the 28th August, but is in this latest build.
Edit-- I found the problem, the GUI path is hardcoded in the HumanPlayer file. I didn't notice it previously, as I had worked in the deathmatch folder before swapping over to duel, so the code was the same in both branches.. I am now completely independent, or at least, haven't found any other dependency issues yet
I would suggest not communicating directly with the GUI through a component.cpp file, as it makes the engine very inflexible if you want to be able to run more than one game from the same base code.
I also noticed a lot of non-dynamic paths in the .cgui files etc, it may be worth looking at a pathing system which automatically inserts the -svGame parameter that is passed to it, so the engine always goes to the right script files
I updated to the latest version of cafu, but now for some reason my mod doesn't load.
The -svGame Duel command loads up into the menu. I see the Duel Map, which is only in the Duel path, but when I load it up, although it loads up the correct map, I get an error at
HUD_main.cgui:125 - Bad Argument #1 to get:("Frags") variable frags is unknown.
This tells me straight away this is loading the script code from the DeathMatch path, as that is your code. My line 125 is updated to make use of my Score component and looks like this:
local kills = gui.Entity:GetComponent("Score"):get("Kills")
To confirm the game was running deathmatch instead of duel, I moved the DeathMatch folder, and the game crashed with a Microsoft error reporting box. once I tried to load past the menu.
It seems to be loading everything except for the scripts from the correct path. Is there any hard defined link to the script folder anywhere in the code?
I must advise this is also a brand new issue, it wasn't in the build I downloaded on the 28th August, but is in this latest build.
Edit-- I found the problem, the GUI path is hardcoded in the HumanPlayer file. I didn't notice it previously, as I had worked in the deathmatch folder before swapping over to duel, so the code was the same in both branches.. I am now completely independent, or at least, haven't found any other dependency issues yet
I would suggest not communicating directly with the GUI through a component.cpp file, as it makes the engine very inflexible if you want to be able to run more than one game from the same base code.
I also noticed a lot of non-dynamic paths in the .cgui files etc, it may be worth looking at a pathing system which automatically inserts the -svGame parameter that is passed to it, so the engine always goes to the right script files