Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Moderator: Userbase Moderators
|
|
|
|
-
Hammerless Penguin
- Snifit

- Posts: 203
- Joined: Sat Sep 22, 2018 6:17 am
- Flair: Just kicking that kirby to the curb!
-
Contact:
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?
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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.
|
|
|
|
|
|
|
|
|
-
Hammerless Penguin
- Snifit

- Posts: 203
- Joined: Sat Sep 22, 2018 6:17 am
- Flair: Just kicking that kirby to the curb!
-
Contact:
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?

|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Fri Sep 20, 2019 2:23 am
|
|
|
|
|
|
|
|
|
-
Hammerless Penguin
- Snifit

- Posts: 203
- Joined: Sat Sep 22, 2018 6:17 am
- Flair: Just kicking that kirby to the curb!
-
Contact:
Postby Hammerless Penguin » Fri Sep 20, 2019 2:27 am
I finally got it to work now thanks.
Added in 6 minutes 47 seconds:
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.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Fri Sep 20, 2019 9:05 am
Here's a list of all the particle effects that are built into the engine.
You can also make your own using a custom .ini file in your level folder.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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.
|
|
|
|
|
|
|
|
|
-
Hammerless Penguin
- Snifit

- Posts: 203
- Joined: Sat Sep 22, 2018 6:17 am
- Flair: Just kicking that kirby to the curb!
-
Contact:
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?
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Tue Oct 01, 2019 5:16 am
Only run the draw call after a check for player.section
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 787
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
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.

|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 787
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
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
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 787
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
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.
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'
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9891
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » 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.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 787
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
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.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
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.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 787
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
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 
|
|
|
|
|
Return to “LunaLua Help”
Users browsing this forum: No registered users and 38 guests
|