[Question] Bots and new weapons...

Suggestions and feedback pertaining to Project Reality Single Player.
Post Reply
HangMan_
Posts: 1753
Joined: 2009-06-07 00:58

[Question] Bots and new weapons...

Post by HangMan_ »

I have been using my PRSP as a testing platform for my NZDF faction of PR for a week now. Today i tried to load a map with an NZDF gun in one of the kits. This weapon is not a PR weapon. It has been tweaked for PR though.

The map CTD'd just after 100%

Is there anything that needs to be done to a weapon to make it work in PRSP? Anything to do with the AI?

Cheers,
HangMan
Image

PR Community Faction Team - "Getting Sh*t Done..."
ballard_44
Retired PR Developer
Posts: 1204
Joined: 2007-05-30 22:47

Re: [Question] Bots and new weapons...

Post by ballard_44 »

Without the new gun added the map loads fine and you can play?

Basically, are you sure it is the gun?
Image
HangMan_
Posts: 1753
Joined: 2009-06-07 00:58

Re: [Question] Bots and new weapons...

Post by HangMan_ »

[R-DEV]ballard_44 wrote:Without the new gun added the map loads fine and you can play?

Basically, are you sure it is the gun?
I'm sure its the gun. I removed it from the kit and it works fine. Map is Korengal if thats any help?? Currently also using custom kit and soldier skins.
Image

PR Community Faction Team - "Getting Sh*t Done..."
ballard_44
Retired PR Developer
Posts: 1204
Joined: 2007-05-30 22:47

Re: [Question] Bots and new weapons...

Post by ballard_44 »

I assume the gun has worked in another bf2 mod?
And the custom kit and skins work fine without the new gun?

Could be a conflict in the index of the weapon?
Basically there could be another weapon in your kit that uses the same index number as the new gun.

Open the .tweak file of the gun and look for...
ObjectTemplate.itemIndex
There will be a number at the end of that code.

You need to check the other .tweak files of all the other things in the kit to see if one of the others already uses the same number.

EDIT- you don't get any error message that tells you what happened after the crash?
Image
Chuc
Retired PR Developer
Posts: 7016
Joined: 2007-02-11 03:14

Re: [Question] Bots and new weapons...

Post by Chuc »

Also run in windowed mode so the error message (most of the time) pops up.
Image
Personal Folio - http://www.studioash.net
HangMan_
Posts: 1753
Joined: 2009-06-07 00:58

Re: [Question] Bots and new weapons...

Post by HangMan_ »

Its not the index, i checked that today. Custom skins work fine, as does the kit.

I'm going to run in windowed mode later today and see what error i get.
Image

PR Community Faction Team - "Getting Sh*t Done..."
HangMan_
Posts: 1753
Joined: 2009-06-07 00:58

Re: [Question] Bots and new weapons...

Post by HangMan_ »

Ok so i tried to run windowed and this error comes up...

Image
Image

PR Community Faction Team - "Getting Sh*t Done..."
Kenny
Posts: 261
Joined: 2006-11-18 03:30

Re: [Question] Bots and new weapons...

Post by Kenny »

Maybe some how your missing something thats why when you try to use that gun it crashes you might try and double checking all files relating to that gun to make sure their really their.
I don't know if this will help but I found this which seems to be similar
Battlefield 2: Special Forces problem [RESOLVED] - Tech Support Forum

The last post mentions something about extracting the Client_shaders.zip in C:\Program Files\EA GAMES\Battlefield 2\mods\bf2 to C:\Program Files\EA GAMES\Battlefield 2\mods\bf2\shaders don't really know what hes going on about.
Image
ballard_44
Retired PR Developer
Posts: 1204
Joined: 2007-05-30 22:47

Re: [Question] Bots and new weapons...

Post by ballard_44 »

XxX_HangMan_XxX wrote:Ok so i tried to run windowed and this error comes up...
Hmm...never seen that error before.

Clear all your BF2 caches and see if it helps?

Code: Select all

My Documents\Battlefield 2\cache
and

Code: Select all

My Documents\Battlefield 2\mods\bf2\cache
Image
HangMan_
Posts: 1753
Joined: 2009-06-07 00:58

Re: [Question] Bots and new weapons...

Post by HangMan_ »

Ok i tested the weapon in a few other mods and it worked fine ingame. It still won't work for PRSP and i can't run windowed or debug because of that error :p
Image

PR Community Faction Team - "Getting Sh*t Done..."
ballard_44
Retired PR Developer
Posts: 1204
Joined: 2007-05-30 22:47

Re: [Question] Bots and new weapons...

Post by ballard_44 »

Well, see if a change in AI code will help.

Look for and open another weapons .tweak file that is an equivalent of the new gun.

Look for this code...
ObjectTemplate.aiTemplate
There will be some more code after the above like...
ObjectTemplate.aiTemplate ar_scope_ai
All guns that are assault rifles with a scope use this code in PRSP.

So if your new gun matches that 'style', copy the whole line to your weapon, replacing the code that the new gun has.

Most the ai code that the hand weapons use is in the objects_server.zip
Open it and goto the...
/Weapons/Handheld/weapon_ranges folder and you will see all the variations.

So if the new gun is not an assault rifle with scope pick the one that it matches in that folder.
Open up the Weapons.ai file and grab the correct code.

If it was a Light Machine Gun the code you would paste would be the lmg_ai part and so on.
Image
Post Reply

Return to “Coop & Singleplayer”