redspark
Forum Replies Created
-
AuthorPosts
-
redsparkParticipantThank you.
redsparkParticipant@thomashaaks wrote:
The “circular import” issue sounds to me like a design issue – that Mr Sibly doesn’t want to change.
It’s actually not possible to change it because imports are pre-compiled. Without both types present in the file that form a cyclical reference, the file wont compile. To change the import to allow it to import uncompiled code, gives you the same thing as an included file. So they are really designed for two different purposes.
If you split your types off into separate files and then include them all into your main file, you should be fine. You can also cheat a bit by making your game object Global. I know it is best to avoid Global variables. However, when something is unique and is going to be referred to throughout your code, a handful of Global variables wont hurt. It also saves popping and pushing them from the function calling stack at every object creation and saves the 4 bytes of pointer memory in every object that points to the Global object.
redsparkParticipantThe AddPreloadedEffect() worked great. Thanks.
redsparkParticipantCool! I look forward to it. Thanks. 🙂
redsparkParticipantI’ll have to keep my eye out for that kind of thing in the future. 😳
Is there a way to force the particle engine to start displaying the particles well into the simulation. For instance, I would like to load the scene with the candle already lit instead of waiting for the flame to actually be built. Could I just loop to update the particles for so many ticks to precalculate their positions?
Thanks.
redsparkParticipantI think I got it working. It was the SetScale, Color and Alphablending being carried over from the particle system interfering with the game graphics. It only worked when the mouse was on the screen because when the mouse was being displayed, it reset all of those things. 😆 When the mouse wasn’t on the screen, they didn’t get reset because the mouse wasn’t drawn. Now the bluing is gone and so is the flicker in the corner.
Thanks for the help. I’m still new to Blitz and everything else. 😉
redsparkParticipantMy field definitions look like:
' Particle Effects Fields
Field particles:tlParticleManager 'The main particle manager for GUI effects
Field effectslib:tlEffectsLibrary 'The effect library
Field CandleFlame:tlEffect
Field Tweener:tTweener
My loading method looks like:
' Setup Particles
SetUpdateFrequency(30)
Tweener = New tTweener.Create(30)
particles = CreateParticleManager()
particles.SetScreenSize(ScreenWidth, ScreenHeight)
particles.SetOrigin(ScreenWidth / 2, ScreenHeight / 2)
particles.SetIdleTimeLimit(5)
'load the effects library
effectslib = LoadEffects(Game.DataPrefix+"data/fx/Candle.eff")
CandleFlame = effectslib.GetEffect("Candle Flame")
Local e:tlEffect = CopyEffect(CandleFlame, particles)
e.sety(449)
e.setx(32)
particles.addeffect(e)
My Draw loop looks like:
' Draw Candles and effects
If Game.Fading()=0 Or Game.Paused=0 Then
Tweener.Update()
For Local Ticks:Int = 1 To Tweener.FrameTicks
Tweener.UpdateExecutionTime()
particles.Update()
Next
particles.DrawParticles(Tweener.Tween)
EndIf
redsparkParticipantThe blue only shows up when the mouse is outside of the window and when I have the particles being displayed. I’ll try to set the colors and blend modes in each draw loop to see if that helps. It’s just strange why it does it only when the mouse is outside of the window.
To me, the gray squares look like the alpha channel of the particle being blended with the background. They rotate around a lot centred on that corner. They aren’t static. They seem to only do this when the screen is faded slightly. So I’m not sure what is causing it. I managed to code my way around the issue for fading the screen in and out but not for the slight dimming that the screen gets when it is on pause.
Perhaps both of these two problems are caused by the same thing. However, I have nothing drawing in the upper corner. If I shut off the particle system, the gray squares go away too. Doing a particles.clearall() removes it before I do a fade. And not drawing the particles until a fade is complete also prevents it. But I haven’t managed to find a way to pause the particles on the spot. Is there a way to do that?
I’m going to make the flame a little bigger and taller but I was pretty satisfied with it. I just need a tiny trail of smoke and I think it will be done. Thanks. 🙂
redsparkParticipantIt seems to be working but I’m getting some odd behavior. Perhaps I’m working in an unsupported mode too. First, I’m in 3D mode using MiniB3D within a Window. When I move my mouse outside of the window and my mouse graphic is not displayed because the cursor has moved outside of the window, I start getting a dark blue hue around every sprite that is displayed with an alpha channel. This doesn’t happen when I’m not displaying particles. It’s only when the particles are active and possibly when an effect is just loaded. But I haven’t tested that.
[attachment=1:o8f385sj]AlphaBlue.jpg[/attachment:o8f385sj]
Also, when this blue hue appears I notice a continuous bunch of sprites being drawn in the upper left corner which are not visible when the mouse is inside the window. It looks like my particle effect but I don’t know why it would be there. There is only one effect running and it is a copy of the template that I loaded. Could it be the template? When on pause it is more obvious that there is something going on in the upper corner. When the game goes on pause, it fades slightly. Whenever my games fades, I get this problem in the corner.
[attachment=0:o8f385sj]PausedProblem.jpg[/attachment:o8f385sj]
redsparkParticipantI updated the modules and the extra module and used CopyEffect() instead of the tlEffect directly and it seems to work fine.
redsparkParticipantI didn’t call SetFrequency(). But I’m having a problem with the particles.update() for the particle manager now. It complains about a null object. I think I read somewhere in another thread about this. I’m going to take a look and see if I can update everything.
The Vaders wont run for the same reason. But the basic particle demo in the docs folder works fine. So I have to have something incorrect.
I also noticed in the tween module that the tween has a create method rather than a create function. I switched that around. I think I remember that being mentioned to do that too. May be I just have an old copy of the module and I need to update.
redsparkParticipantThanks.
redsparkParticipantCould the editor be able to load a background image? It would help to get things like size and color correct. Thanks.
redsparkParticipantI’d love to see attractors and deflectors. I have a candle in my main gui that is on most of the time. However, when the player quits the game, if the candle is still on, one of the character is suppose to turn and blow it out. It would be nice to have the flame react properly to the blowing by using an attractor or something like that. Thanks.
redsparkParticipantCool! Thanks.
-
AuthorPosts