[?] How does a Map know to use a kit?

Making or wanting help making your own asset? Check in here
Post Reply
Acemantura
Posts: 2463
Joined: 2007-08-18 06:50

[?] How does a Map know to use a kit?

Post by Acemantura »

More accurately, how would a map know to use a kit that I've switched around to make it use the Lee-Enfields.

So, what I've done so far, which all lies within the map's folder

in the Server.zip/ServerArchives.con I wrote:
fileManager.mountArchive inits/factions_common.zip factions_common
fileManager.mountArchive inits/factions_taliban.zip factions_taliban
fileManager.mountArchive inits/factions_hamas.zip factions_hamas
fileManager.mountArchive Levels/trenches2/custom.zip Objects
in the custom.zip/kits/hamas_insurgent1.con
ObjectTemplate.activesafe Kit hamas_insurgent1
ObjectTemplate.delete

ObjectTemplate.create Kit hamas_insurgent1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.networkableInfo KitInfo
ObjectTemplate.kitType Support
ObjectTemplate.aiTemplate Support
ObjectTemplate.geometry hamas_kits
ObjectTemplate.geometry.kit 5
ObjectTemplate.geometry.dropGeom 15
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.setCollisionMesh kitcol
ObjectTemplate.dropHeadwear mec_helmet
ObjectTemplate.abilityRestoreRate 0.15
ObjectTemplate.abilityInVehicleRadius 0
ObjectTemplate.abilityInVehicleStrength 0
ObjectTemplate.abilityInVehicleMaterial 91
ObjectTemplate.cullRadiusScale 100000
ObjectTemplate.timeToLiveAfterDeath 300

rem -------------------------------------
ObjectTemplate.addTemplate iraqknife
ObjectTemplate.addTemplate klappspaten
ObjectTemplate.addTemplate insgr_enfield
ObjectTemplate.addTemplate hgr_rkg3
ObjectTemplate.addTemplate chsht_slugshot_idx5
ObjectTemplate.addTemplate ammokit
ObjectTemplate.addTemplate binocular
ObjectTemplate.addTemplate medikit_dressing_arab
rem -------------------------------------

ObjectTemplate.createComponent Ability
ObjectTemplate.ability.hasAmmoAbility 1
ObjectTemplate.ability.hasRepairingAbility 1

ObjectTemplate.createComponent AbilityHud
ObjectTemplate.abilityHud.ammoSound S_Resupply
ObjectTemplate.abilityHud.healingSound S_Heal
ObjectTemplate.abilityHud.repairingSound S_Repair

ObjectTemplate.createComponent VehicleHud
ObjectTemplate.vehicleHud.hudName "HUD_TEXT_MENU_SPAWN_KIT_WARRIOR_HAMAS"
ObjectTemplate.vehicleHud.miniMapIcon "Ingame\Kits\Icons\kit_battle_rifle_Assault_outline.tga"
ObjectTemplate.vehicleHud.vehicleIcon "Ingame\Kits\Icons\kit_battle_rifle_Assault.tga"
ObjectTemplate.vehicleHud.spottedIcon "Ingame\GeneralIcons\empty.tga"
ObjectTemplate.vehicleHud.pantingSound S_SprintBreath
ObjectTemplate.vehicleHud.injurySound S_Injury
ObjectTemplate.vehicleHud.vehicleType 7
Now, what seems to be missing here because I am emulating to a "T" all the other maps I have seen do this.

Thank You in Advance

Edit: in red. Nothing is changed outside of the map folder, I thought I should Highlight this. I am doing this for a community map that probably wont see the light of the larger community so we would like to keep the changes localized and completely within the map's folder.
Last edited by Acemantura on 2010-09-30 07:06, edited 4 times in total.
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: How does a Map know to use a kit?

Post by AncientMan »

You've probably just have to run the file in the init.con.

Something like
run ../../Objects/kits/hamas_insurgent1.con

Either that, or Delete the activesafe/delete bit, since when you mount the hamas zip and the init.con runs the kit setup, it should use the one from the map and not from the objects.

Oh, something else, should be in kits/hamas/hamas_insurgent1.con, since it needs to overwrite the file, hence it needs to be in the exact same place.

Just going off the top of my head here, probably not entirely right info, but just giving some ideas to look into :) .
Image
TeRR0R
Posts: 451
Joined: 2007-10-20 10:33

Re: How does a Map know to use a kit?

Post by TeRR0R »

No need to run it with init.con.
Your serverarchives.con file is fine.


The folder structure from the custom.zip must be the same as the original PR folder structure (see your extracted pr_edit folder) as you virtually mount your folder on top of the original PR tree.
Another important thing is to NOT overwrite existing files, so you must rename your custom con file to a different name.
All files within a folder seems to get loaded alphabetically sorted, so just add some chars to the con file name to make sure it gets loaded after the original file.

So make it look like this: custom.zip/kits/hamas/hamas_insurgent1custom.con
(I used "v2" as suffix in Al Basrah 2).

And if you mod an existing map, I'd like to suggest to rename the map.
This makes things much easier and everyone who installs your map won't mess with the original PR installation.
Post Reply

Return to “PR:BF2 Community Modding”