Jump to content
Official BF Editor Forums
Harry

Spawning kits the '42 way

Recommended Posts

UPDATE: The above works except but need 2 problems worked out.

1. When you pick the kit up you dont get the "Uniform" (no helmet, ammo pack , etc...) I think I know why this is doing this but am not at this point able to remedy it.

2. Only works with ObjectTemplate.team 2 I've tried .Team 1,ObjectTemplate.teamFromClosestCP 1 and just simply leaving it THAT out and I either see nothing or crash to desktop ith no debug info.

Reasoning behind # 1, I can notepad edit the gameplayobjects.con and add them and it will fix the above BUT the problem with trying to make it allittle easier for the mappers to use the pickup kits, when setting the building, bf2 cant or wont atttach that same CP team to the kit therefore it gives you no helmet or pack items. and your soldier looks stupid with a weapon hovering above his head! LOL

Share this post


Link to post
Share on other sites

1. I wouldn't expect to have the clothing or helmets changed, cause they are not part of the weapons kits. The soldier 'kits' are a completely different cup of tea.

2. Try ObjectTemplate.team 0 , then (if desired) set ObjectTemplate.teamFromClosestCP 1. Afaik, there's only one or the other.

Share this post


Link to post
Share on other sites

ObjectTemplate.teamFromClosestCP 1. did not work. I'll try the other.

Im under the impression that it is somehow tied to the control point. I replaced a spawning vehicle with the SAME pickup kit and it woks fine. Only when I add it as a part of the building do I get the above result.

Edited by Smagma

Share this post


Link to post
Share on other sites

****UPDATE*****

Using the UAV trailers (aircontroltowers) I was able to add the kits to this building and everything worked fine. I used the team 1 and team 2 and both worked. I think this worked because these buildings are pre-team determined.

Doing some finalizing test and will get back if everything sorts out.

Share this post


Link to post
Share on other sites
Now, i dont know how this responds to multiple people online, im not capable of testing that atm, BUT it does seem to work now on a dedicated box.

So the total sum would be:

ObjectTemplate.active US_Assault
ObjectTemplate.collisionMesh ats_tow

I truly hope this works.

Are you sure this doesnt work?Ive done this via python and all what I have noticed is that col mesh spawns with kit and it stays in spawn place position, so I havent noticed trembling (yet)[dedicated server]

Edited by Me262

Share this post


Link to post
Share on other sites

The trembling soldier on dedicated servers seems to have been fixed with one of the later patches (1.3, 1.4 or 1.41) . I never saw it happen again on my setup for a while.

Share this post


Link to post
Share on other sites

This is the most important thing when creating pickup kits: You _have_ to give them a collisionmesh and collisionphysics, else it can't work when a) laying on the ground and b ) be used on a server.

The collisionmesh addresses these two points. It gives the kit the ability to lay on the ground or any other surface and the mere existence of the collisionmesh hooks it into the server (you probably know that there are no bundledmeshes in the server files but only collisionmeshes ? )

Only avoid to use a collisionmesh which is too small. I had wildly agitating kits when i used a 1 cm by 1cm box :D , rolling around on the ground and hard to catch :P ....

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites
You _have_ to give them a collisionmesh and collisionphysics, else it can't work when a) laying on the ground

And how they can lay on the ground by default if they dont have col mesh.

Share this post


Link to post
Share on other sites

You mean your own dropkit ? Thats probably hardcoded by evaluating the dropkit geometry in the soldiers kit. They are modeled at their feet and i think they only hold this last position when dropped. Our friends at Dice made life easy by mostly using the big travel bag :D

For pickup kits this isn't possible, as they are standard bundledmeshes. The easiest way to hook them into the serverfiles and get physics the same time is to give them a colmesh.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

you guys really know your stuff. I am a tad confused though. on 42, i would just create an object spawner in the editor then change the objecttemple con to read the weapon i wanted to use provided it was in the object list. from what i am reading this is no longer possible, i have to create a collision mesh with max or something. is there any other way, i have no clue how to use max nor do i have it.

Share this post


Link to post
Share on other sites

you´re my hero mschoeldgen

- after searching for days for an sollution to use the kits on Linux-Unranked-Server - your way solved all problems .. thx a lot ;)

Share this post


Link to post
Share on other sites

Just a quick question!

Aix has had pickups for a while thanks to the great contributions in this thread, but we find that the rotational values of the spawner disappear when used on a server.

In single player, the pickups sit the right way in their weapon crates. But on a server, the pickups all reset to 0 degrees rotation and thus stick out of their weapon boxes (statics) at funny angles.

We've been using Msch's small col mesh for it and short of making all our weapon crate statics all be at a 0 degree angle (which looks silly on most maps), we're not quite sure how to stop this problem.

Any way to stop this from happening?

Share this post


Link to post
Share on other sites

Sorry to bump, but AIX 2.0 is releasing soon and I wouldn't mind squashing this little quirk before hand. Does anyone have an idea why the pickup spawners are losing their rotational values on servers only?

Share this post


Link to post
Share on other sites

No sorry, not yet :( I planned on setting up my testserver for the next major inhouse beta and check this issue while doing that but until now i haven't had the time to do that.

I could imagine it has something to do with the geometries, as pickup kits don't have a geom0,1,2 structure but thats pure speculation.

Share this post


Link to post
Share on other sites

I've done everything it says in Post #14 on how to make a pickup kit, but every time I try to add the kit in a level, I get an itemIndex error saying that the Knife (itemIndex 1) is being used more than one time

However, every weapon in the kit has a different itemIndex

The errors happen in the editor when trying to add the kit's Objectspawner to the level

My test kit

ObjectTemplate.create Kit Pickup_Test
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.networkableInfo KitInfo
ObjectTemplate.kitType Assault
ObjectTemplate.aiTemplate Assault
ObjectTemplate.geometry eurif_fnp90
ObjectTemplate.geometry.kit 1
ObjectTemplate.geometry.dropGeom 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.dropHeadwear helmet
ObjectTemplate.unlockIndex 1
ObjectTemplate.cullRadiusScale 2.4   
rem ---------------CollisionMesh----------------------
ObjectTemplate.collisionMesh small_collonly0
ObjectTemplate.mapMaterial 0 wood_thin 0
ObjectTemplate.physicsType Mesh
rem ---------------/CollisionMesh---------------------

rem -------------------------------------
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate eurif_fnp90
ObjectTemplate.addTemplate medikit
ObjectTemplate.addTemplate defibrillator
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

ObjectTemplate.createComponent Ability
ObjectTemplate.ability.hasHealingAbility 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_ASSAULT"
ObjectTemplate.vehicleHud.miniMapIcon		"Ingame\Kits\Icons\kit_Light_Assault_outline.tga"
ObjectTemplate.vehicleHud.vehicleIcon		"Ingame\Kits\Icons\kit_Light_Assault.tga"
ObjectTemplate.vehicleHud.spottedIcon 		"Ingame\Player\Icons\Minimap\mini_Soldier.dds"
ObjectTemplate.vehicleHud.abilityIcon 		"Ingame\Weapons\Icons\Hud\SpecialKitIcons\kevlarVest.tga"
ObjectTemplate.vehicleHud.pantingSound		S_SprintBreath
ObjectTemplate.vehicleHud.injurySound		S_Injury
ObjectTemplate.vehicleHud.vehicleType 		7

ObjectTemplate.sprintStaminaDissipationFactor     0.6

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

Share this post


Link to post
Share on other sites

From far away it looks as if your pickup kit isn't the problem . It might be another kit conflict ( check your modifications for a duplicate of this kit ) or a conflict in another modded kit. Check the editor logfile ( in /bf2editor/logs ) to find the offending kit.

The conflict might be hidden in your zip's so you should try to pack your files anew.

Share this post


Link to post
Share on other sites

D:\bf2editor\Code\BF2\Game\Objects\Game\kit.cpp(185): checkIfPartExists found:kni_knife
D:\bf2editor\Code\BF2\Game\Objects\Game\kit.cpp(99): (!checkIfPartExists(child, itemIndex)) Pickup_Test Kit error, index conflic. Two or more weapons use the same item index:1 checked KitPart:kni_knife

These are the last two entries in the log

It doesn't tell me the offending kit, but it does say "checkIfPartExists" I'm not sure what this means

Share this post


Link to post
Share on other sites

Its not an error with your kit at all, just a weapon index conflict. You cant have to weapons in a kit with the same index, in this case index 1 or you'll get that error. So either use a different weapon with a different index or change one of the existing weapon's indexes.

Share this post


Link to post
Share on other sites
Its not an error with your kit at all, just a weapon index conflict. You cant have two* weapons in a kit with the same index, in this case index 1 or you'll get that error. So either use a different weapon with a different index or change one of the existing weapon's indexes.

Yes the above is true, but no two weapons in my kit have the same item index

kni_knife: 1

eurif_fnp90: 3

medikit: 5

defibrillator: 6

ParachuteLauncher: 9

Share this post


Link to post
Share on other sites

I still think you have a duplicate of your 'Pickup_Test' somewhere in the files. Check the zips for a doublette in another folder.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.

Loading...

×
×
  • Create New...