I ran into a bug with my mod where the game crashes (back to the menu if running as qvm and a hard crash if running as dll). If it crashes back to the menu I get this error message: "CVAR_Update: handle out of range".
This happens only when the g_synchronousclients cvar is set to 1 and the mod starts an in-game cutscene.
In g_misc.c (line 63) you can see how cutscenes are implemented. It builds an info string and sets that as configstring. In cg_view.c there's the CG_CalcCutsceneViewValues function which reads the configstring and translates it back to a view position. It adjusts the cg.refdef values to move the player's view to the desired position.
Also, to make sure the client is in the same vis area as the camera should be (so the world is actually drawn), server-side the client's position is updated as well. This is done in g_main.c in the G_RunCutscene function (line 1400). It's called from G_RunFrame.
What's probably also of importance is that the player's pmove_type is set to PM_CUTSCENE, a new constant.
I guess this method does something that g_synchronousclients doesn't really like, but I'm not sure what exactly goes wrong (or what g_synchronousclients really does). I tried building ioQuake so I could take a closer look at what happens there, but when trying to build the ioq3.sln from the misc\msvc folder I get the error "cannot open input file 'SDLmain.lib'"
CVAR_Update: handle out of range
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: CVAR_Update: handle out of range
Compile a debug build, put a breakpoint on the error message (it's somewhere in qcommon/cvar.c) and inspect the stack backtrace when the breakpoint is hit.
You probably need to point MSVC to it, it's in code/libs/win(32|64)Eraser wrote:II tried building ioQuake so I could take a closer look at what happens there, but when trying to build the ioq3.sln from the misc\msvc folder I get the error "cannot open input file 'SDLmain.lib'"
Re: CVAR_Update: handle out of range
Oh ! An old topic about a contemporary problem of mine !
But what I'm really not sure about is understand the meaning or find the original cvar causing the trouble.
Can I have more information about that breakpoint method ?
Eraser, did you solve that error in another way that setting g_synchronousclients to 0 ?
I'm using minGW and Msys to compile ioquake3, and I can compile a debug build. I located the error message in cvar.c, and I'm pretty sure I can get the info out of the cvar_t that breaks everything.^misantropia^ wrote:Compile a debug build, put a breakpoint on the error message (it's somewhere in qcommon/cvar.c) and inspect the stack backtrace when the breakpoint is hit.
But what I'm really not sure about is understand the meaning or find the original cvar causing the trouble.
Can I have more information about that breakpoint method ?
Eraser, did you solve that error in another way that setting g_synchronousclients to 0 ?
[url=http://www.dmitri-engman.fr/]My blog[/url] - [url=http://dmeat.free.fr/book/]My portfolio[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
Re: CVAR_Update: handle out of range
Nope, never figured it out. I implemented a workaround by automtically disabling synchronous clients while running a cutscene. This behavior can be disabled through a cvar if someone wants to (manually disabling and enabling synchronous clients gives a nicer result, if timed right).
If you feel up to fixing the bug, go ahead. I'll merge the changes into the trunk.
If you feel up to fixing the bug, go ahead. I'll merge the changes into the trunk.
Re: CVAR_Update: handle out of range
I encounted the problem on my own project, and I don't think this time it has anything to do with g_synchronousclients ... sorry 
What I do is I run a function that sets a "global" variable when the map is loaded. The funny thing is that the function seems to run well (The com_printf prints what it's told to before the error) and the "handle out of range" happens right after.
By the way, I declared my variable along with :
line 85.

What I do is I run a function that sets a "global" variable when the map is loaded. The funny thing is that the function seems to run well (The com_printf prints what it's told to before the error) and the "handle out of range" happens right after.
By the way, I declared my variable along with :
Code: Select all
cg_t cg;
cgs_t cgs;
centity_t cg_entities[MAX_GENTITIES];
weaponInfo_t cg_weapons[MAX_WEAPONS];
itemInfo_t cg_items[MAX_ITEMS];
//Insert here "global variable of the loopmap ? the map bounds vectors and the temp directions to shift concerned entities position
vec3_t cg_loopBounds[2][8];
loopDirections_t cg_loopDirections[3];
[url=http://www.dmitri-engman.fr/]My blog[/url] - [url=http://dmeat.free.fr/book/]My portfolio[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
Re: CVAR_Update: handle out of range
I "solved" the problem by declaring my array variable inside the cg_t structure (named "cg" inside the cgame chapter).
No explanation about anything though.
No explanation about anything though.
[url=http://www.dmitri-engman.fr/]My blog[/url] - [url=http://dmeat.free.fr/book/]My portfolio[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]