Flashy item Effect

Posted By: DLively

Flashy item Effect - 04/02/10 17:13

Hi Everyone!!



So its been a long time since I've requested anything, since I've been trying to learn and do everything myself - But I've come to a fork in the road -


To begin,

Has anyone ever played the original resident evil 1, 2, or 3?

well, here is a youtube video, of which shows what i am after.

http://www.youtube.com/watch?v=Zb0XSpfu_64

once you get to the statues (about 40 seconds in), you will notice the middle statue is holding a red jewel - you will also notice that it flashes, to catch the players eye.


how can i achieve this?

I understand that I am to use a sprite, but how do I animate the sprite to flash like that?


Thanks for your time!
Devon.
Posted By: darkinferno

Re: Flashy item Effect - 04/02/10 18:14

u dont need to animate it at all.. you can just alter its scale and alpha parameters, like:

while(my.alpha>0)
{
my.scale_x+=2*time_step; //increase scale
my.scale_y=my.scale_x;
my.aplha-=30*time_step; //fade out
wait(1);
}

ofcourse you'll need a sprite with an alpha channel..
Posted By: DLively

Re: Flashy item Effect - 04/02/10 19:24

very good theory, Darkinferno!
I'll give that a try for sure.
Thank you!



................
any other ideas are welcome laugh
Posted By: Helghast

Re: Flashy item Effect - 04/03/10 22:21

I hope you dont mind a c-script; I made the exact same effect for another RE like game couple of weeks ago.

Code:
function blinkingItem() {
	you = ent_create("spark.pcx", my.x, NULL);
	you.BRIGHT = on;
	you.PASSABLE = on;
	you.transparent = on;
	
	var scaleFac = 1;
	var timerCount = 32;
	var timerWait = 0;
	
	while(me) {
		vec_set(you.scale_x, vector(scaleFac, scaleFac, scaleFac));
		vec_add(you.pan, vector(0, 0, 0.5)); // make it rotate
//		you.alpha = scaleFac * 100;
		
		timerCount -= 1;
		if(timerCount <= 0) {
			scaleFac -= 0.05;
		}
		
		if(scaleFac < 0) {
			timerWait += 1;
		}
		scaleFac = cycle(scaleFac, 0, 1);
		
		if(timerWait == 3) {
			timerWait = 0;
			timerCount = 32; // 2 second delay
			scaleFac = 0;
		}
		
		wait(1);
	}
}



Call this function on whatever item you want to shine. And also make a spark.pcx file for the flashy effect.

hope that helps!

regards,
Posted By: DLively

Re: Flashy item Effect - 04/06/10 20:38

Wow!
Thanks Helghast!

Ill try it out!

Looks like it should work wink grin

EDIT:
And it does, amazingly! Thanks soo much! A few alterations, and it will be 100%
Posted By: Blink

Re: Flashy item Effect - 04/06/10 20:59

it works great, cool effect. Helghast is on a roll with awesome scripting!
Posted By: molotov

Re: Flashy item Effect - 04/09/10 12:33

Wow Helghast, that's a great script, works perfectly. Thanks!!!
© 2024 lite-C Forums