What is this?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

What is this?

Post by Alcoholic »

Here's the error:

Code: Select all

		if (isalive self && isalive local.player && sighttrace self.gun1.origin local.player.origin 1 64 local.sightrange) (global/cerebralarmor.scr, 158)
		if (isalive self && isalive local.player && ^

^~^~^ Script Error: Cannot cast 'int' to vector

xtank can not find a target. Waiting 6 seconds before another search.

And heres the code its referring to:

Code: Select all

	for (local.p = 1; local.p <= $player.size; local.p++)
	{
		local.player = $player[local.p]
//		if (isalive self && isalive $player[local.p] && self.spotter cansee $player[local.p] 90 local.sightrange)
		if (isalive self && isalive local.player && sighttrace self.gun1.origin local.player.origin 1 64 local.sightrange)
		{
			self.enemytarget = local.player
			self thread tank_attack local.sightrange
			end
		}
	}
	println (self + " can not find a target. Waiting 6 seconds before another search.")
Whats wrong with it? I cant figure out whats wrong.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

nevermind i figured it out.. the "64 local.sightrange" part is where it needed vectors, but the 2 values were single numbers...
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

yeah jv_map what happened was yesterday i posted that one in mapping and it never showed me it posted successfully so i posted the smaller version here.
Post Reply