View previous topic :: View next topic |
Author |
Message |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Fri Sep 26, 2008 4:12 pm Post subject: Backpack Weight |
|
|
Guys, I need a hand again.
Currently in my mod your backpack has a weight value (depending on how much ammo and how many weapons you are carrying).
Right now it will sprint the value when you pick up ammo 50% of the time.
I'd like that it was permanent up in the righthand corner instead of the FPS value.
Can someone point me in the right direction?
Thanks in advance. _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Fri Sep 26, 2008 5:09 pm Post subject: |
|
|
i think that it would be needed in the engine to do that
or maybe csqc, but i dont know much about that atm _________________ bah |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Fri Sep 26, 2008 6:20 pm Post subject: |
|
|
You could put a centerprint in client.qc, PlayerPostThink
centerprint (self,"/n/n/n/n/n/n ",string); |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Fri Sep 26, 2008 9:13 pm Post subject: |
|
|
Wouldn't that conflict with other centerprints?
I use centerprint a lot in my mod. _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Fri Sep 26, 2008 10:15 pm Post subject: |
|
|
Sounds like you may need to construct centerprints by hand.
If your centerprints are using less then about 4 the 7 strongs they can receive, then you can use probably the remaining 3 to print the weight at the bottom.
Otherwise, you may be constructing centerprints manually. See Frik's Tetris mod for an example. If you are targetting an enging with DP_SV_WRITEUNTERMINATEDSTRING then it will be a lot easier... |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Sat Sep 27, 2008 9:26 pm Post subject: |
|
|
I'm trying this in PlayerPreThink:
Code: | z = ftos(self.weight);
centerprint (self, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nyour backpack weighs" z "pounds"); |
It won't compile. How can I get the "z" to print the variable self.weight? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Sat Sep 27, 2008 10:34 pm Post subject: |
|
|
perhaps you could try somthing with gyro to get that to work,
somthing with mass and can....err... perhaps i should fully cook my ideas before i serve them, heh _________________ bah |
|
Back to top |
|
 |
Error Inside3D Staff

Joined: 05 Nov 2004 Posts: 558 Location: VA, USA
|
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Sun Sep 28, 2008 11:46 pm Post subject: |
|
|
That didn't work, but I did figure it out:
Code: | x = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nbackpack weight: ";
y = ftos(self.weight);
z = " pounds";
specialprint (self, x, y, z); |
_________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Mon Sep 29, 2008 12:06 am Post subject: |
|
|
redrum wrote: | That didn't work |
It does if you change your definition of centerprint (I can't remember how exactly, search these forums for varargs) and use a compiler that supports that method (FrikQCC or FTEQCC). |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Sep 29, 2008 8:53 am Post subject: |
|
|
The alternate version doesn't work any differently.
void(...) centerprint = #whatever; works as expected with all qc compilers, though most people create multiple versions if they want support for more than just frikqcc/fteqcc due to the benefits of type checking. _________________ What's a signature? |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Tue Sep 30, 2008 9:08 pm Post subject: |
|
|
Spike wrote: | void(...) centerprint = #whatever; works as expected with all qc compilers, though most people create multiple versions if they want support for more than just frikqcc/fteqcc due to the benefits of type checking. |
Which is why it'smore usually void(entity client, string s, ...) centerprint = #73; to force the first two inputs to be correct. |
|
Back to top |
|
 |
|