Using animated mesh to allow custom vehicle colour?

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Using animated mesh to allow custom vehicle colour?

Post by fo0k »

I have never played with animated meshes..

I was thinking maybe it's possible to use a couple of keys (say the mouse buttons) to 'animate' a skin on a vehicle.. all this would be is a large, long texture fading through all the colours of the rainbow.. then this would be applied to the body of the car.. bascially just mapped in planar. then you would use the mouse button to scroll the texture across the car until you find the colour or mix of colours that you like..

I guess this is possible somehow?


*apologies if all of these letter u's are hurting the eyes of you guys over the pond. don't judge me on my colour.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Using animated mesh to allow custom vehicle colour?

Post by Apache Thunder »

No unfortunately. It appears that animation states can't be changed via controls like with soldier animations. The game seems hard-coded for only soldiers to change animation states.

However, you can try coding it like tank tracks though. You will need to have a normal non animated mesh as an invisible "placeholder" mesh for flight/drag physics as animated meshes don't work as the primary mesh on a vehicle for flight/drag physics. For the "track" mesh which would be your hull, you should have at least two two bones in your rig. One in the back and one in the front. They should be named in the same manner as the tank track bones. (bone0, bone1 for example) Normally springs are used on track bones, but rotational bundles might also work. As long as they don't have collision physics or allowed to "move" in anyway, the mesh will remain stationary and only the texture would animate. Also note that the order that you addtemplat things to the track bundle is important. If you get it backwards, then your car will get twisted up with the front end attaching to the rear bone instead of the front one and visa versa for the rear bone. Child objects that aren't set to use a bone will not affect the order.

You need to also make sure the UVMap/texture is oriented correctly as well as it only works in one direction. (check existing track textures as a guideline)
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Using animated mesh to allow custom vehicle colour?

Post by fo0k »

Thx. I should have mentioned that the tracks texture was what prompted the thought. Will see how far I get on this.
Endless
Posts: 20
Joined: Tue Nov 17, 2009 12:36 pm

Re: Using animated mesh to allow custom vehicle colour?

Post by Endless »

how about you create a few different coloured 'hulls' for the cars, and let them 'float' really high above your car..
when you click/fire.. the main mesh of your car switches position with one of the body meshes floating in the air

Image

actually, now i think about it, i think the tank tracks things are easier.. or.. hmm
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Using animated mesh to allow custom vehicle colour?

Post by Apache Thunder »

Just got an idea. You can try using a firearm that uses the visible dummy projectile system? The firearm would have unlimited ammo and the dummy projectile (refer to AH64/similar vehicles that use dummy projectiles as a guideline) would be a object that has the car meshes addtemplated to it via random geometry code. Be sure to keep the collision mesh part of the main vehicle and only have the visible mesh as the dummy projectile object to ensure that the damage system for the car behave correctly. ;) (oh and the shadow mesh should stay with the main vehicle too)

This way, every time you fire the weapon it would reload instantly making the mesh disappear (but for a time not visible to the human eye if the weapon reload time is instant) and thus making the object refresh with a different mesh via random geometry code.

When I say "dummy projectile", I mean something like this:

Code: Select all

ObjectTemplate.visibleDummyProjectileTemplate YourVisibleCarMeshObject
Perhaps this would be easier then the tank track system?
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Using animated mesh to allow custom vehicle colour?

Post by fo0k »

Yes!

Endless was almost on the money but this variation is how to do it me thinks!

You have been awarded a ytmnd!

http://apatchwork.ytmnd.com/
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Using animated mesh to allow custom vehicle colour?

Post by Apache Thunder »

lol very nice. Thanks :D
ImageImageImage
I have cameras in your head!
Post Reply