Forgotten Hope Public Forum

Forgotten Hope 2 => Modding => Topic started by: fh_spitfire on 03-08-2012, 15:08:22

Title: Custom maps - making NCO kits work
Post by: fh_spitfire on 03-08-2012, 15:08:22
Since our wiki is down, I'll quickly post a tutorial here on how to make rifle NCO kits work in a custom map.

If Sfakia was a custom map, I'd modify it's mapdata.py file to look like this (compare with original):

Code: [Select]
from game.plugins import plugin, limitKit, ticketLoss, NCOrifleData

kit_limits = [
    plugin(limitKit, team = 1, kit = 'GM_Limited_Assault_MP40_K98', slot = 1, limit = 0.07),
    plugin(limitKit, team = 2, kit = 'BA_Limited_Assault_TommygunD_No4', slot = 1, limit = 0.07),
    plugin(limitKit, team = 1, kit = 'GM_Limited_Support_MG34_K98', slot = 3, limit = 0.09),
    plugin(limitKit, team = 2, kit = 'BA_Limited_Support_Bren_No4', slot = 3, limit = 0.1),
]
tickets = [
plugin(ticketLoss, ticketLoss1 = 4, ticketLoss2 = 4)

]

rifleNCO = [plugin(NCOrifleData, kits = ('GM_NCOMP40', 'BA_NCOTommygunS')),]

gpm_cq = {
  64: tickets + kit_limits + rifleNCO,
  16: kit_limits + rifleNCO,
}

Notice the additional plugin "NCORifleData" imported and used. It provides info on what NCO kits are used on a map, this should always be the same as kits set in Init.con !
Title: Re: Custom maps - making NCO kits work
Post by: Rabbit032 on 18-09-2012, 17:09:56
I pulled the armies from Point_du_Hoc's init to mine along with its mapdata.py. No classes show up in my spawn screen, from what's posted above it doesnt look like it should have a problem pulling one from one map to another, any idea what is causing my problem?

-032
Title: Re: Custom maps - making NCO kits work
Post by: [F|H]Taz18 on 18-09-2012, 19:09:05
Yes, that you pulled them from one map to another without running the packing script would be my first guess!  :P
Title: Re: Custom maps - making NCO kits work
Post by: Knochenlutscher on 02-03-2013, 13:03:22
 ;) In 2.45 it's not as easy as editing the Mapdata.py, though it's a Python editing, but you must
take a file from 2.40 and update according the Levels you have installed.
WORDPAD or TEXTEDITOR is good to go

The following is OFFLINE ONLY, DON'T USE when Multiplayer addict, may result in Banns, Flames or other Insults. ONLY FOR THE ADVANCED OFFLINE FIDDLER.

The File that is not easy to edit in 2.45, but in 2.40, is called:
...\EA GAMES\Battlefield 2\mods\fh2\python\game\plugins\NCOrifleData.pyc

Editing in this older is easier, takes 5 Minutes, but be as precise as a swiss watch and control
each init.con in all Mapfolders. Maps that you haven't got in Levels, but in this original file, are from the Devs (Kuuterselka, Crimea...).
I took the naming for my files from the Levelfolder Mapfolders and deleted these WIP stuff.

REMEMBER TO MAKE A BACKUP First of a Clean 2.45, SP Patch Fixed, your custom FH2 AND HERE'S THE EXAMPLE WHY YOU SHOULD KEEP A CLEAN BACKUP OF OLDER 2.40, MAKES MODDING EASIER.
ALL NCO RIFLES will be activated even on custom Maps. Even in Bootcamp_1 (Multiplayer only).

NO CLASSES ARE SHOWN IN SELECTION SCREEN
PICKUP KITS ARE NOT SHOWN INGAME

A: tmp.con not handling init.con content, i.e. you tried converting a 2.40 Custom Map to 2.45 which wasn't delivered a tmp.con, then you supposedly get empty selection screen or CTD before seeing the Map-start screen.
B: Map is supposed to be 2.45 standard, but your custom Classkits not showing up, nor your Pickupkits ingame. Make sure to use the classkits of init.con and place their lines to tmp.con as described above
(only 14!!!, not one single more, 7 per side!!!), same for the pickupkits you wanna see ingame.
Those you forgot, you won't see ingame.

In case of custom Classes and Kits:
All is corrected and you still experience this BUG, then you made a mess with conflicting Weapon-indexes
or using a non handled weapon (without AI code).
I made myself an Excel file handling all ingame Weapons indices and showing them correctly.
This is crucial if you wanna create custom-kits bug-free.
MAPDATA.py and old custom Maps:
You can try to create a mapdata.py the way described above and still it won't work flawless,
NOT ENABLING RIFLE NCO's nor other things written in the Mapdata.py. Why? Don't ask, I tried all.
Best is:
If the map lacks this file, that is no problem to run in 2.45 as some may think.
My old maps run fine and CTD free without, if delivered without originally, creating this file causes problems and seems to be CTD prone to the bone.
Not to mention it is best to use the original mapdata.py on their pre-defined Maps.

UPDATED
Knoch
Title: Re: Custom maps - making NCO kits work
Post by: PapillonFH on 15-04-2014, 21:04:16
I think this is in dire need of an update, as apparently now the NCO kits are hardcoded in the limitKit.pyc instead in mapdata.py
Is there an official way on how to deal with this for custom maps?
Regards, Papillon
Title: Re: Custom maps - making NCO kits work
Post by: gavrant on 15-04-2014, 21:04:16
PapillonFH, the official way of dealing with custom maps is described in the first post of this thread.
Title: Re: Custom maps - making NCO kits work
Post by: PapillonFH on 15-04-2014, 21:04:22
well, I do get python errors with the custom maps.
But, I will recheck.
Title: Re: Custom maps - making NCO kits work
Post by: Darman on 15-11-2014, 22:11:35
Hey folks,

I'm always trying to keep the best old custom maps alive for me and my friends and up to the latest patch it worked perfectly. After 2.45 I had to re-generate the tmp.con files and nothing else on most maps, to get all kits working.

Now, things changed. I have no idea why Devs did this, considering the fact that it did work well before and was way more userfriendly. But thats not the matter now.

I'll point out the problem at the example: Beda_Fomm
The map will now CTD once it has loaded 100%. The reason: A python error. The NCO was not defined.

I redid the mapdata.py like it was shown in the first post of this thread, but that didn't help. Then I've completely redone it using a working .py as model (bardia) and adding the code from here to it after it still showed me errors concerning the NCO in the log.

The beda_fomm/mapdata.py now looks like this:

Spoiler
from game.plugins import plugin, limitKit, ticketLoss, aiPush, NCOrifleData

rifleNCO = [plugin(NCOrifleData, kits = ('IA_NCOBeretta38', 'BA_NCOTommygunS')),]



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 =  5.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_heavy_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 =  5.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(aiPush),

plugin(ticketLoss, ticketLoss1 = 5, ticketLoss2 = 5),

]+ rifleNCO,

}

sp3 = gpm_coop

The map still crashes after loadup, showing this log:

Spoiler
****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:09:54.937000 (wall time: 13.4064253663) ******
[13.4064253663] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4064253663] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4064253663] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12AF83F0> <game.plugins.limitKit.limitKitNCO object at 0x12AF83F0>:
  local variable 's' referenced before assignment
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 137, in on_round_start
UnboundLocalError: local variable 's' referenced before assignment


****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:09:55.159000 (wall time: 13.4064253663) ******
[13.4064253663] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4064253663] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4064253663] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12AF4030> <game.plugins.limitKit.limitKitNCO object at 0x12AF4030>:
  local variable 's' referenced before assignment
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 137, in on_round_start
UnboundLocalError: local variable 's' referenced before assignment


I tried like a thousand times with different ideas, but this produced the shortest .log, so I guess it is the closest to the solution. If theres a script error, I haven't found it. I didn't use a local variable called "s" in the map files.

Any help is appreciated.

NOTE: If this post should be a new topic rather than a comment on the current thread, tell me and I will do it. Or move it.



Title: Re: Custom maps - making NCO kits work
Post by: Ts4EVER on 15-11-2014, 22:11:11

Try this
Code: [Select]
rifleNCO = [
    plugin(NCOrifleData, kits = ('IA_NCOBeretta38', 'BA_NCO')),
]
Title: Re: Custom maps - making NCO kits work
Post by: Darman on 15-11-2014, 22:11:28
Thanks for the quick answer, Ts4EVER

But unfortunatly it didn't help. At first I replaced it only in the mapdata.py.
So it would look like this:
Spoiler
from game.plugins import plugin, limitKit, ticketLoss, aiPush, NCOrifleData

rifleNCO = [
plugin(NCOrifleData, kits = ('IA_NCOBeretta38', 'BA_NCO')),
]




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 =  5.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_heavy_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 =  5.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(aiPush),

plugin(ticketLoss, ticketLoss1 = 5, ticketLoss2 = 5),

]+ rifleNCO,

}

sp3 = gpm_coop

That led to this log:

