Author Topic: I messed up a code in US_Assault.con  (Read 1938 times)

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
I messed up a code in US_Assault.con
« on: 10-03-2013, 22:03:23 »
Howdy,

I was trying to learn some basic modding, like adding vehicles, changing weapon classes etc... After successsfully editing some kits to have other rifles and equipment, I tried to remove the M16 and M203 from the US assault kit and replace it with the G3a3. But map crashes when loading at 15%  :(, this is how the current code looks like:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate USRIF_G3A3
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSAssault
ObjectTemplate.addTemplate UnlockUSAssault2
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

It was in objects_server.zip/Kits/US_Assault.con

Please guys! I need your help to bring the kit back to normal and then replace the M16 and M203 with the G3a3 and regular grenades. Help me unscrew my Bf2, I beg you!  :-[
« Last Edit: 10-03-2013, 22:03:46 by TurkishCommando007 »

Offline Krätzer

  • Developer
  • ******
  • Posts: 621
  • Bitter Lemon
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #1 on: 10-03-2013, 22:03:46 »
Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate USRIF_M203
ObjectTemplate.addTemplate USRGL_M203
ObjectTemplate.addTemplate USPIS_92FS
ObjectTemplate.addTemplate hgr_smoke
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSAssault
ObjectTemplate.addTemplate UnlockUSAssault2
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #2 on: 10-03-2013, 22:03:40 »
It still crashes to desktop  :-[

Here are the other kits I set:

Support:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate ammokit
ObjectTemplate.addTemplate UnlockUSSupport
ObjectTemplate.addTemplate UnlockUSSupport2
ObjectTemplate.addTemplate RULMG_PKM
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

Spec-ops:

Code: [Select]
ObjectTemplate.addTemplate chpis_qsz92
rem ObjectTemplate.addTemplate SIMRAD
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate c4_explosives
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSSpecops
ObjectTemplate.addTemplate UnlockUSSpecops2
ObjectTemplate.addTemplate USRIF_G3A3
ObjectTemplate.addTemplate ParachuteLauncher

Sniper:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate USMIN_Claymore
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSSniper
ObjectTemplate.addTemplate UnlockUSSniper2
ObjectTemplate.addTemplate ParachuteLauncher
ObjectTemplate.addTemplate rurif_Dragunov
rem -------------------------------------

Medic:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate medikit
ObjectTemplate.addTemplate defibrillator
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSMedic
ObjectTemplate.addTemplate UnlockUSMedic2
ObjectTemplate.addTemplate USRIF_G3A3
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

Engineer:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate USHGR_M67
ObjectTemplate.addTemplate wrench
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate at_mine
ObjectTemplate.addTemplate UnlockUSEngineer
ObjectTemplate.addTemplate UnlockUSEngineer2
ObjectTemplate.addTemplate USRIF_MP5_A3
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

AT:

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate USATP_Predator
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSAT
ObjectTemplate.addTemplate UnlockUSAT2
ObjectTemplate.addTemplate USRIF_MP5_A3
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------


Would any of these cause errors? If so, which ones should I change? Did I do any mistakes in the code?
« Last Edit: 10-03-2013, 22:03:39 by TurkishCommando007 »

Offline Korsakov829

  • Full Member
  • ***
  • Posts: 1.751
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #3 on: 10-03-2013, 22:03:27 »
Right click the file, check properties, previous versions tab. Probably won't work but its worth checking.

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #4 on: 10-03-2013, 22:03:39 »
Right click the file, check properties, previous versions tab. Probably won't work but its worth checking.

nope, doesnt work.  :P

Offline Krätzer

  • Developer
  • ******
  • Posts: 621
  • Bitter Lemon
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #5 on: 10-03-2013, 22:03:29 »
Thats why you should create an Backup, ALWAYS! -.-

Objects_server.zip




Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #6 on: 10-03-2013, 22:03:38 »
The G3a3 and the rifle probably share the same itemIndex which means the game can't have two weapons mapped to the same key. You'll need to change the item index of one of them, to whatever the itemindex of the M203 was.

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #7 on: 10-03-2013, 22:03:17 »
Thats why you should create an Backup, ALWAYS! -.-

Objects_server.zip

Phew, thanks a lot Krätzer, you probably saved my modding career before it started.

The G3a3 and the rifle probably share the same itemIndex which means the game can't have two weapons mapped to the same key. You'll need to change the item index of one of them, to whatever the itemindex of the M203 was.

Ok, thanks. I'll try again to do it properly tomorrow. :)

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #8 on: 11-03-2013, 16:03:47 »
What code should I use to make the Assault kit have the knife+G3A3+QPZ92+Smoke+FragGrenades?

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #9 on: 11-03-2013, 18:03:55 »
Also... I need help on replacing the US Humvee with the Hard Justice otokar cobra.

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #10 on: 12-03-2013, 03:03:02 »
Create a custom zip, named whatever you want. Say, Turkish.zip.

Mount it, on top of all the other Battlefield 2 Zips in Server and ClientArchives.con with the code:

Code: [Select]
fileManager.mountArchive Turkish.zip Objects
In this zip include the files and folders you want, make sure not to mess up the structure from BF2.

In the kits .con file, you'll need to remove the M16 and M203 from the kit,

Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate USRIF_M203
ObjectTemplate.addTemplate USRGL_M203
ObjectTemplate.addTemplate USPIS_92FS
ObjectTemplate.addTemplate hgr_smoke
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSAssault
ObjectTemplate.addTemplate UnlockUSAssault2
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------


Changing it to:


Code: [Select]
rem -------------------------------------
ObjectTemplate.addTemplate USRIF_G3a3
ObjectTemplate.addTemplate USPIS_92FS
ObjectTemplate.addTemplate hgr_smoke
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate UnlockUSAssault
ObjectTemplate.addTemplate UnlockUSAssault2
ObjectTemplate.addTemplate ParachuteLauncher
rem -------------------------------------

Save, and update your .zip file. The change should work.

Offline Turkish007

  • Masterspammer
  • ****
  • Posts: 4.060
  • Mini-mod necromancer
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #11 on: 12-03-2013, 16:03:31 »


:D Thanks. How do I fix the HUD_TEXT_MENU_SPAWN_ARMY to write what I want it to write? I tried editing it, but it looked like this.  :-\

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #12 on: 12-03-2013, 17:03:30 »
Inside BF2's folders you will see a folder called Localization, inside is all the languages for the text of the game. Inside the English one you can create your own text file in a similar style to all the others. Copy and paste a line, replace it with your "HUD_" whatever, and then tell the game what it is supposed to display:

I.E:

HUD_TEXT_SPAWN_MENU_ARMY                   "US ARMY"


 

Offline versus

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #13 on: 12-03-2013, 18:03:12 »
And it has to be unicode (UCS-2 Little endian) encoded.



Offline pizzzaman

  • Jr. Member
  • **
  • Posts: 1.043
  • Test Map De-coder
    • View Profile
Re: I messed up a code in US_Assault.con
« Reply #14 on: 12-03-2013, 20:03:28 »
Phew, thanks a lot Krätzer, you probably saved my modding career before it started.

Turkishcommando007  2013
You are bathing in misery and hope, waiting for someone to come and pull the plug.