Issues with Radar

Need help with a tutorial found on InsideQC.com? Post here.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

oh XO i did do that ! lol i didnt notice:P thanks again man lol told you the problem was im prolly an idiot lol. (and yea i dont know anything about C im just now trying to get into it. but i did know not to add in the "Code" part lol..... -.-)


EDIT: :( now im having issues with client.qc that i didnt have before ... it now says "void" is an unknown value.... (i feel really freakin stupid)
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Post by Wazat »

The tutorial has you make some changes to client.qc, so you may have made a mistake. Go to that code and make sure it looks exactly like the code in the tutorial and that it was pasted in the correct place.

What line is it saying the error is on? That's important.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

here ill completely redo my client.qc and redo the tutorial then give you my results , i back up all my files before editing :P
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

Yep i did exactly what was said in the tutorial on a fresh client.qc and get the same errors...

also i cant find the line unless i go through and count each and everyone out, im using notepad :oops:
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Post by Wazat »

Notepad has an option to turn on the status bar, which shows line numbers.

You may need to post your code again, once you find the line number and can see what area the error is in.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
MeTcHsteekle
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Post by MeTcHsteekle »

i found whn i wasusing notepad,it woldent let me copy and paste or i would get retarded errors like "/" is a unknown value or some shit, so i use "qcide" and mkaes it easyer, but i still type most of it so i learn it better

/mispellings, but i dont careeeeee ririiiiiiight nowww
bah
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

problems are on lines 301 and 304 thats what FrikQCC tells me

and... here's my client.qc

Code: Select all

void () player_pain;
void () player_stand1;
void (vector org) spawn_tfog;
void (vector org, entity death_owner) spawn_tdeath;
float modelindex_eyes;
float modelindex_player;
float intermission_running;
float intermission_exittime;

void () info_intermission =
{
};

void () SetChangeParms =
{
	if ((self.health <= FALSE))
	{
		SetNewParms ();
		return;
	}
	self.items = (self.items - (self.items & (((((IT_KEY1 | IT_KEY2) | IT_INVISIBILITY) | IT_INVULNERABILITY) | IT_SUIT) | IT_QUAD)));
	if ((self.health > 100))
	{
		self.health = 100;
	}
	if ((self.health < 50))
	{
		self.health = 50;
	}
	parm1 = self.items;
	parm2 = self.health;
	parm3 = self.armorvalue;
	if ((self.ammo_shells < 25))
	{
		parm4 = 25;
	}
	else
	{
		parm4 = self.ammo_shells;
	}
	parm5 = self.ammo_nails;
	parm6 = self.ammo_rockets;
	parm7 = self.ammo_cells;
	parm8 = self.weapon;
	parm9 = (self.armortype * 100);
};

void () SetNewParms =
{
	parm1 = (IT_SHOTGUN | IT_AXE);
	parm2 = 100;
	parm3 = FALSE;
	parm4 = 25;
	parm5 = FALSE;
	parm6 = FALSE;
	parm7 = FALSE;
	parm8 = TRUE;
	parm9 = FALSE;
};

void () DecodeLevelParms =
{
	if (serverflags)
	{
		if ((world.model == "maps/start.bsp"))
		{
			SetNewParms ();
		}
	}
	self.items = parm1;
	self.health = parm2;
	self.armorvalue = parm3;
	self.ammo_shells = parm4;
	self.ammo_nails = parm5;
	self.ammo_rockets = parm6;
	self.ammo_cells = parm7;
	self.weapon = parm8;
	self.armortype = (parm9 * 0.01);
};

entity () FindIntermission =
{
	local entity spot;
	local float cyc;

	spot = find (world, classname, "info_intermission");
	if (spot)
	{
		cyc = (random () * MOVETYPE_STEP);
		while ((cyc > TRUE))
		{
			spot = find (spot, classname, "info_intermission");
			if (!spot)
			{
				spot = find (spot, classname, "info_intermission");
			}
			cyc = (cyc - TRUE);
		}
		return (spot);
	}
	spot = find (world, classname, "info_player_start");
	if (spot)
	{
		return (spot);
	}
	spot = find (world, classname, "testplayerstart");
	if (spot)
	{
		return (spot);
	}
	objerror ("FindIntermission: no spot");
};
string nextmap;

void () GotoNextMap =
{
	if (cvar ("samelevel"))
	{
		changelevel (mapname);
	}
	else
	{
		changelevel (nextmap);
	}
};

void () ExitIntermission =
{
	if (deathmatch)
	{
		GotoNextMap ();
		return;
	}
	intermission_exittime = (time + TRUE);
	intermission_running = (intermission_running + TRUE);
	if ((intermission_running == FL_SWIM))
	{
		if ((world.model == "maps/e1m7.bsp"))
		{
			WriteByte (MSG_ALL, SVC_CDTRACK);
			WriteByte (MSG_ALL, FL_SWIM);
			WriteByte (MSG_ALL, MOVETYPE_WALK);
			if (!cvar ("registered"))
			{
				WriteByte (MSG_ALL, SVC_FINALE);
				WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in...");
			}
			else
			{
				WriteByte (MSG_ALL, SVC_FINALE);
				WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A...");
			}
			return;
		}
		else
		{
			if ((world.model == "maps/e2m6.bsp"))
			{
				WriteByte (MSG_ALL, SVC_CDTRACK);
				WriteByte (MSG_ALL, FL_SWIM);
				WriteByte (MSG_ALL, MOVETYPE_WALK);
				WriteByte (MSG_ALL, SVC_FINALE);
				WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death...");
				return;
			}
			else
			{
				if ((world.model == "maps/e3m6.bsp"))
				{
					WriteByte (MSG_ALL, SVC_CDTRACK);
					WriteByte (MSG_ALL, FL_SWIM);
					WriteByte (MSG_ALL, MOVETYPE_WALK);
					WriteByte (MSG_ALL, SVC_FINALE);
					WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your ...");
					return;
				}
				else
				{
					if ((world.model == "maps/e4m7.bsp"))
					{
						WriteByte (MSG_ALL, SVC_CDTRACK);
						WriteByte (MSG_ALL, FL_SWIM);
						WriteByte (MSG_ALL, MOVETYPE_WALK);
						WriteByte (MSG_ALL, SVC_FINALE);
						WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being...");
						return;
					}
				}
			}
		}
		GotoNextMap ();
	}
	if ((intermission_running == MOVETYPE_WALK))
	{
		if (!cvar ("registered"))
		{
			WriteByte (MSG_ALL, SVC_SELLSCREEN);
			return;
		}
		if (((serverflags & 15) == 15))
		{
			WriteByte (MSG_ALL, SVC_FINALE);
			WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront he...");
			return;
		}
	}
	GotoNextMap ();
};

void () IntermissionThink =
{
	if ((time < intermission_exittime))
	{
		return;
	}
	if (((!self.button0 && !self.button1) && !self.button2))
	{
		return;
	}
	ExitIntermission ();
};

void () execute_changelevel =
{
	local entity pos;

	intermission_running = TRUE;
	if (deathmatch)
	{
		intermission_exittime = (time + MOVETYPE_FLY);
	}
	else
	{
		intermission_exittime = (time + FL_SWIM);
	}
	WriteByte (MSG_ALL, SVC_CDTRACK);
	WriteByte (MSG_ALL, MOVETYPE_WALK);
	WriteByte (MSG_ALL, MOVETYPE_WALK);
	pos = FindIntermission ();
	other = find (world, classname, "player");
	while ((other != world))
	{
		other.view_ofs = VEC_ORIGIN;
		other.v_angle = pos.mangle;
		other.angles = pos.mangle;
		other.fixangle = TRUE;
		other.nextthink = (time + 0.5);
		other.takedamage = DAMAGE_NO;
		other.solid = SOLID_NOT;
		other.movetype = MOVETYPE_NONE;
		other.modelindex = FALSE;
		setorigin (other, pos.origin);
		other = find (other, classname, "player");
	}
	WriteByte (MSG_ALL, SVC_INTERMISSION);
};

void () changelevel_touch =
{
	local entity pos;

	if ((other.classname != "player"))
	{
		return;
	}
	if (((cvar ("noexit") == TRUE) || ((cvar ("noexit") == FL_SWIM) && (mapname != "start"))))
	{
		T_Damage (other, self, self, 50000);
		return;
	}
	if ((coop || deathmatch))
	{
		bprint (other.netname);
		bprint (" exited the level\n");
	}
	nextmap = self.map;
	SUB_UseTargets ();
	if (((self.spawnflags & TRUE) && (deathmatch == FALSE)))
	{
		GotoNextMap ();
		return;
	}
	self.touch = SUB_Null;
	self.think = execute_changelevel;
	self.nextthink = (time + 0.1);
};

void () trigger_changelevel =
{
	if (!self.map)
	{
		objerror ("chagnelevel trigger doesn't have map");
	}
	InitTrigger ();
	self.touch = changelevel_touch;
};
void () set_suicide_frame;

void () respawn =
// VENOMUS START
void () func_radar;
// VENOMUS END

{
	if (coop)
	{
		CopyToBodyQue (self);
		setspawnparms (self);
		PutClientInServer ();
	}
	else
	{
		if (deathmatch)
		{
			CopyToBodyQue (self);
			SetNewParms ();
			PutClientInServer ();
		}
		else
		{
			localcmd ("restart\n");
		}
	}
};

void () ClientKill =
{
	bprint (self.netname);
	bprint (" suicides\n");
	set_suicide_frame ();
	self.modelindex = modelindex_player;
	self.frags = (self.frags - FL_SWIM);
	respawn ();
};

float (vector v) CheckSpawnPoint =
{
	return (FALSE);
};

entity () SelectSpawnPoint =
{
	local entity spot;
	local entity thing;
	local float pcount;

	spot = find (world, classname, "testplayerstart");
	if (spot)
	{
		return (spot);
	}
	if (coop)
	{
		lastspawn = find (lastspawn, classname, "info_player_coop");
		if ((lastspawn == world))
		{
			lastspawn = find (lastspawn, classname, "info_player_start");
		}
		if ((lastspawn != world))
		{
			return (lastspawn);
		}
	}
	else
	{
		if (deathmatch)
		{
			spot = lastspawn;
			while (TRUE)
			{
				spot = find (spot, classname, "info_player_deathmatch");
				if ((spot != world))
				{
					if ((spot == lastspawn))
					{
						return (lastspawn);
					}
					pcount = FALSE;
					thing = findradius (spot.origin, FL_MONSTER);
					while (thing)
					{
						if ((thing.classname == "player"))
						{
							pcount = (pcount + TRUE);
						}
						thing = thing.chain;
					}
					if ((pcount == FALSE))
					{
						lastspawn = spot;
						return (spot);
					}
				}
			}
		}
	}
	if (serverflags)
	{
		spot = find (world, classname, "info_player_start2");
		if (spot)
		{
			return (spot);
		}
	}
	spot = find (world, classname, "info_player_start");
	if (!spot)
	{
		error ("PutClientInServer: no info_player_start on level");
	}
	return (spot);
};
void () PlayerDie;

void () PutClientInServer =
{
	local entity spot;

	spot = SelectSpawnPoint ();
	self.classname = "player";
	self.health = 100;
	self.takedamage = DAMAGE_AIM;
	self.solid = SOLID_SLIDEBOX;
	self.movetype = MOVETYPE_WALK;
	self.show_hostile = FALSE;
	self.max_health = 100;
	self.flags = FL_CLIENT;
	self.air_finished = (time + 12);
	self.dmg = FL_SWIM;
	self.super_damage_finished = FALSE;
	self.radsuit_finished = FALSE;
	self.invisible_finished = FALSE;
	self.invincible_finished = FALSE;
	self.effects = FALSE;
	self.invincible_time = FALSE;
	DecodeLevelParms ();
	W_SetCurrentAmmo ();
	self.attack_finished = time;
	self.th_pain = player_pain;
	self.th_die = PlayerDie;
	self.deadflag = DEAD_NO;
	self.pausetime = FALSE;
	self.origin = (spot.origin + '0 0 1');
	self.angles = spot.angles;
	self.fixangle = TRUE;
	setmodel (self, "progs/eyes.mdl");
	modelindex_eyes = self.modelindex;
	setmodel (self, "progs/player.mdl");
	modelindex_player = self.modelindex;
	setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
	self.view_ofs = '0 0 22';
	player_stand1 ();
	if ((deathmatch || coop))
	{
		makevectors (self.angles);
		spawn_tfog ((self.origin + (v_forward * 20)));
	}
	// VENOMUS START
	if (!find (world, classname, "func_radar"))
	{
		local entity radar;

		radar = spawn ();
		radar.classname = "func_radar";
		setorigin (radar, self.origin);
		radar.think = func_radar;
		radar.nextthink = time;
	}
// VENOMUS END
	spawn_tdeath (self.origin, self);
};

void () info_player_start =
{
};

void () info_player_start2 =
{
};

void () testplayerstart =
{
};

void () info_player_deathmatch =
{
};

void () info_player_coop =
{
};

void () NextLevel =
{
	local entity o;

	if ((mapname == "start"))
	{
		if (!cvar ("registered"))
		{
			mapname = "e1m1";
		}
		else
		{
			if (!(serverflags & TRUE))
			{
				mapname = "e1m1";
				serverflags = (serverflags | TRUE);
			}
			else
			{
				if (!(serverflags & FL_SWIM))
				{
					mapname = "e2m1";
					serverflags = (serverflags | FL_SWIM);
				}
				else
				{
					if (!(serverflags & MOVETYPE_STEP))
					{
						mapname = "e3m1";
						serverflags = (serverflags | MOVETYPE_STEP);
					}
					else
					{
						if (!(serverflags & FL_CLIENT))
						{
							mapname = "e4m1";
							serverflags = (serverflags - MOVETYPE_PUSH);
						}
					}
				}
			}
		}
		o = spawn ();
		o.map = mapname;
	}
	else
	{
		o = find (world, classname, "trigger_changelevel");
		if (!o)
		{
			mapname = "start";
			o = spawn ();
			o.map = mapname;
		}
	}
	nextmap = o.map;
	gameover = TRUE;
	if ((o.nextthink < time))
	{
		o.think = execute_changelevel;
		o.nextthink = (time + 0.1);
	}
};

void () CheckRules =
{
	local float timelimit;
	local float fraglimit;

	if (gameover)
	{
		return;
	}
	timelimit = (cvar ("timelimit") * 60);
	fraglimit = cvar ("fraglimit");
	if ((timelimit && (time >= timelimit)))
	{
		NextLevel ();
		return;
	}
	if ((fraglimit && (self.frags >= fraglimit)))
	{
		NextLevel ();
		return;
	}
};

void () PlayerDeathThink =
{
	local entity old_self;
	local float forward;

	if ((self.flags & FL_ONGROUND))
	{
		forward = vlen (self.velocity);
		forward = (forward - 20);
		if ((forward <= FALSE))
		{
			self.velocity = VEC_ORIGIN;
		}
		else
		{
			self.velocity = (forward * normalize (self.velocity));
		}
	}
	if ((self.deadflag == DEAD_DEAD))
	{
		if (((self.button2 || self.button1) || self.button0))
		{
			return;
		}
		self.deadflag = DEAD_RESPAWNABLE;
		return;
	}
	if (((!self.button2 && !self.button1) && !self.button0))
	{
		return;
	}
	self.button0 = FALSE;
	self.button1 = FALSE;
	self.button2 = FALSE;
	respawn ();
};

void () PlayerJump =
{
	local vector start;
	local vector end;

	if ((self.flags & FL_WATERJUMP))
	{
		return;
	}
	if ((self.waterlevel >= FL_SWIM))
	{
		if ((self.watertype == CONTENT_WATER))
		{
			self.velocity_z = 100;
		}
		else
		{
			if ((self.watertype == CONTENT_SLIME))
			{
				self.velocity_z = 80;
			}
			else
			{
				self.velocity_z = 50;
			}
		}
		if ((self.swim_flag < time))
		{
			self.swim_flag = (time + TRUE);
			if ((random () < 0.5))
			{
				sound (self, CHAN_BODY, "misc/water1.wav", TRUE, ATTN_NORM);
			}
			else
			{
				sound (self, CHAN_BODY, "misc/water2.wav", TRUE, ATTN_NORM);
			}
		}
		return;
	}
	if (!(self.flags & FL_ONGROUND))
	{
		return;
	}
	if (!(self.flags & FL_JUMPRELEASED))
	{
		return;
	}
	self.flags = (self.flags - (self.flags & FL_JUMPRELEASED));
	self.flags = (self.flags - FL_ONGROUND);
	self.button2 = FALSE;
	sound (self, CHAN_BODY, "player/plyrjmp8.wav", TRUE, ATTN_NORM);
	self.velocity_z = (self.velocity_z + 270);
};
.float dmgtime;

void () WaterMove =
{
	if ((self.movetype == MOVETYPE_NOCLIP))
	{
		return;
	}
	if ((self.health < FALSE))
	{
		return;
	}
	if ((self.waterlevel != MOVETYPE_WALK))
	{
		if ((self.air_finished < time))
		{
			sound (self, CHAN_VOICE, "player/gasp2.wav", TRUE, ATTN_NORM);
		}
		else
		{
			if ((self.air_finished < (time + MOVETYPE_FLYMISSILE)))
			{
				sound (self, CHAN_VOICE, "player/gasp1.wav", TRUE, ATTN_NORM);
			}
		}
		self.air_finished = (time + 12);
		self.dmg = FL_SWIM;
	}
	else
	{
		if ((self.air_finished < time))
		{
			if ((self.pain_finished < time))
			{
				self.dmg = (self.dmg + FL_SWIM);
				if ((self.dmg > 15))
				{
					self.dmg = MOVETYPE_BOUNCE;
				}
				T_Damage (self, world, world, self.dmg);
				self.pain_finished = (time + TRUE);
			}
		}
	}
	if (!self.waterlevel)
	{
		if ((self.flags & FL_INWATER))
		{
			sound (self, CHAN_BODY, "misc/outwater.wav", TRUE, ATTN_NORM);
			self.flags = (self.flags - FL_INWATER);
		}
		return;
	}
	if ((self.watertype == CONTENT_LAVA))
	{
		if ((self.dmgtime < time))
		{
			if ((self.radsuit_finished > time))
			{
				self.dmgtime = (time + TRUE);
			}
			else
			{
				self.dmgtime = (time + 0.2);
			}
			T_Damage (self, world, world, (MOVETYPE_BOUNCE * self.waterlevel));
		}
	}
	else
	{
		if ((self.watertype == CONTENT_SLIME))
		{
			if (((self.dmgtime < time) && (self.radsuit_finished < time)))
			{
				self.dmgtime = (time + TRUE);
				T_Damage (self, world, world, (MOVETYPE_STEP * self.waterlevel));
			}
		}
	}
	if (!(self.flags & FL_INWATER))
	{
		if ((self.watertype == CONTENT_LAVA))
		{
			sound (self, CHAN_BODY, "player/inlava.wav", TRUE, ATTN_NORM);
		}
		if ((self.watertype == CONTENT_WATER))
		{
			sound (self, CHAN_BODY, "player/inh2o.wav", TRUE, ATTN_NORM);
		}
		if ((self.watertype == CONTENT_SLIME))
		{
			sound (self, CHAN_BODY, "player/slimbrn2.wav", TRUE, ATTN_NORM);
		}
		self.flags = (self.flags + FL_INWATER);
		self.dmgtime = FALSE;
	}
	if (!(self.flags & FL_WATERJUMP))
	{
		self.velocity = (self.velocity - (((0.8 * self.waterlevel) * frametime) * self.velocity));
	}
};

void () CheckWaterJump =
{
	local vector start;
	local vector end;

	makevectors (self.angles);
	start = self.origin;
	start_z = (start_z + FL_CLIENT);
	v_forward_z = FALSE;
	normalize (v_forward);
	end = (start + (v_forward * 24));
	traceline (start, end, TRUE, self);
	if ((trace_fraction < TRUE))
	{
		start_z = ((start_z + self.maxs_z) - FL_CLIENT);
		end = (start + (v_forward * 24));
		self.movedir = (trace_plane_normal * -50);
		traceline (start, end, TRUE, self);
		if ((trace_fraction == TRUE))
		{
			self.flags = (self.flags | FL_WATERJUMP);
			self.velocity_z = 225;
			self.flags = (self.flags - (self.flags & FL_JUMPRELEASED));
			self.teleport_time = (time + FL_SWIM);
			return;
		}
	}
};

void () PlayerPreThink =
{
	local float mspeed;
	local float aspeed;
	local float r;

	if (intermission_running)
	{
		IntermissionThink ();
		return;
	}
	if ((self.view_ofs == VEC_ORIGIN))
	{
		return;
	}
	makevectors (self.v_angle);
	CheckRules ();
	WaterMove ();
	if ((self.waterlevel == FL_SWIM))
	{
		CheckWaterJump ();
	}
	if ((self.deadflag >= DEAD_DEAD))
	{
		PlayerDeathThink ();
		return;
	}
	if ((self.deadflag == DEAD_DYING))
	{
		return;
	}
	if (self.button2)
	{
		PlayerJump ();
	}
	else
	{
		self.flags = (self.flags | FL_JUMPRELEASED);
	}
	if ((time < self.pausetime))
	{
		self.velocity = VEC_ORIGIN;
	}
	if ((((time > self.attack_finished) && (self.currentammo == FALSE)) && (self.weapon != IT_AXE)))
	{
		self.weapon = W_BestWeapon ();
		W_SetCurrentAmmo ();
	}
};

void () CheckPowerups =
{
	if ((self.health <= FALSE))
	{
		return;
	}
	if (self.invisible_finished)
	{
		if ((self.invisible_sound < time))
		{
			sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE);
			self.invisible_sound = (time + ((random () * MOVETYPE_WALK) + TRUE));
		}
		if ((self.invisible_finished < (time + MOVETYPE_WALK)))
		{
			if ((self.invisible_time == TRUE))
			{
				sprint (self, "Ring of Shadows magic is fading\n");
				stuffcmd (self, "bf\n");
				sound (self, CHAN_AUTO, "items/inv2.wav", TRUE, ATTN_NORM);
				self.invisible_time = (time + TRUE);
			}
			if ((self.invisible_time < time))
			{
				self.invisible_time = (time + TRUE);
				stuffcmd (self, "bf\n");
			}
		}
		if ((self.invisible_finished < time))
		{
			self.items = (self.items - IT_INVISIBILITY);
			self.invisible_finished = FALSE;
			self.invisible_time = FALSE;
		}
		self.frame = FALSE;
		self.modelindex = modelindex_eyes;
	}
	else
	{
		self.modelindex = modelindex_player;
	}
	if (self.invincible_finished)
	{
		if ((self.invincible_finished < (time + MOVETYPE_WALK)))
		{
			if ((self.invincible_time == TRUE))
			{
				sprint (self, "Protection is almost burned out\n");
				stuffcmd (self, "bf\n");
				sound (self, CHAN_AUTO, "items/protect2.wav", TRUE, ATTN_NORM);
				self.invincible_time = (time + TRUE);
			}
			if ((self.invincible_time < time))
			{
				self.invincible_time = (time + TRUE);
				stuffcmd (self, "bf\n");
			}
		}
		if ((self.invincible_finished < time))
		{
			self.items = (self.items - IT_INVULNERABILITY);
			self.invincible_time = FALSE;
			self.invincible_finished = FALSE;
		}
		if ((self.invincible_finished > time))
		{
			self.effects = (self.effects | EF_DIMLIGHT);
		}
		else
		{
			self.effects = (self.effects - (self.effects & EF_DIMLIGHT));
		}
	}
	if (self.super_damage_finished)
	{
		if ((self.super_damage_finished < (time + MOVETYPE_WALK)))
		{
			if ((self.super_time == TRUE))
			{
				sprint (self, "Quad Damage is wearing off\n");
				stuffcmd (self, "bf\n");
				sound (self, CHAN_AUTO, "items/damage2.wav", TRUE, ATTN_NORM);
				self.super_time = (time + TRUE);
			}
			if ((self.super_time < time))
			{
				self.super_time = (time + TRUE);
				stuffcmd (self, "bf\n");
			}
		}
		if ((self.super_damage_finished < time))
		{
			self.items = (self.items - IT_QUAD);
			self.super_damage_finished = FALSE;
			self.super_time = FALSE;
		}
		if ((self.super_damage_finished > time))
		{
			self.effects = (self.effects | EF_DIMLIGHT);
		}
		else
		{
			self.effects = (self.effects - (self.effects & EF_DIMLIGHT));
		}
	}
	if (self.radsuit_finished)
	{
		self.air_finished = (time + 12);
		if ((self.radsuit_finished < (time + MOVETYPE_WALK)))
		{
			if ((self.rad_time == TRUE))
			{
				sprint (self, "Air supply in Biosuit expiring\n");
				stuffcmd (self, "bf\n");
				sound (self, CHAN_AUTO, "items/suit2.wav", TRUE, ATTN_NORM);
				self.rad_time = (time + TRUE);
			}
			if ((self.rad_time < time))
			{
				self.rad_time = (time + TRUE);
				stuffcmd (self, "bf\n");
			}
		}
		if ((self.radsuit_finished < time))
		{
			self.items = (self.items - IT_SUIT);
			self.rad_time = FALSE;
			self.radsuit_finished = FALSE;
		}
	}
};

void () PlayerPostThink =
{
	local float mspeed;
	local float aspeed;
	local float r;

	if ((self.view_ofs == VEC_ORIGIN))
	{
		return;
	}
	if (self.deadflag)
	{
		return;
	}
	W_WeaponFrame ();
	if ((((self.jump_flag < -300) && (self.flags & FL_ONGROUND)) && (self.health > FALSE)))
	{
		if ((self.watertype == CONTENT_WATER))
		{
			sound (self, CHAN_BODY, "player/h2ojump.wav", TRUE, ATTN_NORM);
		}
		else
		{
			if ((self.jump_flag < -650))
			{
				T_Damage (self, world, world, MOVETYPE_FLY);
				sound (self, CHAN_VOICE, "player/land2.wav", TRUE, ATTN_NORM);
				self.deathtype = "falling";
			}
			else
			{
				sound (self, CHAN_VOICE, "player/land.wav", TRUE, ATTN_NORM);
			}
		}
		self.jump_flag = FALSE;
	}
	if (!(self.flags & FL_ONGROUND))
	{
		self.jump_flag = self.velocity_z;
	}
	CheckPowerups ();
};

void () ClientConnect =
{
	bprint (self.netname);
	bprint (" entered the game\n");
	if (intermission_running)
	{
		ExitIntermission ();
	}
};

