View previous topic :: View next topic |
Author |
Message |
hondobondo
Joined: 26 Sep 2006 Posts: 101
|
Posted: Sun Mar 01, 2009 11:36 pm Post subject: how do i change how the ammo is displayed |
|
|
say i want to increase ammo limits past 255. how do i make the status bar read up to 999 ammo like the health? |
|
Back to top |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Mon Mar 02, 2009 1:01 am Post subject: |
|
|
Check SV_WriteClientdataToMessage() in sv_main.c (server) and CL_ParseClientdata () in cl_parse.c (client). Be ready to break network compatibility though, since ammo, armor and other stuff is sent thru network as bytes. _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Mar 02, 2009 11:59 am Post subject: |
|
|
You can send larger ammo values if you send svc_updatestat (or whatever the name is) somewhere after the clientupdate svc thingie which would be in SV_WriteClientdataToMessage according to frag.machine. This wouldn't need to modify the protocol, but does need a modified server. I don't think its really possible to do it reliably in qc. _________________ What's a signature? |
|
Back to top |
|
 |
hondobondo
Joined: 26 Sep 2006 Posts: 101
|
Posted: Mon Mar 02, 2009 6:48 pm Post subject: yeah i figured |
|
|
not really interested in breaking protocol. oh well |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Mar 02, 2009 7:13 pm Post subject: |
|
|
does noone read my posts?
ammo counts are sent as bytes within the svc_clientdata message. If you send an svc_updatestat STAT_MYAMMOTYPE myvalue where myvalue is a long, you can send bigger numbers. the update stat will overwrite the stat sent in the more limited clientdata.
This does not cause protocol incompatibilities!
If you can get the qc to run a frame every single time an outgoing packet is sent (yup, fairly easy really) then you can write into the client's unreliable buffer. But you need to make sure this is done for every single outgoing packet. _________________ What's a signature? |
|
Back to top |
|
 |
Electro
Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia
|
Posted: Mon Mar 02, 2009 9:59 pm Post subject: |
|
|
Don't worry Spike, I read your posts at least. _________________ Unit reporting!
http://www.bendarling.net/ |
|
Back to top |
|
 |
|