Page 2 of 2

Posted: Mon Dec 27, 2004 9:28 pm
by Elgan
Green Beret wrote:isnt there a way to activate a trigger using a gun.
as in shooting it to trigger it?
set the spanw flags for the trigger to 128

128 ( trigger no projectile)
144 ( trigger inc projectile)

Posted: Tue Dec 28, 2004 3:11 am
by Green Beret
Thnx :wink:

Posted: Tue Dec 28, 2004 4:11 am
by HDL_CinC_Dragon
heres a question... can an MG42 be targeted by a trigger (MG bound to corner of building on a turret made by the mapper and when the trigger is pressed, the MG fires?

Posted: Tue Dec 28, 2004 4:41 am
by Green Beret
probally hit control + k and connect the trigger to the mg42.make sure to connect in correct order.
im not positive this will work :wink:

Posted: Tue Dec 28, 2004 6:01 am
by lizardkid
its easier to script it.

trigger, setthread, you know the drill..

Code: Select all

mgShootAtHim:

$mg aimat $victim
wait 1
$mg shootat $victim
wait 1
$mg aimat NULL

not totally sure it's shootat...

Posted: Tue Dec 28, 2004 8:12 pm
by Green Beret
probally $player,again not totally sure.

Posted: Thu Dec 30, 2004 8:16 pm
by HDL_CinC_Dragon
so would the thread be

Code: Select all

mg_ops:
            $gunner waittill trigger
            $mg aimat $player
            wait .5 //I like fast results ;-)
            $mg shootat $player
            wait .5 //I like fast results ;-)
            $mg aimat NULL 
goto mg_ops
end
?

Posted: Sat Jan 01, 2005 4:25 pm
by Rookie One.pl
Well, assuming that $gunner is the trigger, it should work. ;) There's one thing - you shouldn't be using goto (I'm not even sure if there's such thing in MoH scripting...), have a while loop instead. And if you want fast results, change wait 5 to waitframe - can't get any faster than that without removing the waiting completely. 8-) I would do it like this:

Code: Select all

mg_ops:
            while(1) {
                        $gunner waittill trigger
                        $mg aimat $player
                        waitframe //now that's real fast!
                        $mg shootat $player
                        waitframe //hurry up!
                        $mg aimat NULL
            }
end

Posted: Sat Jan 01, 2005 4:38 pm
by HDL_CinC_Dragon
Thnx Rookie

Posted: Wed Jan 26, 2005 7:21 pm
by Rookie One.pl
I'm going to hijack the topic. :twisted:

Is there a way to get the primary weapon the player's using? I tried $player.gun and $player.weapon, but they both return NIL... :(

Posted: Wed Jan 26, 2005 10:48 pm
by bdbodger
This will work

Code: Select all

mg_ops:

while(1) {
		$gunner waittill trigger

		local.player = parm.other

		$mg setaimtarget local.player

		$mg waittill ontarget

		$mg startfiring

		While(local.player istouching $gunner)
		{
			$mg setaimtarget local.player

			waitframe
		}

		$mg stopfiring
            }
end 

Posted: Thu Jan 27, 2005 12:32 am
by Elgan
wont that just make a mg fire:S?

well tname thing mg

Posted: Thu Jan 27, 2005 2:13 pm
by Rookie One.pl
I asked jv_map about this:
jv_map@mods-r-us.net wrote:you can do something like:

Code: Select all

$player[local.number] weaponcommand dual targetname ("playerweap" + local.number) // sets targetname of weapon player is holding
// then:
switch($("playerweap" + local.number).model)
{
   case "models/weapons/m1_garand.tik":
       // blablabla
       break
   // etc
}
P.S. don't do this every frame, it will cause tremendous lag (with a delay of say 0.5 I think there won't be a problem).

Posted: Sat Jan 29, 2005 9:18 pm
by HDL_CinC_Dragon
You little HiJacker!!!!! lol :lol: