I just explained that in my previous post...Swaffy wrote:I know how death bubbles work, silly. I was talking about what makes the barb wire fences damage soldiers.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.
Using barbedwire against vehicles?
-
- Posts: 617
- Joined: Mon Oct 01, 2012 3:13 pm
- Location: Canada
- Contact:
Re: Using barbedwire against vehicles?
See my Strasbourg map project here.
Re: Using barbedwire against vehicles?
My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?Classical Modder wrote:I just explained that in my previous post...
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
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Using barbedwire against vehicles?
I always thought it was deathbubbles to, but seems its a separate Obstacle Type instead.
http://bfmods.com/mdt/scripting/ObjectT ... tacle.html
http://bfmods.com/mdt/scripting/ObjectT ... tacle.html
Swaffy wrote:My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?Classical Modder wrote:I just explained that in my previous post...
See? Not there.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
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Using barbedwire against vehicles?
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)Swaffy wrote:My issue is ... where is the code for the death bubbles that the vanilla barb wire fences use?Classical Modder wrote:I just explained that in my previous post...
See? Not there.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
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
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.



I have cameras in your head!