Particles.lua???

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 180
Joined: Sat Sep 22, 2018 6:17 am
Flair: gee it sure is Booooring around here.
Current Project: Super Mario And The 10 Golden Elements
Chat Username: Hammerless penguin
Contact:

Particles.lua???

Postby Hammerless Penguin » Fri Sep 20, 2019 1:29 am

Does anybody know how to get it? That one lua code that gives you rain,snow ect. I've searched everywhere and had no luck finding it. Is it a built in feature in smbx2?
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797

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

Re: Particles.lua???

Postby Enjl » Fri Sep 20, 2019 2:00 am

Yes it is. You can simply load it with local particles = require("particles")

data/scripts/particles has some standard particle systems you can load, too.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 180
Joined: Sat Sep 22, 2018 6:17 am
Flair: gee it sure is Booooring around here.
Current Project: Super Mario And The 10 Golden Elements
Chat Username: Hammerless penguin
Contact:

Re: Particles.lua???

Postby Hammerless Penguin » Fri Sep 20, 2019 2:21 am

Enjl wrote:
Fri Sep 20, 2019 2:00 am
Yes it is. You can simply load it with local particles = require("particles")

data/scripts/particles has some standard particle systems you can load, too.
Is this how you are supposed do it?

Image
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797

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

Re: Particles.lua???

Postby Enjl » Fri Sep 20, 2019 2:23 am

No.
https://wohlsoft.ru/pgewiki/Particles.lua
Skip the "installation" section.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 180
Joined: Sat Sep 22, 2018 6:17 am
Flair: gee it sure is Booooring around here.
Current Project: Super Mario And The 10 Golden Elements
Chat Username: Hammerless penguin
Contact:

Re: Particles.lua???

Postby Hammerless Penguin » Fri Sep 20, 2019 2:27 am

Enjl wrote:
Fri Sep 20, 2019 2:23 am
No.
https://wohlsoft.ru/pgewiki/Particles.lua
Skip the "installation" section.
I finally got it to work now thanks.

Added in 6 minutes 47 seconds:
Enjl wrote:
Fri Sep 20, 2019 2:23 am
No.
https://wohlsoft.ru/pgewiki/Particles.lua
Skip the "installation" section.
One more question,Is there any more effects other than rain? The website only told how to do the flame and the rain one. Is there anymore like sandstorms,smoke,snow or fog.
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797

User avatar
Hoeloe
Grinder
Grinder
Posts: 1167
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: Particles.lua???

Postby Hoeloe » Fri Sep 20, 2019 9:05 am

Here's a list of all the particle effects that are built into the engine.

Image

You can also make your own using a custom .ini file in your level folder.

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

Re: Particles.lua???

Postby Enjl » Fri Sep 20, 2019 9:48 am

Enjl wrote:
Fri Sep 20, 2019 2:00 am
data/scripts/particles has some standard particle systems you can load, too.
That's where you can find what Hoeloe just posted.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 180
Joined: Sat Sep 22, 2018 6:17 am
Flair: gee it sure is Booooring around here.
Current Project: Super Mario And The 10 Golden Elements
Chat Username: Hammerless penguin
Contact:

Re: Particles.lua???

Postby Hammerless Penguin » Tue Oct 01, 2019 3:11 am

One more extra question. What if i wanted it to rain in only one section instead of the entire level? How do I do it?
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797

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

Re: Particles.lua???

Postby Enjl » Tue Oct 01, 2019 5:16 am

Only run the draw call after a check for player.section
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Volcano Lotus
Volcano Lotus
Posts: 580
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
Contact:

Re: Particles.lua???

Postby DrMekar » Mon Oct 28, 2019 12:25 pm

Enjl wrote:
Tue Oct 01, 2019 5:16 am
Only run the draw call after a check for player.section
I don't fully understand how that's meant. Doing it like this only leads to Error Message and
I can't find anythink about it in the Wiki article.

Image

Image
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: Particles.lua???

Postby Enjl » Mon Oct 28, 2019 12:45 pm

That's not how if statements work. You're trying to call a function. I'll give you the if statement but I also urge to check out the official lua documentation and learn the fundamentals of the language.
if player.section == 0 then
--do stuff
end
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Volcano Lotus
Volcano Lotus
Posts: 580
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
Contact:

