MG42s... Yes, I already read all the other threads

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Personator
Private
Posts: 5
Joined: Fri Mar 21, 2003 11:42 pm

MG42s... Yes, I already read all the other threads

Post 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?
matt_moh
Sergeant
Posts: 65
Joined: Sat Feb 08, 2003 12:04 am

Post 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.
MC Disgruntled Goat
Lance Corporal
Posts: 22
Joined: Mon Sep 02, 2002 9:58 pm

Post 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 ).
Personator
Private
Posts: 5
Joined: Fri Mar 21, 2003 11:42 pm

Post by Personator »

Still not working... if someone is willing, ill email the map and scr, its not very big, basically an AI test.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Any errors in console?

You may send me the files (zip 'em).
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Personator
Private
Posts: 5
Joined: Fri Mar 21, 2003 11:42 pm

Post by Personator »

Yeah, I had the gunners targeting the guns instead of the other way around. it works fine now.
Post Reply