Forum

bprint woes

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

bprint woes

Postby ajay » Mon Nov 17, 2008 4:06 pm

if ((bright > 0) && (self.torch_dim_time < time) && (timer_on != 0))
{
bright = bright - 1;
self.torch_dim_time = time + 1;
local string bp;
bp = ftos(bright);
bprint ("Battery level = ");
bprint (bp);
if (bright <= 0)
{
player_flashlight_toggle();
}
}


Thanks to help I've got a nice "battery running out and torch turning off" thing going on, see above.
The problem I've got is that I want, when the torch is turned on, to display the remaining 'power' left in it. However Quake doesn't agree with the way I'm doing it.
'Bright' being that battery power. I'm intending to also do some maths to show it as a percentage, but as it's not showing up at all, I'm merely trying to get the first step working.
Nothing is displayed at alll, not "battery Level", not bp's value, nothing.
???
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Postby Spike » Mon Nov 17, 2008 8:02 pm

you have no new line.

bprint ("Battery level = ");
bprint (bp);
bprint ("\n");

should fix it.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby ajay » Mon Nov 17, 2008 8:12 pm

Oh bloody hell! I both hate it and love it when its something so silly and small!

Thank You
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest