View unanswered posts | View active topics It is currently Fri Dec 27, 2024 9:51 am



Reply to topic  [ 12 posts ] 
 Animating Glows (with lua!) 
Author Message
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Animating Glows (with lua!)
Allright, I'm pretty sure nobody's done this yet.

I figure that using a script to produce pretty looking effects has got to be useful to someone, but I've stopped working on this just for now.

Basically, by first defining a ton of nearly-identical MOPIxels, each with an integer in the PresetName and with a corresponding ScreenEffect attached, you can then simply use a loop in Lua to spawn them sequentially.
I did this repetitive task using extensive Find&Replace, but I also made a junky bash script to do the same thing. You don't need it though.

Included in this proof-of-concept are a number of various bombs, each with a different effect.
The effects are edits of attack sprites from a mod for the game Mugen, specifically someone's Cirno character.
These effect will be included in a mod I am still developing, which is to be an entirely Lua-based floating actor, with a basic AI and lots of pretty. I intended to release it all at once, but I've slowed down development and well, I'm kinda bored.
Not to mention, I would love to see people implement this sort of thing.

That said, the animation script could use some work.
Ideally, it would not simply flash one frame at a time, but phase gently through them. I'll detail that better late, but you can see what I mean.

Glow animations included in this package:
Explode - It's a pretty-looking explosion effect, nice and large.
Implode - Really nice attach animation, repurposed as an implosion. My favorite looking thing there.
Beam - An energy attack splashing down from straight above. Glows are not the same size however, and it looks jittery.
Hegagram - A spinning and glowing hex, perfect for spinning below the body of a flying magician. The hexagram rotates forever, you can check out how simple it was to repeat the Lua script indefinitely.

Enough talk, it's better to look at how it was done.
The thing boils down to just this; spawning something based on a string and a formatted integer you just increase.
Here's some not-so-real code to explain, so you don't have to download.
Code:
if timer is past Xms, then
reset timer
local glow = CreateMOPixel(string.format("Explode Glow ".. self.GlowCounter)) //that's how to concatenate folks!
set glow's positon to self.Pos
Spawn the glow!
add one to the glow counter
if glow counter is greater than the number of frames then delete self end
end


Attachment:
File comment: Proof-of-concept
Cirno.rte.zip [2.15 MiB]
Downloaded 255 times

Thanks to those guys (you know who you are) who tried to help me with this and the associated glows.

TODO:
Spawn two glows at once, and use fading to smooth out animation.
Pass on velocity to spawned glows, so you can make something like this move.


Last edited by PhantomAGN on Wed Dec 30, 2009 5:59 am, edited 1 time in total.



Wed Dec 30, 2009 1:09 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: Animating Glows (with lua!)
Very pretty. A little on the jerky side, but using the strengths will definitely make it look smooth. I applaud you good sir!


Wed Dec 30, 2009 2:12 am
Profile
User avatar

Joined: Sun Feb 17, 2008 11:21 am
Posts: 54
Reply with quote
Post Re: Animating Glows (with lua!)
You deserve a medal. Hexagram is awesome.
Will somebody make a demonic super-actor just to be summoned by that?
(I would, but it would suck compared to the animation.)


Wed Dec 30, 2009 11:18 am
Profile
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Re: Animating Glows (with lua!)
I'm glad that the response has been as good as this.

But keep in mind that I did not create the actual glows, I actually just blatantly ripped them from someone else's work.
Because that original work is share/modify, I decided that this is pretty fair use.
That said, you could probably recolor it red by applying the same filter to each image and get far enough from the original that you could even claim originality (I've seen worse behavior from professional "artists").

By all means, try to use this for something your own. if someone like me can produce as pretty a thing as this, anyone can.
Lua just happens to be fun at the moment, I can't even write ini code without basically duplicating an existing thing.


Last edited by PhantomAGN on Wed Dec 30, 2009 10:55 pm, edited 1 time in total.



Wed Dec 30, 2009 12:57 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: Animating Glows (with lua!)
PhantomAGN wrote:
I can't even write ini code without basically duplicating an existing thing.

Somewhat unknown fact: This is 90% of ini coding. The other 10% is remembering how you duplicated something and frankensteining bits of it to get a half-new, half-old thing.


Wed Dec 30, 2009 1:04 pm
Profile
User avatar

Joined: Sun Feb 17, 2008 11:21 am
Posts: 54
Reply with quote
Post Re: Animating Glows (with lua!)
Does anybody know of a piece of software that can perform the same filter/operation/whatever on a large number of files? That would make this a lot quicker.


Fri Jan 01, 2010 9:26 pm
Profile
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Re: Animating Glows (with lua!)
I very nearly succeeded with MacOS's automator actions, but in the end it could not specify the proper "fill in green with black" that the glows needed (They were not anything I had ever seen before, a tint of green was the "clear" color, like CC's magenta).

I too would be interested in some sort of batch processor.
Oh, before I forgot, if you can record and replay mouse movements, you may be able to do some of this.
I decided it was not worth it, as sometimes lag in the actions was too much for the program to keep up with the mouse.


Fri Jan 01, 2010 9:46 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Animating Glows (with lua!)
If all you need is batch renaming/file conversion/basic modifiers, try Irfanview. I'm not sure if there's a Mac version, but I know that on Windows it's really useful.


Sat Jan 02, 2010 1:11 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Animating Glows (with lua!)
I was planning on doing this sometime, actually, but I guess you beat me to it. I haven't gotten to take a look at it yet, but nice job nonetheless.
IrfanView is definitely my recommendation, but it definitely doesn't exist on Mac. Somebody on the forum can probably do it for you on a Windows machine, though.


Sat Jan 02, 2010 3:51 am
Profile WWW
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Re: Animating Glows (with lua!)
Thanks, TLB.
I look forward to seeing what other people manage to use it for, I's still trying to implement a lua-based actor with these as effects, but it's going to take a million years.

As for IrFanView, I can run it fine on my mac, actually.


Sat Jan 02, 2010 4:06 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Animating Glows (with lua!)
Nicely done. Boom boom isn't centered right throughout the animation and hexagram looks misfitting when put on the ground due to cc's perspective/terrain, but as a proof of concept it's perfect.

Now if only we could rotate glows without needing tons of frames for different angles. Just think about a drop ship thruster with this style for the exhaust effect.


Mon Jan 04, 2010 4:05 am
Profile
User avatar

Joined: Wed Dec 13, 2006 12:10 am
Posts: 562
Location: Termina
Reply with quote
Post Re: Animating Glows (with lua!)
This will really aid in making Darlos9D's The Flux look epic (if that's still being worked on that is :-( )


Mon Jan 04, 2010 11:10 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.065s | 14 Queries | GZIP : Off ]