Page 1 of 2

Issues with Radar

Posted: Tue Sep 16, 2008 7:23 pm
by ceriux
My error log

Code: Select all



warning: Q202: ai.qc:275:FindTarget must return a value
warning: Q203: ai.qc:442:CheckAnyAttack does not return a value
warning: Q203: ai.qc:446:CheckAnyAttack does not return a value
warning: Q203: ai.qc:450:CheckAnyAttack does not return a value
warning: Q203: ai.qc:454:CheckAnyAttack does not return a value
warning: Q203: ai.qc:458:CheckAnyAttack does not return a value
warning: Q203: ai.qc:462:CheckAnyAttack does not return a value
warning: Q203: ai.qc:464:CheckAnyAttack does not return a value
warning: Q105: items.qc:30:droptofloor: Too few parameters. See definition defs.qc(365)
warning: Q206: client.qc:112:FindIntermission: not all control paths return a value
error: Q505: client.qc:306:Unknown value "void"
error: Q505: client.qc:465:Unknown value "func_radar"
warning: Q106: client.qc:781:Assignment to constant

The tutorial
http://inside3d.com/showtutorial.php?id=14


if its needed ill post up my qc's

Posted: Wed Sep 17, 2008 4:54 am
by ceriux
also getting an error "unknown command"


here:

Code: Select all

 {
                self.flash_flag = FALSE;
                W_SetCurrentAmmo ();
                self.flash.think = sub_remove;
                self.flash.nextthink = time + 0.1;
        }
in the flashlight tutorial.

Posted: Wed Sep 17, 2008 5:14 am
by Error
to fix flashlight

QC compiler is case sensitive. change sub_remove to SUB_Remove

Posted: Wed Sep 17, 2008 5:20 am
by ceriux
thats what it was before but ill try again really quick


"Yep same thing" i removed that line and it compiles and i can turn the flash light on using impulse 30 in the console, once i get this fixed is there a way i can assign impulse 30 to a key?

Posted: Wed Sep 17, 2008 5:36 am
by Wazat
Yup. To assign any command to a key use the "bind" command in the console:

bind <key> "command"

For example:

bind f "impulse 30"

Alternately, you can make an alias (such as in autoexec.cfg) and then bind that:
alias flashlight "impulse 30"
bind f "flashlight"

That gets useful if you need things to happen only while the key is held down (like the flashlight turns off automatically when they release the key).

alias +flashlight "impulse 30"
alias -flashlight "impulse 31"
bind f "+flashlight"

Hope that helps!

Posted: Wed Sep 17, 2008 5:40 am
by ceriux
well i tried binding f to impulse 30 ingame cuz i knew u could bind things but it didnt work, let me try ur alias thing. i may not need the sub part of the code.

the bind works now to get it to where the flash light toggles -.- cuz i been doing some testing and if u cant turn the flashlight off it just gets brighter and brighter and brighter till it slows ur pc down... lol

Posted: Wed Sep 17, 2008 6:11 am
by ceriux
GRR... iv tried crap loads of things but i cant get "SUB_Remove" to work i even looked in the Subs.qc to see if it was wrong at all and thats exactly the same? anyone have any idea why it isnt working?

"sorry for double post"


EDIT: I FIXED IT! it wasnt compiling subs before the new "flash.qc" i made because he said put it under "defs.qc" when it should go below subs! so it didnt reconize that SUB_Remove was part of the code and so it did realize that "SUB_Remove" was infact a command!

thanks for your guy's help with that.

Does anyone know anything about the radar thing? i had it compile with 0 Errors but nothing happened in game.


EDIT2: oh and for anyone who cares

Image


EDIT3: Radar's still not working... i got the entire code to almost compile . it has 0 warnings and 1 error unkown Value "void"


This is where it messes up....

Code: Select all

	}

	self.think = radar_think;

void () func_radar =
{
	if (!self.model)
		setsize (self, '-100 -100 -100', '100 100 100');
	else
	{
		setmodel (self, self.model);

Posted: Thu Sep 18, 2008 5:07 pm
by ceriux
bump :(

i know you guys are prolly annoyed i just did this , because i do know its rude...

but i really need help with this, no matter what iv tried i cant get it to work.

either the tutorials wrong... or well im just an idiot ... which is prolly the case ....

anyways even a reply with "i dont think anyone wants to help you" would be appreciated ... thanks again guys for what you have helped me with ....

Posted: Thu Sep 18, 2008 6:50 pm
by Wazat
It looks like your code is missing a } at the end of the function, right before the "void () func_radar =" line. Did you delete something by accident? The tutorial says the end of that function should probably be:

self.think = radar_think;
self.nextthink = time + self.cnt;
};


If this radar code doesn't do what you want, you could steal the radar code from my voidents mod. My site (static.condemned.com) is gone now, but I suppose Cheapalert would have it on his archives site. I could upload it if all else fails.

However, your code will probably work when you fix this one bug. I hope that helps!

EDIT: Oh and BTW, we're not annoyed. I just don't notice sometimes when replies are posted, so I didn't see that you still needed help. :) Sorry 'bout that.

Posted: Thu Sep 18, 2008 9:21 pm
by ceriux
well he says to put it in between those things. but ill try and play around abit , you gave me an idea, honstely all i really want is a 2d radar i can put in the top right corner of my screen, but this will do, id also like it to be moddable to where if your a certain class you can see enemys on it also. but that can come later.

thank you for your help ^.^

well im still getting the same error, even after redoing everything like 30 times again....

here's the qc code that has something wrong with it. ( it messes up at step two in the tut.)

Code: Select all

// VENOMUS START
void () radar_think =
{
	local entity head;

	head = nextent (world);
	while (head != world)
	{
		if (head.health > 0)
		{
			if (head.classname == "player")
			{
				local vector bliporg;

				bliporg = '0 0 0';
				bliporg_x = (head.origin_x / 

self.punchangle_x) + self.origin_x;
				bliporg_y = (head.origin_y / 

self.punchangle_y) + self.origin_y;
				bliporg_z = (head.origin_z / 

self.punchangle_z) + self.origin_z;

				local entity blip;

				blip = spawn ();
				setorigin (blip, bliporg);
				setmodel (blip, "progs/s_bubble.spr");
				blip.think = SUB_Remove;
				blip.nextthink = time + self.cnt;
			}
		}

		head = nextent (head);
	}

	self.think = radar_think;

void () func_radar =
{
	if (!self.model)
		setsize (self, '-100 -100 -100', '100 100 100');
	else
	{
		setmodel (self, self.model);

		local vector org;

		org = '0 0 0';
		org_x = (self.maxs_x + self.mins_x) / 2;
		org_y = (self.maxs_y + self.mins_y) / 2;
		org_z = (self.maxs_z + self.mins_z) / 2;
		setorigin (self, org);
	}

	if (!self.cnt)
		self.cnt = 1;

	self.punchangle = '0 0 0';
	self.punchangle_x = 8192 / self.size_x;
	self.punchangle_y = 8192 / self.size_y;
	self.punchangle_z = 8192 / self.size_z;

	self.solid = SOLID_NOT;
	self.movetype = MOVETYPE_NONE;

	self.think = radar_think;
	self.nextthink = time + self.cnt;
};
// VENOMUS END

	self.nextthink = time + selfMUS END


Posted: Thu Sep 18, 2008 11:27 pm
by CocoT
head = nextent (head);
}

self.think = radar_think;
}
void () func_radar =
{
if (!self.model)


This could be the issue.

Posted: Thu Sep 18, 2008 11:31 pm
by ceriux
i added that in, and it says self is not a type now.

Posted: Fri Sep 19, 2008 12:11 am
by Wazat
Okay, here's what happened. You seem to have pasted the func_radar function into the wrong place (inside of the function above it, instead of below where the function ended). It's only a few lines difference, but that's a huge deal in computer code. :) The self.nextthink line at the very bottom of the code was supposed to be at the bottom of radar_think (followed by a closing } brace). In fact, part of that line seems to have been nuked and replaced by MUS END. O_o

Whatever happened, here's what your code needs to look like:

Code: Select all

// VENOMUS START
void () radar_think =
{
	local entity head;

	head = nextent (world);
	while (head != world)
	{
		if (head.health > 0)
		{
			if (head.classname == "player")
			{
				local vector bliporg;

				bliporg = '0 0 0';
				bliporg_x = (head.origin_x / self.punchangle_x) + self.origin_x;
				bliporg_y = (head.origin_y / self.punchangle_y) + self.origin_y;
				bliporg_z = (head.origin_z / self.punchangle_z) + self.origin_z;

				local entity blip;

				blip = spawn ();
				setorigin (blip, bliporg);
				setmodel (blip, "progs/s_bubble.spr");
				blip.think = SUB_Remove;
				blip.nextthink = time + self.cnt;
			}
		}

		head = nextent (head);
	}

	self.think = radar_think;
	self.nextthink = time + self.cnt;
};

void () func_radar =
{
	if (!self.model)
		setsize (self, '-100 -100 -100', '100 100 100');
	else
	{
		setmodel (self, self.model);

		local vector org;

		org = '0 0 0';
		org_x = (self.maxs_x + self.mins_x) / 2;
		org_y = (self.maxs_y + self.mins_y) / 2;
		org_z = (self.maxs_z + self.mins_z) / 2;
		setorigin (self, org);
	}

	if (!self.cnt)
		self.cnt = 1;

	self.punchangle = '0 0 0';
	self.punchangle_x = 8192 / self.size_x;
	self.punchangle_y = 8192 / self.size_y;
	self.punchangle_z = 8192 / self.size_z;

	self.solid = SOLID_NOT;
	self.movetype = MOVETYPE_NONE;

	self.think = radar_think;
	self.nextthink = time + self.cnt;
};
// VENOMUS END
I hope that fixes it for you.

Posted: Fri Sep 19, 2008 12:40 am
by ceriux
now it says "code" is not a type and "radar_think" is an unknown command :P

Posted: Fri Sep 19, 2008 5:14 pm
by Wazat
I guess you don't know any C stuff at all. :)

Don't copy the CODE: line at the top of the code I posted. That's not part of the code, it's just the forum telling you that the stuff below it is the code.

Please, look carefully at what you're doing before blindly doing it. The stuff you should copy from my post starts with // VENEMOUS START and ends with // VENEMOUS END