CGM buffer for client 0 is full

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

CGM buffer for client 0 is full

Post by wacko »

I've made a stopwatch counting the time a player is in an area.
Now after being in there for some seconds, I get that error message "CGM buffer for client 0 is full" repeatedly and fps are under 5.
What is a CGM buffer and/or what should I do?

Code: Select all

start_pw:
local.player=parm.other
local.stopwatch=0.0
while (local.player istouching $pw)
{
waitthread hudprint ((local.stopwatch) + " seconds") .75 .65 .1 
local.stopwatch += 0.1
}
waitframe 
wait 10
waitthread hudprint (" ") 1 1 1
end 

hudprint local.nstring local.r local.g local.b: 

   huddraw_rect 187 140 -84 50 50 
   huddraw_color 187 local.r local.g local.b 
   huddraw_font 187 "facfont-20" 
   huddraw_string 187 local.nstring 
   huddraw_align 187 left bottom 
   huddraw_alpha 187 1 
   wait .1 //refresh time 

end
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

too much hud print in too little time. well.

i take it thats a trigger_multple.

so. The guy walks in and then he triggers off alot of fast hud prints while he stays there each .1 one, but as he stays there hes still touching a trigger which is trigger again threading to another loop and another and another that dont end as hes there. all hud printing really fast.

if ur going to have seconds why not wait a second alsom really need to go at 0.1 of a second :|?

try doing the follwing might stop it:

Code: Select all

start_pw:
local.player=parm.other
if(self.trig_dude == local.player)
{
end
}
self.trig_dude  = local.player
local.stopwatch=0.0
while (local.player istouching $pw)
{
waitthread hudprint ((local.stopwatch) + " seconds") .75 .65 .1
local.stopwatch += 0.1
}
waitframe
wait 10
waitthread hudprint (" ") 1 1 1
self.trig_dude  = NIL
end

User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Perfect explanation and solution! :D
Thanks Elgan, this seems to work. Now I start tryin local.stopwatch += 0.01 :P :wink:
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Just one comment you can change the color and string without redefineing the size , font ,alpha and alignment each time . You can draw it once and update the color and string . If you remember the botsmapper I did it had a scrolling message along the bottom that changed colors as it moved . This is the thread , you see the color and position is changed inside the whle loop but not all the other information .

drawhud:

huddraw_virtualsize 1 1
huddraw_alpha 1 1
huddraw_font 1 "facfont-20"
huddraw_color 1 1 0 0
huddraw_rect 1 0 400 300 20
huddraw_string 1 "Bot mapping system by Bdbodger"
huddraw_align 1 "left" "top"

local.c = 0

while(1)
{
for(local.i= 640;local.i > -300;local.i--)
{
huddraw_rect 1 local.i 400 300 20

if(local.c == 50)
{
local.c = 0
huddraw_color 1 (randomfloat(1)) (randomfloat(1)) (randomfloat(1))
}

local.c++

wait .03
}
}

end


Also how is your thread started with setthread ? Can it be new threads are being started for this player over and over again ? I don't see a nottriggerable for the trigger or any thing to stop a new thread being started as the trigger keeps fireing . If you didn't use setthread then never mind .
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

bdbodger wrote:...
Also how is your thread started with setthread ? Can it be new threads are being started for this player over and over again ? I don't see a nottriggerable for the trigger or any thing to stop a new thread being started as the trigger keeps fireing . If you didn't use setthread then never mind .
Umm, it is started by a setthread. :oops: But it might be started for mutiple players and if I did make it nottriggerable, wouldn't it stop working then for the other players? Is Elgan's method not, umm, good enough?
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

well thinkin about it my meathod might still crash with lots of people in the trigger as the trig-dude would change and then change agian so everyone keeps getting triggerd again. sorry i overlooked that.

nottriggerable would stop everyone else from the trigger. If thats what u want use that else.

also u wont need to change the colour of the hud draw again at the end, just nulling the string will hide it.

We could store if the player has triggerd it in the player instead or an array in the trigger. i stored it in the trigger before because then its just that little extra thing the player has to carry arround with them aye. This time we will store it in the player however.

Code: Select all

start_pw:
local.player=parm.other
if(local.player.trig_dude == 1)
{
end
}
waitthread hudprint // just set it up first.
local.player.trig_dude = 1
local.stopwatch=0.0
while (local.player istouching $pw)
{
//waitthread hudprint ((local.stopwatch) + " seconds")
wait .1
huddraw_string 187 ((local.stopwatch) + " seconds")
local.stopwatch += 0.1
}
waitframe
wait 10
//waitthread hudprint (" ") 1 1 1
huddraw_string 187 ""
local.player.trig_dude = 0
}

end

hudprint local.nstring local.r local.g local.b:

   huddraw_rect 187 140 -84 50 50
   huddraw_color 187 .75 .65 .1 //local.r local.g local.b
   huddraw_font 187 "facfont-20"
   huddraw_string 187 local.nstring
   huddraw_align 187 left bottom
   huddraw_alpha 187 1
   //wait .1 //refresh time

end 
well there u go, i mangled ur hud draw stuff , if u want to use the hud draw in more places then change it how u wish. but just showing what Bd meant that u can update it without redoing all the rest of it.

The trigger will not trigger more than once for more than one player unless he / she has left the trigger already.

once triggerd it sets up the hud draw then in your loop it updates the string only. i didnt see any need to be updating the colour? however u can change it depending on the rest of your script's needs.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Yey, this is even prettier :wink:
Just the last } in start_pw must be deleted and if

Code: Select all

waitthread hudprint
is without parameters, then

Code: Select all

hudprint local.nstring local.r local.g local.b: 
doesn't need them either, does it?
But then, as that thread is executed only once, I can just do

Code: Select all

start_pw: 
local.player=parm.other 
if(local.player.trig_dude == 1) 
{ 
end 
} 
huddraw_rect 187 140 -84 50 50 
huddraw_color 187 .75 .65 .1 
huddraw_font 187 "facfont-20" 
huddraw_align 187 left bottom 
huddraw_alpha 187 1 
local.player.trig_dude = 1 
local.stopwatch=0.0 
while (local.player istouching $pw) 
{ 
wait .1 
huddraw_string 187 ((local.stopwatch) + " seconds") 
local.stopwatch += 0.1 
} 
waitframe 
wait 10 
huddraw_string 187 "" 
local.player.trig_dude = 0 
end 
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Yes that looks a lot better . If you are up to it you can even create a back drop for the timer then instead of

huddraw_string 187 ""

You can change the alpha of the back drop and timer . I think if you did that you would just make the back drop first and over lay the timer by createing it second . A back drop could be made from some of the main menu back drops . One other thing mutiple players? with just one hud element ?

Oh and elgan

if(self.trig_dude == local.player)
{
end
}

I guess I over looked that sorry .
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

bdbodger wrote:Yes that looks a lot better . If you are up to it you can even create a back drop for the timer then instead of

huddraw_string 187 ""

You can change the alpha of the back drop and timer . I think if you did that you would just make the back drop first and over lay the timer by createing it second . A back drop could be made from some of the main menu back drops . One other thing mutiple players? with just one hud element ?
What is a back drop? :? And why not just a single one? They rather are in there one after the other...
The whole thing is kind of a hazard course. Players start at point A, spend some time inside the trigger_multiple, and leave at point B. The time they needed is what the stopwatch counts. It would be cool to get a iprintln afterwards telling player's name and his time, but as I can't access the player's name via script...
bdbodger wrote:Oh and elgan
if(self.trig_dude == local.player)
{
end
}
I guess I over looked that sorry .
As this is @Elgan, I (hopefully) don't have to know what u want to say!?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

By back drop I mean something like this

Image

I was just saying that one hud for more than one player means that the timer starts over when the second player enters the area ?
Last edited by bdbodger on Mon Nov 21, 2005 10:41 am, edited 1 time in total.
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

bdbodger wrote:By back drop I mean something like this...
I see. Yes this would be nice. Is there a tut explaining the huddraw stuff? Else, I'd have to play around with it. I have some examples to study and the g_allclasses.html of course, but umm, I still don't understand it completely yet. :oops:
bdbodger wrote:I was just saying that one hud for more than one player means w(t?)hat the timer starts over when the second player enters the area ?
Unfortunately I can't test in MP yet. But this leads to horrifyingly basic questions: If a player#2 did start over the stopwatch, this would mean, that local.anything isnt just accessed by player#1?! I thought, this thread would be fired seperately for each player on clientside, and each player would have his own independant local.anything... (and his own hudstuff, btw)?!
Would a variable local.player.anything (instead of local.anything) make any difference?
Lol, and what about level.anything? This would be accessible for all players, wouldn't it? Omg, I know nothing :cry:
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Huddraw is serverside all players will see it . The script runs on the server also not the client . I guess the server can create a stopwatch for the client but not a hud element like this .
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

