View previous topic :: View next topic |
Author |
Message |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Wed Nov 14, 2007 10:24 pm Post subject: Replace Crosshair and More than 255 ammo? |
|
|
Hi
I´m trying to replace the crosshair from the conchars with a lmp file.
in gl_screen.c
i changed
Code: | if (crosshair.value)
Draw_Character (scr_vrect.x + scr_vrect.width/2 - 4, scr_vrect.y + scr_vrect.height/2 - 4, '+');; |
TO
Code: | if (crosshair.value)
Draw_CachePic ("gfx/crosshair.lmp") |
It doesn´t show my crosshair
Second question:
I´m using ammo_cells as money but it prints max 255
i want to print 1000 or more.
Third question:
can i set a max ammo for shells and nails? |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Nov 15, 2007 1:45 pm Post subject: |
|
|
Ammo counts are normally sent as unsigned bytes in the svc_playerinfo packet. Hence the 0 to 255 range. You'd have to find where that packet is sent and change the type to short or long or something. And do the same in the bit of code that reads it the other end. Note that this breaks protocol and demo compatability.
Draw_CachePic caches the picture. It does not draw it. Notice how you stripped out the arguments for where to actually draw it.
It returns a qpic_t * normally. With usable width and height fields/members. I can't remember what the actual draw function is. Try Draw_TransPic.
Maximum values for shells and nails are enforced in the qc code. Note that the engine clamps it to the 255 range in the svc_playerinfo packet, but this only affects what the client can see.
QuakeWorld and later DP (5 onwards ?) protocols send ammo counts seperatly from the svc_playerinfo, allowing it to use bandwidth more effectivly and support bigger values like quakeworld. _________________ What's a signature? |
|
Back to top |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Fri Nov 30, 2007 12:53 am Post subject: |
|
|
Yeah i replaced the crosshair.
Is it possible to change the crosshair when i move?
i tried this
if (sv_accelerate.value ==0)
{
Draw_TransPic(220,60, Draw_CachePic ("gfx/crosshair.lmp"));
}
else if (sv_accelerate.value >=1 )
{
Draw_TransPic (220,60,Draw_CachePic("gfx/crosshair2.lmp"));
}
sv_accelerate doesn´t work
and i tried cl_forwardspeed too.
which command should i use? |
|
Back to top |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Fri Nov 30, 2007 1:23 am Post subject: |
|
|
You should try to watch changes in the client origin and/or speed. From top of my mind it's cl.velocity or something like that. You can check view.c for the camera bobbing code which is based on client movement for a start. _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
|