void () ClientDisconnect =
{
	if (gameover)
	{
		return;
	}
	bprint (self.netname);
	bprint (" left the game with ");
	bprint (ftos (self.frags));
	bprint (" frags\n");
	sound (self, CHAN_BODY, "player/tornoff2.wav", TRUE, ATTN_NONE);
	set_suicide_frame ();
};

void (entity targ, entity attacker) ClientObituary =
{
	local float rnum;
	local string deathstring;
	local string deathstring2;

	rnum = random ();
	if ((targ.classname == "player"))
	{
		if ((attacker.classname == "teledeath"))
		{
			bprint (targ.netname);
			bprint (" was telefragged by ");
			bprint (attacker.owner.netname);
			bprint ("\n");
			attacker.owner.frags = (attacker.owner.frags + TRUE);
			return;
		}
		if ((attacker.classname == "teledeath2"))
		{
			bprint ("Satan's power deflects ");
			bprint (targ.netname);
			bprint ("'s telefrag\n");
			targ.frags = (targ.frags - TRUE);
			return;
		}
		if ((attacker.classname == "player"))
		{
			if ((targ == attacker))
			{
				attacker.frags = (attacker.frags - TRUE);
				bprint (targ.netname);
				if (((targ.weapon == FL_GODMODE) && (targ.waterlevel > TRUE)))
				{
					bprint (" discharges into the water.\n");
					return;
				}
				if ((targ.weapon == IT_GRENADE_LAUNCHER))
				{
					bprint (" tries to put the pin back in\n");
				}
				else
				{
					bprint (" becomes bored with life\n");
				}
				return;
			}
			else
			{
				if ((((teamplay == FL_SWIM) && (targ.team > FALSE)) && (targ.team == attacker.team)))
				{
					if ((rnum < 0.25))
					{
						deathstring = " mows down a teammate\n";
					}
					else
					{
						if ((rnum < 0.5))
						{
							deathstring = " checks his glasses\n";
						}
						else
						{
							if ((rnum < 0.75))
							{
								deathstring = " gets a frag for the other team\n";
							}
							else
							{
								deathstring = " loses another friend\n";
							}
						}
					}
					bprint (attacker.netname);
					bprint (deathstring);
					attacker.frags = (attacker.frags - TRUE);
					return;
				}
				else
				{
					attacker.frags = (attacker.frags + TRUE);
					rnum = attacker.weapon;
					if ((rnum == IT_AXE))
					{
						deathstring = " was ax-murdered by ";
						deathstring2 = "\n";
					}
					if ((rnum == IT_SHOTGUN))
					{
						deathstring = " chewed on ";
						deathstring2 = "'s boomstick\n";
					}
					if ((rnum == IT_SUPER_SHOTGUN))
					{
						deathstring = " ate 2 loads of ";
						deathstring2 = "'s buckshot\n";
					}
					if ((rnum == IT_NAILGUN))
					{
						deathstring = " was nailed by ";
						deathstring2 = "\n";
					}
					if ((rnum == IT_SUPER_NAILGUN))
					{
						deathstring = " was punctured by ";
						deathstring2 = "\n";
					}
					if ((rnum == IT_GRENADE_LAUNCHER))
					{
						deathstring = " eats ";
						deathstring2 = "'s pineapple\n";
						if ((targ.health < -40))
						{
							deathstring = " was gibbed by ";
							deathstring2 = "'s grenade\n";
						}
					}
					if ((rnum == IT_ROCKET_LAUNCHER))
					{
						deathstring = " rides ";
						deathstring2 = "'s rocket\n";
						if ((targ.health < -40))
						{
							deathstring = " was gibbed by ";
							deathstring2 = "'s rocket\n";
						}
					}
					if ((rnum == IT_LIGHTNING))
					{
						deathstring = " accepts ";
						if ((attacker.waterlevel > TRUE))
						{
							deathstring2 = "'s discharge\n";
						}
						else
						{
							deathstring2 = "'s shaft\n";
						}
					}
					bprint (targ.netname);
					bprint (deathstring);
					bprint (attacker.netname);
					bprint (deathstring2);
				}
			}
			return;
		}
		else
		{
			targ.frags = (targ.frags - TRUE);
			bprint (targ.netname);
			if ((attacker.flags & FL_MONSTER))
			{
				if ((attacker.classname == "monster_army"))
				{
					bprint (" was shot by a Grunt\n");
				}
				if ((attacker.classname == "monster_demon1"))
				{
					bprint (" was eviscerated by a Fiend\n");
				}
				if ((attacker.classname == "monster_dog"))
				{
					bprint (" was mauled by a Rottweiler\n");
				}
				if ((attacker.classname == "monster_dragon"))
				{
					bprint (" was fried by a Dragon\n");
				}
				if ((attacker.classname == "monster_enforcer"))
				{
					bprint (" was blasted by an Enforcer\n");
				}
				if ((attacker.classname == "monster_fish"))
				{
					bprint (" was fed to the Rotfish\n");
				}
				if ((attacker.classname == "monster_hell_knight"))
				{
					bprint (" was slain by a Death Knight\n");
				}
				if ((attacker.classname == "monster_knight"))
				{
					bprint (" was slashed by a Knight\n");
				}
				if ((attacker.classname == "monster_ogre"))
				{
					bprint (" was destroyed by an Ogre\n");
				}
				if ((attacker.classname == "monster_oldone"))
				{
					bprint (" became one with Shub-Niggurath\n");
				}
				if ((attacker.classname == "monster_shalrath"))
				{
					bprint (" was exploded by a Vore\n");
				}
				if ((attacker.classname == "monster_shambler"))
				{
					bprint (" was smashed by a Shambler\n");
				}
				if ((attacker.classname == "monster_tarbaby"))
				{
					bprint (" was slimed by a Spawn\n");
				}
				if ((attacker.classname == "monster_vomit"))
				{
					bprint (" was vomited on by a Vomitus\n");
				}
				if ((attacker.classname == "monster_wizard"))
				{
					bprint (" was scragged by a Scrag\n");
				}
				if ((attacker.classname == "monster_zombie"))
				{
					bprint (" joins the Zombies\n");
				}
				return;
			}
			if ((attacker.classname == "explo_box"))
			{
				bprint (" blew up\n");
				return;
			}
			if (((attacker.solid == SOLID_BSP) && (attacker != world)))
			{
				bprint (" was squished\n");
				return;
			}
			if (((attacker.classname == "trap_shooter") || (attacker.classname == "trap_spikeshooter")))
			{
				bprint (" was spiked\n");
				return;
			}
			if ((attacker.classname == "fireball"))
			{
				bprint (" ate a lavaball\n");
				return;
			}
			if ((attacker.classname == "trigger_changelevel"))
			{
				bprint (" tried to leave\n");
				return;
			}
			rnum = targ.watertype;
			if ((rnum == CONTENT_WATER))
			{
				if ((random () < 0.5))
				{
					bprint (" sleeps with the fishes\n");
				}
				else
				{
					bprint (" sucks it down\n");
				}
				return;
			}
			else
			{
				if ((rnum == CONTENT_SLIME))
				{
					if ((random () < 0.5))
					{
						bprint (" gulped a load of slime\n");
					}
					else
					{
						bprint (" can't exist on slime alone\n");
					}
					return;
				}
				else
				{
					if ((rnum == CONTENT_LAVA))
					{
						if ((targ.health < -15))
						{
							bprint (" burst into flames\n");
							return;
						}
						if ((random () < 0.5))
						{
							bprint (" turned into hot slag\n");
						}
						else
						{
							bprint (" visits the Volcano God\n");
						}
						return;
					}
				}
			}
			if ((targ.deathtype == "falling"))
			{
				targ.deathtype = "";
				bprint (" fell to his death\n");
				return;
			}
			bprint (" died\n");
		}
	}
};
Lardarse
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Post by Lardarse »