you can use client urc menus and globalwidgetcommand to change them . it's a meathod ive used for some things in the past. i usualy try to avoid stufftexting things but for extra display it can be quite uselfull along with some cmds like subtitle and locaprint. some player have stufftext hexed so they cant use stufftext , tut they only miss out on some cool server side effects:d

for a widget example u cud stufftext , taken from medic script from AP.

Code: Select all


fakehealth:

	if(game.game != "AA")
	{
		end
	}

	self stufftext "globalwidgetcommand dday1 shader townhallwindow"
	self stufftext "globalwidgetcommand dday1 fgcolor 1.00 1.00 1.00 1.00"
	self stufftext "globalwidgetcommand dday1 bgcolor 0.50 0.50 0.50 0.00"
	self stufftext "globalwidgetcommand dday1 fadein 0"
	self stufftext "globalwidgetcommand dday1 menu dday1 640 480 NONE 0"
	self stufftext "globalwidgetcommand dday1 virtualres 1" 
	self stufftext "globalwidgetcommand dday1 fullscreen 1" 

	self stufftext "globalwidgetcommand june6 borderstyle NONE"
	self stufftext "globalwidgetcommand june6 shader textures/hud/healthback"
	self stufftext "globalwidgetcommand june6 rect 16 420 16 64"
	self stufftext "globalwidgetcommand june6 fgcolor 1.00 1.00 1.00 1.00"
	self stufftext "globalwidgetcommand june6 bgcolor 0.00 0.00 0.00 0.00"
	self stufftext "globalwidgetcommand june6 linkcvar dmplayerhealth"
	self stufftext "globalwidgetcommand june6 statbar vertical 0 100"
	self stufftext "globalwidgetcommand june6 statbar_shader textures/hud/healthmeter"
	self stufftext "globalwidgetcommand june6 statbar_shader_flash textures/hud/healthmeterflash"


	self stufftext "globalwidgetcommand dday2 fgcolor 1.00 1.00 1.00 1.00"
	self stufftext "globalwidgetcommand dday2 bgcolor 0.50 0.50 0.50 0.00"
	self stufftext "globalwidgetcommand dday2 fadein 0"
	self stufftext "globalwidgetcommand dday2 menu dday2 640 480 NONE 0"
	self stufftext "globalwidgetcommand dday2 virtualres 1" 
	self stufftext "globalwidgetcommand dday2 fullscreen 1" 

	self stufftext "globalwidgetcommand charliesector borderstyle NONE"
	self stufftext "globalwidgetcommand charliesector textalign left " 
	self stufftext "globalwidgetcommand charliesector rect 40 470 150 20"
	self stufftext "globalwidgetcommand charliesector fgcolor 0.70 0.60 0.05 1.00"
	self stufftext "globalwidgetcommand charliesector bgcolor 0.00 0.00 0.00 0.00"
	self stufftext "globalwidgetcommand charliesector linkcvar dmplayerhealth"
	self stufftext "globalwidgetcommand charliesector font facfont-20"
	self stufftext "globalwidgetcommand charliesector shader townhallwindow"

	self stufftext "showmenu dday2"
	self stufftext "showmenu dday1"
end
then simply stufftexting ("dmplayerhealth " + local.number)
then

Code: Select all

	self stufftext "hidemenu dday2"
	self stufftext "hidemenu dday1"
makes the state bar created out of the widget found on a client , that number. It's used to show the ehalth of another player for medics.

locaprting and subtlte are slow and only good for 1 message or a msg with a delay of like 1 second.

or u can use the cmd stopwatch but u might have to mess with it to make it count up:|.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Uuum, thanks....
At the moment, though, I think I'm quite satisfied with what I have. And I'm sorry, but I don't get much of what u trying to explain :oops:
I put ur lines into my script and, well, I got a healthbar displayed, but I really have no idea how to change what lines to get something that would fit my needs.
As soon as I can test my stuff in LAN (with more than one player), I probably will find lots of problems and might come back :wink:
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

u cud manipulate the widgest to just a line of text, this allows u to do stuff like on hud draw except for one player at a time.

what game are you running? AA? SH and BT might need diff widgets, i see as it worked for u its probs AA ur using. So, as for needing a LAN, maybe this will help. cough*no link here*cough
Post Reply