[General] Arab's fixes and changes

Making or wanting help making your own asset? Check in here
Post Reply
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

[General] Arab's fixes and changes

Post by Arab »

Hey all.

So I've decided to start fixing PR's issues with Performances, and other Issues as a compliment to the development so that servers and players can run games lag-free, performance-issue free and crash-free as a dedication to those who developed code and helped developed for PR :)

Instead of uploading links, I decided to write tutorials instead :)

You will see bits and pieces of information as you browse here, but I'll do my best to fit it here.

So without due, let us begin

Before we start, we need to create a pr_edit folder.
Windows 7 Users: Simply copy 'pr' and paste and then rename pr (copy) to pr_edit.
XP users: Make a folder called pr_edit, open pr, highlight everything and copy, go to pr_edit folder and paste.

After it's done copying, go to bin folder (not rubbish bin), and right-click on prlauncher.exe and make a shortcut to desktop, and then rename shortcut to anything.

LIST OF BF2 CODES:
http://www.bfeditor.org/forums/index.ph ... opic=14164
https://www.realitymod.com/forum/f189-m ... g-bf2.html

This also may be useful for Python coders: BF2 Gameplay Scripting Guide v0.1

1. How I improve performances on all types of meshes (Possibly)


Files we want to modify:
objects_common_client.zip
objects_vehicle_client.zip
objects_statics_client.zip
objects_weapons_client.zip

We will look at two programs created by Bytehazard. All credits go to him

1. BfMeshView - bfmeshview200.zip. For viewing meshes, models and fixing uv maps, textures, meshes etc. Great toolkit!

2. BfMeshCheck - meshcheck100.zip. For detecting errors.

ByteHazard's BF Tools

We will start with BfMeshView first.

1. Extract it.
2. Open it up.

Get really familiar with it. Experiment and look around, get a feel for the simple UI.

After you have a feel for it, we will setup associations first. This is an important step that makes it easy to view meshes without manually doing it:

'Setup Associations'
1. Go to Options, Preferences.

2. At the bottom, tick .staticmesh, .bundledmesh, .skinnedmesh, .collisionmesh. You can obviously select others or all of it if you want to view those files without having to right-click and setup associations manually.

Done

At the far-bottom, under Miscellaneous, you can allow it to maximize (fill up the screen) on start, and change the color of the stage.

Now, to Bf2 Mesh Check.

Before we start, we need to first make a folder first for the mod files. It can be made anywhere, it doesn't need to follow a directory pattern i.e "C:\program files\ea games\battlefield 2\mods\pr"

The program hates special characters, and crashes when you scan it for more than 20 seconds if your mod has '_', '-' so make your mod have letters only to prevent crashing.
In this case, I made one on the C:\Games folder.

We need to go to C:\Program Files\*Game Folder*\Battlefield 2\mods\pr_edit (or pr)\content\objects_static_client.zip etc
Copy all those .zip and paste into the created destination which is C:\Games or wherever you made the folder. Right-click and press extract each archive to separate folder. The Mesh Checker cannot support archives or folders with anything apart from alphabets, so you need to extract the files so that they can be read.

To use:

1. You need to point the mod path. Since there's no browse option, you need to copy and paste it, or you can type it in.
At mod path, go to the folder where you created your game folder and copy the directory in explorer. Paste it.

There's also fast mode. I don't check it because I'm not sure if it's the most accurate.

2. Select your mesh type to load. You can load StaticMesh, BundledMesh or SkinnedMesh. In this case, we will do each of everything. After you selected your preferred option, Press 'Start'.

It will scan between 1-5 minutes. The errors are highlighted in Red.
Now to go through Errors and their meanings

Code: Select all

 [font=Comic Sans MS][color=DeepSkyBlue]Glossary[/color][/font]
[color=DarkOrange]x = number[/color]

[b]Important:[/b] For every change, Go to [u]File -> Save to save[/u]

NaNs 
Meaning: Bad Vertices. The number next to Nan is the number of Vertices that needs fixing. Not sure exactly, but it improves performances once it's fixed, and makes FPS more stable. 
Solution: Double-click it. It will open BfMeshviewer. Over there, go to 'Tools', then 'Fix Mesh'. Go to File -> Save, and click 'Yes' to replace.

After you fixed them all, I like to rescan them to make sure it's fixed.

Afterwards, go back to the folder 'objects_static_client' and open it. Use Winrar/winzip/windows etc to make a zip folder and place it in your pr_edit folder to test.

To test:

Download the debugger here:
[url=https://www.realitymod.com/forum/f388-pr-bf2-community-modding/123029-info-running-debugger-1-0-a.html]PR 1.0 Debugger[/url] and follow the tutorial.

Now, open your launcher and create an offline profile. I like to create a profile called 'Test'.

After you made it, go to settings, select 'Test', and adjust setting to match this:
[code]
Profile 0003: test
              Type: Offline
        View Intro: False
        Fullscreen: False
      Display Mode: 800x600@60Hz
      Enable Local RCON Commands: Ticked (Global Tab)
     Video Setting: High
Place mouse over play, click on '\/' arrow, select 'Launch Debugger', manage profiles, click once on your user, click on convert, done. Double click your username and start the game.

A quick warning, debugger is annoying and will show messages at first. If the game won't boot, try a different resolution.

Select a map, and load it. You have to press 'ok' about 15 times but once you load the game, go and spawn.
Turn on the fps counter by pressing the console key '~' on the top-left side, and type in renderer.drawfps 1. The one in debugger is more detailed, allowing you to have drawcalls and lots of other features to debug and monitor performance.

Boot Project Reality (unmodified) in debug-mode, go to a building that's causing lag (plenty in Fallujah West), open up console and type in renderer.drawfps1, press F12 for screenshot (Screenshot is in My Documents -> Project Reality), then go to Project Reality (edited) in debug-mode and do the same. You should see a difference in FPS, and maybe in draw-calls.

When I finish this, I will upload it

Update: Finished it, yet to upload. If anyone can suggest a way of taking out only the modified files while perserving the directory, please pm me.

2. How I added the missing/fixed Atlases & mesh particles


What I basically did was compare the bf2 objects_server, objects_client, menu_client, menu_server to pr objects_common_server, objects_common_client, menu_client & menu_server and then extracted pr's files.

For the menu meme atlas, I renamed it from menu_atlas to meme_atlas.

I searched for all atlas files within pr, compared it to bf2 and placed it at the correct directory.

LINKS
Meme Atlas: TinyUpload.com - MEME ATLAS FIX
Mesh Particles: TinyUpload.com - MESH PARTICLES MISSING FIX

It's uploaded on the forum now.

More to come as I update the article with more tutorials like 3d markers and test out my tutorial.
Last edited by Arab on 2015-01-11 11:56, edited 152 times in total.
Reason: Organizing and updating it
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

What exactly are you changing? Dont need a full list, but some examples would be nice
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

I went to look for .tweak, .con and .inc files that are out-of-place.
Like this:
Image

I then copied the code from Notepad, pasted it in Wordpad, copied it from Wordpad, and pasted it back to Notepad, to become this:

Image

And applied it to every document that looked like that, and trust me, I searched all of them and fixed it all in the archive :)

I've tried to make the same thing happen in Battlefield 2 by making the paragraph messy, and it resulted in a CTD. So this will dramatically improve stability and help resolve most crashes, and at best all crashes I hope

I fixed also the music player .tweak files for Vietnam the same way, but I don't know what button to press for the music to play in the helicopter.

OLD:
Image
NEW:
Image
Last edited by Arab on 2014-07-22 10:03, edited 8 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

If thats all you are doing, im afraid you are wasting a bit of time :(
The default editor always screws up a bit. Use notepad++, there everything is the way it should be.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

I'm using it now, and it's so much better.
Last edited by Arab on 2014-08-10 10:18, edited 17 times in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

Here are the other fixes too.

The bird file was corrupted when I opened it, so I replaced it with vBf2, and I know the model was culled to save space and is not used in maps to save performance, but just thought to do it anyway.

(Moved Attachments to front page for easy viewing)
Last edited by Arab on 2014-08-03 08:59, edited 1 time in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

Good catch on the missing parameter, i doubt anyone actually pays attention to all the error messages theses days :D
Just in case you didnt figuere it out already, the parameters are <hp in %> <effect> <Vec3 position> <Vec3 rotation>
The bird texture is actually just a .tga renamed to .dds. I think thats fine.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

Thanks :)

I'm not finished yet going through Bfeditor logs and I ignored the invalid command messages because they are valid (I got a complete list of Bf2 commands), but ill recheck the commands quickly.

The flags and the effects say this:

Code: Select all

[ParticleSystem] : PointSprites arent used right now!!!! USEAdditive instead
Things to do:
-Check BF Editor logs
-Fix UAV Lag. How it lags the server: When people are clicking on the left mouse/fire button. Why it does that? It fires invisible projectiles that lag it. How to fix it: Remove firing codes.

But that would prevent the commander lazing.
-See what networkableinfo code is needed, and remove un-necessary ones like the ones used by markers.
I'll test what networkableinfo does exactly because as far as I know, it allows other people to see an object move in motion, and I believe if it's removed/rem'd, the vehicle moves jaggedly.
-Fix Mine, C4 disappearing glitch by adding the right type of setnetworkableinfo.?
-Rework on weighted sprint, this time getting much more organized and focusing on smoothing animation transitions

Just a note to the mappers

-Forklifts in all maps need to be removed as they cause crashes when beeping and moving, especially when exploded.

Biggest priority for me is fixing crashes, and server performance issues (Hardware + Bandwidth) related to effects and un-needed code before the next update.
Last edited by Arab on 2014-07-23 08:49, edited 5 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

Arab wrote: -Fix UAV Lag. How it lags the server: When people are clicking on the left mouse/fire button. Why it does that? It fires invisible projectiles that lag it. How to fix it: Remove firing codes.
Is the UAV lag really related to the CO firing his main weapon? It just uses the hornprojectile, so if that causes problem every horn should too.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

[R-CON]Mats391 wrote:Is the UAV lag really related to the CO firing his main weapon? It just uses the hornprojectile, so if that causes problem every horn should too.
Not quite sure. I fixed and updated a mistake in "Fix Paragraphs in Typos" with the markers.

And I found out that if there's a line left between a code, the Battlefield 2 Server crashes. Typing rem before an unwanted code is an easy way to tell the engine not to load the code.

common/uav/uav.con

Code: Select all

 ObjectTemplate.create GenericFireArm uav
ObjectTemplate.modifiedByUser dbzao
ObjectTemplate.createdInEditor 1
rem ---BeginComp:WeaponHud --- [b]These are the Hud setups[/b]
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.hudName "uav"
ObjectTemplate.weaponHud.guiIndex 33001
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.enableMouse 1
ObjectTemplate.weaponHud.displaySelectOnActivation 0
ObjectTemplate.weaponHud.crosshairIcon Ingame/Vehicles/Icons/Hud/Air/Attack/Su34/TVGuided/tvGuided_Crosshair.tga
ObjectTemplate.weaponHud.crosshairIconSize 128
ObjectTemplate.weaponHud.altCrosshairIcon Ingame/Vehicles/Icons/Hud/Air/Attack/Su34/TVGuided/tvGuided_Crosshair.tga
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp [b]<- ?[/b]
ObjectTemplate.fire.roundsPerMinute 60 [b]<- ?[/b]
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp [b]Don't know what it's used for, but it's because the UAV works like an airplane, and it needs those codes in I'm guessing?[/b]
ObjectTemplate.ammo.ammoType 15
ObjectTemplate.ammo.nrOfMags -1
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 1800
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.reloadWithoutPlayer 1
rem ---EndComp ---
rem ---BeginComp:WeaponBasedRecoilComp ---
ObjectTemplate.createComponent WeaponBasedRecoilComp
rem ---EndComp ---
rem ---BeginComp:SimpleDeviationComp ---
ObjectTemplate.createComponent SimpleDeviationComp
rem ---EndComp ---
rem ---BeginComp :D efaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp :P ostProcess ---
ObjectTemplate.createComponent PostProcess
ObjectTemplate.postProcess.tvDistortionScale 0
ObjectTemplate.postProcess.tvDistortionFreq 0
ObjectTemplate.postProcess.tvDistortionRoll 0
ObjectTemplate.postProcess.tvInterference 0.07
rem ---EndComp ---
rem ---BeginComp :D efaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
rem ---EndComp ---
rem ---BeginComp:LPTargetComp ---
ObjectTemplate.createComponent LPTargetComp
ObjectTemplate.target.maxDistance 9999
ObjectTemplate.target.setTargetAtMaxDistance 1
ObjectTemplate.target.targetSystem TSTVGuided
ObjectTemplate.target.targetObjectTemplate UniqueTarget
ObjectTemplate.target.disableFireWhenActiveMissile 1
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.material 56
rem -------------------------------------
ObjectTemplate.addTemplate S_uav_Fire1P
ObjectTemplate.addTemplate S_uav_Fire1P_Outdoor
ObjectTemplate.addTemplate S_uav_Fire3P
ObjectTemplate.addTemplate S_uav_BoltClick
ObjectTemplate.addTemplate S_uav_TriggerClick
ObjectTemplate.addTemplate S_uav_SwitchFireRate
ObjectTemplate.addTemplate S_uav_Reload1P
ObjectTemplate.addTemplate S_uav_Reload3P
ObjectTemplate.addTemplate S_uav_Deploy1P
ObjectTemplate.addTemplate S_uav_Deploy3P
ObjectTemplate.addTemplate S_uav_Zoom
rem -------------------------------------
ObjectTemplate.projectileTemplate uav_projectile
ObjectTemplate.velocity 10
ObjectTemplate.itemIndex 1
 ObjectTemplate.isSelectable 1

ObjectTemplate.activeSafe Sound S_uav_Fire1P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Fire1P_Outdoor [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Fire3P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_BoltClick [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_TriggerClick [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_SwitchFireRate [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo 

ObjectTemplate.activeSafe Sound S_uav_Reload1P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Reload3P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Deploy1P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Deploy3P [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.activeSafe Sound S_uav_Zoom [b]<- ?[/b]
ObjectTemplate.modifiedByUser ljo

ObjectTemplate.create GenericProjectile uav_projectile
ObjectTemplate.creator MHO-1:mho
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.createNotInGrid 1
ObjectTemplate.cullRadiusScale 15
rem ---BeginComp :D efaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
ObjectTemplate.collision.hasCollisionEffect 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp:SeekClosestTargetComp ---
ObjectTemplate.createComponent SeekClosestTargetComp
ObjectTemplate.seek.targetType TTUnique
ObjectTemplate.seek.trackingDelay 0
ObjectTemplate.seek.maxAngleLock 360
ObjectTemplate.seek.maxDistLock 99999
ObjectTemplate.seek.reLockTime 0
rem ---EndComp ---
rem ---BeginComp :D efaultFollowComp ---
ObjectTemplate.createComponent DefaultFollowComp
ObjectTemplate.follow.maxYaw 360
ObjectTemplate.follow.maxPitch 0
ObjectTemplate.follow.changePitch 0
ObjectTemplate.follow.changeYaw 0.1
ObjectTemplate.follow.minDist 1
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
ObjectTemplate.penetrate.allowLiquidPenetration 0
rem ---EndComp ---
ObjectTemplate.mapMaterial 0 metal 97
ObjectTemplate.drag 1
ObjectTemplate.mass 500
ObjectTemplate.gravityModifier 0
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 97
rem -------------------------------------
ObjectTemplate.addTemplate S_uav_projectile_Looping
ObjectTemplate.addTemplate uav_projectile_Camera
ObjectTemplate.setPosition 0/-3/3
ObjectTemplate.setRotation 0/60/0
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/1200/0/0
ObjectTemplate.material 97
ObjectTemplate.hasOnTimeEffect 0
ObjectTemplate.damage 0
ObjectTemplate.acceleration 0
ObjectTemplate.maxSpeed 10
ObjectTemplate.useProjectileCamera 1

ObjectTemplate.activeSafe Sound S_uav_projectile_Looping
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename ""
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.5
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 1
ObjectTemplate.halfVolumeDistance 5


ObjectTemplate.create Camera uav_projectile_Camera
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.createdInEditor 1
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
rem -------------------------------------
ObjectTemplate.addTemplate S_uav_projectile_Camera_RotationRpm
rem -------------------------------------
ObjectTemplate.CVMInside 0
ObjectTemplate.CVMFrontChase 0
ObjectTemplate.CVMFlyBy 0
ObjectTemplate.followStiffness 6
ObjectTemplate.chaseDistance 1
ObjectTemplate.chaseAngle 1
ObjectTemplate.chaseOffset 0/0/0
ObjectTemplate.worldFOV 0.6
ObjectTemplate.insideFOV 0.6
ObjectTemplate.worldFOV 0.6
ObjectTemplate.insideFOV 0.6
ObjectTemplate.allowInsideDynamicLights 1
ObjectTemplate.allowInsideStaticSun 0
ObjectTemplate.insideStaticSunDirection -0.25/-0.5/0.75
ObjectTemplate.insideStaticSunColor 1/1/1
ObjectTemplate.insideStaticSunDamageColor 1/0/0
ObjectTemplate.insideDamageFrequency 3
ObjectTemplate.insideDamageThreshold 0.15
ObjectTemplate.insideStaticSunAmbientColor 0.7/0.7/0.7

ObjectTemplate.activeSafe Sound S_uav_projectile_Camera_RotationRpm
ObjectTemplate.modifiedByUser ljo
What I did, was changed from this

Code: Select all

rem -------------------------------------
ObjectTemplate.addTemplate S_uav_Fire1P
ObjectTemplate.addTemplate S_uav_Fire1P_Outdoor
ObjectTemplate.addTemplate S_uav_Fire3P
ObjectTemplate.addTemplate S_uav_BoltClick
ObjectTemplate.addTemplate S_uav_TriggerClick
ObjectTemplate.addTemplate S_uav_SwitchFireRate
ObjectTemplate.addTemplate S_uav_Reload1P
ObjectTemplate.addTemplate S_uav_Reload3P
ObjectTemplate.addTemplate S_uav_Deploy1P
ObjectTemplate.addTemplate S_uav_Deploy3P
ObjectTemplate.addTemplate S_uav_Zoom
rem -------------------------------------
to this:

Code: Select all

rem ObjectTemplate.addTemplate S_uav_Fire1P
rem ObjectTemplate.addTemplate S_uav_Fire1P_Outdoor
rem ObjectTemplate.addTemplate S_uav_Fire3P
rem ObjectTemplate.addTemplate S_uav_BoltClick
rem ObjectTemplate.addTemplate S_uav_TriggerClick
rem ObjectTemplate.addTemplate S_uav_SwitchFireRate
rem ObjectTemplate.addTemplate S_uav_Reload1P
rem ObjectTemplate.addTemplate S_uav_Reload3P
rem ObjectTemplate.addTemplate S_uav_Deploy1P
rem ObjectTemplate.addTemplate S_uav_Deploy3P
rem ObjectTemplate.addTemplate S_uav_Zoom
Not sure if placing codes between two rem -*Insert Group Here* disables them, so I changed it for both uav.con and uav2.con. Zoom still works despite me remming it, all tested on Internet Server Co-Op (Bots) mode on Ramiel.

Is the UAV viewable in the sky?
Last edited by Arab on 2014-07-23 12:57, edited 10 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

I dont think blank lines do any harm. There are a lot around of them.
rem always only marks that line as being a comment. To mark multiple lines as comments, use beginrem ... endrem
The UAV is not visible.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

Well, that sucks lol.

I wish there's a way to log exactly why a game crashes or that, apart from the usual error message shown.
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: [Fixing] Files with typos

Post by LITOralis.nMd »

Arab , you're doing yeoman work deep in the trenches, it's much appreciated.

Try grabbing Notepad++ and WinMerge, it'll speed up and streamline your workflow.

Also someone at one point (2012ish?) had made a stylesheet for Notepad++ for BF2 code, which was very useful. I lost it on a new PC build though. Anyone still using it?
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: [Fixing] Files with typos

Post by LITOralis.nMd »

Actually, do this:
1. download PortableApps: PortableApps.com - Portable software for USB, portable and cloud drives
install Portable Apps onto your fastest drive , to something like c:\PortableApps
start up PortableApps
Click Apps->Get more apps
2. download Winmerge_portable
3. download Notepad++ portable
4. download IrfanViewer portable

PortableApps will keep all your PR docs in a separate directory,
i.e. C:\PortableApps\Documents
so it doesn't get mixed in with the rest of your life.

EDIT: Pchat portable is a great IRC client if you want to idle in the PR IRC channels.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

No worries mate! I'll grab them :)

As for BF2 Code, I always cross-reference them with the original, but a stylesheet will help immensely!

And I use this as documentation: http://bfmods.com/mdt/Reference/index.html

As for going through code, and able to open 1,000's of documents at once, look here:
http://www.sevenforums.com/tutorials/13 ... ected.html

Windows 7 only allows 15 files to be opened at one time, and that can be changed in the registry. Though the higher you go, the more memory it takes, and sometimes can load things slowly. I've set mine to 2,000 and it loads without slowdowns.

You can also use a program called Everything, which instantly searches for files in a flash, so you can point it into a directory and type in '.con'
Last edited by Arab on 2014-07-23 15:07, edited 1 time in total.
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: [Fixing] Files with typos

Post by LITOralis.nMd »

I found the BF2 stylesheet for Notepad++ , was still on my dropbox

https://www.dropbox.com/s/nn8jf8p0fl60c37/BF2

start notepadd++,
File Menu->Language->Define your language->Import->browse to the download BF2.xml file,

Then open a BF2 file,
File Menu->Language->select bf2 at bottom of the menu.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

Thanks, really appreciated Litoralis!

I fixed the jets/heli debris hopping/bouncing glitch.

SU25a Original

Code: Select all

ObjectTemplate.geometry mec_jet_su25a
ObjectTemplate.setCollisionMesh mec_jet_su25a
ObjectTemplate.mapMaterial 0 Airplane 184
ObjectTemplate.mapMaterial 1 penetrable_glass 1006
ObjectTemplate.mapMaterial 2 Airplane 184
ObjectTemplate.mapMaterial 3 Wreck 60
ObjectTemplate.mapMaterial 4 Rubber 102
ObjectTemplate.mapMaterial 5 UNDEFINED 31
ObjectTemplate.mapMaterial 6 Rubber 102
ObjectTemplate.drag 0.0
ObjectTemplate.mass 7000
ObjectTemplate.inertiaModifier 0.4/0.4/0.1
ObjectTemplate.InertiaModifierForWreck 0.4/0.4/0.8
rem ObjectTemplate.gravityModifier 2
ObjectTemplate.floaterMod 0.8
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate pilot_cas_mp_ai
SU25a Modified

Code: Select all

ObjectTemplate.geometry mec_jet_su25a
ObjectTemplate.setCollisionMesh mec_jet_su25a
ObjectTemplate.mapMaterial 0 Airplane 184
ObjectTemplate.mapMaterial 1 penetrable_glass 1006
ObjectTemplate.mapMaterial 2 Airplane 184
ObjectTemplate.mapMaterial 3 Wreck 60
ObjectTemplate.mapMaterial 4 Rubber 102
[b]ObjectTemplate.mapMaterial 5 Rubber 102[/b] (Note: It was previously undefined, not sure about it)
ObjectTemplate.mapMaterial 6 Rubber 102
ObjectTemplate.drag [b]0.05[/b] (Bf2 value from Mig-44)
ObjectTemplate.mass [b]34000000[/b] (This adds weight. 35000000 makes it too heavy to lift off/is the max, also jet doesn't take ages to land, but haven't timed both yet)
ObjectTemplate.inertiaModifier [b]0.4/0.4/0.4[/b] (Bf2 value from Mig-44)
(I removed inertiaModifierWreck, which must've fixed it)
rem ObjectTemplate.gravityModifier 2
ObjectTemplate.floaterMod [b]0.8[/b] (Bf2 value)
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate pilot_cas_mp_ai
and now I'm off to bed :)
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Fixing] Files with typos

Post by Mats391 »

Arab wrote: And I use this as documentation: Battlefield Mod Development Tools Guide
This the documentation for bf1942 and bf vietnam. A lot of things stay true for bf2, but some dont. You can use this: https://www.realitymod.com/forum/f388-p ... mands.html
That however has only the commands, not the parameters explained and also is bf2 and bf2142 mixed together.
Arab wrote:
I fixed the jets/heli debris hopping/bouncing glitch.
The second parameter in mapMaterial is simply a name to make it easier to read, i think. Jets do currently explode instantly in air w/o wrecks. This is because wrecks fall stupidly slow to the ground which looks retarded. You can observe that when some chopper gets killed in high altitude. If you find a way to fix that it would be awesome, but if not you dont need to worry about jet wrecks.
mries
Posts: 475
Joined: 2013-06-30 16:16

Re: [Fixing] Files with typos

Post by mries »

Wow Arab, I have 0 knowledge about coding etc. but from what I read here, you fixed a lot and you are doing a lot, thats amazing! Keep up the good work
Image

Image
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [Fixing] Files with typos

Post by Arab »

[quote=""'[R-CON"]Mats391;2024613']
The second parameter in mapMaterial is simply a name to make it easier to read, i think. Jets do currently explode instantly in air w/o wrecks. This is because wrecks fall stupidly slow to the ground which looks retarded. You can observe that when some chopper gets killed in high altitude. If you find a way to fix that it would be awesome, but if not you dont need to worry about jet wrecks.[/quote]
ObjectTemplate.gravityModifier makes jet not fall slow anymore :) I set it to 1.5, but set it too high and the jet cannot take off. Same with mass. So if it's 1.5, the mass must be low as well.

I'll make a video of it and post it to show you the change

[quote="mries""]Wow Arab, I have 0 knowledge about coding etc. but from what I read here, you fixed a lot and you are doing a lot, thats amazing! Keep up the good work[/quote]
Thanks man, I appreciate that :)
Post Reply

Return to “PR:BF2 Community Modding”