Using barbedwire against vehicles?

Ask questions, discuss ideas, get answers
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: Using barbedwire against vehicles?

Post by Diamondback »

Swaffy wrote:
Classical Modder wrote:Well, best way to do this is to make supply vehicles (Hanomag, HoHa) distribute negative health instead of positive health. This is the mechanism death bubbles use and it works well except for vehicles that get stuck in the death bubbles.

You can edit the faction(s) which are affected by the negative health, edit the radius of the death bubble, and edit how much health it takes away from the soldier or vehicle. It's quite neat actually.

Look at the supply depot objects (Hanomag, HoHa, medic locker, Air rep pads, land rep pads, etc) for the code.
I know how death bubbles work, silly. I was talking about what makes the barb wire fences damage soldiers.
I just explained that in my previous post...
See my Strasbourg map project here.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Using barbedwire against vehicles?

Post by Swaffy »

Classical Modder wrote:I just explained that in my previous post...
My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?

Code: Select all

ObjectTemplate.create Obstacle stebarbwire_m1
ObjectTemplate.geometry stebarbwire_m1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.addToCollisionGroup c_CGProjectiles
ObjectTemplate.aiTemplate stebarbwire_m1

ObjectTemplate.addtemplate e_Barbwire
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0
See? Not there.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Using barbedwire against vehicles?

Post by freddy »

I always thought it was deathbubbles to, but seems its a separate Obstacle Type instead.

http://bfmods.com/mdt/scripting/ObjectT ... tacle.html

Swaffy wrote:
Classical Modder wrote:I just explained that in my previous post...
My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?

Code: Select all

ObjectTemplate.create Obstacle stebarbwire_m1
ObjectTemplate.geometry stebarbwire_m1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.addToCollisionGroup c_CGProjectiles
ObjectTemplate.aiTemplate stebarbwire_m1

ObjectTemplate.addtemplate e_Barbwire
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0
See? Not there.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Using barbedwire against vehicles?

Post by Apache Thunder »

Swaffy wrote:
Classical Modder wrote:I just explained that in my previous post...
My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?

Code: Select all

ObjectTemplate.create Obstacle stebarbwire_m1
ObjectTemplate.geometry stebarbwire_m1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.addToCollisionGroup c_CGProjectiles
ObjectTemplate.aiTemplate stebarbwire_m1

ObjectTemplate.addtemplate e_Barbwire
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0
See? Not there.
Barbwire uses the "Obstacle" object class. There is no "death bubbles" in use by said objects. Obstacle is a special type of object that only has collision physics to soldiers and projectiles (though vanilla objects always have the c_CGProjectiles collision group added to prevent projectiles from hitting them. So yes, if you wanted to, you can allow projectiles to impact obstacle objects). Soldiers can still walk through obstacle objects (Thus they don't have complete collision physics like a normal solid object does). But their movement will be slowed. (this slowing of movement occurs even if damage is set to 0)

If you want to use an obstacle object as a death bubble for soldiers you can create a custom collision mesh for it and use this command. It's unused in the vanilla files. I have used it for the custom death boxes I put inside most of the buildings in my BFH'42 mod to prevent soldiers from glitching into the buildings:

Code: Select all

ObjectTemplate.damage 300
I'm not sure what the default value is. I think it may be 10 or close to that. The command was always left unspecified in the vanilla files. But you can add that command to customize how fast the object will kill soldiers.

The benefit of using obstacle objects over death bubbles for keeping soldiers away from things is that you can very accurately specify the area of coverage as their area of effect is defined by their collision mesh. So the damage occurs as soon as a soldier touches it's collision mesh. However unlike health depots rigged to become death bubbles, it's not team specific, so obstacles will always effect both teams indiscriminately. There is no way to have obstacles only impact one team's soldiers.

Also, as far as I'm aware, it is impossible to have vehicles interact with Obstacle objects. They are in their own special collision group that excludes them. There's no way to undo that.
ImageImageImage
I have cameras in your head!
Post Reply