tank in mp that move around *not controled by player*
Moderator: Moderators
tank in mp that move around *not controled by player*
Hay Everyone...
ok what i want to know is...
How do i make a tank for multiplayer, which will move around the level and stop then shoot somwhere, move on to another area, then stop and shoot somwhere, then move on again and SO ON.
i have seen it been done on some official levels. and i was wondering how i can do this??
thanks
ok what i want to know is...
How do i make a tank for multiplayer, which will move around the level and stop then shoot somwhere, move on to another area, then stop and shoot somwhere, then move on again and SO ON.
i have seen it been done on some official levels. and i was wondering how i can do this??
thanks
...prepare for your finest hour...
ok barney.. just rip the code for tanks that you used in your sp levels, but for targeting you have to do it different. just add these lines:
and put a while statement around it.. thats just a simple way... the driving thing your own your own, it should be simple enough.. and dont just copy my code like you do with everything else!
you gotta do thinking this time!

Code: Select all
for (local.i = 1; local.i <= $player.size; local.i++)
{
local.player = $player[local.i]
local.los = sighttrace (whatever values you want yata yata)
if (local.los)
{
$tank setaimtarget local.player
$tank waittill ontarget
$tank startfiring
wait 1
$tank stopfiring
wait 4
}
}easy man.
i did do my own. i jus used alot of tuts, cause when it comes to scripting i aint good.
no i don't want the tank to aim and shoot at the player.
i want the tank to move to the first node, then stop aim and fire at like a random area, then move to the next node, stop and fire at some random area, then move to the next area...and so on
i did do my own. i jus used alot of tuts, cause when it comes to scripting i aint good.
no i don't want the tank to aim and shoot at the player.
i want the tank to move to the first node, then stop aim and fire at like a random area, then move to the next node, stop and fire at some random area, then move to the next area...and so on
...prepare for your finest hour...
ok my tank will now move 
it will now stop and fire at a script_origin i have set, then move on to the next path.....and so on..
BUT...
1) u can't hear the tank at all!!?? not the moving sound, or stoping sound or firing.( u get it he he)
2) u see the anim of the tank fire, but the explosion is not there??
here is my script and HELP...
here is JUS ONE of the WAYPOINTS
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
$tiger1.gun = $tiger1 QueryTurretSlotEntity 0
$tiger1 nodamage
tankagain:
// start at tank. head towards garden, then church
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun anim fire
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
$tiger1 exec scripts/randomshoot.scr
wait 5
I COPYED THE RANDOMSHOOT.SCR completely for this tiger to work...do i need the randomshoot script?????
i jus got it from the server with the tank in.
here is the randomshoot.scr if u need to read it.
//**************************************
//*** this will:
//*** check to see if it should shoot
//*** if so, count players
//*** random pick whoever is in range and shoot at them
start:
self.randomshoot = randomint(6)
if (self.randomshoot == 1)
{
println ("looking for target")
self.count = 1
if ($player[2])
{
self.count = 2
if ($player[3])
{
self.count = 3
if ($player[4])
{
self.count = 4
if ($player[5])
{
self.count = 5
if ($player[6])
{
self.count = 6
if ($player[7])
{
self.count = 7
if ($player[8])
{
self.count = 8
if ($player[9])
{
self.count = 9
if ($player[10])
{
self.count = 10
}
}
}
}
}
}
}
}
}
self.selectshoot = 1 + randomint(self.count)
println ("targeting player #" + self.selectshoot)
if (vector_length (self.origin - $player[self.selectshoot].origin) > 200)
{
if (vector_length (self.origin - $player[self.selectshoot].origin) < 3000)
{
wait 2
self.gun setAimTarget $player[self.selectshoot]
self.gun waittill ontarget
self.gun anim fire
}
}
}
else
{
println ("not looking for target")
}
end
OK i want the sound on tank.
and the explosion when the tank fires. all i see is the animation of it firing then it moves on ???
HEEEEEeeeeeeeeeeeeeeeeeellllllpppppPPPPPPPP plz
it will now stop and fire at a script_origin i have set, then move on to the next path.....and so on..
BUT...
1) u can't hear the tank at all!!?? not the moving sound, or stoping sound or firing.( u get it he he)
2) u see the anim of the tank fire, but the explosion is not there??
here is my script and HELP...
here is JUS ONE of the WAYPOINTS
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
$tiger1.gun = $tiger1 QueryTurretSlotEntity 0
$tiger1 nodamage
tankagain:
// start at tank. head towards garden, then church
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun anim fire
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
$tiger1 exec scripts/randomshoot.scr
wait 5
I COPYED THE RANDOMSHOOT.SCR completely for this tiger to work...do i need the randomshoot script?????
i jus got it from the server with the tank in.
here is the randomshoot.scr if u need to read it.
//**************************************
//*** this will:
//*** check to see if it should shoot
//*** if so, count players
//*** random pick whoever is in range and shoot at them
start:
self.randomshoot = randomint(6)
if (self.randomshoot == 1)
{
println ("looking for target")
self.count = 1
if ($player[2])
{
self.count = 2
if ($player[3])
{
self.count = 3
if ($player[4])
{
self.count = 4
if ($player[5])
{
self.count = 5
if ($player[6])
{
self.count = 6
if ($player[7])
{
self.count = 7
if ($player[8])
{
self.count = 8
if ($player[9])
{
self.count = 9
if ($player[10])
{
self.count = 10
}
}
}
}
}
}
}
}
}
self.selectshoot = 1 + randomint(self.count)
println ("targeting player #" + self.selectshoot)
if (vector_length (self.origin - $player[self.selectshoot].origin) > 200)
{
if (vector_length (self.origin - $player[self.selectshoot].origin) < 3000)
{
wait 2
self.gun setAimTarget $player[self.selectshoot]
self.gun waittill ontarget
self.gun anim fire
}
}
}
else
{
println ("not looking for target")
}
end
OK i want the sound on tank.
and the explosion when the tank fires. all i see is the animation of it firing then it moves on ???
HEEEEEeeeeeeeeeeeeeeeeeellllllpppppPPPPPPPP plz
...prepare for your finest hour...
it now looks like this...
and still no sound on tank and now explosion!!?? yes u see the anim but not the explosion??? help. this is wat it looks like now.
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
wait 5
and still no sound on tank and now explosion!!?? yes u see the anim but not the explosion??? help. this is wat it looks like now.
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
wait 5
...prepare for your finest hour...
i got rid of the randomshoot.scr and the anim fire like u said alcoh..
it does exact same!?
i mean it moves and u see the tank fire.
but u don't hear it move or fire or nothin.
this is what it looks like now (showing u one of the paths)
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
$tiger1.gun = $tiger1 QueryTurretSlotEntity 0
$tiger1 nodamage
tankagain:
// start at tank. head towards garden, then church
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
wait 5
it does exact same!?
i mean it moves and u see the tank fire.
but u don't hear it move or fire or nothin.
this is what it looks like now (showing u one of the paths)
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
$tiger1.gun = $tiger1 QueryTurretSlotEntity 0
$tiger1 nodamage
tankagain:
// start at tank. head towards garden, then church
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
$tiger1.gun setAimTarget $aim1
$tiger1.gun waittill ontarget
$tiger1.gun startfiring
wait(1)
$tiger1.gun stopFiring
wait 5
...prepare for your finest hour...
can anyone help with this plz???
why is there no sound with the tank?
why can i only see the animation of the tank fire, and not the explosion?
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
local.gun = $tiger1 QueryTurretSlotEntity 0
// Set the tank's immunities.
self immune bullet
self immune fast_bullet
self immune grenade
self immune bash
$tiger1 nodamage
tankagain:
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
local.gun setAimTarget $aim1
local.gun waittill ontarget
local.gun startfiring
wait 1
local.gun stopFiring
wait 5
why is there no sound with the tank?
why can i only see the animation of the tank fire, and not the explosion?
tiger:
$tiger1 setcollisionentity self.target // Set the tank collision mask
$tiger1.angle = 360
local.gun = $tiger1 QueryTurretSlotEntity 0
// Set the tank's immunities.
self immune bullet
self immune fast_bullet
self immune grenade
self immune bash
$tiger1 nodamage
tankagain:
$node1.target = NULL
$tiger1 drive $node1
$tiger1 waittill drive
$tiger1 stop
local.gun setAimTarget $aim1
local.gun waittill ontarget
local.gun startfiring
wait 1
local.gun stopFiring
wait 5
...prepare for your finest hour...