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



Reply to topic  [ 5 posts ] 
 Rather Puzzled 
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 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.


Thu Dec 24, 2009 2:32 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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)


Thu Dec 24, 2009 10:36 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: 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.


Thu Dec 24, 2009 11:31 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: Rather Puzzled
What strength do you have the glows set to? By that I mean the StartStrength and EndStrength, defined in the INI.


Thu Dec 24, 2009 9:47 pm
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: 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.


Thu Dec 24, 2009 9:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.085s | 15 Queries | GZIP : Off ]