Data Realms Fan Forums
http://45.55.195.193/

Rather Puzzled
http://45.55.195.193/viewtopic.php?f=73&t=17414
Page 1 of 1

Author:  PhantomAGN [ Thu Dec 24, 2009 2:32 am ]
Post subject:  Rather Puzzled

Hey all.
This script is intended to spawn a particle once every 200ms, for 24 iterations.
I have defined 24 MOPixels, each with a different ScreenEffect glow.
Together, in series, they should act like an animation (and, I hope, a very good one at that.)

However, the code is not working, and in fact now that I have a while loop, it actually crashes the game.
http://pastebin.com/m158f692f

Looking for suggestions, hand slapping, etc.
And/Or a better way to animate glows.

Author:  Abdul Alhazred [ Thu Dec 24, 2009 10:36 am ]
Post subject:  Re: Rather Puzzled

You seem to have misunderstood how a while-loop work (quite common actually). Your loop won't end until 25*200ms have passed. I suspect that since the loop can not end the engine can not progress and therefore time will "stop".

If you want to spawn pixels while the counter is below a certain value, you should do this in the update function. For example like this: http://pastebin.com/d7be0f0aa (this code has not been tested)

Author:  PhantomAGN [ Thu Dec 24, 2009 11:31 am ]
Post subject:  Re: Rather Puzzled

Eureka!
You're absolutely right, and now I know to not bother coding late at night!
You saved my "animation by glows," thanks!

I'm really hoping that this method is useful to the community, though I suspect that it would not be particularly hard to do the same thing with an emitter, entirely in ini code.
I just hate ini, and love lua.

Edit:
Sadly, this line is out of syntax, or CC's lua does not support formatting.
local glow = CreateMOPixel(string.format("Glow %02d" self.GlowCounter))
EditEdit:
What is this, a liveblog of PhantomAGN's lua failings?
It appears that, as you even used, concatenation is done with a "..".
Well then, disregard the above.
EditEditEdit:
IT WORKS.
Woo hoo, off to play with my new animated glowing explosions.

EditEditEditEditEdit:
The glows act as if they were out of palette, and I was certain they did not have that constraint!
Black -> Green, Blue -> Black, etc.
As always, my code works, and nothing else does.

Author:  TheLastBanana [ Thu Dec 24, 2009 9:47 pm ]
Post subject:  Re: Rather Puzzled

What strength do you have the glows set to? By that I mean the StartStrength and EndStrength, defined in the INI.

Author:  PhantomAGN [ Thu Dec 24, 2009 9:57 pm ]
Post subject:  Re: Rather Puzzled

The base looks like this, and then all the frames are CopyOf.
EffectStartTime = 0
EffectStopTime = 50
EffectStartStrength = 1
EffectStopStrength = 1
EffectAlwaysShows = 1

I've experimented with the strengths, but it's not something that I seem to be able to fix that way.
I've also moved this part of the conversation to here:
http://forums.datarealms.com/viewtopic.php?f=75&t=17423
Just because it's not lua-related anymore.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/