Post your scripting questions / solutions here
Moderator: Moderators
OxYdO666
Corporal
Posts: 30 Joined: Wed Jul 07, 2004 5:26 pm
Post
by OxYdO666 » Wed Jul 21, 2004 8:20 pm
hi ppl!
I found a script to obtain a flakk88 which draws with coords but there is the cannon its poster the text but nothing occurs!why????
Code: Select all
flakk:
local.flak = spawn "statweapons/flak88base.tik"
local.flak.origin = ( -347.90 -991.18 -191.88 )
local.flakgun = spawn "statweapons/flak88turret.tik"
local.flakgun.origin = ( -347.90 -991.18 -142 ) //49.87
local.flakgun.angle = 160
local.flakgun dmprojectile "projectiles/tigercannonshell.tik"
wait 10
iprintln "Flak 88mm Loading Shells - Ready To Shoot!"
ShootAgain:
local.target = randomint(12)+1
local.flakgun setaimtarget level.target[local.target]
local.flakgun waittill ontarget
local.flakgun anim fire
wait 1
local.flakgun anim fire
wait .5
local.flakgun anim fire
wait .5
local.flakgun anim fire
wait 10
goto ShootAgain
thread flakk
setup:
level.target[1] = spawn script_origin
level.target[1].origin = ( 488.88 1074.88 -49.88 )
level.target[2] = spawn script_origin
level.target[2].origin = ( -347.90 -991.18 -191.88 )
level.target[3] = spawn script_origin
level.target[3].origin = ( 1792.87 -242.82 -191.88 )
level.target[4] = spawn script_origin
level.target[4].origin = ( 248.35 -224.88 -189.92)
level.target[5] = spawn script_origin
level.target[5].origin = ( 3248.87 -222.53 -31.88 )
level.target[6] = spawn script_origin
level.target[6].origin = ( 3087.42 -767.88 156.66 )
level.target[7] = spawn script_origin
level.target[7].origin = (2672.87 -537.60 -191.88 )
level.target[8] = spawn script_origin
level.target[8].origin = ( 233.66 663.02 10.54 )
level.target[9] = spawn script_origin
level.target[9].origin = ( -2233.66 -363.02 13.54 )
level.target[10] = spawn script_origin
level.target[10].origin = ( -3111.78 1829.03 21.93 )
level.target[11] = spawn script_origin
level.target[11].origin = ( -1543.66 -3123.02 23.54 )
level.target[12] = spawn script_origin
level.target[12].origin = ( 2674.83 -1664.18 0.12 )
end
OxYdO666
Corporal
Posts: 30 Joined: Wed Jul 07, 2004 5:26 pm
Post
by OxYdO666 » Thu Jul 22, 2004 4:33 pm
anyone
M&M
General
Posts: 1427 Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:
Post
by M&M » Thu Jul 22, 2004 5:54 pm
well,i have no clue .but i am sure the others could do with a better explanation of the problem .specially this part
but there is the cannon its poster the text but nothing occurs!why????
and where did u put this script ,so on ....
more info =faster solution
G3mInI
First Lieutenant
Posts: 187 Joined: Sat Jun 29, 2002 3:49 am
Post
by G3mInI » Wed Jul 28, 2004 1:40 am
Well not sure but I would try something like this. The structure of this script is taken from The Bridge Objective Map. Of course you may have to play around with the origins of the flak, base, and the targets. And another thing I have found that the command anim fire doesnt seem to work but anim fire_scripted works well. With that all being said, this would be the gist of it:
// THE BRIDGE
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER
main:
setcvar "g_obj_alliedtext1" "Defend the bridge"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Place an explosive"
setcvar "g_obj_axistext2" "under the bridge"
setcvar "g_obj_axistext3" "to destroy it"
setcvar "g_scoreboardpic" "objdm4"
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/obj/whatever.scr
exec global/ambient.scr obj_team4
thread global/exploder.scr::main
thread global/minefield.scr::minefield_setup
exec global/door_locked.scr::lock
waitthread setup
thread flakk
level waittill spawn
level.defusing_team = "allies"
level.planting_team = "axis"
level.bomb_damage = 300
level.bomb_explosion_radius = 1024
// set the parameters for this round/wave based match
level.dmrespawning = 0 // 1 **wave based** or 0 **round based**
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = allies // set to axis, allies, kills, or draw
level waittill roundstart // comment this line out if you want to see the flak shoot by putting // in front of this line
thread ShootAgain
//$bridge_bomb thread global/obj_dm.scr::bomb_thinker
//$bridge_bomb2 thread global/obj_dm.scr::bomb_thinker
//$bridge_bomb thread axis_win_bomb $bridge_bomb $bridge_bomb2
//$bridge_bomb thread allied_win_timer
// thread objectives_setup
end
axis_win_bomb local.bomb1 local.bomb2:
while ((local.bomb1.exploded != 1) && (local.bomb2.exploded != 1))
wait .1
teamwin axis
end
//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------
allied_win_timer:
level waittill allieswin
end
flakk:
local.flak = spawn "statweapons/flak88base.tik"
local.flak.origin = ( -347.90 -991.18 -191.88 )
local.flakgun = spawn "statweapons/flak88turret.tik"
local.flakgun.origin = ( -347.90 -991.18 -142 ) //49.87
local.flakgun.angle = 160
local.flakgun dmprojectile "projectiles/tigercannonshell.tik"
wait 10
iprintln "Flak 88mm Loading Shells - Ready To Shoot!"
end
ShootAgain:
local.target = randomint(12)+1
local.flakgun setaimtarget level.target[local.target]
local.flakgun waittill ontarget
local.flakgun anim fire_scripted
wait 1
local.flakgun anim fire_scripted
wait .5
local.flakgun anim fire_scripted
wait .5
local.flakgun anim fire_scripted
wait 10
goto ShootAgain
end
setup:
level.target[1] = spawn script_origin
level.target[1].origin = ( 488.88 1074.88 -49.88 )
level.target[2] = spawn script_origin
level.target[2].origin = ( -347.90 -991.18 -191.88 )
level.target[3] = spawn script_origin
level.target[3].origin = ( 1792.87 -242.82 -191.88 )
level.target[4] = spawn script_origin
level.target[4].origin = ( 248.35 -224.88 -189.92)
level.target[5] = spawn script_origin
level.target[5].origin = ( 3248.87 -222.53 -31.88 )
level.target[6] = spawn script_origin
level.target[6].origin = ( 3087.42 -767.88 156.66 )
level.target[7] = spawn script_origin
level.target[7].origin = (2672.87 -537.60 -191.88 )
level.target[8] = spawn script_origin
level.target[8].origin = ( 233.66 663.02 10.54 )
level.target[9] = spawn script_origin
level.target[9].origin = ( -2233.66 -363.02 13.54 )
level.target[10] = spawn script_origin
level.target[10].origin = ( -3111.78 1829.03 21.93 )
level.target[11] = spawn script_origin
level.target[11].origin = ( -1543.66 -3123.02 23.54 )
level.target[12] = spawn script_origin
level.target[12].origin = ( 2674.83 -1664.18 0.12 )
end
Now just build and compile a map big enough to house these coordinates. And make a flat surface in the area of the flak -347.90 -991.18 -191.88.
Name this script to whatever.scr (the same name as you name the .bsp file you compiled). Put the .bsp and this .scr file in the ../mohaa/main/maps/obj folder (if it doesnt exist then make it exist) and I am pretty sure that would get a flak spawned into the map and shooting. May not hear the sounds but it will shoot.
G3mInI