[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

Re: [General] Arab's fixes and changes

Post by Arab »

[R-DEV]piepieonline wrote:Yes, in the ninja kit :P

Aside from that, I don't believe so? Why..?
Thought it was unused. Oh well

Updated front page, removed links, added 3d mine marker from other thread

Edit: Link is broken for 3d mine marker aargh :cussing:

I haven't seen this tutorial used, thought to share. It's gamelogic.novehiclesomit for gamelogicinit.con. Never used it, so don't know it's pro's and con's.

Code: Select all

[b]"Its not dependent on the map but on the mod. A mod supporting the 'noVehicles' option from servers should have the 'gameLogic.noVehicleOmit <vehicle>' statements in the gamelogicinit.con like this: 

gameLogic.noVehiclesOmit Ahe_ah1z
gameLogic.noVehiclesOmit Ahe_havoc
gameLogic.noVehiclesOmit Ahe_z10
gameLogic.noVehiclesOmit Air_f35b
gameLogic.noVehiclesOmit Air_j10
gameLogic.noVehiclesOmit Air_su30mkk
gameLogic.noVehiclesOmit Chthe_z8"
[/b]
Source: How Can I Make My Map Work With The "no Vehicles" Option? Battlefield 2 Editor Forum

My priority above all else is to now get the weapons animations fluid using fadein and fadeout. Rather than wasting time researching about weapon weights, I decided to use phale's ones:
0.2-0.3 for pistols, 0.3-0.4 for assault rifles, carbines, and SMGs, etc., and 0.5+ for machine guns, sniper rifles, rocket launchers, etc.

Reason being
1) It wastes time and it's frustrating to cross reference every weapon (I already made a list of all weapon weights in a .doc)

2) Easier to decide what weight feels normal for the weapon and class, like insurgents because insurgents can be from poor backgrounds, making their handling of the AK-47 different than compared to a trained soldier

3) Also good for contributes to use when they are designing new weapons, instead of wasting time looking for weapon weights.

Now, the better question. What advantages do I get from these fadein, fadeouts?
-Smooth Transition of firing, zoom in and zoom out when walking
-Running Animation is transitioned slowly, giving a more realistic effect of weapon weight simulation

As soon as I get started on it, I will upload it.
Last edited by Arab on 2014-10-19 04:43, edited 4 times in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

The debugger is amazing
Link

Warning: GameServer: failed to open arhive.md5 for (sbeneh_outskirts), content checking will not work

For Sbeneh Outskirts since I tried to load it. Means clientarchives.con is pointing to the wrong archive
Needs to change from this
fileManager.mountArchive Levels/sbeneh_outskirts/objects_client.zip Objects

Into this
fileManager.mountArchive Levels/sbeneh_outskirts/client.zip Objects

Not only Sbeneh has this issue, but there's maps that don't have clientarchives.con, and a fair lot of them that have refers to the wrong named zip
Last edited by Arab on 2014-10-20 11:50, edited 13 times in total.
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [General] Arab's fixes and changes

Post by Amok@ndy »

the client/serverarchives on sbeneh should simply get deleted as there are no more mapspecific objects inside the mapfolder so the archvies are out of need
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [General] Arab's fixes and changes

Post by Mineral »

Doesn't matter much though. It's not an issue if a zip is missing, it's a issue when a file is missing.

@Arab: client.zip/server.zip are automatically loaded in. server and client archives.con are only for extra zip's that need to be loaded. In this case, sbeneh stopped using the extra archives, but the .con's still exist. Not a real issue that can cause any harm.
Image
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

I'm now doing the animation tweaks (And nothing else).

As I was removing everything else that wasn't an '.inc' file I noticed one .baf file that doesn't have a name.

It's not used in the animationsystem3p.
It's called ".baf" in objects_weapons_server\weapons\handheld\ussalute\animations\3p

Also, I discovered the vnrif_nagantzf reload animation doesn't end when you prone and get up from prone. It continues!

What it means is that when you reload, and you go to the prone position, the reload continues to play!.

Now seeing what code does that effect for the Mat 49

Edit: How you do it [W.I.P]

1. Make two copies of the reload .bak file, and call it reload2, reload3
2. In your animationsystem1p.inc, copy the bold text and rename the weapon name to suit your replaced weapon.

Code: Select all

animationSystem.cameraSpring.use 1
animationSystem.cameraSpring.amplitude 0.03/0.02/0.03
animationSystem.cameraSpring.zoomDamping 2/3/4
animationSystem.cameraSpring.stiffness 10/10/10
animationSystem.cameraSpring.move 2/2/2
animationSystem.cameraSpring.look 1/1
animationSystem.cameraSpring.fire 0/0/20

rem *** Animations ***
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_deploy.baf
animationManager.looping 0
animationManager.length 2.6
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_fire.baf
animationManager.looping 0
[b]animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_Mat49_reload.baf
animationManager.looping 0
animationManager.length 6.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload2.baf
animationManager.length 6.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload3.baf
animationManager.length 6.8[/b]
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_run.baf
animationManager.length 0.666667
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_sprint.baf
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_stand.baf
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_tozoom.baf
animationManager.looping 0
animationManager.length 0.4
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_fire.baf
animationManager.looping 0
animationManager.length 0.333333
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_run.baf
animationManager.length 1.83333
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_stand.baf

animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_run_prone.baf
animationManager.length 0.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_toprone.baf
animationManager.length 1
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_toprone_rev.baf
animationManager.length 1.2

rem *** Bundles ***
animationSystem.createBundle deploy
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0.42
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_deploy.baf

animationSystem.createBundle fire
animationBundle.isLooping 0
animationBundle.abruptPlayback 1
animationBundle.fadeInTime 0.001
animationBundle.fadeOutTime 0.42
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_fire.baf

[b]animationSystem.createBundle reload
animationBundle.isLooping 0
animationBundle.fadeInTime 0.2
animationBundle.fadeOutTime 0.2
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload3.baf
animationBundle.setAnimationStartTime Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload3.baf 3.95
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload2.baf
animationBundle.setAnimationStartTime Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload2.baf 2.2
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload.baf
animationBundle.addEvent effect:0
animationBundle.setEventStartTime effect:0 0.712

animationSystem.createBundle reload_2
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload2.baf

animationSystem.createBundle reload_3
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload3.baf[/b]
Last edited by Arab on 2014-10-26 12:09, edited 11 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [General] Arab's fixes and changes

Post by Mats391 »

Arab wrote:I'm now doing the animation tweaks (And nothing else).

As I was removing everything else that wasn't an '.inc' file I noticed one .baf file that doesn't have a name.

It's not used in the animationsystem3p.
It's called ".baf" in objects_weapons_server\weapons\handheld\ussalute\animations\3p

Also, I discovered the vnrif_nagantzf reload animation doesn't end when you prone and get up from prone. It continues!

What it means is that when you reload, and you go to the prone position, the reload continues to play!.

Now seeing what code does that effect for the Mat 49

Edit: How you do it [W.I.P]

1. Make two copies of the reload .bak file, and call it reload2, reload3
2. In your animationsystem1p.inc, copy the bold text and rename the weapon name to suit your replaced weapon.

Code: Select all

animationSystem.cameraSpring.use 1
animationSystem.cameraSpring.amplitude 0.03/0.02/0.03
animationSystem.cameraSpring.zoomDamping 2/3/4
animationSystem.cameraSpring.stiffness 10/10/10
animationSystem.cameraSpring.move 2/2/2
animationSystem.cameraSpring.look 1/1
animationSystem.cameraSpring.fire 0/0/20

rem *** Animations ***
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_deploy.baf
animationManager.looping 0
animationManager.length 2.6
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_fire.baf
animationManager.looping 0
[b]animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_Mat49_reload.baf
animationManager.looping 0
animationManager.length 6.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload2.baf
animationManager.length 6.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload3.baf
animationManager.length 6.8[/b]
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_run.baf
animationManager.length 0.666667
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_sprint.baf
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_stand.baf
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_tozoom.baf
animationManager.looping 0
animationManager.length 0.4
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_fire.baf
animationManager.looping 0
animationManager.length 0.333333
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_run.baf
animationManager.length 1.83333
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_zoom_stand.baf

animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_run_prone.baf
animationManager.length 0.8
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_toprone.baf
animationManager.length 1
animationSystem.createAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_toprone_rev.baf
animationManager.length 1.2

rem *** Bundles ***
animationSystem.createBundle deploy
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0.42
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_deploy.baf

animationSystem.createBundle fire
animationBundle.isLooping 0
animationBundle.abruptPlayback 1
animationBundle.fadeInTime 0.001
animationBundle.fadeOutTime 0.42
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/Animations/1p/1p_mat49_fire.baf

[b]animationSystem.createBundle reload
animationBundle.isLooping 0
animationBundle.fadeInTime 0.2
animationBundle.fadeOutTime 0.2
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload3.baf
animationBundle.setAnimationStartTime Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload3.baf 3.95
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload2.baf
animationBundle.setAnimationStartTime Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload2.baf 2.2
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_mat49_reload.baf
animationBundle.addEvent effect:0
animationBundle.setEventStartTime effect:0 0.712

animationSystem.createBundle reload_2
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload2.baf

animationSystem.createBundle reload_3
animationBundle.isLooping 0
animationBundle.fadeInTime 0
animationBundle.fadeOutTime 0
animationBundle.addAnimation Objects/Weapons/Handheld/vnrif_mat49/animations/1p/1p_Mat49_reload3.baf[/b]
You mean you fixed the bug that cancels reload animation when going prone, but still keep the to-prone animations?
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

[R-CON]Mats391 wrote:You mean you fixed the bug that cancels reload animation when going prone, but still keep the to-prone animations?
Yeah. But I don't think it's practical because you have to get the value right otherwise the weapon will be replaying the reloading animation twice.

Forgot, you add this to the .tweak:
ObjectTemplate.ammo.reloadAmount 1
ObjectTemplate.ammo.firstShotExtraTime <- Value is the start of the reload in seconds
ObjectTemplate.ammo.lastShotExtraTime <- Value is the end of the reload in seconds

I'm still testing it, and studying it but it's a start.

If I can't get it, as you said in the past, it doesn't matter.
Last edited by Arab on 2014-10-26 13:07, edited 2 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [General] Arab's fixes and changes

Post by Mats391 »

Well if it works, we surely can find someone (you :p ) that does it.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

[R-CON]Mats391 wrote:Well if it works, we surely can find someone (you :p ) that does it.
Nope, doesn't work :( I remember exactly I asked this question, and you and [R-DEV]Rhino answered it and he said he did it for the Mosin Nagant Scoped version by I think splitting the reload animation into chunks, have the system load the 2nd and 3rd part of the animation, and load them in together with the .tweak. I don't fully understand it, and it looks complicated to do.

If there could be some way to do it through python, I think it would be simple but I don't know python.

So I'm leaving this out and just continue making the animations fluid.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

For the explosive not exploding bug, adding this to the geometry section will allow it to explode all of the time.

The bug https://www.realitymod.com/forum/f26-pr ... plode.html

This not only affects grenades, but any explosives as I've played an unmodified repo while deploying c4_small and it didn't explode too, and this code which was present in vbf2 for some reason isn't for PR.

So doing this for all c4, tripmines, grenades will make it explode 100% of the time.

Seems like Dice had this problem with their earlier builds of BF2 where the same bug happens, and this is the fix.

Code: Select all

rem This code, for reference, is found under ---BeginComp:ThrownAnimationComp ---
ObjectTemplate.createComponent ThrownAnimationComp
rem ---EndComp ---. Don't add this to the code, just for reference
ObjectTemplate.setCollisionMesh [b]yourweapon[/b]
ObjectTemplate.mapMaterial 0 Collision_Material 46
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
This one above is for grenades.
For C4, you compare c4_explosives.tweak from bf2 objects_server.zip to pr objects_weapons_server c4_large.tweak etc and copy the coding in to pr's weapons, and do the same for idx4 etc.

Also, don't know why these ones aren't present.

Example is for the vbf2 m67 grenade

Code: Select all

 
rem -------------------------------------
ObjectTemplate.addTemplate S_ushgr_m67_Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/2.8/0/0
ObjectTemplate.material 46
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.localPredictOnClient 1

[b]ObjectTemplate.minDamage 0.2[/b]
ObjectTemplate.damage 0
[b]ObjectTemplate.damageOwner 1[/b]
ObjectTemplate.minDamage x is the multiplier to set the minimum damage the projectile can cause due to distance. So that means that a grenade that is far away from you causes less damage than when you get closer. 1.0 is the value when the range doesn't affect the result.

ObjectTemplate.damageOwner means the projectile will/will not hurt the firer or firer vehicle, depending on 1: Yes it will hurt, or 0: No it won't

ObjectTemplate.minDamage 0.2 info
MDT - ObjectTemplate - Properties - MinDamage

So here's the comparisons for the F1 Grenade codes, both pr and pr_repo:
OLD: In red

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2005/3/22 17:49]
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe GenericFireArm f1grenade
ObjectTemplate.creator TLO-1:tlo
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.cullRadiusScale 10
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\f1grenade.tga
ObjectTemplate.weaponHud.specialAbilityIcon Ingame\Weapons\Icons\Hud\SpecialKitIcons\handgrenade.tga
ObjectTemplate.weaponHud.hudName "killed"
ObjectTemplate.weaponHud.guiIndex 3510
ObjectTemplate.weaponHud.altGuiIndex 3500
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.disableOnSprint 0
rem ---EndComp ---
rem ---BeginComp:ThrownFireComp ---
ObjectTemplate.createComponent ThrownFireComp
ObjectTemplate.fire.fireLaunchDelay 0.3
ObjectTemplate.fire.altFireInput PIAltFire
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.projectileStartPosition 0/0/0.2
ObjectTemplate.fire.fireLaunchDelaySoft 0.5
ObjectTemplate.fire.showWeaponAfterReloadDelay 0.1
ObjectTemplate.fire.pullBackTime 1
ObjectTemplate.fire.projectileStartRotation 0/0/60
ObjectTemplate.fire.randomRotationSpeed 9
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 2
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 2.25
ObjectTemplate.ammo.minimumTimeUntilReload 0.5
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.instantReloadOnEnable 1
ObjectTemplate.ammo.toggleWhenNoAmmo 1
ObjectTemplate.ammo.magLinkWeapon insgr_hgr_trap
rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp ---
include ../../common/deviation.con "handprojectile" "grenade"
rem ---EndComp ---
rem ---BeginComp :D efaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
ObjectTemplate.sound.noisy 0
rem ---EndComp ---
rem ---BeginComp:ThrownAnimationComp ---
ObjectTemplate.createComponent ThrownAnimationComp
rem ---EndComp ---
[b][color=Red]ObjectTemplate.geometry f1grenade
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.aiTemplate grenade_ai[/color][/b]
rem -------------------------------------
ObjectTemplate.addTemplate S_f1grenade_Fire1P
ObjectTemplate.addTemplate S_f1grenade_Fire1P_Outdoor
ObjectTemplate.addTemplate S_f1grenade_Fire3P
ObjectTemplate.addTemplate S_f1grenade_BoltClick
ObjectTemplate.addTemplate S_f1grenade_TriggerClick
ObjectTemplate.addTemplate S_f1grenade_SwitchFireRate
ObjectTemplate.addTemplate S_f1grenade_Reload1P
ObjectTemplate.addTemplate S_f1grenade_Reload3P
ObjectTemplate.addTemplate S_f1grenade_Deploy1P
ObjectTemplate.addTemplate S_f1grenade_Deploy3P
ObjectTemplate.addTemplate S_f1grenade_Zoom
ObjectTemplate.addTemplate e_grenade_spooneject
ObjectTemplate.addTemplate e_grenade_from_prone
ObjectTemplate.addTemplate e_grenade_prone
rem -------------------------------------
ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/f1grenade/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/ushgr_m67/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate f1grenade_Projectile
ObjectTemplate.keepProjectiles 30
ObjectTemplate.velocity 20
ObjectTemplate.itemIndex 5
ObjectTemplate.delayToUse 2.25

GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.create GenericProjectile f1grenade_Projectile
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.createNotInGrid 1
ObjectTemplate.createdInEditor 1
rem ---BeginComp :D efaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
ObjectTemplate.collision.bouncing 1
rem ---EndComp ---
rem ---BeginComp :D efaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 3069
ObjectTemplate.detonation.explosionRadius 18
ObjectTemplate.detonation.explosionForce 8
ObjectTemplate.detonation.explosionDamage 115
ObjectTemplate.detonation.detonateOnWaterCollision 0
ObjectTemplate.detonation.endEffectTemplate e_exp_grenade
ObjectTemplate.detonation.useMMOnEndEffect 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
rem ---EndComp ---
ObjectTemplate.geometry f1grenade_projectile
ObjectTemplate.setCollisionMesh f1grenade
ObjectTemplate.mapMaterial 0 Collision_Material 46
ObjectTemplate.mass 2
ObjectTemplate.floaterMod 0
ObjectTemplate.centerOfCollisionOffset 0/-0.05/0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType RotationalPoint
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 46
rem -------------------------------------
ObjectTemplate.addTemplate S_f1grenade_Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/3.8/0/0
ObjectTemplate.material 46
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.localPredictOnClient 1
ObjectTemplate.damage 0

ObjectTemplate.activeSafe Sound S_f1grenade_Fire1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.44
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.901/1/

ObjectTemplate.activeSafe Sound S_f1grenade_Fire1P_Outdoor
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.44
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.901/1/

ObjectTemplate.activeSafe Sound S_f1grenade_Fire3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin_3p.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small_3p.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.42
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 4

ObjectTemplate.activeSafe Sound S_f1grenade_BoltClick
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_TriggerClick
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_SwitchFireRate
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_Reload1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.28
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_f1grenade_Reload3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_f1grenade_Deploy1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.28
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_f1grenade_Deploy3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_f1grenade_Zoom
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_Projectile_Looping
ObjectTemplate.modifiedByUser nfe

NEW: In blue

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2005/3/22 17:49]
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe GenericFireArm f1grenade
ObjectTemplate.creator TLO-1:tlo
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.cullRadiusScale 10
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\f1grenade.tga
ObjectTemplate.weaponHud.specialAbilityIcon Ingame\Weapons\Icons\Hud\SpecialKitIcons\handgrenade.tga
ObjectTemplate.weaponHud.hudName "killed"
ObjectTemplate.weaponHud.guiIndex 3510
ObjectTemplate.weaponHud.altGuiIndex 3500
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.disableOnSprint 0
rem ---EndComp ---
rem ---BeginComp:ThrownFireComp ---
ObjectTemplate.createComponent ThrownFireComp
ObjectTemplate.fire.fireLaunchDelay 0.3
ObjectTemplate.fire.altFireInput PIAltFire
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.projectileStartPosition 0/0/0.2
ObjectTemplate.fire.fireLaunchDelaySoft 0.5
ObjectTemplate.fire.showWeaponAfterReloadDelay 0.1
ObjectTemplate.fire.pullBackTime 1
ObjectTemplate.fire.projectileStartRotation 0/0/60
ObjectTemplate.fire.randomRotationSpeed 9
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 2
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 2.25
ObjectTemplate.ammo.minimumTimeUntilReload 0.5
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.instantReloadOnEnable 1
ObjectTemplate.ammo.toggleWhenNoAmmo 1
ObjectTemplate.ammo.magLinkWeapon insgr_hgr_trap
rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp ---
include ../../common/deviation.con "handprojectile" "grenade"
rem ---EndComp ---
rem ---BeginComp :D efaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
ObjectTemplate.sound.noisy 0
rem ---EndComp ---
rem ---BeginComp:ThrownAnimationComp ---
ObjectTemplate.createComponent ThrownAnimationComp
rem ---EndComp ---
ObjectTemplate.geometry f1grenade
[color=RoyalBlue][b]ObjectTemplate.setCollisionMesh f1grenade[/b]
[b]ObjectTemplate.mapMaterial 0 Collision_Material 46[/b][/color]
[color=RoyalBlue][b]ObjectTemplate.floaterMod 0[/b][/color]
ObjectTemplate.hasMobilePhysics 0
[color=RoyalBlue][b]ObjectTemplate.hasCollisionPhysics 1[/b]
[b]ObjectTemplate.physicsType Mesh[/b][/color]
ObjectTemplate.aiTemplate grenade_ai
rem -------------------------------------
ObjectTemplate.addTemplate S_f1grenade_Fire1P
ObjectTemplate.addTemplate S_f1grenade_Fire1P_Outdoor
ObjectTemplate.addTemplate S_f1grenade_Fire3P
ObjectTemplate.addTemplate S_f1grenade_BoltClick
ObjectTemplate.addTemplate S_f1grenade_TriggerClick
ObjectTemplate.addTemplate S_f1grenade_SwitchFireRate
ObjectTemplate.addTemplate S_f1grenade_Reload1P
ObjectTemplate.addTemplate S_f1grenade_Reload3P
ObjectTemplate.addTemplate S_f1grenade_Deploy1P
ObjectTemplate.addTemplate S_f1grenade_Deploy3P
ObjectTemplate.addTemplate S_f1grenade_Zoom
ObjectTemplate.addTemplate e_grenade_spooneject
ObjectTemplate.addTemplate e_grenade_from_prone
ObjectTemplate.addTemplate e_grenade_prone
rem -------------------------------------
ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/f1grenade/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/ushgr_m67/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate f1grenade_Projectile
ObjectTemplate.keepProjectiles 30
ObjectTemplate.velocity 20
ObjectTemplate.itemIndex 5
ObjectTemplate.delayToUse 2.25

GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.create GenericProjectile f1grenade_Projectile
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.createNotInGrid 1
ObjectTemplate.createdInEditor 1
rem ---BeginComp :D efaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
ObjectTemplate.collision.bouncing 1
rem ---EndComp ---
rem ---BeginComp :D efaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 3069
ObjectTemplate.detonation.explosionRadius 18
ObjectTemplate.detonation.explosionForce 8
ObjectTemplate.detonation.explosionDamage 115
ObjectTemplate.detonation.detonateOnWaterCollision 0
ObjectTemplate.detonation.endEffectTemplate e_exp_grenade
ObjectTemplate.detonation.useMMOnEndEffect 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
rem ---EndComp ---
ObjectTemplate.geometry f1grenade_projectile
ObjectTemplate.setCollisionMesh f1grenade
ObjectTemplate.mapMaterial 0 Collision_Material 46
ObjectTemplate.mass 2
ObjectTemplate.floaterMod 0
ObjectTemplate.centerOfCollisionOffset 0/-0.05/0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType RotationalPoint
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 46
rem -------------------------------------
ObjectTemplate.addTemplate S_f1grenade_Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/3.8/0/0
ObjectTemplate.material 46
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.localPredictOnClient 1
rem ObjectTemplate.minDamage 0.2
ObjectTemplate.damage 0
ObjectTemplate.damageOwner 1

ObjectTemplate.activeSafe Sound S_f1grenade_Fire1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.44
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.901/1/

ObjectTemplate.activeSafe Sound S_f1grenade_Fire1P_Outdoor
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.44
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.901/1/

ObjectTemplate.activeSafe Sound S_f1grenade_Fire3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_throw_complete.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_pin_3p.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_small_3p.wav,objects/weapons/handheld/ushgr_m67/sounds/m67_throw_big_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.42
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 4

ObjectTemplate.activeSafe Sound S_f1grenade_BoltClick
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_TriggerClick
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_SwitchFireRate
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_Reload1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.28
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_f1grenade_Reload3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_f1grenade_Deploy1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.28
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_f1grenade_Deploy3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/ushgr_m67/sounds/m67_deploy_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 1.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_f1grenade_Zoom
ObjectTemplate.modifiedByUser nfe

ObjectTemplate.activeSafe Sound S_f1grenade_Projectile_Looping
ObjectTemplate.modifiedByUser nfe
Last edited by Arab on 2014-11-01 23:30, edited 14 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [General] Arab's fixes and changes

Post by Mats391 »

Would be awesome if that fixed the explosion issue, but got some questions.
How did you reproduce the no-explosion but? Afaik it only happens with lots of players around or has it some other cause?
You only added a collmesh to the weapon, not the projectile/grenade?

minDamage and damageOwner are also not required. They only apply to projectiles that deal damage on impact, not explosions. Explosions have this built in by default. The damage falls of linear to the edge of the explosion radius.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

[R-CON]Mats391 wrote:Would be awesome if that fixed the explosion issue, but got some questions.
How did you reproduce the no-explosion but? Afaik it only happens with lots of players around or has it some other cause?
You only added a collmesh to the weapon, not the projectile/grenade?

minDamage and damageOwner are also not required. They only apply to projectiles that deal damage on impact, not explosions. Explosions have this built in by default. The damage falls of linear to the edge of the explosion radius.
Well, by luck I tested it on Ramiel with a c4, and it didn't explode. This is on local, no bots.

The collmesh wasn't present, so thought I'd add it.

Interestingly, adding minDamage and damageOwner made the suicide death from grenade points to -16 on the edited version, rather than the -8 on the unedited one.

Edit: Unless I forgot I suicided twice :/ Tested it again and it seems I forgot I died twice, meaning it's -8 per death so it's -16
Last edited by Arab on 2014-11-01 10:40, edited 2 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [General] Arab's fixes and changes

Post by Mats391 »

Did you try the C4 again on ramiel w/o the fix? It seems rather random reason and c4 usually tended to work.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

[R-CON]Mats391 wrote:Did you try the C4 again on ramiel w/o the fix? It seems rather random reason and c4 usually tended to work.
Yes it fixes it :) But I'll do a test by firing it 40 times, on local with bots. And you are right, c4 does work but there's the odd bug that makes it not work from time to time because of the collision meshes not present. And it happens on hilly areas too I notice. Changing the collision mesh at the 2nd part from Mesh to Point below the penetrategroup I think is the correct code.

Tutorial: How to fix C4 bug (and other explosives) not exploding at random times
Requirements:

I highly recommend you modify all c4 files with this fix
-WinMerge
-Notepad++ (Easiest to use, better than notepad) association with .tweak and .con files
-PR: objects_server_weapons.zip -> handheld -> c4_whatever opened -> .tweak
-BF2: objects_server.zip -> handheld -> c4_explosive opened -> .tweak

Basically, the type of explosive you want to fix is the matching vanilla file you want to compare it to. Like grenade with grenades etc.

1. Open up Winmerge
Image
2. Select the archive of objects_weapons_server.zip, find the .tweak file, and drag it by holding the mouse and alt-tab in the Winmerge section, or you can simply drag it into the WinMerge icon on the taskbar.
Drag the file in WinMerge. It should look like this:
Image
This sets it so that the pr mod file is on the left
3. Do the same for the other archive of c4_explosive.tweak, but this time aim it at the box below, like this:
Image
and press OK
This means the original vbf2 file is at the right
4. Now, what we want to replace are these files highlighted in blue only, so that it can be merged to the left:
Image

This brings back the collision meshes, which is important in my opinion. We aren't done yet though.
5. We go scroll down until we see this section, and in blue is where we change to the left.
Image

6. Copy the left code, open the .tweak file inside the objects_weapons_server.zip file and paste it in.

7. With the top 1 code paragraphs you just did, copy them from the updated .tweak, leave it open, go to the idx6.tweak, idx7, q4 etc and update the top code sections with it and repeat for all the other .tweak that doesn't have that code update.

Save and test! Although I do not know what idx6 and 7 does, I think by memory, these are the distance sound files, but for some reason the collision mesh code is repeated in these files but not the other section. So either they meant to be there or they are not. I'll test it and keep an update.

Also, here's the help files from BF2Editor folder that has command descriptions for all modders:
Help Files from BF2Editor Folder
Last edited by Arab on 2014-11-02 02:12, edited 14 times in total.
Reason: updating post
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

In objects_weapons_server, I found mapmaterials with 0 06_-_Default 31 etc

1. ObjectTemplate.activeSafe SimpleObject mec_ahe_mi24_nose_cap
ObjectTemplate.creator EDMUNDFOVARGUE:Edmund_Fovargue
ObjectTemplate.modifiedByUser "Edmund Fovargue"
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.cullRadiusScale 25
ObjectTemplate.geometry mec_ahe_mi24_nose_cap
ObjectTemplate.setCollisionMesh ru_ahe_mi24_nose_cap
ObjectTemplate.mapMaterial 0 06_-_Default 31

2. ObjectTemplate.geometry us_jep_hmmwv_crowsmg
ObjectTemplate.setCollisionMesh us_jep_hmmwv_crowsmg
ObjectTemplate.mapMaterial 0 07_-_Default 26
ObjectTemplate.mapMaterial 1 09_-_Default 26
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh

3. ObjectTemplate.geometry ru_ahe_mi24_nose_cap
ObjectTemplate.setCollisionMesh ru_ahe_mi24_nose_cap
ObjectTemplate.mapMaterial 0 06_-_Default 31
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh

4. ObjectTemplate.geometry us_jep_hmmwv_crowsmg
ObjectTemplate.setCollisionMesh us_jep_hmmwv_crowsmg
ObjectTemplate.mapMaterial 0 07_-_Default 26
ObjectTemplate.mapMaterial 1 09_-_Default 26
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh

5. ObjectTemplate.geometry us_jep_hmmwv_uparmored_crowsmg
ObjectTemplate.setCollisionMesh us_jep_hmmwv_uparmored_crowsmg
ObjectTemplate.mapMaterial 0 07_-_Default 26
ObjectTemplate.mapMaterial 1 09_-_Default 26

Are these ok?

All I did to find these was simply get all the .tweak through windows search, place it into a folder on desktop, fired up command prompt, go to the folder directory, typed in "copy *.tweak all.txt" and then opened it up with notepad++
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [General] Arab's fixes and changes

Post by Mats391 »

Will give the explosion thing a try. Cant hurt.

The materials should be fine. As already said before the second parameter in mapMaterial is just the name and only for the coder. Since the name only includes valid characters, everything is fine.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

Hey guys.

In usrif_m16a4ugl, animationsystem1p

Code: Select all

animationBundle.addAnimation 
Objects/Weapons/Handheld/usrif_m4ugl/Animations/1p/1p_m4ugl_zoom_run.baf
[b]Objects/Weapons/Handheld/usrif_m4ugl/Animations/1p/1p_m4ugl_zoom_run.baf[/b]
Would the duplicate animation increase the chance of any server getting confused/overwhelmed and crashing?

I know the other ones are codes that causes crashes, like in vehicles, weapons, python.
Probably not.

I will someday, to be honest look through and find duplicates, not manually as it really is annoying and we are human. Hair pulling stuff, so I'll use the search + a duplicate finder and then yeah.

I think with +dedicated you can run the debugger on a server. In the next version of the PR_Launcher, he should include all of the usual bf2 commands in the next launcher.
Last edited by Arab on 2014-11-06 10:02, edited 1 time in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

One thing that annoyed me was not being able to pick up ieds and stuff.

So I looked at the code, and ObjectTemplate.canPickup 1 is rem ObjectTemplate.canPickup 1

So upon unblocking it, I tested it.
I set the ied and I can use the wrench to pick it up, no problem. Of-course, when you switch to the same ied, it shows the remote. You just left or right click it.

Also, c4_large, c4_slam? <-- have no clue what this is, c4_small doesnt need the detonator object because since 1.0 it's not used.
Last edited by Arab on 2014-11-08 10:51, edited 3 times in total.
DonDOOM
Posts: 819
Joined: 2007-02-10 11:42

Re: [General] Arab's fixes and changes

Post by DonDOOM »

The "slam" is a redundant explosive device that used to be in PR. The code is probably still around for some reason.
Image
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [General] Arab's fixes and changes

Post by Arab »

I'll delete slam, and if it's still used, it will show an error message.

SettingsManager.U32Set GSPerfLogAtPlayerCount 100 for Usersettings.con in mods/pr/settings
from this link:

The default value is 30, so I changed it to 100. Maybe it will fix auto-deploy because the max number of players is 100.

From my understanding, SettingManager.U32Set GSPerfLogAtPlayerCount 100 allows the max number of player the server you play on can support. Even though this code isn't really needed because obviously people can play on 100 player servers, I think this code could be used as a fix for auto-deploy. The 100 value is a max value of the servers.

And also, there's a typo. SettingsManager.boolSet GSClPunkBuster 1 has a dot next to it.
Last edited by Arab on 2014-11-12 08:58, edited 11 times in total.
Post Reply

Return to “PR:BF2 Community Modding”