Spoiler
****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:36:59.865000 (wall time: 13.4571675876) ******
[13.4571675876] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4571675876] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4571675876] gameplayPlugin::warn: exception in plugin.bf2_init <game.plugins.limitKit.limitKitNCO object at 0x12B09370>:
  Kit 'ba_nco' is not defined or has not been loaded for this map.
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 281, in bf2_init
  File "python/game/plugins/limitKit.py", line 679, in bf2_init
  File "python/game/plugins/limitKit.py", line 587, in __init__
  File "python/game/plugins/limitKit.py", line 453, in __init__
  File "python/game/utilities.py", line 650, in verifyTemplateExistence
Exception: Kit 'ba_nco' is not defined or has not been loaded for this map.

[13.4571675876] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12B09370> <game.plugins.limitKit.limitKitNCO object at 0x12B09370>:
  Kit limit for slot 6 of team 1 has not been defined.
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 132, in on_round_start
Exception: Kit limit for slot 6 of team 1 has not been defined.


****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:37:00.091000 (wall time: 13.4571675876) ******
[13.4571675876] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4571675876] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.4571675876] gameplayPlugin::warn: exception in plugin.bf2_init <game.plugins.limitKit.limitKitNCO object at 0x12B5C590>:
  Kit 'ba_nco' is not defined or has not been loaded for this map.
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 281, in bf2_init
  File "python/game/plugins/limitKit.py", line 679, in bf2_init
  File "python/game/plugins/limitKit.py", line 587, in __init__
  File "python/game/plugins/limitKit.py", line 453, in __init__
  File "python/game/utilities.py", line 650, in verifyTemplateExistence
Exception: Kit 'ba_nco' is not defined or has not been loaded for this map.

[13.4571675876] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12B5C590> <game.plugins.limitKit.limitKitNCO object at 0x12B5C590>:
  Kit limit for slot 6 of team 1 has not been defined.
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 132, in on_round_start
Exception: Kit limit for slot 6 of team 1 has not been defined.

After that I updated the init.con and tmp.con, too and replaced the tommyGunS NCO with the standart BA_NCO. That lead to a ctd again with this log about a variable error again.

Spoiler
****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:42:13.306000 (wall time: 13.6101303138) ******
[13.6101303138] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.6101303138] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.6101303138] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12AEF410> <game.plugins.limitKit.limitKitNCO object at 0x12AEF410>:
  local variable 's' referenced before assignment
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 137, in on_round_start
UnboundLocalError: local variable 's' referenced before assignment


****** beda_fomm, gpm_coop, 64 - 2014-11-15 22:42:13.533000 (wall time: 13.6101303138) ******
[13.6101303138] aiFixups::warn: ControlPoint British_7th_Armored_Division_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.6101303138] aiFixups::warn: ControlPoint Italian_10th_Army_64: an unableToChangeTeam CP with incoming neighboring strategic areas.
[13.6101303138] gameplayPlugin::warn: exception in plugin.round_start <game.plugins.limitKit.limitKitNCO object at 0x12AEA090> <game.plugins.limitKit.limitKitNCO object at 0x12AEA090>:
  local variable 's' referenced before assignment
Traceback (most recent call last):
  File "python/game/gameplayPlugin.py", line 302, in round_start
  File "python/game/plugins/limitKit.py", line 630, in round_start
  File "python/game/plugins/limitKit.py", line 137, in on_round_start
UnboundLocalError: local variable 's' referenced before assignment

Title: Re: Custom maps - making NCO kits work
Post by: Ts4EVER on 15-11-2014, 22:11:39
Then undo these changes and try this instead:

Code: [Select]
rifleNCO = [
    plugin(NCOrifleData, kits = ('IA_NCOBeretta38', 'BA_NCOTommygunS')),
]

Title: Re: Custom maps - making NCO kits work
Post by: Darman on 15-11-2014, 22:11:44
umm,

I don't really have to try this to know its not working. This was exactly my initial try, as posted in my first spoiler (beda_fomm/mapdata.py) on the first of my posts here.
Title: Re: Custom maps - making NCO kits work
Post by: Stubbfan on 15-11-2014, 23:11:07
Code: [Select]
]+ rifleNCO,

}

sp3 = gpm_coop

Shouldn't that be:

Code: [Select]
]

}

sp3 = gpm_coop + rifleNCO
Title: Re: Custom maps - making NCO kits work
Post by: gavrant on 15-11-2014, 23:11:34
Those PY WARN messages in the game and in logs don't cause CTDs by themselves, usually you can still play a map with them. It's a more fundamental issue, I'm afraid.

Please upload init.con and tmp.con of the map.

Code: [Select]
]+ rifleNCO,

}

sp3 = gpm_coop

Shouldn't that be:

Code: [Select]
]

}

sp3 = gpm_coop + rifleNCO
No, it shouldn't.
Title: Re: Custom maps - making NCO kits work
Post by: Darman on 15-11-2014, 23:11:32
No stubbfan, it shouldn't (I suppose). The rifleNCO should be initialized for the gpm_coop mode. the sp3 is another story and has no impact on the gpm_coop. I'm always running the coop mode.

@gavrant: Here you go

init.con:

Spoiler
rem *** Generated by BF2Editor ***
if v_arg1 == BF2Editor

run Heightdata.con
LevelSettings.InitWorld
run Terrain.con BF2Editor
run StaticObjects.con BF2Editor
run Sounds.con
run Sky.con BF2Editor
run Editor/GamePlayObjects.con host
UndergrowthEditable.create
Undergrowth.load Levels\beda_fomm\
run Overgrowth/Overgrowth.con
Overgrowth.editorEnable 1
run AmbientObjects.con BF2Editor
run Water.con
run TriggerableTemplates.con BF2Editor

else

run Heightdata.con
run Terrain.con v_arg2
run Sky.con v_arg2
run CompiledRoads.con
run Sounds.con
run tmp.con v_arg1
Undergrowth.load Levels\beda_fomm\
run Overgrowth/Overgrowth.con
run Overgrowth/OvergrowthCollision.con
run AmbientObjects.con
run Water.con
run TriggerableTemplates.con

endIf

rem ------------------------------- LevelSettings -------------------------------
rem -----------------------------------------------------------------------------

gameLogic.setTeamName 1 "IT"
gameLogic.setTeamName 2 "GB"

gameLogic.setTeamLanguage 1 "FH2Italian"
gameLogic.setTeamLanguage 2 "FH2British"

gameLogic.setTeamFlag 0 "flag_neutral"
gameLogic.setTeamFlag 1 "flag_it"
gameLogic.setTeamFlag 2 "flag_gb"

gameLogic.setKit 1 0 "IA_ScoutK98Short" "ia_light_soldier"
gameLogic.setKit 2 0 "BA_ScoutEarly" "ba_light_soldier"

gameLogic.setKit 1 1 "IA_Limited_Assault_Beretta38_K98" "ia_heavy_soldier"
gameLogic.setKit 2 1 "BA_Limited_Assault_TommygunD_No4" "ba_heavy_soldier"

gameLogic.setKit 1 2 "IA_RiflemanK98" "ia_light_soldier"
gameLogic.setKit 2 2 "BA_RiflemanEarly" "ba_light_soldier"

gameLogic.setKit 1 3 "IA_Limited_Support_MG34_K98" "ia_light_soldier"
gameLogic.setKit 2 3 "BA_Limited_Support_Bren_No4" "ba_heavy_soldier"

gameLogic.setKit 1 4 "ia_EngineerK98Short" "ia_light_soldier"
gameLogic.setKit 2 4 "BA_EngineerEarly" "ba_light_soldier"

gameLogic.setKit 1 5 "ia_ATPzB39_Limited" "ia_heavy_soldier"
gameLogic.setKit 2 5 "BA_ATBoys_Limited" "ba_heavy_soldier"

gameLogic.setKit 1 6 "IA_NCOBeretta38" "ia_light_soldier"
gameLogic.setKit 2 6 "BA_NCOTommygunS" "ba_light_soldier"

rem -----------------------------------------------------------------------------

gameLogic.setBeforeSpawnCamera -452/26/82 -9/6/0

if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix ""
else
texturemanager.customTextureSuffix ""
endIf
rem -----------------------------------------------------------------------------

GameLogic.MaximumLevelViewDistance 500

rem -----------------------------------------------------------------------------

gameLogic.setDefaultNumberOfTicketsEx 16 1 200
gameLogic.setDefaultNumberOfTicketsEx 16 2 200
gameLogic.setDefaultNumberOfTicketsEx 32 1 250
gameLogic.setDefaultNumberOfTicketsEx 32 2 250
gameLogic.setDefaultNumberOfTicketsEx 64 1 350
gameLogic.setDefaultNumberOfTicketsEx 64 2 350
gameLogic.setDefaultNumberOfTicketsEx 128 1 350
gameLogic.setDefaultNumberOfTicketsEx 128 2 350
gameLogic.setDefaultTimeToNextAIWave 8
gameLogic.setTicketLossAtEndPerMin 1000
gameLogic.setTicketLossPerMin 1 4
gameLogic.setTicketLossPerMin 2 4

rem -----------------------------------------------------------------------------

rem -----------------------------------------------------------------------------

renderer.globalStaticMeshLodDistanceScale 1
renderer.globalBundleMeshLodDistanceScale 1
renderer.globalSkinnedMeshLodDistanceScale 1

tmp.con:

Spoiler
rem $fh2_donotread
rem ***  KIT LOADERS  ***
rem *** autogenerated ***

run ../../objects/kits/ia/ia_ncoberetta38.inc
run ../../objects/kits/spawnable/ga_pickupsapperk98short.inc
run ../../objects/kits/spawnable/ba_pickuppilotwebley.inc
run ../../objects/kits/spawnable/ga_pickupgrenadierk98.inc
run ../../objects/kits/spawnable/ba_pickupsniperno4.inc
run ../../objects/kits/ba/ba_scoutearly.inc
run ../../objects/kits/spawnable/ga_pickuptankhunterk98short.inc
run ../../objects/kits/spawnable/ia_pickupsappercarcano38.inc
run ../../objects/kits/spawnable/ba_pickuptankhunterno4short.inc
run ../../objects/kits/ia/ia_limited_support_mg34_k98.inc
run ../../objects/kits/ba/ba_limited_support_bren_no4.inc
run ../../objects/kits/ia/ia_engineerk98short.inc
run ../../objects/kits/spawnable/ia_pickupsupportbreda.inc
run ../../objects/kits/ia/ia_atpzb39_limited.inc
run ../../objects/kits/ba/ba_riflemanearly.inc
run ../../objects/kits/spawnable/ga_pickuppilotp08.inc
run ../../objects/kits/ia/ia_scoutk98short.inc
run ../../objects/kits/ba/ba_ncotommygunS.inc
run ../../objects/kits/spawnable/ia_pickuptankhuntercarcano38.inc
run ../../objects/kits/ba/ba_atboys_limited.inc
run ../../objects/kits/spawnable/ba_pickupantitankboys.inc
run ../../objects/kits/spawnable/ba_pickupsupportbrenmk1.inc
run ../../objects/kits/spawnable/ba_pickupsapperno4short.inc
run ../../objects/kits/ba/ba_engineerearly.inc
run ../../objects/kits/ba/ba_limited_assault_tommygund_no4.inc
run ../../objects/kits/ia/ia_riflemank98.inc
run ../../objects/kits/spawnable/ga_pickupsupportmg34.inc
run ../../objects/kits/spawnable/ga_pickupsniperk98.inc
run ../../objects/kits/spawnable/ba_pickupgrenadierno4.inc
run ../../objects/kits/spawnable/ga_pickupantitankpzb39.inc
run ../../objects/kits/ia/ia_limited_assault_beretta38_k98.inc
run ../../objects/kits/spawnable/ia_pickuppilotberetta34.inc

rem *** KITSETS ***
run ../../objects/kits/ia/ia_kits.inc
run ../../objects/kits/ba/ba_kits.inc

rem *** KIT SPAWNERS ***
run ../../objects/kits/ia/ia_kits_spawner.inc
run ../../objects/kits/ba/ba_kits_spawner.inc

rem *** END OF AUTO_GENERATED PART ***
rem $fh2_read



Another info on the CTD: it happens right after the click on "Join" when I host a local game or right after the 100% loaded when starting up a local dedicated server. I'm not even ingame on the deployment screen with no kits available like after the 2.45 patch with the .tmp issue back then.

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.
Title: Re: Custom maps - making NCO kits work
Post by: gavrant 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.
Title: Re: Custom maps - making NCO kits work
Post by: Darman 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.
Title: Re: Custom maps - making NCO kits work
Post by: Stubbfan 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?
Title: Re: Custom maps - making NCO kits work
Post by: Darman 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.
Title: Re: Custom maps - making NCO kits work
Post by: gavrant 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.
Title: Re: Custom maps - making NCO kits work
Post by: Airshark79 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.
Title: Re: Custom maps - making NCO kits work
Post by: Stubbfan on 15-11-2014, 23:11:18
There could be a million reasons.
Title: Re: Custom maps - making NCO kits work
Post by: Darman 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 (https://www.dropbox.com/s/o78wbk427jvf66o/beda_fomm.7z?dl=0)
Title: Re: Custom maps - making NCO kits work
Post by: gavrant 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.
Title: Re: Custom maps - making NCO kits work
Post by: Darman 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.
Title: Re: Custom maps - making NCO kits work
Post by: gavrant 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.
Title: Re: Custom maps - making NCO kits work
Post by: Darman 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...