imported_peterigz
Forum Replies Created
-
AuthorPosts
-
imported_peterigzParticipantHmm this is very strange. On the emitters downloads downloads page each download links directly to the effect file for example:
http://www.rigzsoft.co.uk/files/emitters/ShootemUpEffects.eff
So if you download that are you not left with a file on your HD called ShootemUpEffects.eff ? Which browser are you using? Maybe it is doing something strange to the files because it recognises them as zip files- maybe it’s renaming them to .zip? In which case you’d need to change them back again to .eff
imported_peterigzParticipantTo switch a particle manager to use interpolated mode you can call MyParticleManager.SetUpdateMode(tlUPDATE_MODE_INTERPOLATED) and do MyParticleManager.SetUpdateMode(tlUPDATE_MODE_COMILED) to set it back. And when you load in effects set the compile parameter to false so that it doesn’t compile. I noticed though that there’s a bit of code to do with how it loads in the shapes that can be optimised quite a bit, so I might try and sort that out. It’s mainly only loading in shapes with a lot of frames of animation that is the main reason it can be slow sometimes.
imported_peterigzParticipantEffects libraries are files that end in .eff – These are the files that you load and import into the editor. So you can just download an effects library from this site, then go File -> Open Library and locate where you downloaded the library and load it in.
imported_peterigzParticipantHello, there’s no need to unzip the .eff files, they can (and have to) be loaded into the editor as they are.
imported_peterigzParticipantHmm that’s not good with the saving issue, never seen that before. Does the whole whole program crash as well when it happens? And where are you try to save to?
As for copying effects between files the best option is to use Import library from the file menu, there yuo can choose which effects are imported along with any shapes they use.
imported_peterigzParticipantYou can use effect.SoftKill() which tells it to stop spawning particles allowing any existing particles belong to the effect to just dying out.
imported_peterigzParticipantAhh I see. Then I think you need to look at the ParticleManager.SetOrigin(x,y) command. You can change the origin of particle managers specifically so that you can move effects about with your camera.
So just set the origin of the particle manager to match your camera coordinates and all particles drawing will be offset by this.
imported_peterigzParticipantCan you attach the specific effect you’re trying to move about? I think the only thing I can think that might be causing a problem is if you are using an effect that has a single particle but it’s not as relative so therefore it wouldn’t move about with the effect.
If you can send the effect though I could do a little example with it.
imported_peterigzParticipantHello, your example is basically how you would do it.
Taking the sample code from this site, to move the effect around with the mouse you could do:
SuperStrict
Import rigz.timelinefx
Import rigz.tweener
'Load the effects library
Local MyEffectsLib:tlEffectsLibrary = LoadEffects("effects/examples.eff")
'Create an effect and assign it an effect from the library
Local MyEffect:tlEffect = MyEffectsLib.GetEffect("simple explosion 1")
'Create the particle manager to manage the particles
Local MyParticleManager:tlParticleManager = CreateParticleManager()
Graphics (1024, 768, 0)
'These commands are important to set the origin of the particle manager. For this example we're setting the origin so that
'effects will be placed at screen coordinates. If you leave out the setorigin command then an effect created at 0,0 would
'be placed at the center of the screen.
myparticlemanager.SetScreenSize(GraphicsWidth(), GraphicsHeight())
myparticlemanager.SetOrigin(GraphicsWidth() / 2, GraphicsHeight() / 2)
'This will make one frame equal 33 millisecs long - or 30 updates per second.
SetUpdateFrequency(30)
'Create a tweener using the tweener mod. Make sure its frequency matches that above
Local Tweener:tTweener = New tTweener.Create(30)
local mouseeffect:tleffect
'Our main loop
While Not KeyDown(KEY_ESCAPE) Or AppTerminate()
Cls
If MouseHit(1)
'to create an effect you need to use the copyeffect command, and copy the MyEffect you created earlier.
'You shouldn't use MyEffect as it is the template
'for which is used to create effects you draw on screen.
Local tempeffect:tlEffect = CopyEffect(myeffect, MyParticleManager)
'Set the temp effect to the mouse coords
tempeffect.setposition(mousex(),mousey())
mouseeffect=tempeffect
'add the effect the the particle manager. Important, otherwise the particle manager would have nothing to update
MyParticleManager.addeffect(tempeffect)
End If
'here is the timing code, update the tweener to get the number of ticks for this loop
Tweener.Update()
For Local Ticks:Int = 1 To Tweener.FrameTicks
'Update the execution time for the tweener
Tweener.UpdateExecutionTime()
'Update the particle manager
if mouseeffect mouseeffect.setposition(mousex(),mousey())
MyParticleManager.Update()
Next
'and finally draw the particles.
MyParticleManager.DrawParticles(Tweener.Tween)
Flip 0
Wend
That’s just a very rough example, but is basically what you’d have to do. You can also download the vaders source code from the downloads page for some more insights, for example the bullets are effects that are moved about the screen.
imported_peterigzParticipantCool 😎
I agree it’s always better to go for the cleaner solution 🙂
imported_peterigzParticipantBy making it a single particle (Single check box on the particle tab). Single particles do not die, they just spawn 1 particle and loop over their lifetime graphs forever.
Having said all that though I’ve just added effect.DoNotTimeout() to achieve what you want now anyway 🙂
Seemed to be doing its job in the small test I made, available via SVN.
imported_peterigzParticipantI see, in that I just made a new effect each time and killed it (using effect.SoftKill) when you stopped thrusting.
But forget all that because I just thought of the ideal solution: In your thruster effect create a new emitter and make it a single particle (on the Particle tab) and set its size to 0, that way they’ll always be a particle within the effect so it won’t time out, as single particles do not expire until you destroy the effect.
By the way, it’s looking good 😀 Always nice to see how people are making use of it.
I will check out the time out issue too, as it certainly shouldn’t have been timing out anyway.
imported_peterigzParticipantI wrote an article for maxcoder about making an asteroids game using TimelineFX, which had a ship with a thruster. Can’t remember for the life of me what I did but I’ll go check 🙂
I’m sure it had the same kind of thing you’re trying to do…
imported_peterigzParticipantFixed the bug in ClearAll and added new method ClearLayer. SVN is updated. Let me know if there’s any problems 🙂
imported_peterigzParticipantNo problem.
I thought they’d be some things I’d miss :). I’ll fix that and add a new “ClearLayer” method when I get home tonight.
-
AuthorPosts