Forgotten Hope 2 > Modding

Custom maps - making NCO kits work

(1/6) > >>

fh_spitfire:
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: ---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,
}
--- End code ---

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 !

Rabbit032:
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

[F|H]Taz18:
Yes, that you pulled them from one map to another without running the packing script would be my first guess!  :P

Knochenlutscher:
 ;) 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

PapillonFH:
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

Navigation

[0] Message Index

[#] Next page

Go to full version