Ok. Here's a small tip: Whenever you get ome really random error that doens't make sense for thcode you're writing, check for a missing semicolon on the line above where the error is happening This will quite often be many of the errors that you cause by messing around with the code.

Got that? Good.

Now then. Your error is caused by the fact that you have put a function prototype (a line that tells the code that "this function exists, I will define it later") in the no man's land between the = and { of a function definition. Unlike some people around here, I'm not willing to spoon-feed you the answer until you show the willingness to find your own spoon...
CocoT
Posts: 695
Joined: Tue Dec 14, 2004 5:39 pm
Location: Belly-Gum
Contact:

Post by CocoT »

My two cents: if you feel you're really, really at the early stages of coding, you might want to try simply looking around the code and making little changes in and there, and then see what happens, instead of starting with more complex tutorials. Like, start with weapons.qc and change some numbers here and there, make rockets fly faster, grenades create more damage, change models, sounds, that sort of stuff. I know it sounds less exciting than what some of the tuts promise, but it's a good way to get used to simply seeing the code and understanding how some of its very basic structure works. That's how I started QC... You might also start with the simpler kinds of tutorials.
Neurotic Conversions - New location: Update your bookmarks!
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

i understand all the simpler tutorials actually. more or less actually i fixed one on my own and didnt even ask for help the one that when you shoot it says "bang bang" it didnt work and i fixed it, the only time i really ask for help on something is if iv tried time and time again and nothings seems to work. matter of fact how i fixed the one code was by going through lines of other similar code to see how it worked then applied what i learned and fixed the issue. And secondly im not asking for someone to strait up do the code for me honestly if someone was to teach me quakec from the start over some chat device id probably almost perfer that more. coding has been slightly irratating for me because iv taught myself how to 3D model, texture, and map over the years and iv just started on this. coding isnt as simple as messing around with a tool till u get it to work. most of the code i can tell what it does or get the idea. but i still dont understand how you can just put it together and know what its going to do. so far the best way i seem to be learning is by doing the harder tutorials then asking for help. belive me im not asking for something to be spoon fed to me, other wise i would have tired once and only once then said hey can someone do this for me i give up. but i appeciate all your guy's help its been great that you guys have been so friendly and helpful so far. most modding communitys are well lets say the exact opposite of helpful.
Post Reply