Page 1 of 1

variable meaning plz

Posted: Wed Nov 24, 2004 12:04 am
by agentmad007
Hi ,

Can i know what that mean :

Code: Select all

if (($mg1 cansee $player[local.i] 360 1440)
what stand 360 and 1440 for plz ?

It is from wacko and krane Machine gun script.Mine dont want to autofire , i guess its because of those numbers.

Thx

Posted: Wed Nov 24, 2004 12:43 pm
by Splaetos
looks like fov(frame of view) and distance to me, but im jsut guessing

Posted: Wed Nov 24, 2004 1:18 pm
by jv_map
Yes fov and distance 8-) ... note you have one ( too many :wink:

Posted: Wed Nov 24, 2004 1:57 pm
by agentmad007
okay but how to find the right fov and distance ?

Posted: Wed Nov 24, 2004 2:17 pm
by Splaetos
did you take out the other parenthesis jv mentioned?

I dont know how that script behaves, the second number is the distance in WU(im pretty sure) so it will fire if someoen gets within that range.

Im not sure what vector the fov uses(and like i said im not familiar with this script so i dont know how it behaves) but 360 is in degrees... I dont know if that voers horizonatal or both hoirxonal and vertical tho....

thats all the information present in that line tho... if it sees a player(within the parameters) it shoots.

Posted: Wed Nov 24, 2004 2:49 pm
by agentmad007
This is from wacko containerz map :


main:

thread activate_mg
thread prep-mg

Code: Select all


main:

thread activate_mg
thread prep-mg

prep_mg:


	$mg1 setPlayerUsable 0
	$mg1 turnspeed 150
	$mg1 burstFireSettings 0 .13 0 0
	$idletarget bind $idletarget_origin
	$idletarget_origin rotateY 35
end

activate_mg:
while (1) 
	{ 
	for (local.i=1; local.i<=$player.size; local.i++) 
		{ 
		keepontarget:
		wait .1
		if (($mg1 cansee $player[local.i] 360 1440) && (isAlive $player[local.i]) && $player[local.i].dmteam==level.mg_enemy)
			{
			$mg1 loopsound turret_alarm
			$mg1 setaimtarget $player[local.i]
			if ($mg1 cansee $player[local.i] 50 1440)
				{
				$mg1 startfiring
				}   
			else 
				{ 
				$mg1 stopfiring
				} 
			goto keepontarget
 			}
		else 
			{ 
			$mg1 stopfiring
			$mg1 setaimtarget $idletarget
			waitframe
			$mg1 loopsound turret_turn
			} 
		} 
	wait .1 
	}
end

mg_enemy:
$mg_trigger nottriggerable
if (level.mg_enemy=="allies")
	{
	$mg_switch anim turnon
	$bulb_idle hide
	$bulb_blue show
	$mg_switch playsound click_switch
	$bulb_red hide
	level.mg_enemy="axis"
	}
else
	{
	$mg_switch anim turnoff
	$bulb_idle hide
	$bulb_red show 
	$mg_switch playsound click_switch
	$bulb_blue hide
	level.mg_enemy="allies"
	}
wait .5
$mg_trigger triggerable
end

i tried many Fov and distance , still doesn't want to work .

My turret weapon stand to origin :

Code: Select all

"origin" "-3446.00 -5540.00 80.00"
and wacko's turret to :

Code: Select all

"origin" "840.00 -2368.00  0.00"
Is the fov and distance linked to the Turret origin ? This is the only way i found to explain my failure .

Help plz ;)

Posted: Wed Nov 24, 2004 6:37 pm
by agentmad007
problem solved.My model was leaked :oops: