Need help with Snow particle effect

Need help with any SMBX game-related issues? Ask your questions here.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on-topic/appropriate?
-Are you posting in the right forum/following the forum rules?
User avatar
Animebryan
Bit
Bit
Posts: 144
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Current Project: Star of Darkness
Contact:

Need help with Snow particle effect

Postby Animebryan » Fri Oct 04, 2019 10:39 am

I'm trying to use a snow effect in a level but I want to make the snow particles stand out more (bigger & less transparent) & increase their number. Also, using an example code, it displays throughout all sections, including indoors. How do I control which sections to have it display in?
Need serious help with Lua based features :(

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7626
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with Snow particle effect

Postby Enjl » Fri Oct 04, 2019 11:13 am

Only call the particle effect's draw function under the conditions you want it to draw. For example, after checking if player.section == 2.
To change the properties of the emitter, you can change the ini: https://wohlsoft.ru/pgewiki/Particles.lua#Values
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
Animebryan
Bit
Bit
Posts: 144
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Current Project: Star of Darkness
Contact:

Re: Need help with Snow particle effect

Postby Animebryan » Fri Oct 04, 2019 11:50 am

I need code examples
Need serious help with Lua based features :(

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7626
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with Snow particle effect

Postby Enjl » Fri Oct 04, 2019 11:54 am

function onDraw()
if player.section == 2 then
myEmitter:Draw(0)
end
end

You should already have a different name for myEmitter in your code.
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
Animebryan
Bit
Bit
Posts: 144
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Current Project: Star of Darkness
Contact:

Re: Need help with Snow particle effect

Postby Animebryan » Fri Oct 04, 2019 1:24 pm

Where would I put that code? And what do you mean "different name for myEmitter"?

Image
Need serious help with Lua based features :(

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7626
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with Snow particle effect

Postby Enjl » Fri Oct 04, 2019 1:28 pm

Animebryan wrote:
Fri Oct 04, 2019 1:24 pm
Where would I put that code? And what do you mean "different name for myEmitter"?

Image
As you can see, looking at my code and your code side by side, I call :Draw() on something. I named this something myEmitter to indicate that it is a particle emitter. In your code, it is called effect. All you need to do in your code is insert the check for player section, like I suggested in my first reply and illustrated in my other reply. The section number you need to insert depends on which section you want the emitter to draw in. Fairly simple conditional statement.
ImageImageImageImage
ImageImageImageImageImageImage


Return to “Help and Support”

Who is online

Users browsing this forum: TrashNomad64 and 2 guests