Post your scripting questions / solutions here
Moderator: Moderators
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed Nov 24, 2004 12:04 am
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
Splaetos
Major General
Posts: 730 Joined: Tue Jan 20, 2004 2:55 pm
Contact:
Post
by Splaetos » Wed Nov 24, 2004 12:43 pm
looks like fov(frame of view) and distance to me, but im jsut guessing
When I am king, you will be first against the wall~
jv_map
Site Admin
Posts: 6521 Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:
Post
by jv_map » Wed Nov 24, 2004 1:18 pm
Yes fov and distance
... note you have one ( too many
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed Nov 24, 2004 1:57 pm
okay but how to find the right fov and distance ?
Splaetos
Major General
Posts: 730 Joined: Tue Jan 20, 2004 2:55 pm
Contact:
Post
by Splaetos » Wed Nov 24, 2004 2:17 pm
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.
When I am king, you will be first against the wall~
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed Nov 24, 2004 2:49 pm
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 :
Is the fov and distance linked to the Turret origin ? This is the only way i found to explain my failure .
Help plz
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed Nov 24, 2004 6:37 pm
problem solved.My model was leaked