Re: Particles.lua???

Postby DrMekar » Mon Oct 28, 2019 1:13 pm

Enjl wrote:
Mon Oct 28, 2019 12:45 pm
That's not how if statements work. You're trying to call a function. I'll give you the if statement but I also urge to check out the official lua documentation and learn the fundamentals of the language.
if player.section == 0 then
--do stuff
end
Thanks, but it's still not working. It says there should be a 'then' near the ',', everytime, not
mattering if I write == 0,1 or == 0
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: Particles.lua???

Postby Enjl » Mon Oct 28, 2019 1:49 pm

DrMekar wrote:
Mon Oct 28, 2019 1:13 pm
Enjl wrote:
Mon Oct 28, 2019 12:45 pm
That's not how if statements work. You're trying to call a function. I'll give you the if statement but I also urge to check out the official lua documentation and learn the fundamentals of the language.
if player.section == 0 then
--do stuff
end
Thanks, but it's still not working. It says there should be a 'then' near the ',', everytime, not
mattering if I write == 0,1 or == 0
https://www.lua.org/pil/4.3.1.html
Once you understand this my previous post should make more sense. Then again. Dunno where you put a comma.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Volcano Lotus
Volcano Lotus
Posts: 580
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
Contact:

Re: Particles.lua???

Postby DrMekar » Mon Oct 28, 2019 2:01 pm

Enjl wrote:
Mon Oct 28, 2019 1:49 pm
DrMekar wrote:
Mon Oct 28, 2019 1:13 pm
Enjl wrote:
Mon Oct 28, 2019 12:45 pm
That's not how if statements work. You're trying to call a function. I'll give you the if statement but I also urge to check out the official lua documentation and learn the fundamentals of the language.
if player.section == 0 then
--do stuff
end
Thanks, but it's still not working. It says there should be a 'then' near the ',', everytime, not
mattering if I write == 0,1 or == 0
https://www.lua.org/pil/4.3.1.html
Once you understand this my previous post should make more sense. Then again. Dunno where you put a comma.
I will defenitly take a look at this though the level it's used in needs to be done until Halloween.

Image

Here's the full code. I don't know what is meant with the comma either or where lua sees one. (The 0,1 is of course a Comma, though
I don't know how to write it else).

only writing 0 leads to a diffrent message telling me to add 'end'
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: Particles.lua???

Postby Enjl » Mon Oct 28, 2019 2:03 pm

every scope in lua needs to be closed. the end in my post was to close the if statement.
as for the comma, if you don't know logical operators like "and" and "or" and need to get the level done quick, i suggest just making two if statements - one checking for section 0, the other for section 1, cause the code you wrote is utter nonsense.
You also need to eventually uncomment the actual draw call.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Volcano Lotus
Volcano Lotus
Posts: 580
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
Contact:

Re: Particles.lua???

Postby DrMekar » Mon Oct 28, 2019 2:28 pm

Enjl wrote:
Mon Oct 28, 2019 2:03 pm
every scope in lua needs to be closed. the end in my post was to close the if statement.
as for the comma, if you don't know logical operators like "and" and "or" and need to get the level done quick, i suggest just making two if statements - one checking for section 0, the other for section 1, cause the code you wrote is utter nonsense.
You also need to eventually uncomment the actual draw call.

Code: Select all

function onCameraUpdate()
    if player.section == 0 then
    effect:Draw();
end

if player.section == 1 then
   effect:Draw();
end
It still says there needs to be a 'end' somewhere, but I just really don't know
where.
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

User avatar
Hoeloe
Grinder
Grinder
Posts: 1167
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: Particles.lua???

Postby Hoeloe » Tue Oct 29, 2019 7:47 am

Every time you write "function", "then", or "do", you need to have a corresponding "end" to close it off. Currently you have two "then"s, and one "function", but only two "end"s.

User avatar
DrMekar
Volcano Lotus
Volcano Lotus
Posts: 580
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
Contact:

Re: Particles.lua???

Postby DrMekar » Tue Oct 29, 2019 2:42 pm

Hoeloe wrote:
Tue Oct 29, 2019 7:47 am
Every time you write "function", "then", or "do", you need to have a corresponding "end" to close it off. Currently you have two "then"s, and one "function", but only two "end"s.
Of course. It works now, thanks alot ;)
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests