Jump to content
Official BF Editor Forums
Sign in to follow this  
[SG:BFM-Dev]Hangman

Stoping A Vehicle From Being Repaired

Recommended Posts

Well I can't think of a command right now but you might try that:

Create a custom material for your non repairable vehicle and set the damage mod for repair material->your material to 0.0001

Not tested and I cannot verify that now ;)

Share this post


Link to post
Share on other sites

Wild guess, but:

- a wrench wants to repair a vehicle to full.

- a vehicle has a maximum HP which is used for this

- a vehicle also has a HP value when spawned.

Solution: set the maximum HP to 0, then it's HP can never be increased any further.

ObjectTemplate.armor.maxHitPoints 0
ObjectTemplate.armor.hitPoints 1000

Not tested, it could also crash the game. (divide by 0 error? hehe.)

Note: CanBeRepaired is not an Armor component member in my book, only CanbeRepairedAsWreck exists.

EDIT

Tested: instantly destroys the vehicle. (thus, the game tries to keep HitPoints < MaxHitpoints)

Edited by bergerkiller

Share this post


Link to post
Share on other sites

Wait, instantly instantly, or instantly as in one second?

I'd try the material thing. The wrench has "ObjectTemplate.ammo.abilityMaterial 84" so like Cassio said, set the damage mod of 84 vs. your vehicle's material to 0.0001.

Share this post


Link to post
Share on other sites

I think the col0 needs to be modified to carry that special material. Keep in mind that for damage from other projectiles than the wrench the material should mimic the damageMods from another armor material.

Share this post


Link to post
Share on other sites

I'm pretty sure this is what you're looking for; check out the material editor section:

http://www.bfeditor.org/forums/index.php?showtopic=3633

I remember using that tool before once, but it didn't really do what I needed. I think it does what it's supposed to though.

Anyway, once you have your material cloned and applied to your vehicle, open up common_server.zip/Material/MaterialManagerSettings.con in your mod and add (or replace) this:

MaterialManager.createCell X Y

MaterialManager.damageMod Z

where X is the repair material (should be 84), Y is your vehicle's material, and Z is how much damage X should do against Y (or repair in this case, so 0.0001 which is the closest you can get to zero).

I think that should work, but I haven't tried it.

EDIT: Tested it and it works. The guy still wrenches on it, but it doesn't repair (well it probably does, just so slowly that you would never notice). Apparently if you change the damageMod for 84 vs. any one of your vehicle's materials you will not be able to repair the vehicle from other materials (windows for instance).

How did this work in 1942? I remember some cars could only be repaired by wrenching on the front of them.

Edited by Chael

Share this post


Link to post
Share on other sites
How did this work in 1942? I remember some cars could only be repaired by wrenching on the front of them.
As far as i rememeber it was done in code ( s.th. like
ObjectTemplate.canBeRepaired 1/0

) .

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...