Page 1 of 1
MG42s... Yes, I already read all the other threads
Posted: Fri Mar 21, 2003 11:46 pm
by Personator
OK, ive read every tutorial and every thread involving MG42's, but I cannot get them to work. The nazis walk up and man them, but dont turn or fire them. There are two gunner/mg sets, names MG42_gunner/MG42 and MG42Gunner_2/MG42_2. There are lines between the gunners and MGs, and I have the AI settings correct. Here is the .scr file:
exec global/loadout.scr maps/test.scr
exec global/ai.scr
main:
level waittill spawn
$mg42 thread global/mg42_active.scr::mg42
$mg42_2 thread global/mg42_active.scr::mg42_2
end
What am I doing wrong?
Posted: Fri Mar 21, 2003 11:58 pm
by matt_moh
I have the same problem with the gunners not shooting. One thing that might be wrong with your script, though is this line:
$mg42_2 thread global/mg42_active.scr::mg42_2
The last part, after global/mg42_active.scr:: is a thread in the script mg42_active.scr. This shouldn't be changed to the name of your gun. It needs to stay mg42 because that's the name of thread in the script.
I hope this helps a little and I hope someone can tell us why our gunners aren't shooting.
Posted: Sat Mar 22, 2003 1:14 am
by MC Disgruntled Goat
Hey guys
I have a gunner in my maps. In my script, I had the $mg42 thread global/mg42_active.scr::mg42 in between waittill prespawn and spawn. Mine works fine with it there. Try that. Also, make sure your AI gunner is labeled as a machinegunner in the AI parameter window (press I ).
Posted: Sat Mar 22, 2003 4:34 pm
by Personator
Still not working... if someone is willing, ill email the map and scr, its not very big, basically an AI test.
Posted: Sun Mar 23, 2003 6:56 am
by jv_map
Any errors in console?
You may send me the files (zip 'em).
Posted: Mon Mar 24, 2003 12:27 pm
by bdbodger
well I think that I got my mg42 to work for spearhead by useing the global/turret.scr in that script all mg42's have the same targetname $mg42
if ($mg42)
for (local.i=1;local.i<$mg42.size+1;local.i++)
$mg42[local.i] thread mg42_start
mg42_start local.type:
level waittill spawn
if !(self.set)
self.set = -1
if (self.target)
{
local.man = $(self.target)
local.man.mg = self
.local.man thread gunner_think
}
gunner_think:
self.mg targettype "auto"
self type_idle "machinegunner"
self type_attack "machinegunner"
self type_disguise "machinegunner"
self type_grenade "machinegunner"
self gun "MG42"
self turret self.mg
the gunner is the $mg42's target . Also I think you can do it without any script you just have to make sure you press I to bring up ai's property box and set the "turret" to the targetname of your gun but don't ! set the ai's target to be the gun . the gun's target can be the man not vise versa .I had a friend that deleted the target for the ai and got his gun to work .
Posted: Tue Mar 25, 2003 12:24 am
by Personator
Yeah, I had the gunners targeting the guns instead of the other way around. it works fine now.