Forum

Need some QuakeC Help

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Need some QuakeC Help

Postby hawkins83 » Thu Oct 19, 2006 7:20 pm

Ok i am making a counter strike mod from the tutorials. I got all 4 of them to work. How do i bind the flip, salute, and stuff frames to a button?
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby Spike » Fri Oct 20, 2006 12:20 am

Not sure which tuts you're talking about, but here's the theory.

send two stuffcmds for each button.
alias +salute "impulse 50"
alias -salute "impulse 51"

A user can then:
bind space +salute

when pressed, 50 will trigger, when released, 51 will trigger.
It is possible that these impulses will never arrive, or will be duplicated (keyboard repeat).

The keyboard input executes the binds when pressed. On release, if the bind contains a single command/name starting with a +, then it executes the command with a - instead of that plus. Works for anything, commands, aliases... and cvars if you're crazy. Note that it also adds an extra parameter relating to which button/keycode is pressed to trigger it.


Alternativly you can depend on extensions, and send:
alias +salute +button3
alias -salute -button3
and in the code:
.float button3;
void() somefunc =
{
if (self.button3)
sprint(self, "Hey, stop saluting\n");
};
This method is more reliable, assuming the client and server both support this feature.
DarkPlaces and FTE support this feature. A few others no-doubt do but I can't name those reliably.
You don't have to do the alias thing, but it might help make people's configs make more sense.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby hawkins83 » Fri Oct 20, 2006 12:50 pm

Ok thanks, one more problem i added alot more stuff and i get this error, i can get you the code but maybe you guys could tell me what i have 2 do without looking at it. And can someone tell me how to bind a sound to a key and have it only be heard on your team not global.
error: Q551: LINK:0:player_zoomout was not defined (see prototype weapons.qc(2))
error: Q551: LINK:1:player_zoom was not defined (see prototype weapons.qc(3))
error: Q551: LINK:2:player_zoomb was not defined (see prototype weapons.qc(4))
error: Q551: LINK:3:player_mossberg was not defined (see prototype weapons.qc(1277))
error: Q551: LINK:4:player_reload_mossberg was not defined (see prototype weapons.qc(1278))
error: Q551: LINK:5:player_mp5a was not defined (see prototype weapons.qc(1279))
error: Q551: LINK:6:player_mp5f was not defined (see prototype weapons.qc(1280))
error: Q551: LINK:7:player_mp5g was not defined (see prototype weapons.qc(1281))
error: Q551: LINK:8:player_reload_mp5 was not defined (see prototype weapons.qc(1282))
error: Q551: LINK:9:player_mp5_switch was not defined (see prototype weapons.qc(1283))
error: Q551: LINK:10:player_mp5sda was not defined (see prototype weapons.qc(1284))
error: Q551: LINK:11:player_mp5sdf was not defined (see prototype weapons.qc(1285))
error: Q551: LINK:12:player_mp5sdg was not defined (see prototype weapons.qc(1286))
error: Q551: LINK:13:player_reload_mp5sd was not defined (see prototype weapons.qc(1287))
error: Q551: LINK:14:player_mp5sd_switch was not defined (see prototype weapons.qc(1288))
error: Q551: LINK:15:player_mk23a was not defined (see prototype weapons.qc(1289))
error: Q551: LINK:16:player_mk23b was not defined (see prototype weapons.qc(1290))
error: Q551: LINK:17:player_reload_mk23 was not defined (see prototype weapons.qc(1291))
error: Q551: LINK:18:player_reload_m16 was not defined (see prototype weapons.qc(1292))
error: Q551: LINK:19:player_m16a was not defined (see prototype weapons.qc(1293))
error: Q551: LINK:20:player_m16b was not defined (see prototype weapons.qc(1294))
error: Q551: LINK:21:player_m16_grenade was not defined (see prototype weapons.qc(1295))
error: Q551: LINK:22:player_raw was not defined (see prototype weapons.qc(1296))
error: Q551: LINK:23:player_kbar was not defined (see prototype weapons.qc(1297))
error: Q551: LINK:24:player_hgrenade was not defined (see prototype weapons.qc(1298))
error: Q551: LINK:25:player_assaultshotgun was not defined (see prototype weapons.qc(1299))
error: Q551: LINK:26:player_reload_psg1 was not defined (see prototype weapons.qc(1300))
error: Q551: LINK:27:player_reload_barrett was not defined (see prototype weapons.qc(1301))
error: Q551: LINK:28:player_psg1 was not defined (see prototype weapons.qc(1302))
error: Q551: LINK:29:player_barrett was not defined (see prototype weapons.qc(1303))
error: Q551: LINK:30:player_m60 was not defined (see prototype weapons.qc(1304))
error: Q551: LINK:31:player_reload_m60 was not defined (see prototype weapons.qc(1305))
error: Q551: LINK:32:player_m60_winchester was not defined (see prototype weapons.qc(1306))


Here is the weapons.qc
http://www.inside3d.com/pastebin.php?action=show&id=96
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby hawkins83 » Fri Oct 20, 2006 6:45 pm

(01:39:56 PM) Hawk: void() player_axe1;
(01:39:56 PM) Hawk: void() player_axeb1;
(01:39:56 PM) Hawk: void() player_axec1;
(01:39:56 PM) Hawk: void() player_axed1;
(01:39:56 PM) Hawk: void() player_shot1;
(01:39:56 PM) Hawk: void() player_nail1;
(01:39:56 PM) Hawk: void() player_light1;
(01:39:56 PM) Hawk: void() player_rocket1;
(01:39:56 PM) Hawk: void() player_mossberg;
(01:39:56 PM) Hawk: void() player_reload_mossberg;
(01:39:57 PM) Hawk: void() player_mp5a;
(01:39:57 PM) Hawk: void() player_mp5f;
(01:39:57 PM) Hawk: void() player_mp5g;
(01:39:57 PM) Hawk: void() player_reload_mp5;
(01:39:57 PM) Hawk: void() player_mp5_switch;
(01:39:57 PM) Hawk: void() player_mp5sda;
(01:39:57 PM) Hawk: void() player_mp5sdf;
(01:39:57 PM) Hawk: void() player_mp5sdg;
(01:39:57 PM) Hawk: void() player_reload_mp5sd;
(01:39:57 PM) Hawk: void() player_mp5sd_switch;
(01:39:57 PM) Hawk: void() player_mk23a;
(01:39:57 PM) Hawk: void() player_mk23b;
(01:39:57 PM) Hawk: void() player_reload_mk23;
(01:39:57 PM) Hawk: void() player_reload_m16;
(01:39:57 PM) Hawk: void() player_m16a;
(01:39:57 PM) Hawk: void() player_m16b;
(01:39:57 PM) Hawk: void() player_m16_grenade;
(01:39:57 PM) Hawk: void() player_raw;
(01:39:57 PM) Hawk: void() player_kbar;
(01:39:57 PM) Hawk: void() player_hgrenade;
(01:39:57 PM) Hawk: void() player_assaultshotgun;
(01:39:57 PM) Hawk: void() player_reload_psg1;
(01:39:57 PM) Hawk: void() player_reload_barrett;
(01:39:57 PM) Hawk: void() player_psg1;
(01:39:57 PM) Hawk: void() player_barrett;
(01:39:57 PM) Hawk: void() player_m60;
(01:39:57 PM) Hawk: void() player_reload_m60;
(01:39:57 PM) Hawk: void() player_m60_winchester;
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby FrikaC » Sat Oct 21, 2006 8:55 am

Those are the prototypes. Where are they actually defined? Surely the tutorial explains (/me doesn't want to look at it, butr will if he must)
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby hawkins83 » Sat Oct 21, 2006 3:23 pm

Never mind it works. I need a good free photo editor for pcx files now
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby scar3crow » Sat Oct 21, 2006 5:35 pm

GIMP is free iirc, just google it, should be on sourceforge or similar.
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby hawkins83 » Sat Oct 21, 2006 6:48 pm

Yea i got gimp, but when i convert it to a .lmp the color is fucked up
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby hawkins83 » Sat Oct 21, 2006 6:51 pm

I want to make a VIP gamemode, like in Americas Army.
I was thinking i could base the code of this, http://minion.planetquake.gamespy.com// ... /radio.htm. So the first person that joins the server becomes the vip and the escort team has to get the vip to a certain spot on the map.
hawkins83
 
Posts: 28
Joined: Sun Sep 03, 2006 6:39 am

Postby scar3crow » Sat Oct 21, 2006 7:14 pm

regarding the lmp color, sounds like you might be in need of Fimg, Frik's image editor which is apparently very useful for modders of Quake. http://qexpo.quakedev.com/uploaded/8/fimg_v017.zip
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby xaGe » Sun Oct 22, 2006 6:21 am

That's an under statement! It has came in handy many times for me specially working on The Ascension of Vigil... I used it to convert the high-res png's I made into quake compatible sprites... Fimg! can covert .lmp's & .spr's into many other image formats & visa versa...

scar3crow wrote:regarding the lmp color, sounds like you might be in need of Fimg, Frik's image editor which is apparently very useful for modder's of Quake. http://qexpo.quakedev.com/uploaded/8/fimg_v017.zip
Last edited by xaGe on Fri Oct 27, 2006 1:02 am, edited 2 times in total.
User avatar
xaGe
 
Posts: 461
Joined: Wed Mar 01, 2006 8:29 am
Location: Upstate, New York

Postby r00k » Thu Oct 26, 2006 11:11 pm

:P ya and after trying to make simple icons to replace the regular .bsp items i gave up trying to find a sprite editor worthy of the effort for quake, and now i find it! :P
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest