Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: .30 cal Browning in multiplayer????

  1. #1

    Default .30 cal Browning in multiplayer????

    G'day folks,
    I'm not sure where to post this question but I imagine it can be resolved via script.... hopefully.

    The .30 cal browning, either (stand alone) on it's stand or mounted to jeep doesn't work in multiplayer which leaves the game very much one-sided because the more lethal MG42 works well in multiplayer.
    Would it be possible to use a trigger and script to take control of the .30 cal and fire it in a multiplayer map?
    I have searched tutorials and Google for a solution to no avail.
    There's no write-up in the entities window for it and very few options. I selected the only relevant option being the "deathmatch" checkbox but that just made the gun and jeep disappear when tested in FFA and TDM.

    There doesn't appear to be a scr for the 30cal so I copied the two scr files for the mg42 and placed them in the global folder before renaming them from "mg42.scr" & "mg42_active.scr" to "30cal.scr" & "30cal_active.scr", respectively.
    I used the "Find" & "Replace" function of WordPad to change all instances of "mg42" to "30cal" in both scr files.

    I added the following lines to my map's scr, before the "level waittill spawn".
    Code:
    	exec global/30cal.scr
    	exec global/30cal_active.scr
    I set the 30cal model to "playerusable" in the entities window. As noted on the first line of the mg42.scr
    I tried both values "1" then after that compile and test I tried "0". Nether had any effect on either of the two 30cal guns or the mg42.
    And of course I re-packed the pk3 and moved it to the "main" directory before testing.

    I've since found a third mg42 related scr located in Breakthrough, called "mg42init" which binds the player to the gun but I left that alone as I'm editing for AA which doesn't have that file and I feel I'm sinking deeper in doodoo.
    I'm not seeing anything for the .30cal in either expansions nor is it listed in the "weapons.scr" whereas the mg42 is.

    So yeah, I've tried to work it out myself with every possibility that seems logical to me, a humble multiplayer mapper.
    I'm just wondering if this has been done in a multiplayer map before and if so, am I getting close or barking up the wrong tree?

    Any help graciously accepted and appreciated.
    Cheers.


    A new day, a new map, a new problem. lol It never ends.

  2. #2

    Default

    I have find the code you need on the vehices_thinkers.scr.

    Only just change the targetname for the one you use:


    local.vturretent = $s1_jeep1 queryturretslotentity 0
    local.vturretent unlock
    $s1_jeep1 attachturretslot 0 $player // Attach the player to the jeep
    $player perferredweapon ".30cal Machine Gun"
    local.vturretent lock

  3. #3

    Default

    Thanks for that mate.
    Much appreciated.

  4. #4

    Default

    Hey that worked but with two minor problems.
    1. I can't dismount the gun. The mg42 is the same key to mount or dismount.
    2. There's no actual firing sound, just the bullets hitting objects sound effects. Shoot the sky and it's dead silent.

    I looked through the vehices_thinkers.scr but nothing stood out except for the thread you already gave me in it's original form ("self" instead of "s1_jeep1").
    I could make that trigger not triggerable when used and add another trigger to dismount. Have each trigger disable itself and enable the other.
    I'm not sure what to write in that thread just yet.
    It's after midnight here so I'll continue after some sleep.

    Thanks again DoubleKill. It's good to be finally getting somewhere.

  5. #5

    Default

    To dismount from the Jeep you need to execute the code a second time.

    I put a example you can use for the trigger:


    jeep_trig:

    self nottriggerable

    local.player = parm.other

    local.vturretent = $s1_jeep1 queryturretslotentity 0
    local.vturretent unlock
    $s1_jeep1 attachturretslot 0 local.player // Attach the player to the jeep
    wait 1.5
    self triggerable

    end


    The sound for the gun you need to change on the alias because the gun was only made to make sound on SP.
    Last edited by DoubleKill; December 30th, 2019 at 07:42 AM.

  6. #6

    Default

    Thanks again mate.
    I was more after the stand alone .30cal (without jeep) but when I couldn't mount that I tried the jeep mounted 30cal.
    I've tried using the same script with changed targetname but I've not had any luck.
    I don't know where or how you found "s1_jeep1" but nothing else seems to work in place of it. Does the stand alone 30cal have a secret name too?

    I've only been up for an hour and already managed to break everything. lol

  7. #7

    Default

    DoubleKill: I'm afraid your second script doesn't work for me.
    At first I tried it as the primary trigger (absolutely nothing happened) then I resorted to the first script and used the second one ("jeep_trig") as a secondary trigger just for the dismount.
    Again, absolutely nothing happened. I was stuck on the gun again.

    Sorry when it comes to scripting you need to hold my hand and spell-out every step (i.e. call this trigger "blahblahblah" and make it setthread "dosomething". Make a second trigger within reach and call it ... etc.) as if you're writing a tutorial.
    I've been putting off returning with the bad news all day.

    I'm happy to send the map if you care to take a look at it.

  8. #8

    Default

    I don't mind having a look, Acca. Btw, do you know the name/location of the standalone .30cal model?

  9. #9

    Default

    No probs Smithy, I'll send it to you. Thanks

    The standalone is weird, it's path is "vehicle_allied_jeep_30cal" but it's not on a jeep.
    When I first selected it, it placed the standalone 30cal on the ground and the 30cal jeep was over it /around it also on the ground, about the gun width off center.
    Like the jeep had two guns, side-by-side.

  10. #10

    Default

    For the 30call alone i have create this code and works fine:


    local.call = spawn "vehicles/jeep_30cal.tik" classname TurretGun
    local.call.origin = ( 429.25 906.89 48.13 )
    local.call viewOffset "-42 0 100"
    local.call idleCheckOffset "-56 0 0"


    On the code i have convert the 30call to a TurretGun so you can use her like the mg42.

    If this code still dont work for you send me the map by PM and i will put the weapon working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •