Replace Crosshair and More than 255 ammo?
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
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
TO
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?
I´m trying to replace the crosshair from the conchars with a lmp file.
in gl_screen.c
i changed
- Code: Select all
if (crosshair.value)
Draw_Character (scr_vrect.x + scr_vrect.width/2 - 4, scr_vrect.y + scr_vrect.height/2 - 4, '+');;
TO
- Code: Select all
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?
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
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.
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
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?
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?
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
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.
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
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest