Page 1 of 2

Concept for destructable vehicle cosmetics

Posted: Sat Feb 22, 2014 3:42 am
by Vilespring
I remember reading somewhere about destructible child bundles, but the had the problem that bots die when one is destroyed, even though the piloted are is untouched. So, I slept on the idea, and I came up with a potential solution, well, for cosmetic damage, and I'm here for you guys to see if it would work.

So, my idea still uses the destructible bundles, but a PCO is added to the tank via spawner and held in place, and this PCO with no entrance has the cosmetic pieces to the vehicle, like side skirts, sandbags, etc.

it could actually be used to make ERA armor, now that I think about it.

what do you guys think? :D

Re: Concept for destructable vehicle cosmetics

Posted: Sat Feb 22, 2014 10:41 pm
by Swaffy
It would work well for a player using it client-side, but I'm not sure how well that would go on a server.

Re: Concept for destructable vehicle cosmetics

Posted: Sun Feb 23, 2014 1:33 am
by Vilespring
oh. I think client stress, all the time, I forget online. Well, that's good.

Re: Concept for destructable vehicle cosmetics

Posted: Sun Feb 23, 2014 9:43 am
by freddy
Vilespring wrote: for cosmetic damage
check this out viewtopic.php?f=43&t=49

Re: Concept for destructable vehicle cosmetics

Posted: Sun Feb 23, 2014 7:15 pm
by Vilespring
That's interesting. My idea was so that parts fly off depending on how they were hit, like if you hit the right side of the tiger, some of the track guards will fly off the right side.

I might combine both of these. I think that's pretty cool, the armor effect code, I might have to flay with it more. :)

Re: Concept for destructable vehicle cosmetics

Posted: Sun Feb 23, 2014 9:05 pm
by freddy
That would be nice! You can spawn things with the armoreffect so it cold be dropping stuff that way to i guess.

Apache did some funky modding in his heroes mod

Re: Concept for destructable vehicle cosmetics

Posted: Sun Feb 23, 2014 9:55 pm
by Vilespring
now how did he do that?!?! :lol:

Re: Concept for destructable vehicle cosmetics

Posted: Sun Mar 09, 2014 8:13 am
by Apache Thunder
That's the destructible child objects concept you mentioned in your first post. Basically what I did was just add armor code to the springs so they can take damage. But unfortunately the game can't differentiate the alive status of the host vehicle from the child object correctly, so if a child object gets destroyed it kills all the occupants of the vehicle (it does not matter if they are bots or human).

It was something I was about to add to my BFH'42 mod and that bug came up during single-player testing. The test video I did was done either alone on a local server or in a singleplayer map with the vehicle unoccupied. I didn't know about the bug at the time I made that video. :P

However you might be able to use this concept for other things like building doors/destructible walls on a building that is also destructible. The main thing for it to work correctly in multiplayer is that the child objects have to be PCOs (as if you were coding passenger positions).

As long as you never put entry point objects you don't have to worry about that bug. Actually it's a bad idea to ever allow players to actually occupy a destructible PCO position on a host PCO. If that child object gets destroyed while a player is using it, the game crashes. There's coding to stop players from switching to them though. I think some planes or boats use PCO ID codes to prevent seat switching to certain PCO positions.

Just note that armor effects on child objects most likely do not function. I don't recall armor effects on destructible child objects working in multiplayer.

Re: Concept for destructable vehicle cosmetics

Posted: Sun Mar 09, 2014 10:37 pm
by Swaffy
I have an AA variant of an M3 Halftrack and I put static objects around the side and back to act as supplemental armor. But they are static objects and so they cannot be damaged.

Have you tried to add a child PCO to the parent PCO? I guess that would cause collision mesh issues ...

Re: Concept for destructable vehicle cosmetics

Posted: Mon Mar 10, 2014 6:12 pm
by Apache Thunder
You will need to modify the material settings for the material IDs used by your static object child objects so that the projectiles you fire at them do damage to them. Much like with how multiple material IDs can be used on the same mesh, multiple objects with different material IDs can effect the damage projectiles do to the vehicle they are addTemplated to.

Since most materials IDs used on static objects aren't set up to take any damage at all from projectiles, using statics makes certain parts of your vehicle immune to damage. The best fix for that is to code all your projectiles to do some damage to those materials used by the static objects you added to the vehicle. (probably less then what the main vehicle materials do, so you can allow them to act as armor but not make the vehicle immune)

As for PCO's on PCO's, yes that can be done and has been done. The "passenger" positions on all vehicles are done via PCOs as child objects. Though normally, these child PCOs do not have armor turned on.