Page 1 of 2

Error

Posted: Sun Jun 22, 2003 10:27 am
by martijn_NL
I wanted to make a flak88 fire, but i get these errors:

CL_EndRegistration: 0.01 seconds
CL_InitCGame: 3.77 seconds
Going from CS_PRIMED to CS_ACTIVE for {xdc}[Cg.]Martijn_NL
^~^~^ Add the following line to the *_precache.scr map script:
cache models/player/american_army.tik
Called FadeSound with: 0.000000
{xdc}[Cg.]Martijn_NL has entered the battle
MUSIC: changing from [ none | none ] to [ normal | normal ]
^~^~^ Add the following line to the *_precache.scr map script:
cache models/player/american_army_fps.tik
LOCALIZATION ERROR: 'Tijd resterend: 0:00' does not have a localization entry
$flak setaimtarget $flak_axis_target[local.index] (maps/dm/mp_test_tow.scr, 55)
$flak setaimtarget $flak_axis_target^

^~^~^ Script Error: array index 2 out of range

$flak setaimtarget $flak_axis_target[local.index] (maps/dm/mp_test_tow.scr, 55)
$flak ^

^~^~^ Script Error: Failed execution of command 'setaimtarget' for class 'FixedTurret' Targetname 'flak'

$flak waittill ontarget (maps/dm/mp_test_tow.scr, 56)
$flak ^

^~^~^ Script Error: invalid waittill ontarget for 'FixedTurret'

^~^~^ Add the following line to the *_precache.scr map script:
cache models/projectiles/berlin_bombs.tik
^~^~^ Add the following line to the *_precache.scr map script:
cache models/fx/explosionberlinbomb.tik
LOCALIZATION ERROR: 'NPCS: Allies 0(0) Axis 0(0)' does not have a localization entry
$flak setaimtarget $flak_axis_target[local.index] (maps/dm/mp_test_tow.scr, 55)
$flak ^

^~^~^ Script Error: Failed execution of command 'setaimtarget' for class 'FixedTurret' Targetname 'flak'

$flak waittill ontarget (maps/dm/mp_test_tow.scr, 56)
$flak ^

^~^~^ Script Error: invalid waittill ontarget for 'FixedTurret'

local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom[local.index].origin (maps/dm/mp_test_tow.scr, 82)
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom^

^~^~^ Script Error: array index 5 out of range

local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom[local.index].origin (maps/dm/mp_test_tow.scr, 82)
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom[local.index]^

^~^~^ Script Error: Cannot cast 'NIL' to listener

^~^~^ Game (Event: 'origin', Object: 'Projectile') : Couldn't convert string to vector - malformed string 'NIL'
$flak setaimtarget $flak_axis_target[local.index] (maps/dm/mp_test_tow.scr, 55)
$flak setaimtarget $flak_axis_target^

^~^~^ Script Error: array index 5 out of range

$flak setaimtarget $flak_axis_target[local.index] (maps/dm/mp_test_tow.scr, 55)
$flak ^

^~^~^ Script Error: Failed execution of command 'setaimtarget' for class 'FixedTurret' Targetname 'flak'

$flak waittill ontarget (maps/dm/mp_test_tow.scr, 56)
$flak ^






This is my script file:

main:
exec global/exploder.scr

thread control_flak

end



//----------------------------------------------------------
//Control the Flak88
//----------------------------------------------------------
control_flak:



iprintln "The Axis control the Flak 88!"

//Fire!
thread flak_attack_loop



end




//-----------------------------------------------
// Flak cannon fire
//-----------------------------------------------


flak_attack_loop:






while ( 1 )
{
local.index = randomint 6


wait local.index


if( local.index <= 0 )
{
local.index++
}


$flak setaimtarget $flak_axis_target[local.index]
$flak waittill ontarget


$flak anim fire

wait 1

waitthread Do_flak_explosion



}

end


//-----------------------------------------------
// Make flak go boom
//-----------------------------------------------
Do_flak_explosion:


local.index = randomint 9
if ( local.index==0 )
local.index++

local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom[local.index].origin
local.ent explode


end



This is how it works i make the flak fire on several script orgin (with a targetname) The flak aim on it and fires. On the place i want the explosion i add several script orgins and there the exploded. The explosions worked, but the flak won't aim and fire. All the script orgins will choose random.
Can someone help me?

Posted: Sun Jun 22, 2003 10:37 am
by jv_map
I think you're using the wrong flak. You need the turretweapon -> flak88

Posted: Sun Jun 22, 2003 11:06 am
by martijn_NL
No that doesn't work. I think it is the script that makes the error, but i don't know what.

Posted: Sun Jun 22, 2003 11:08 am
by jv_map
^~^~^ Script Error: Failed execution of command 'setaimtarget' for class 'FixedTurret' Targetname 'flak'

FixedTurret is a Spearhead class I think. You really need a TurretWeapon class instead.

Posted: Sun Jun 22, 2003 11:12 am
by martijn_NL
I added classname: turretweapon_german_flak88

Is that wrong?

What would you advice to add?

Posted: Sun Jun 22, 2003 12:00 pm
by mohaa_rox
don't add ur own classname :o

Posted: Mon Jun 23, 2003 5:27 pm
by martijn_NL
No i did not add my own classname, i copied the class name from the turret Flak 88 to this forum.

My question is to make a flak 88 fire just like the spearhead map mp_ardennes_tow. I can make the explosions, but i can't make the flak 88 fire, i looked ay script that is with the map and copied that to my own script ( u see my own script at the first topic). I think that the script is not right. Can any one help me with making the flak 88 fire. The flak need to fire to a script orgin, that is in the sky and not far from the flak 88. The flak is not shooting where the explosion are, the flak is just shooting in the air (fake shooting) But in the map it looks real. So have anyone suggestions for the script. The errors that i had are also on the first topic.

Posted: Tue Jun 24, 2003 12:25 pm
by bdbodger
In the gags/T1l2_flak88.scr they do this
//-------------------------------------------------------------------
SetupFlakCannons:
//-------------------------------------------------------------------

$Flak88A.gun = $Flak88A QueryTurretSlotEntity 0
$Flak88B.gun = $Flak88B QueryTurretSlotEntity 0

$Flak88A.gun setaimtarget $Flak88A.target
$Flak88B.gun setaimtarget $Flak88B.target


so that you set the "gun" to the aimtarget by querying the turretslot for the gun entity and haveing it aim at the target .

Posted: Tue Jun 24, 2003 12:41 pm
by bdbodger
I forgot to add that the fire animation is in p_flak88_cannon.tik . The cannon is spawned when you add a p_flak88 to your map so you use $myflak88.gun anim fire after you query the slot as stated in the post above . here is a line from the p_flak88.tik
// Spawn and attach the parts
spawnturret 0 "statweapons/P_flak88_cannon.tik" // Cannon attached to the vehicle
that is why in the editor all you see is the base but in the game you see the whole flak88 . The p_flak88_cannon.tik has no line like this in it so you don't see it in the right click menu .
/*QUAKED turretweapon_german_flak88 (0.0 .0 0.0) (-55 -55 0) (55 55 128)
Flak 88
*/

Posted: Tue Jun 24, 2003 12:42 pm
by mohaa_rox
martijn_NL wrote:No i did not add my own classname, i copied the class name from the turret Flak 88 to this forum.
precisely, u can't do that i think. i tried that before, it never worked.

the problem lies with using the wrong flak, try addon or like bdbodger said, the p_flak88. :wink:

Posted: Tue Jun 24, 2003 4:08 pm
by martijn_NL
My target is a script_orgin with a targetname, how does teh script know where the flak88 need to aim on? Do i need to link the flak to the script_orgin?

Do i need to add this line to my script?:
// Spawn and attach the parts
spawnturret 0 "statweapons/P_flak88_cannon.tik" // Cannon attached to the vehicle

Cause this line doesn't stand in gags/T1l2_flak88.scr.


Martijn_NL

Posted: Tue Jun 24, 2003 5:22 pm
by mohaa_rox
martijn_NL wrote:My target is a script_orgin with a targetname, how does teh script know where the flak88 need to aim on? Do i need to link the flak to the script_orgin?

Do i need to add this line to my script?:
// Spawn and attach the parts
spawnturret 0 "statweapons/P_flak88_cannon.tik" // Cannon attached to the vehicle

Cause this line doesn't stand in gags/T1l2_flak88.scr.


Martijn_NL
u needn't, it's already attached in the tiki.

Posted: Wed Jun 25, 2003 7:29 am
by martijn_NL
$Flak88A.gun = $Flak88A QueryTurretSlotEntity 0
$Flak88B.gun = $Flak88B QueryTurretSlotEntity 0

$Flak88A.gun setaimtarget $Flak88A.target
$Flak88B.gun setaimtarget $Flak88B.target


The script says to aim at a target, but my target is a script_orgin with the targetname flak_target. How does the flak88 aim on it? That is wat i don't understand

Posted: Wed Jun 25, 2003 2:19 pm
by bdbodger
$Flak88A.gun setaimtarget $Flak88A.target

You notice that the setaimtarget is the target of the $flak88A.gun so query the turret slot first

$Flak88A.gun = $Flak88A QueryTurretSlotEntity 0

then you can set the aim target for $flak88A.gun

$Flak88A.gun setaimtarget $flak_target . Which is your script_origin you see the "gun" part of the flak88 must target whatever a script_origin $player etc .

Posted: Thu Jun 26, 2003 6:29 am
by martijn_NL
I did it different, but it worked. :lol: At last

here is the script:

main:
level waittill prespawn
level.script = "maps/dm/b.scr"
exec global/exploder.scr

level waittill spawn

thread flak

end

flak:

$flak.gun = $flak QueryTurretSlotEntity 0
$flak_turret0 turnspeed 15
$flak_turret0 pitchspeed 7.5
$flak_turret0 viewjitter 7
$flak_turret0 firedelay 4
$flak_turret0 maxyawoffset 20.0
$flak_turret0 pitchcaps "20 10 0"
$flak.collisionent = $flak88_collision
$flak_turret0.collisionent = $flak88_turret_collision
$flak lock


while (1)
{
local.rand = randomint 9
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 5
$flak.gun waittill ontarget
$flak.gun anim fire
wait 0.5
$flak.gun sound flak_snd_reload

local.index = randomint 9

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_boom9.origin
local.ent explode
break
case 9:
local.ent = spawn models/projectiles/Berlin_Bombs.tik origin $flak_axis_boom9.origin
local.ent explode
break
}



}

End