Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Image Effects! (https://forums.graalonline.com/forums/showthread.php?t=36606)

G_yoshi 08-25-2002 12:19 PM

Image Effects!
 
I think it would be nice if there was a command for showimgs that would automatically run through some kind of image manipulate routine such as making it wave like a flag or ripple...without having to use gifs or mngs.

This would be nice so that I (or other people) don't have to use bunch of NPCs to create the effect I want.

maybe something like changeimgeffect index,effectnumber;

0 - normal (default)
1 - Wave Effect
2 - Ripple
3 - Fire
etc.

Kaimetsu 08-25-2002 02:27 PM

Re: Image Effects!
 
Kinda nice, I guess, but there are problems. Those things need to be prerendered, and that'd stand a chance of causing noticable slowdown. There are ways around it yadda yadda but it's easier if people just use mngs.

G_yoshi 08-26-2002 11:16 AM

Re: Re: Image Effects!
 
Quote:

Originally posted by Kaimetsu
Kinda nice, I guess, but there are problems. Those things need to be prerendered, and that'd stand a chance of causing noticable slowdown. There are ways around it yadda yadda but it's easier if people just use mngs.
I suppose...unless I can get my great NPC scripter to help or someone else :)

It looks neat what I've done so far...but I'm having a little difficulty trying to figure out a way to do it all with one NPC.

NPC Code:
//#CLIENTSIDE
if (playerenters) {
this.imgx = 0;
this.img = 1;
this.y = 0;
showimg this.img,dk_logo.png,screenwidth/2304+this.imgx,12+this.y;
changeimgcolors this.img,1,1,1,1-(this.y*.01);
changeimgpart this.img,this.imgx,0,1,112;
changeimgvis this.img,7;
timeout = .05;
}

if (timeout) {
this.y = 0;
for (this.y=0; this.y<24; this.y=this.y+1.5) {
showimg this.img,dk_logo.png,screenwidth/2-304+this.imgx,12+this.y;
changeimgcolors this.img,1,1,1,1-(this.y*.01);
changeimgpart this.img,this.imgx,0,1,112;
changeimgvis this.img,7;
sleep .05;
}
for (this.y=24; this.y>-1; this.y=this.y-1.5) {
showimg this.img,dk_logo.png,screenwidth/2-304+this.imgx,12+this.y;
changeimgcolors this.img,1,1,1,1-(this.y*.01);
changeimgpart this.img,this.imgx,0,1,112;
changeimgvis this.img,7;
sleep .05;
}
timeout = 0.05;
}



That is what the script is for one vertical line (1x112) and the image is 608 pixels wide. I know there's a way to do it with one NPC I just keep hitting the wrong way...heck I've even come up with an idea on how to possibly determine needed lines using imgwidth(); just not sure how to get one NPC to do all of those lines in a very smooth manner. I'll keep working at it though...eventually I'll get it :)

G_yoshi 08-26-2002 11:18 AM

1 Attachment(s)
Sorry, forgot to post a screenshot of what it looks like (or what I've got so far using ~50 NPCs :x)

Kaimetsu 08-26-2002 11:36 AM

1 Attachment(s)
I'm not sure if I know what you're doing. Something like this?

G_yoshi 08-26-2002 01:23 PM

Quote:

Originally posted by Kaimetsu
I'm not sure if I know what you're doing. Something like this?
*stunned* :eek:

You hit it dead center!

*dies*

Might I recieve permission to use this on my PW?

Kaimetsu 08-26-2002 01:48 PM

Quote:

Originally posted by G_yoshi


*stunned* :eek:

You hit it dead center!

*dies*

Might I recieve permission to use this on my PW?

Yeah, whatever. It took me about a minute to write, I'm not gonna get possessive over it.

G_yoshi 08-26-2002 01:54 PM

1 Attachment(s)
Quote:

Originally posted by Kaimetsu


Yeah, whatever. It took me about a minute to write, I'm not gonna get possessive over it.

ok :D

I've had a little fun manipulating it...very neat :eek:

DarkPyro_2001 08-27-2002 06:23 AM

'Theif'? You sad, sad little man.

Kaimetsu 08-27-2002 06:31 AM

Quote:

Originally posted by DarkPyro_2001
'Theif'? You sad, sad little man.
What are you talking about here?

konidias 08-27-2002 04:10 PM

Quote:

Originally posted by Kaimetsu


What are you talking about here?

He spelled Thief wrong, in his JobClass select screen. :)

Poogle 08-27-2002 07:18 PM

yup lol btw koni like your sig

Kaimetsu 08-28-2002 02:00 AM

Quote:

Originally posted by konidias


He spelled Thief wrong, in his JobClass select screen. :)

Oh, I see. That makes sense :)

RavenTelvecho 08-30-2002 09:18 AM

R0bin:
if(created){
x=x-(1/16);
timeout=0.05;
this.imgwidth=394;
this.imgheight=260;
hide;
}
if(timeout){
timeout=0.05;
this.speed+=4;
for(i=this.imgwidth;i!=0;i--;){
showimg i,#f,x+(i/16),y+sin((i+this.speed)*0.03);
changeimgpart i,i,0,1,this.imgheight;
}
}

I edited kai's code so you could use it in-level. :D

Tyhm 08-30-2002 09:33 AM

AAAAAAAAAAAAAAAAAAAAAA!
GODAWFUL CODING!
*dies*

Kaimetsu 08-30-2002 02:48 PM

Quote:

Originally posted by Tyhm
AAAAAAAAAAAAAAAAAAAAAA!
GODAWFUL CODING!
*dies*

*shrugs*

It wasn't made for efficiency, I really just wanted to get the concept down. In reality I would've used precalculated variables, alternatives to trigonometric functions/lookup tables blah blah.

Tyhm 08-31-2002 01:26 AM

if(created){
x=x-(1/16); //drift online
timeout=0.05; //only work reliably once ever
this.imgwidth=394; //ditto
this.imgheight=260; //ditto
hide;
}

To make this work online, you'd need

if(created){
if(visible) x=x-(1/16); //middling, it's best to put in the exact x
hide;
}
if(playerenters){
timeout=0.05;
this.imgwidth=394;
this.imgheight=260;
}

Don't believe me? Put a warp in your level to another level, and vice versa. When you reenter, everything goes plotz.

RavenTelvecho 08-31-2002 01:36 AM

R0bin: Who said i wanted it online?
If people decide to use it in their levels, they can fix it themselves.

Com013 08-31-2002 01:52 AM

I haven't looked at the script, but what Tyhm posted looks like it wouldn't even work offline if you leave the level and reenter it.
(just try pressing F5 and press Load).

And I am always trying to make my scripts compatible with the online mode. (but not with server side scripting)

G_yoshi 08-31-2002 05:33 AM

Quote:

Originally posted by Tyhm
if(created){
x=x-(1/16); //drift online
timeout=0.05; //only work reliably once ever
this.imgwidth=394; //ditto
this.imgheight=260; //ditto
hide;
}

To make this work online, you'd need

if(created){
if(visible) x=x-(1/16); //middling, it's best to put in the exact x
hide;
}
if(playerenters){
timeout=0.05;
this.imgwidth=394;
this.imgheight=260;
}

Don't believe me? Put a warp in your level to another level, and vice versa. When you reenter, everything goes plotz.

Ehem, if you put //#CLIENTSIDE at the beginning of the NPC, I'm pretty sure it will work :)

Tyhm 08-31-2002 07:43 AM

I find that highly suspect. If it's clientside, then the NPCServ created condition fires both once ever (so that the x+=is only called once) and every time a player enters (so that timeout doesn't die and the variables stay defined)

G_yoshi 08-31-2002 08:31 AM

Quote:

Originally posted by Tyhm
I find that highly suspect. If it's clientside, then the NPCServ created condition fires both once ever (so that the x+=is only called once) and every time a player enters (so that timeout doesn't die and the variables stay defined)
I only used the little scriptlet Kaimetsu made for a stationary effect...just log onto my PW and go through the character creation stuff, you'll see it :)

Kaimetsu 08-31-2002 03:50 PM

Quote:

Originally posted by Tyhm

Don't believe me? Put a warp in your level to another level, and vice versa. When you reenter, everything goes plotz.

Oh, you were talking to the other guy...? It's helpful to quote the post you're addressing.

Tyhm 08-31-2002 11:07 PM

Didn't look at your original, but the quoted passage, with the if(created) stuff, certainly won't work on a Classic-style server, and I can't fathom it working serverside either.


All times are GMT +2. The time now is 01:56 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.