Author Topic: Custom maps - making NCO kits work  (Read 4468 times)

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #15 on: 15-11-2014, 23:11:17 »
Try this mapdata.py:
Spoiler
from game.plugins import plugin, limitKit, ticketLoss, NCOrifleData

gpm_coop = {
    64: [
        plugin(limitKit, team = 1, slot = 0, limit =  4.0/32.0, kit = "IA_ScoutK98Short", soldier = "ia_light_soldier"),
        plugin(limitKit, team = 1, slot = 1, limit =  6.0/32.0, kit = "IA_Limited_Assault_Beretta38_K98", soldier = "ia_heavy_soldier"),
        plugin(limitKit, team = 1, slot = 2, limit =  9.0/32.0, kit = "IA_RiflemanK98", soldier = "ia_light_soldier"),
        plugin(limitKit, team = 1, slot = 3, limit =  6.0/32.0, kit = "IA_Limited_Support_MG34_K98", soldier = "ia_light_soldier"),
        plugin(limitKit, team = 1, slot = 4, limit =  4.0/32.0, kit = "ia_EngineerK98Short", soldier = "ia_light_soldier"),
        plugin(limitKit, team = 1, slot = 5, limit =  4.0/32.0, kit = "ia_ATPzB39_Limited", soldier = "ia_heavy_soldier"),

        plugin(limitKit, team = 2, slot = 0, limit =  4.0/32.0, kit = "BA_ScoutEarly", soldier = "ba_light_soldier"),
        plugin(limitKit, team = 2, slot = 1, limit =  6.0/32.0, kit = "BA_Limited_Assault_TommygunD_No4", soldier = "ba_heavy_soldier"),
        plugin(limitKit, team = 2, slot = 2, limit =  9.0/32.0, kit = "BA_RiflemanEarly", soldier = "ba_light_soldier"),
        plugin(limitKit, team = 2, slot = 3, limit =  6.0/32.0, kit = "BA_Limited_Support_Bren_No4", soldier = "ba_heavy_soldier"),
        plugin(limitKit, team = 2, slot = 4, limit =  4.0/32.0, kit = "BA_EngineerEarly", soldier = "ba_light_soldier"),
        plugin(limitKit, team = 2, slot = 5, limit =  4.0/32.0, kit = "BA_ATBoys_Limited", soldier = "ba_heavy_soldier"),

        plugin(NCOrifleData, kits = ('IA_NCOBeretta38', 'BA_NCOTommygunS'), soldiers = ("ia_light_soldier", "ba_light_soldier")),
    ],
}

sp3 = gpm_coop

Note, it should fix Python warnings but not CTDs. For CTDs, try launching the map in the local game in the windowed mode, perhaps the game will show the error then.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 226
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #16 on: 15-11-2014, 23:11:36 »
Well, thanks, I suppose.

That seems to have solved the issue with the NCO and Kit limits. Now the log is significantly shorter. However the CTD is still there.

log:
Spoiler
****** beda_fomm, gpm_coop, 64 - 2014-11-15 23:33:02.841000 (wall time: 13.7431609299) ******
[13.7431609299] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.7431609299] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.

****** beda_fomm, gpm_coop, 64 - 2014-11-15 23:33:03.070000 (wall time: 13.7431609299) ******
[13.7431609299] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.7431609299] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.

But these are only warnings. They shouldn't cause CTDs. So I guess the error must lay somewhere else. I'll have investigate further. Unfortunatly the log doesn't seem to be much of a help from now on.
« Last Edit: 15-11-2014, 23:11:09 by Darman »

Offline Stubbfan

  • Developer
  • ******
  • Posts: 438
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #17 on: 15-11-2014, 23:11:20 »
Logs show errors from python. A crash in python and a CTD is two different things. Do you not get an error message if you run the game in windowed mode?

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 226
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #18 on: 15-11-2014, 23:11:51 »
Logs show errors from python. A crash in python and a CTD is two different things. Do you not get an error message if you run the game in windowed mode?

Unfortunatly no. The window will ctd just like the dedicated server console or the fullscreen mode. Without a message or something.

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #19 on: 15-11-2014, 23:11:18 »
Those remaining warnings say that the bases of both teams can't be captured by the enemy, but the AI strategic areas are configured so that bots think they can attack them.

EDIT: py warn messages ingame are on thing. They usually, as you pointed out, don't lead to ctds and don't affect the gameplay. But the logs show some exception errors and that seem to cause the crashes, if I'm not mistaken.
As Stubbfan said above, ingame PY WARN messages and exceptions or warnings in the logs are the same thing, actually.

Logs show errors from python. A crash in python and a CTD is two different things. Do you not get an error message if you run the game in windowed mode?

Unfortunatly no. The window will ctd just like the dedicated server console or the fullscreen mode. Without a message or something.
Upload the map then.

Offline Airshark79

  • Jr. Member
  • **
  • Posts: 453
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #20 on: 15-11-2014, 23:11:14 »
I'd like to hear about how the crash problem is solved. Had a similar %100-1second-crash issue last week.

Offline Stubbfan

  • Developer
  • ******
  • Posts: 438
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #21 on: 15-11-2014, 23:11:18 »
There could be a million reasons.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 226
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #22 on: 16-11-2014, 00:11:05 »
And I found the ONE reason.

Looks like it was not python afterall  :-[

I browsed the whole map files again and found an old friend hiding in there: ESAI. So I removed the ESAI file (server.zip/gamemodes/gpm_coop/64/AI/strategies.ai). CTD: solved.

The commander is going crazy with his orders now so I'll have to look into that, as the log and gavrant said, its because he thinks the bases are attackable. Don't know how to fix that now, hopefully will know soon.

Sorry for that all, I had no idea ESAI was no longer supported.

Anyway, thanks for helping me solving the NCO problem :D

If you still want to check the map out, heres the LINK
« Last Edit: 16-11-2014, 00:11:17 by Darman »

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #23 on: 16-11-2014, 00:11:33 »
Copy the following code to GameModes\gpm_coop\64\AI\StrategicAreas.ai in server.zip:
Spoiler
rem *** Create strategic areas ***
aiStrategicArea.createFromControlPoint Agedabia_64 1 1000000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint Antelat_64 305 1000000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint Beda_Fomm_East_64 304 1000000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint Beda_Fomm_West_64 302 1000000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint British_7th_Armored_Division_64 301 100000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint Italian_10th_Army_64 303 100000
aiStrategicArea.layer 1

aiStrategicArea.createFromControlPoint Sidi_Saleh_64 2 1000000
aiStrategicArea.layer 1

aiStrategicArea.setActive Agedabia_64
AIStrategicArea.addNeighbour Beda_Fomm_West_64
AIStrategicArea.addNeighbour Sidi_Saleh_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry -770.064/24.865/-676.934
AIStrategicArea.setOrderPosition Vehicle -764.82/24.865/-670.745
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 22.6274

aiStrategicArea.setActive Antelat_64
AIStrategicArea.addNeighbour Sidi_Saleh_64
AIStrategicArea.addNeighbour British_7th_Armored_Division_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry 379.724/36.0625/-68.6586
AIStrategicArea.setOrderPosition Vehicle 385.362/36.0625/-66.284
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 25.4558

aiStrategicArea.setActive Beda_Fomm_East_64
AIStrategicArea.addNeighbour Beda_Fomm_West_64
AIStrategicArea.addNeighbour Sidi_Saleh_64
AIStrategicArea.addNeighbour Italian_10th_Army_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry -362.796/24.175/116.441
AIStrategicArea.setOrderPosition Vehicle -377.933/24.175/107.802
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 56.5685

aiStrategicArea.setActive Beda_Fomm_West_64
AIStrategicArea.addNeighbour Beda_Fomm_East_64
AIStrategicArea.addNeighbour Agedabia_64
AIStrategicArea.addNeighbour Sidi_Saleh_64
AIStrategicArea.addNeighbour Italian_10th_Army_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry -515.13/24.175/70.233
AIStrategicArea.setOrderPosition Vehicle -506.934/24.175/83.7643
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 56.5685

aiStrategicArea.setActive British_7th_Armored_Division_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry 833.684/25.725/156.979
AIStrategicArea.setOrderPosition Vehicle 834.474/25.725/157.519
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 2.82843

aiStrategicArea.setActive Italian_10th_Army_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry 835.619/25.725/157.908
AIStrategicArea.setOrderPosition Vehicle 831.587/25.725/160.371
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 2.82843

aiStrategicArea.setActive Sidi_Saleh_64
AIStrategicArea.addNeighbour Beda_Fomm_West_64
AIStrategicArea.addNeighbour Beda_Fomm_East_64
AIStrategicArea.addNeighbour Antelat_64
AIStrategicArea.addNeighbour Agedabia_64
aiStrategicArea.addObjectTypeFlag ControlPoint
AIStrategicArea.setOrderPosition Infantry -273.953/27.39/-393.533
AIStrategicArea.setOrderPosition Vehicle -276.627/27.39/-399.943
aiStrategicArea.setSide 0
aiStrategicArea.vehicleSearchRadius 22.6274
This will fix the warnings. I also took the liberty of slightly improving AI spawning in there.

ESAI was removed in 2.48 because the amount of issues it started to cause exceeded the amount of issues it supposedly fixed.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 226
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #24 on: 16-11-2014, 00:11:14 »
Huge thanks on all, gavrant!  ;D

I was already working on that strategic Area file, but this sure saves me a lot of time!
I will also use that for other custom maps as example, should similiar issues appear.

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #25 on: 16-11-2014, 00:11:16 »
I must say, the map has rather weird flag layout, with neutral flags behind the British front line. I guess, that way most of the British bots find themselves halfway between the front line and the neutrals when the first Italian wave arrives.

Offline Darman

  • FH-Betatester
  • ***
  • Posts: 226
    • View Profile
Re: Custom maps - making NCO kits work
« Reply #26 on: 16-11-2014, 01:11:14 »
It sure does. But I didn't create it. And I must say, I palyed it a lot and it does work out, its fun. Most bots don't find there way out of the city until the Italian wave hits. Anyway, this is offtopic now...