how do i change how the ammo is displayed
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
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?
- hondobondo
- Posts: 207
- Joined: Tue Sep 26, 2006 2:48 am
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.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
yeah i figured
not really interested in breaking protocol. oh well
- hondobondo
- Posts: 207
- Joined: Tue Sep 26, 2006 2:48 am
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.
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Don't worry Spike, I read your posts at least.
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest