PDA

View Full Version : Unlockable weapons in mods


GlobalFear
08-08-2005, 07:48 PM
Has anyone figured out how to have multiple kits per class?
I'm trying to figure out how to bypass the whole rank system and give everyone unlocks for a mod I am working on.

Thanks

shadow2k1
08-08-2005, 08:21 PM
i read somewhere (dont remember where) that you cant have multiple kits
you can only have 2 kits per class. in leimans terms, the regular weapon and the unlock weapon.

and so far thru trial and error ive come to realize you can only have X amount of items in the kit, for instance you cant have spec ops class have C4, claymores, AT mines, grenades and rockets.

I have also been trying to find a solution or a workaround to this issue
if you happen to find a way i would appreciate it if you could fill me in, and ill do the same.

Johnny Bravo
08-08-2005, 08:38 PM
i know how to give sniper class a m82

22CW Cainius
08-08-2005, 09:07 PM
yeah the unlock deal is a good idea. just alternate set ups for folks... like for the anti-armor you could have a guy with a few stingers and a different hand weapon instead...

imported_dadofsam
08-08-2005, 09:55 PM
the wepaons cant be "simply" added to other kits, as they all have index number which dictates where the weapons allowed to go, you can edit the index numbersas to make them all fit into 1 kit,
there are most probably easy ways to create a random kit spawn, eg. if set criteria is met, eg. if 5 AT kits then spawn as AA etc.
selecting the whole unlock kit, hmm probably doable, but dont quote me on that

GlobalFear
08-08-2005, 10:44 PM
I am pretty sure it is doable.

My issue is that I know no python what so ever.
If I could somehow trick the game itself into thinking that I had all the unlocks for the mod...........

dadofsam,
How would I go about doing something like you mentioned?

The Vincester
08-09-2005, 02:11 AM
You can make anyone have anything you want... with a few exceptions. No player can carry more than 9 items (8 unless you want things to be a real pain).

For example my Spec Ops that I use for COOP by modifying the US_Specops.con:


ObjectTemplate.create Kit US_Specops
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.kitType Specops
ObjectTemplate.aiTemplate Specops
ObjectTemplate.geometry US_Kits
ObjectTemplate.geometry.kit 0
ObjectTemplate.geometry.dropGeom 10
ObjectTemplate.networkableInfo KitInfo
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.unlockIndex 4
ObjectTemplate.cullRadiusScale 2.5
rem -------------------------------------
ObjectTemplate.addTemplate USPIS_92FS_silencer
rem ObjectTemplate.addTemplate SIMRAD
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate c4_explosives
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSSpecops
ObjectTemplate.addTemplate USRIF_M4
ObjectTemplate.addTemplate ussni_m95_barret
ObjectTemplate.addTemplate ammokit
ObjectTemplate.addTemplate usatp_predator
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

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_SPECIALFORCES"
ObjectTemplate.vehicleHud.miniMapIcon "Ingame\Kits\Icons\kit_Specops_outline.tga"
ObjectTemplate.vehicleHud.vehicleIcon "Ingame\Kits\Icons\kit_Specops.tga"
ObjectTemplate.vehicleHud.spottedIcon "Ingame\Player\Icons\Minimap\mini_Soldier.dds"
ObjectTemplate.vehicleHud.pantingSound S_SprintBreath
ObjectTemplate.vehicleHud.injurySound S_Injury
ObjectTemplate.sprintStaminaDissipationFactor 0.2

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

ObjectTemplate.create ItemContainer UnlockUSSpecops
ObjectTemplate.addTemplate usrif_g36c
ObjectTemplate.unlockLevel 1


As you can see he has the M95 and ammokit and the predator... I'm a killing machine.

Now, you have to be careful because you have to change the default "slot" that certain items are in... like the M95 being slot "3", I had to change to slot "6" like so in the ussni_m95_barret.tweak file:


ObjectTemplate.itemIndex 6


All of these files are in your Objects_server.zip file. If you plan on doing a lot of changing to these files, move a copy from your mod/bf2 folder into your mod/***your mod name*** folder, then change your ServerArchives.con file (in your mods root folder) to read:


fileManager.mountArchive Objects_server.zip Objects


That will force your mod to use YOUR files.

Basically play around with things... I've made quite a fun Single Player game for myself (I'm sick of Smacktards) and having fun "tweaking" things. Just be sure to change a little at a time and keep a LOG of what you change. In fact keep the ORIGINAL code right there, but add a "rem" line with a comment on what you did in the file, it will ignore it as code.

You'll know if you have something wrong, because as soon as you do, you'll have a CTD during the map loading.

HAVE FUN!

p.s. Remember these files are "read only" by default... don't forget to change that or you won't be able to save.

GlobalFear
08-09-2005, 02:19 AM
I'm aware of all of that. I said in the original post that this was for my own mod.
Might help someone else out though.
(Unless of course the .tweak files are python then I stand corrected)

I need to figure out how to make use of the unlocks feature to add multiple kits per class.


Changing this:
ObjectTemplate.create ItemContainer UnlockUSSpecops
ObjectTemplate.addTemplate usrif_g36c
ObjectTemplate.unlockLevel 1
to this:
ObjectTemplate.create ItemContainer UnlockUSSpecops
ObjectTemplate.addTemplate usrif_g36c
ObjectTemplate.unlockLevel 0

Didn't work. It displays the default weapon it the selection screen but spawns with the unlockable one. No choice.

If anyone has any ideas I am open to hear them. :)

Raslin
08-09-2005, 07:38 AM
do it like they did with the demo. Go into the python files, forget which ones, and set rank levels to 0.

={SOC}= Sniper
08-09-2005, 07:49 AM
How u add the 50 cal that was cut out?

GlobalFear
08-09-2005, 01:03 PM
Raslin, that hasn't worked since the patch???

Johnny Bravo
08-09-2005, 07:21 PM
How u add the 50 cal that was cut out?

go to Objects_server.zip,open kits,US,US_Sniper. Then in the \mods\bf2\ go to Objects,weapons,handheld,and find USSNI_M82A1, in US_Sniper,type this:
ObjectTemplate.addTemplate USSNI_M82A1 and put the rem in front of this:
rem ObjectTemplate.addTemplate USRIF_M24 now u have a M82.

shadow2k1
08-11-2005, 01:09 AM
Now, you have to be careful because you have to change the default "slot" that certain items are in... like the M95 being slot "3", I had to change to slot "6" like so in the ussni_m95_barret.tweak file:


ObjectTemplate.itemIndex 6


.

how do ya know what slot to set this to? does this have to be changed for all the weapons?

The Vincester
08-11-2005, 01:57 AM
how do ya know what slot to set this to? does this have to be changed for all the weapons?

Well, it's all according to what you want to put where... the # is determined by an "open slot" in a kit.

For example, the normal spec op kit has as it's slot:

1. Knife
2. Pistol
3. M4
4. C-4
9. Is the Parachute for all classes.

That means slots 5, 6, 7, and 8 are open... you have to go to the weap on change the "default" slot. So say I want an AT rocket, and it's default is slot 4, it needs to be changed, because that would be a conflict with the C-4, so it needs to be changed, or you will crash on loading a map.

Now, keep in mind, if you change the weapon, it's changed for the "normal" AT, so they'll have to select the new slot to select the weapon.

Hopefully that makes sense.

shadow2k1
08-11-2005, 03:55 PM
ok so if spec ops is
1. Knife
2. Pistol
3. M4
4. C-4
9. Is the Parachute for all classes.

and the AT class is
1. Knife
2. Pistol
3. M4
4. AT rocket
9. Is the Parachute for all classes.

and i change the index number of the rocket to 5
what happens to the AT class slot 4? does that slot open up?

i guess what im trying to get at is how does changing that index number effect the other classes

if C4 is slot 4 and i want to use it on 2 other classes do all the files have to have the same slot number?

excentriker.de
08-11-2005, 04:28 PM
You can not have 2 items with the same .itemIndex in one kit. So you have to change the index of one of the items. Also you have to obtain if this item is part of an other kit that you have to change the index to a value that isnt in conlict with an item of that Kit.

If you wanna C4 on the AT-class you have tochange it maybe to 6, 7 or 8 to avoid conflicts with other classes , for instance, the Handgrenades.

shadow2k1
08-11-2005, 05:42 PM
maybe my point wasnt understandable, i understand that it needs to be changed but if i change the default index number for the AT rocket to say 5 and place it on the spec ops, what effect does it have on the AT class? or do i have to change the slot number on him and the other subsequent files

excentriker.de
08-11-2005, 06:50 PM
It has no effect for the at-soldier , because he has no item with .itemIndex 5, but the Specops has C4, and C4 has already .itemIndex 5

maybe you should make an table with the current layout and the suggsted layout , that will give you the most overview whta to change

http://www.excentriker.de/bf2/kits-weapons.gif

shadow2k1
08-11-2005, 07:49 PM
thanks ex, that helps alot much appreciated
one more Q if ya know.
what file holds the info for the amount of clips and grenades each class can carry? is it in the tweak files? or con files?

excentriker.de
08-11-2005, 07:52 PM
.tweak

2-5
03-15-2006, 09:25 AM
do you need to craeate your own mod to edit those files?

i only get a ctd if i edit one of the .con files ... :confused:

jdrou
03-15-2006, 11:21 PM
do you need to craeate your own mod to edit those files?

i only get a ctd if i edit one of the .con files ... :confused:
Exactly what file did you change and what change did you make? You don't HAVE to make it a separate mod but modding most files will prevent you from playing online otherwise. I'd strongly suggest downloading a mod and looking at the changes they've made to see what can be done.