Jump to content
Official BF Editor Forums

Custom Kits And Ai

Recommended Posts


I am having a problem regarding using custom kits and weapons in singleplayer. I have a map that works great in all game modes with no problems. I added custom kits and weapons to it and it works fine in conquest only. When I attempt to load a singleplayer game it will load all the way to the spawn screen and then produce the error below when hitting "ok" in both windowed mode and Debug. Debug produces no log file.

This is my first map with AI and it is entirely possible that I did it wrong, but it does seem to work fine without the added kits/weapons. Keep in mind that I do not have 3dMax (which seems to be the program all the AI tutorials use). I had it several times before but Autodesk wont let me have anymore trial versions (I guess they are on to me) and I'd have to sell my car to actually buy it. :D I moved the largest island files from Infantry and Vehicles to the output folder before I ran FixNavmesh. I dont know if thats causing the problem but it does work ingame.. so I dunno. Help is always appreciated. Thanks


Link to comment
Share on other sites

Mmmh this could be an init-related error. My friend only used 3 weapons for the spawn screen before, and the ai crashed because it couldn't load kit #4. The bots don't see the spawn screen. :lol:

To help further post the init.con and the kit coding :P

Link to comment
Share on other sites

Its this map:



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

run Heightdata.con
run Terrain.con BF2Editor
run StaticObjects.con BF2Editor
run Sounds.con
run Sky.con BF2Editor
run Editor/GamePlayObjects.con host
Undergrowth.load Levels\Sniper_Valley\
run Overgrowth/Overgrowth.con
Overgrowth.editorEnable 1
run AmbientObjects.con BF2Editor
run Water.con
run TriggerableTemplates.con BF2Editor


rem ----  KITS ----

run objects/soldiers/ch/ch_sas.con
run objects/soldiers/ch/ch_massad.con
run objects/soldiers/us/ch_1st_recon.con
run objects/soldiers/us/us_1st_recon.con
run objects/soldiers/us/us_massad.con
run objects/soldiers/us/us_sas.con

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\Sniper_Valley\
run Overgrowth/Overgrowth.con
run Overgrowth/OvergrowthCollision.con
run AmbientObjects.con
run Water.con
run TriggerableTemplates.con
run ServerArchives.con


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

gameLogic.setTeamName 1 "CH"
gameLogic.setTeamName 2 "US"

gameLogic.setTeamLanguage 1 "Chinese"
gameLogic.setTeamLanguage 2 "English"

gameLogic.setTeamFlag 0 "flag_neutral"
gameLogic.setTeamFlag 1 "flag_ch"
gameLogic.setTeamFlag 2 "flag_us"

gameLogic.setKit 1 0 "ch_1st_recon" "ch_light_soldier"
gameLogic.setKit 2 0 "us_1st_recon" "us_light_soldier"

gameLogic.setKit 1 1 "ch_sas" "ch_light_soldier"
gameLogic.setKit 2 1 "us_sas" "us_light_soldier"

gameLogic.setKit 1 2 "ch_massad" "ch_light_soldier"
gameLogic.setKit 2 2 "us_massad" "us_light_soldier"

gameLogic.setKit 1 3 "ch_pla" "ch_light_soldier"
gameLogic.setKit 2 3 "us_pla" "us_light_soldier"

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

gameLogic.setBeforeSpawnCamera 0/150/0 0/0/0

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

GameLogic.MaximumLevelViewDistance 850

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

gameLogic.setDefaultNumberOfTicketsEx 16 1 50
gameLogic.setDefaultNumberOfTicketsEx 16 2 50
gameLogic.setDefaultNumberOfTicketsEx 32 1 50
gameLogic.setDefaultNumberOfTicketsEx 32 2 50
gameLogic.setDefaultNumberOfTicketsEx 64 1 50
gameLogic.setDefaultNumberOfTicketsEx 64 2 50
gameLogic.setDefaultNumberOfTicketsEx 128 1 50
gameLogic.setDefaultNumberOfTicketsEx 128 2 50
gameLogic.setDefaultTimeToNextAIWave 8
gameLogic.setTicketLossAtEndPerMin 1000
gameLogic.setTicketLossPerMin 1 10
gameLogic.setTicketLossPerMin 2 10

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

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

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


fileManager.mountArchive Levels/sniper_valley/kits.zip Objects
fileManager.mountArchive Levels/sniper_valley/weapons.zip Objects


ObjectTemplate.create Kit us_1st_recon
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.networkableInfo KitInfo
ObjectTemplate.kitType Sniper
ObjectTemplate.aiTemplate Sniper
ObjectTemplate.geometry us_kits
ObjectTemplate.geometry.kit 6
ObjectTemplate.geometry.dropGeom 16
ObjectTemplate.setHasCollisionPhysics 1
rem ObjectTemplate.dropHeadwear helmet
ObjectTemplate.abilityRestoreRate 0.05
ObjectTemplate.abilityInVehicleRadius 7
ObjectTemplate.abilityInVehicleStrength 0.25
ObjectTemplate.abilityInVehicleMaterial 73
ObjectTemplate.unlockIndex 1
ObjectTemplate.cullRadiusScale 2.4

rem -------------------------------------
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate usrifm24
ObjectTemplate.addTemplate ushgrm67
ObjectTemplate.addTemplate usminclaymore
ObjectTemplate.addTemplate defibrillator
ObjectTemplate.addTemplate usrifg36c
ObjectTemplate.addTemplate hgrsmoke
ObjectTemplate.addTemplate nshgrflashbang
ObjectTemplate.addTemplate parachutelauncher
ObjectTemplate.addTemplate Unlockus1strecon
ObjectTemplate.addTemplate Unlockus1strecon2
rem -------------------------------------

ObjectTemplate.createComponent Ability
ObjectTemplate.ability.hasHealingAbility 1

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

ObjectTemplate.createComponent VehicleHud
ObjectTemplate.vehicleHud.hudName 		"1st Recon"
ObjectTemplate.vehicleHud.miniMapIcon		"Ingame\Kits\Icons\kit_Sniper_outline.tga"
ObjectTemplate.vehicleHud.vehicleIcon		"Ingame\Kits\Icons\kit_Sniper.tga"
ObjectTemplate.vehicleHud.pantingSound		S_SprintBreath
ObjectTemplate.vehicleHud.injurySound		S_Injury
ObjectTemplate.vehicleHud.vehicleType 		7

ObjectTemplate.sprintStaminaDissipationFactor 	0.2

rem ---BeginComp:Radio ---
ObjectTemplate.createComponent Radio
ObjectTemplate.Radio.spottedMessage		"sniper_spotted"
rem ---EndComp ---

ObjectTemplate.create ItemContainer Unlockus1strecon
ObjectTemplate.unlockLevel 1

ObjectTemplate.create ItemContainer Unlockus1strecon2
ObjectTemplate.unlockLevel 2

Link to comment
Share on other sites

  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...