Animated flags

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Animated flags

Post by Zip »

I'm not sure whether this should be in here or scripts......

Is it possible to make a flag that flutters in the wind?
Zip :?
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

The way EA has done it is by models.

Im sure this could be done also by a shader with your custom texture.

Something like this:

Code: Select all

textures/yourfoldername/yourtexturename
{
      	qer_keyword flag
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	cull none
	nomipmaps
	nopicmip
	deformVertexes flap t 60 sin 0 1.5 0	0.1 1 0
	deformVertexes flap t 60 sin 0 1.5 0.20 0.2 1 0

	{
		map textures/yourfoldername/yourtexturename.tga
		depthWrite
		alphaFunc GE128
	nextbundle
		map $lightmap
	}
}
Modify the deformVertexes line values in the shader to produce the effect you want. May also work better with a path mesh then a brush since I have tried this with brushes and it loses the effect.

If you want the same effect as the models in mohaa you may want to see what shader info it has :)
Image
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post by Zip »

I knew I should have kept my mouth shut, that sounds a bit to hard for me at the moment. I need to learn more stuff before I attempt that by the sounds of it. Thanks though :)

Does anyone have an example of one, or better still have a British flag already made I can, erm, steal :? ?
Zip :?
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

E-mail me the texture and Ill make a test map for you so you can see the shader at work :)

Gendeath@planetmedalofhonor.com
Image
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

Heres a test map of the shader at work...needs alittle work but I think you get the idea:

testflag.zip

Check you mail also Zip :)
Image
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post by Zip »

That was very kind of you, thanks :)

I think I want it wobble more, can I use 'pakscape' to find the script and edit it or shall i make a new script called testflag.scr?
Zip :?
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

yes or simply use winzip also :)

You can edit the script without having to recompile also to see the effects :)

Ill have to look and find what each value controls...
Image
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

General Death wrote:Ill have to look and find what each value controls...

Code: Select all

Here are the explanations for the deform values: 

EXPLANATION 

flap___s|t___div___function___base___amplitude___.phase__frequency___optionalmin__optionalmax 

flap____t____128______sin_______0________4_______.25_______.25 __________1 __________0_____ 
Image
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post by Zip »

Thanks General :D
Zip :?
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post by General Death »

I got your e-mails and ill answer them Sunday :)
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

look at a nazi flag which explains it.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Post Reply