Author Topic: How to allow use of enemy MG's and AT guns ?  (Read 776 times)

Offline Michael Z Freeman

  • Jr. Member
  • **
  • Posts: 707
  • The Few are many;) (Used to be known as DJ Barney)
    • View Profile
    • Homepage
How to allow use of enemy MG's and AT guns ?
« on: 06-10-2016, 16:10:52 »
I'm pretty sure this used to be possible. At least I remember playing Supercharge and being able to defend a German bunker with their MG. So is it possible to turn this back on in my setup ? Does it involve editing every weapon, or is there some kind of global setting ? Cheers.

EDIT: I posted about this in Minor Suggestions. Apparently I *can* use them in MP. Will have to check this. If this is so I'm not sure if its just my version doing this, or if they were locked to prevent AI related crashes ?

EDIT: Seems that its only SOME maps that have enemy weapons like this locked for some reason.Anyone, how to edit these weapons to allow entry ?
« Last Edit: 15-10-2016, 18:10:15 by Michael Z Freeman »

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: How to allow use of enemy MG's and AT guns ?
« Reply #1 on: 24-10-2016, 08:10:06 »
The reason why most of static emplacements can be used only by the defending team in SP/Coop is to prevent the attacking team from losing its bots manning those MGs and AT guns as the offensive progresses forward. The emplacements (with the exception of the mortars) are coded so that bots, once entering them, can leave only by being killed, which makes sense for the "static defenses" kind of maps. As a result, on maps like Alam Halfa, while playing for the German team, you may end with a quarter of your teammates manning the MGs and AT guns only useful against your own main base.

If you still want to unlock emplacements, go to the respective GamePlayObjects.con, remove "ObjectTemplate.teamOnVehicle  1" from the respective object spawners and remove the following code at the start of the file for the respective emplacements:
Code: [Select]
ObjectTemplate.activeSafe PlayerControlObject <Emplacement name>
ObjectTemplate.dontClearTeamOnExit 1
Note, don't mix locked and unlocked object spawners for a single MG or AT gun on one map, this might end in CTDs.

Offline batistadk

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: How to allow use of enemy MG's and AT guns ?
« Reply #2 on: 24-10-2016, 19:10:38 »
Hey gavrant, glad you're still here. I hope SP/COOP get some treat in the next update. Thanks for your input and work.

Keep rocking!

batistadk

Offline Michael Z Freeman

  • Jr. Member
  • **
  • Posts: 707
  • The Few are many;) (Used to be known as DJ Barney)
    • View Profile
    • Homepage
Re: How to allow use of enemy MG's and AT guns ?
« Reply #3 on: 24-10-2016, 20:10:26 »
If you still want to unlock emplacements, go to the respective GamePlayObjects.con, remove "ObjectTemplate.teamOnVehicle  1" from the respective object spawners and remove the following code at the start of the file for the respective emplacements:
Code: [Select]
ObjectTemplate.activeSafe PlayerControlObject <Emplacement name>
ObjectTemplate.dontClearTeamOnExit 1
Note, don't mix locked and unlocked object spawners for a single MG or AT gun on one map, this might end in CTDs.

Cool. Did you do the same thing for the same classes of positions for each map ? That way I could run a script through all my maps.

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: How to allow use of enemy MG's and AT guns ?
« Reply #4 on: 30-10-2016, 17:10:22 »
Hey gavrant, glad you're still here. I hope SP/COOP get some treat in the next update. Thanks for your input and work.

Keep rocking!

batistadk
Hey, I'm not dead for the mod yet! To tease you, SP/Coop will definitely get some tasty things in the next update, including a fix for one nasty ancient bug ;)


Cool. Did you do the same thing for the same classes of positions for each map ? That way I could run a script through all my maps.
It's "random" - most maps have MGs/AT guns/artillery locked, but some don't (for example, Luttich, on which every cappable flag is open for attack/counterattack for an entire round, so all the static emplacements there are valuable for both teams). You would need a script capable of smart parsing GamePlayObjects.con's, hunting for those "ObjectTemplate.teamOnVehicle  1" in ObjectSpawners.

Offline Michael Z Freeman

  • Jr. Member
  • **
  • Posts: 707
  • The Few are many;) (Used to be known as DJ Barney)
    • View Profile
    • Homepage
Re: How to allow use of enemy MG's and AT guns ?
« Reply #5 on: 30-10-2016, 20:10:06 »
Hey gavrant, glad you're still here. I hope SP/COOP get some treat in the next update. Thanks for your input and work.

Keep rocking!

batistadk
Hey, I'm not dead for the mod yet! To tease you, SP/Coop will definitely get some tasty things in the next update, including a fix for one nasty ancient bug ;)

Hey, could it be the "have to re-select coop mode from drop down menu to actually make coop maps appear" bug ? :D


Cool. Did you do the same thing for the same classes of positions for each map ? That way I could run a script through all my maps.
It's "random" - most maps have MGs/AT guns/artillery locked, but some don't (for example, Luttich, on which every cappable flag is open for attack/counterattack for an entire round, so all the static emplacements there are valuable for both teams). You would need a script capable of smart parsing GamePlayObjects.con's, hunting for those "ObjectTemplate.teamOnVehicle  1" in ObjectSpawners.
[/quote][/quote]

OK, thanks for info. I could write a smart script. At least I know now what's going on as I originally thought that all weapons were disabled.

Offline FHMax3

  • Jr. Member
  • **
  • Posts: 676
  • Sergeant of War Trickery
    • View Profile
Re: How to allow use of enemy MG's and AT guns ?
« Reply #6 on: 11-12-2016, 15:12:27 »


Hey, I'm not dead for the mod yet! To tease you, SP/Coop will definitely get some tasty things in the next update, including a fix for one nasty ancient bug ;)
-Gavarant

And what is that bug? I'd like to know.
That other thread failed miserably and if you try to spam or flame here, I will break your arms.
FH2 won't be the last FH. ;)