Page 1 of 1

Mg42 AI

Posted: Thu Sep 04, 2003 1:15 pm
by martijn_NL
I did the tutorial for the mg42 ai on .map
I did everything just as was told, but the mg42 guys doesn't even spawn.
Here is the error that the console comes with:
if (self.spawn_left == NIL || self.spawn_left <= 0) (global/mg42_active.scr, 151)
if (self.spawn_left == NIL || self.spawn_left ^

^~^~^ Script Error: binary '<=' applied to incompatible types 'string' and 'int'

SkeletorCacheFileCallback: Could not open binary file 'newanim/models/human/human/german_winter_type2.skc' or 'models/human/human/german_winter_type2.skc'
^~^~^ TIKI_InitTiki: Couldn't load models/human/human/german_winter_type2.tik
^~^~^ Classname (null) used, but model was not a TIKI, using Object.
SkeletorCacheFileCallback: Could not open binary file 'newanim/models/human/human/german_winter_type2.skc' or 'models/human/human/german_winter_type2.skc'
^~^~^ TIKI_InitTiki: Couldn't load models/human/human/german_winter_type2.tik
^~^~^ Classname (null) used, but model was not a TIKI, using Object.
*!*!*!* Objects are not allowed for use in the game. Make it a static model or a script model as needed.
SkeletorCacheFileCallback: Could not open binary file 'newanim/models/human/human/german_winter_type2.skc' or 'models/human/human/german_winter_type2.skc'
^~^~^ TIKI_InitTiki: Couldn't load models/human/human/german_winter_type2.tik
^~^~^ Bad model name 'models/human/human/german_winter_type2.tik'
self.gunner = spawn self.model_gunner gun "mg42" ammo_grenade "5" origin self.spawner_gunner.origin (global/mg42_active.scr, 154)
self.gunner = ^

^~^~^ Script Error: You must specify an explicit classname for misc object tik models

self.gunner waittill death (global/mg42_active.scr, 471)
self.gunner ^

^~^~^ Script Error: command 'waittill' applied to NIL

self.gunner exec global/disable_ai.scr (global/mg42_active.scr, 177)
self.gunner ^

^~^~^ Script Error: command 'exec' applied to NIL

self.gunner exec global/runto.scr self.path_gunner (global/mg42_active.scr, 178)
self.gunner ^

^~^~^ Script Error: command 'exec' applied to NIL

self.gunner waittill movedone (global/mg42_active.scr, 179)
self.gunner ^

^~^~^ Script Error: command 'waittill' applied to NIL

self.gunner exec global/enable_ai.scr (global/mg42_active.scr, 180)
self.gunner ^

^~^~^ Script Error: command 'exec' applied to NIL

here is what i wrote in my script file:

Code: Select all

$mg42_bunker1 thread global/mg42_active.scr::mg42
	$mg42_bunker2 thread global/mg42_active.scr::mg42
	$mg42 thread global/mg42_active.scr::mg42
	$mg42_hill thread global/mg42_active.scr::mg42
Does someone knows what i did wrong?

Posted: Thu Sep 04, 2003 3:45 pm
by bdbodger
here is a line from tha script
self.gunner = $(self.targetname + "_gunner")
do you have a $mg42_bunker1_gunner in your map?

and one for the other guns too ?

also these lines
self.spawn_left = self.spawn
did you use these for your guns key:spawn value:5 //number of spawns here
wait 1
if (self.gunner == NULL && self.spotter == NULL)
thread mg42_spawn

end


//*****************************************************************************************************************
mg42_spawn:

if (self.spawn_left == NIL || self.spawn_left <= 0)
end

Posted: Thu Sep 04, 2003 5:38 pm
by martijn_NL
I checked everything what u said. I added a gunner, but when i shoot the gunner, there did not respawn another gunner, and i get the same errors again. So does as anyone else know what i do wrong. :roll:

Posted: Thu Sep 04, 2003 5:52 pm
by martijn_NL
In the mg42_active script are these senteces:

self.spawner_gunner = $(self.targetname + "_spawner_gunner")

and

self.gunner = spawn self.model_gunner gun "mg42" ammo_grenade "5" origin self.spawner_gunner.origin

But the console give the errors that self.gunner is NIL. So i think there is same sort of an error in that script. I'm right with that? :?:

Posted: Fri Sep 05, 2003 10:36 am
by Angex
If your gunner and spotter aren't respawning, its probably the pathnodes setup incorrectly. The mg42_active.scr works fine!

Make sure you've got an $mg42_bunker1_spawner_gunner and an $mg42_bunker1_spawner_spotter (if needed) pathnode, this is where the gunner and spotter will spawn. Then add two more pathnodes closer to the gun called $mg42_bunker1_gunner_path and $mg42_bunker1_spotter_path (if needed), this is where they will runto before acting as a gunner and spotter.

Posted: Fri Sep 05, 2003 4:12 pm
by martijn_NL
I made an mistake, $ai_model have to be german_winter_type2.tik, but i used human/german_winter_type2.tik . :roll:

But i have another question, i made a bunker just as shown on manstein 's site.

[IMG]
http://dynamic5.gamespy.com/~manstein/c ... ole_1a.gif
[/IMG]

But the mg42 has a higher position than when i use a sandbag small semicircel. So when the AI want to get the mg42 i sit down a bit but can't use the mg42. So does some one know how the make the gunner stands up instead of sitting down?