Script error

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Script error

Post by martijn_NL »

I wanted to make a flak88 autofire (just like mp_ardennes_TOW). That worked. But then i wanted to add more places were the flak88 could fire, so i add some script_objects and expand some in my script. I maked the switch bigger. But know it gives this error:
Bad taken:
case
` case 16:(,aps/obj/obj_blitzkrieg.scr,326)

I thought some thing is wrong in case 16, but i couldn't fiund the error
Can sombody find the error? Plaese

Martijn_NL

Here is the total script:

main:
level waittill prespawn
level.script = "maps/dm/obj_blitzkrieg.scr"


$flak.gun = $flak QueryTurretSlotEntity 0
$flak lock
local.bla = 0
exec global/exploder.scr

setcvar "g_obj_alliedtext1" "Control the Flak88"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Control the Flak88"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "none"


level waittill spawn
level.bRoundStarted = 1
$obj_flak.ControlledBy = 2

end


Control_flak:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $obj_flak.ControlledBy != 0 )
{

iprintln "The Axis control the Flak 88!"

//Fire!
thread axis_flak
$obj_flak.ControlledBy = 0
}
}
else if( parm.other.dmteam == allies )
{
if( $obj_flak.ControlledBy != 1 )
{


iprintln "The Allies control the Flak 88!"

//Fire!
thread allied_flak
$obj_flak.ControlledBy = 1
}

}
}



end






end


end

allied_flak:

while (parm.other.dmteam == allies)

{

local.rand = randomint 7
switch (local.rand)
{
case 0:
$flak.gun setaimtarget $flak_allied_target0
break
case 1:
$flak.gun setaimtarget $flak_allied_target1
break
case 2:
$flak.gun setaimtarget $flak_allied_target2
break
case 3:
$flak.gun setaimtarget $flak_allied_target3
break
case 4:
$flak.gun setaimtarget $flak_allied_target4
break
case 5:
$flak.gun setaimtarget $flak_allied_target5
break
case 6:
$flak.gun setaimtarget $flak_allied_target6
break
case 7:
$flak.gun setaimtarget $flak_allied_target7
break
}


wait local.rand
$flak.gun waittill ontarget
$flak.gun anim fire
wait 0.5
$flak.gun sound flak_snd_reload

local.index = randomint 20

wait 1

switch (local.index)
{
case 0:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom0.origin
local.ent explode
break
case 1:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom1.origin
local.ent explode
break
case 2:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom2.origin
local.ent explode
break
case 3:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom3.origin
local.ent explode
break
case 4:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom4.origin
local.ent explode
break
case 5:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom5.origin
local.ent explode
break
case 6:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom6.origin
local.ent explode
break
case 7:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom7.origin
local.ent explode
break
case 8:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom8.origin
local.ent explode
break
case 9:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom9.origin
local.ent explode
break
case 10:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom10.origin
local.ent explode
break
case 11:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom11.origin
local.ent explode
break
case 12:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom12.origin
local.ent explode
break
case 13:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom13.origin
local.ent explode
break
case 14:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom14.origin
local.ent explode
break
case 15:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom15.origin
local.ent explode
break
case 16:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom16.origin
local.ent explode
break
case 17:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom17.origin
local.ent explode
break
case 18:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom18.origin
local.ent explode
break
case 19:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom19.origin
local.ent explode
break
case 20:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_allied_boom20.origin
local.ent explode
break
}
}




end


axis_flak:

while (parm.other.dmteam == axis)
{

local.rand = randomint 7
switch (local.rand)
{
case 0:
$flak.gun setaimtarget $flak_axis_target0
break
case 1:
$flak.gun setaimtarget $flak_axis_target1
break
case 2:
$flak.gun setaimtarget $flak_axis_target2
break
case 3:
$flak.gun setaimtarget $flak_axis_target3
break
case 4:
$flak.gun setaimtarget $flak_axis_target4
break
case 5:
$flak.gun setaimtarget $flak_axis_target5
break
case 6:
$flak.gun setaimtarget $flak_axis_target6
break
case 7:
$flak.gun setaimtarget $flak_axis_target7
break
}


wait local.rand
$flak.gun waittill ontarget
$flak.gun anim fire
wait 0.5
$flak.gun sound flak_snd_reload

local.index = randomint 20

wait 1

switch (local.index)
{
case 0:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom0.origin
local.ent explode
break
case 1:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom1.origin
local.ent explode
break
case 2:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom2.origin
local.ent explode
break
case 3:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom3.origin
local.ent explode
break
case 4:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom4.origin
local.ent explode
break
case 5:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom5.origin
local.ent explode
break
case 6:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom6.origin
local.ent explode
break
case 7:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom7.origin
local.ent explode
break
case 8:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom8.origin
local.ent explode
break
case 9:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom9.origin
local.ent explode
break
case 10:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom10.origin
local.ent explode
break
case 11:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom11.origin
local.ent explode
break
case 12:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom12.origin
local.ent explode
break
case 13:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom13.origin
local.ent explode
break
case 14:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom14.origin
local.ent explode
break
case 15:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom15.origin
local.ent explode
break
` case 16:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom16.origin
local.ent explode
break
case 17:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom17.origin
local.ent explode
break
case 18:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom18.origin
local.ent explode
break
case 19:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom19.origin
local.ent explode
break
case 20:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom20.origin
local.ent explode
break
}
}


End
Mapping 4 life
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

little mark

Post by tltrude »

You must be going blind for looking at it.

==========================
local.ent explode
break
` case 16:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom16.origin
local.ent explode
break
==========================

remove the "`" token, Ha ha! We have all done it.
Tom Trude,

Image
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post by martijn_NL »

lol ,i see it, thanks man
Mapping 4 life
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

lmao that was easy!!!

nice work TOM :D
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply