auto firing cannon at player
Moderator: Moderators
auto firing cannon at player
I have'nt done scripting in ages (or mapping come to that)but i thought i would try to do this tut but i just can not get it to work.
Here is the script can anyone let me know if there something missing please.(oh yeah its to make a cannon auto fire at the player)
main
exec global/loadout.scr maps/test_flak.scr
exec global/exploder.scr
exec global/friendly.scr
exec global/ai.scr
level.script = maps/test_flak.scr
level waittill prespawn
exec global/ambient.scr m3l3 // Ambient sound of the Normandy-levels.
level waittill spawn // Wait until the player has spawned into the level
fadein 2 0 0 0 1
wait 3 // A slow level fade in
$player item weapons/m1_garand.tik // The player gets the Garand-rifle
$player ammo rifle 40 // And 40 bullets for it
$player item weapons/M2frag_grenade_sp.tik // Also, the player gets hand grenades
$player ammo grenade 15 // The amount of grenades
Fire_88mm_weapon: // This script part will start as soon as the player runs through the trigger
local.gun_name = $88mm_weapon1 // Initialize the flak
local.target = $player // Defines the player as the 88?s target
local.gun_name setaimtarget local.target // Let the 88 aim at the player
wait(1) // Let the 88 wait before firing until the turning is done
local.range = 96 + randomint(128)
local.offset = 96 + randomint(128) // Defines the range and accuracy of the gun
local.gun_name anim fire_scripted // Starts the gun firing
wait(0.7 + ((randomint(6)) * .1)) // Random time from shooting til impact
local.a = local.target.origin
if((randomint(100)) < 50)
local.a[0] = local.a[0] + local.range
else
local.a[0] = local.a[0] - local.range
if((randomint(100)) < 50)
local.a[1] = local.a[1] + local.offset
else
local.a[1] = local.a[1] - local.offset // Redefines the target to make it look realistical
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.Exp3 = spawn "animate/fx_mortar_higgins.tik" // Play the explosions
exec global/earthquake.scr .23 4 0 0 // The screen shakes each impact
local.Exp1.origin = local.a local.Exp1 anim start
local.Exp2.origin = local.a
local.Exp2 anim start
local.Exp3.origin = local.a
local.Exp3 anim start
wait(1) // Disables the animation
local.Exp1 remove
local.Exp2 remove
local.Exp3 remove // Removes the animations
local.gun_name setaimtarget $FlakBaseAim
end // This brings the 88 gun back to its starting position (needs a script_origin inside the map)
Here is the script can anyone let me know if there something missing please.(oh yeah its to make a cannon auto fire at the player)
main
exec global/loadout.scr maps/test_flak.scr
exec global/exploder.scr
exec global/friendly.scr
exec global/ai.scr
level.script = maps/test_flak.scr
level waittill prespawn
exec global/ambient.scr m3l3 // Ambient sound of the Normandy-levels.
level waittill spawn // Wait until the player has spawned into the level
fadein 2 0 0 0 1
wait 3 // A slow level fade in
$player item weapons/m1_garand.tik // The player gets the Garand-rifle
$player ammo rifle 40 // And 40 bullets for it
$player item weapons/M2frag_grenade_sp.tik // Also, the player gets hand grenades
$player ammo grenade 15 // The amount of grenades
Fire_88mm_weapon: // This script part will start as soon as the player runs through the trigger
local.gun_name = $88mm_weapon1 // Initialize the flak
local.target = $player // Defines the player as the 88?s target
local.gun_name setaimtarget local.target // Let the 88 aim at the player
wait(1) // Let the 88 wait before firing until the turning is done
local.range = 96 + randomint(128)
local.offset = 96 + randomint(128) // Defines the range and accuracy of the gun
local.gun_name anim fire_scripted // Starts the gun firing
wait(0.7 + ((randomint(6)) * .1)) // Random time from shooting til impact
local.a = local.target.origin
if((randomint(100)) < 50)
local.a[0] = local.a[0] + local.range
else
local.a[0] = local.a[0] - local.range
if((randomint(100)) < 50)
local.a[1] = local.a[1] + local.offset
else
local.a[1] = local.a[1] - local.offset // Redefines the target to make it look realistical
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.Exp3 = spawn "animate/fx_mortar_higgins.tik" // Play the explosions
exec global/earthquake.scr .23 4 0 0 // The screen shakes each impact
local.Exp1.origin = local.a local.Exp1 anim start
local.Exp2.origin = local.a
local.Exp2 anim start
local.Exp3.origin = local.a
local.Exp3 anim start
wait(1) // Disables the animation
local.Exp1 remove
local.Exp2 remove
local.Exp3 remove // Removes the animations
local.gun_name setaimtarget $FlakBaseAim
end // This brings the 88 gun back to its starting position (needs a script_origin inside the map)
My candle burns at both ends it will not last the night but oh my foes and oh my friends it gives a lovely light.
Try this . Does the script run at all can't spot any mistakes at the moment .
$player item weapons/M2frag_grenade_sp.tik // Also, the player gets hand grenades
$player ammo grenade 15 // The amount of grenades
end
Fire_88mm_weapon: // This script part will start as soon as the player runs through the trigger
local.gun_name = $88mm_weapon1 // Initialize the flak
local.target = $player // Defines the player as the 88?s target
local.gun_name setaimtarget local.target // Let the 88 aim at the player
local.gun_name waittill ontarget //wait(1) // Let the 88 wait before firing until the turning is done
local.range = 96 + randomint(128)
local.offset = 96 + randomint(128) // Defines the range and accuracy of the gun
$player item weapons/M2frag_grenade_sp.tik // Also, the player gets hand grenades
$player ammo grenade 15 // The amount of grenades
end
Fire_88mm_weapon: // This script part will start as soon as the player runs through the trigger
local.gun_name = $88mm_weapon1 // Initialize the flak
local.target = $player // Defines the player as the 88?s target
local.gun_name setaimtarget local.target // Let the 88 aim at the player
local.gun_name waittill ontarget //wait(1) // Let the 88 wait before firing until the turning is done
local.range = 96 + randomint(128)
local.offset = 96 + randomint(128) // Defines the range and accuracy of the gun
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
global/aim_and_shoot.scr
There is a global/aim_and_shoot.scr you can use, provided that your gun is a real AI gunner.
Below is what is in that script.
// tells AI to aim and then shoot
start local.target:
self exec global/aimat.scr local.target
self waittill animdone
self exec global/shoot.scr
There is a singleplayer mission where an AI tank shoots at the player -- might be M5L0b or 6.
Below is what is in that script.
// tells AI to aim and then shoot
start local.target:
self exec global/aimat.scr local.target
self waittill animdone
self exec global/shoot.scr
There is a singleplayer mission where an AI tank shoots at the player -- might be M5L0b or 6.
You must be one of those lucky people then or one that never messes with the default settings of there computer.
I got a game called mafia and i was playing away when i realized i could'nt get into half the streets i used to be able to
low and behold a quick re-install of the game and everything was back to normal !
Maybe i just got a screwy computer,
I got a game called mafia and i was playing away when i realized i could'nt get into half the streets i used to be able to
Maybe i just got a screwy computer,
My candle burns at both ends it will not last the night but oh my foes and oh my friends it gives a lovely light.
Ok this is getting damn freaky!
For anyone that wants a look ive included the map.script.bsp.
This is the map ive always know to work.I get the obj to come up and when i hit the trigger it goes to next obj but i can not get any weapons to work!
Heeeeeeelp! im going crazy
http://www.merlins-lair.co.uk/map_and_script.zip
For anyone that wants a look ive included the map.script.bsp.
This is the map ive always know to work.I get the obj to come up and when i hit the trigger it goes to next obj but i can not get any weapons to work!
http://www.merlins-lair.co.uk/map_and_script.zip
My candle burns at both ends it will not last the night but oh my foes and oh my friends it gives a lovely light.
ooook i got it to work BUT only when i tried it by loading up moh BREAKTHROUGH instead of moh allied assualt
is there a difference ?
I don't understand why its works with one and not the other ?
I don't understand why its works with one and not the other ?
My candle burns at both ends it will not last the night but oh my foes and oh my friends it gives a lovely light.
sh, bt
Some of the models in SH/BT don't work in Mohaa. The SDK version of radient is for SH/BT.



