imported_peterigz
Forum Replies Created
-
AuthorPosts
-
imported_peterigzParticipantahh ok, is there anything else that might be killing the effect before they get a chance to spawn?
imported_peterigzParticipantCool effects you got there! 🙂
I noticed in that nuke effect that the upper part of the mushroom cloud doesn’t spawn particles until about 1 second into the effect, so my first thought is that at some point in your code you’re killing the effect before they get a chance to spawn. Having a dig around the code I think it could be this bit:
If xmove>270 Then
effect.destroy()
ListRemove(NukeWaveList,Self)
EndIf
which is in the tNukeWave type. I think those waves reach >250 in under a second before that part of the nuke can spawn. I don’t have the zipstream mod at hand otherwise I’d confirm it myself. Let me know 😉
imported_peterigzParticipantahh ic, i was just pressing enter 🙂 I’ll take a look tomorrow, off to bed now!
imported_peterigzParticipantHow do you fire a Nuke?
imported_peterigzParticipantHeh, over site there, just fixed it and will be in next update which I’ll release this weekend.
Just checking out the nuke problem now.
imported_peterigzParticipantI’ll stick it on the to-do list 🙂
imported_peterigzParticipanthehe, yeh, there’s no file associations there yet, once I figure out how to implement it in the installer I’ll put it in.
imported_peterigzParticipantErm, I’m not sure really, I don’t know what the best/common practice is. I guess it’d be more “polite” to restore each state to what they were, I never really gave it much thought as I was so used to just setting the rotation etc., before drawing anything anyway. It does seem to be one of the more common things people run into though so maybe it would be a worthy change. I can’t see it costing much more overhead to do so…
imported_peterigzParticipantHello, I’ve prepared a test version of the editor that makes a save log when you save. you can get it from here:
http://www.rigzsoft.co.uk/files/TimelineFXEditorSetupTest.exe
You can just install that over the top of your current installation.
the log is saved in the installation, however, if you’re on Vista it will save into the virtualstore folder, you will find that here:
%user%/appdata/local/virtualstore/program files (x86)/TimelineFX/savelog.txt
if you save a file and send me the log file then hopefully we can get to the bottom the problem, an exmaple of a corrupted file as mentioned would also be helpful. Thanks!
imported_peterigzParticipantThat’s not a bad idea, i’ll look into that 🙂
imported_peterigzParticipantAh of course, ok. Could you attach a corrupted save file either to a forum post or email to me pete@rigzsoft.co.uk. Thanks.
imported_peterigzParticipantWhen you click save does it crash straight away, before it even gives you a dialogue box?
imported_peterigzParticipantHello, is it possible that you could attach a corrupted effects file here so I could take a look at it? It seems likely that it’s something to do with saving, as it also autosaves every five minutes so it could be crashing it there too. I’ll take out the autosave for a start as its just a debug thing I’ve had in there.
I also have vista and every thing’s ok here. Do you run vista as an administrator? I can’t think it’s anything to do with that but you never know! While you attach an effects file I might prepare a debug version that creates a log when saving that you can run, that should help me get to the bottom of whatever’s happening.
imported_peterigzParticipantHi Ziggy, I’ve been meaning to implement this for a while. I also want to add it as a graph within the editor so you can change the scale overtime.
No time like the present I guess, I’ll add it this afternoon, shouldn’t take too long as most of it’s there already 🙂
September 20, 2009 at 11:52 am in reply to: I cannot get TinelineFX to work with pther drawing code #3508
imported_peterigzParticipantHi Bugzilla,
The reason they disappear like that is because when the particles are drawn there’s no telling what state they will leave the values of SetScale, SetRotation, SetAlpha etc. So when you use drawSprite or DrawImage, it’s good practice to set these to what you want for each image drawn. I see that you’re extending tlEntity, in which case you can use the render method to draw your sprites. I had a play with your code and got it working, I’d advise that you have a read through of the tutorial on this site called “Making a game from start to finish”, and also, there is a similar tutorial in the BlitzMax Coder magazine that explains a lot about extending tlEntity and how to use it. Post here as much as you want too, I’m happy to help, as it helps me make it a better module!
You’ll notice in the code below I’ve added update methods to your types, these override the update methods in tlEntity, but like I say, things are explained more in detail in the tutorials.
Strict
Framework brl.max2d
Import rigz.entity
Import rigz.tweener
Import brl.pngloader
Import rigz.timelinefx
SetGraphicsDriver GLMax2DDriver()
Graphics 1024, 768
HideMouse()
'
PARTICLE VARIABLES
Global effectslib:tlEffectsLibrary
Global particles:tlParticleManager 'The main particle manager for all the explosions and bullets
particles = CreateParticleManager()
effectslib = LoadEffects("vadereffects.eff")
'Orient the particles so that screen coords are what we use to position stuff
particles.SetScreenSize(GraphicsWidth(), GraphicsHeight())
particles.SetOrigin(GraphicsWidth() / 2, GraphicsHeight() / 2)
particles.SetIdleTimeLimit(5)
'
Type player Extends tlEntity
'Field img:TAnimImage
Field dx:Int
Field dy:Int
Field angle:Float
Field speed:Float
Field moving = False
Method moveTo()
angle = ATan2(dy - y, dx - x) + 90
'x = x + Cos(angle) * speed
'y = y + Sin(angle) * speed
Self.SetEntityDirection(angle)
If(Distance(x, y, dx, dy) < 10)
Self.SetSpeed(0)
moving = 0
End If
DebugLog Distance(x, y, dx, dy)
End Method
Rem
bbdoc:Update the entity
End Rem
Method Update()
Self.capture()
If Self.moving
Self.moveTo()
End If
Super.Update()
End Method
End Type
Type background Extends tlEntity
'Field img:TAnimImage
End Type
Type cursor Extends tlEntity
'Field img:TAnimImage
Rem
bbdoc:Update the entity
End Rem
Method Update()
Self.capture()
Self.SetPosition(MouseX(), MouseY())
Super.Update()
End Method
End Type
Local p:player = New player
p.setsprite(LoadSprite("Player.png"))
p.SetPosition(400, 400)
p.Capture()
p.Update()
p.speed = 0
Local bg:TImage = New TImage
bg = LoadImage("background.png")
Local curs:cursor = New cursor
curs.SetSprite(LoadSprite("CURSOR.png"))
curs.setPosition(MouseX(), MouseY())
curs.Capture()
curs.Update()
'set up a tweener using the tweener module
Global tweener:tTweener = New tTweener.Create(30)
SetUpdateFrequency(30)
While Not KeyDown(KEY_ESCAPE)
Cls
tweener.Update()
For Local Ticks:Int = 1 To tweener.FrameTicks
'Update the execution time for the tweener
tweener.UpdateExecutionTime()
curs.Update()
If(MouseHit(1))
Local explode:tlEffect
explode = CopyEffect(effectslib.GetEffect("player Explosion"), particles)
'create the explosion and add it to the particle manager
explode.setx(MouseX())
explode.sety(MouseY())
particles.addeffect(explode)
p.dx = MouseX()
p.dy = MouseY()
p.SetSpeed(100)
p.moving = True
End If
p.Update()
particles.Update()
Next
drawbackground(bg)
'DrawSprite(bg.img, bg.x, bg.y)
p.Render(tweener.Tween)
'DrawSprite(p.img, p.x, p.y)
curs.Render(tweener.Tween)
'DrawSprite(curs.img, MouseX(), MouseY())
particles.DrawParticles(tweener.Tween)
Flip
Wend
Function drawbackground(background:TImage)
SetScale GraphicsWidth() / Float(ImageWidth(background)), GraphicsHeight() / Float(ImageHeight(background))
SetColor 255, 255, 255
SetAlpha 1
SetBlend SOLIDBLEND
SetRotation 0
DrawImage(background, 0, 0)
End Function
Function Distance(x0:Float, y0:Float, x1:Float, y1:Float)
Local distx:Float = x0 - x1
Local disty:Float = y0 - y1
Return Sqr(distx * distx + disty * disty)
End Function
-
AuthorPosts