Various Questions

Description: Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.
Moderator: Moderators

Love Bodhi
Topic author, Close friend
Close friend
Avatar
Love Bodhi
Topic author, Close friend
Close friend
Age: 19
Reputation: 13
Posts: 89
Joined: 14 Nov 2014
Location: China

Post #1by Love Bodhi » 20 Apr 2016, 14:28

I don't know how to disable hud on lunalua
2nd question:Can use Lunalua in global codes?(Not single level)
Last edited by Love Bodhi on 21 Apr 2016, 1:48, edited 1 time in total.
(Sorry for my bad English.I'm Chinese)
Image

Join my Discord: https://discord.gg/22GUfFq

花仙魔法使者,变身!
迎春花的精灵啊,听从我的召唤,赐予我温暖的心灵,将所有爱心、美丽、智慧的力量,汇集起一切的信念、坚定和希望,让奇迹之光重生,让生命之花绽放,魔法凝结!

h2643 M
Contributor
Contributor
h2643 M
Contributor
Contributor
Reputation: 82
Posts: 327
Joined: 15 Feb 2014
Location: Ukraine
Skype YouTube VK

Post #2by h2643 » 20 Apr 2016, 15:36

1) This line disables the hud completely:

Code: Select all

Graphics.activateHUD = false

2) Yes, use lunaworld.lua instead of lunadll.lua, and place it in the episode folder or something. http://wohlsoft.ru/pgewiki/Lua_Files
<Knux> h2643 the super computer

Love Bodhi
Topic author, Close friend
Close friend
Avatar
Love Bodhi
Topic author, Close friend
Close friend
Age: 19
Reputation: 13
Posts: 89
Joined: 14 Nov 2014
Location: China

Post #3by Love Bodhi » 21 Apr 2016, 1:47

Question 3:What?SDL2 Mixer don't play any sounds whatever the path correction.
(Sorry for my bad English.I'm Chinese)
Image

Join my Discord: https://discord.gg/22GUfFq

花仙魔法使者,变身!
迎春花的精灵啊,听从我的召唤,赐予我温暖的心灵,将所有爱心、美丽、智慧的力量,汇集起一切的信念、坚定和希望,让奇迹之光重生,让生命之花绽放,魔法凝结!

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 20
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #4by Sambo » 21 Apr 2016, 2:34

Are you having problems with sound effects not working in general, or are you trying to play a custom sound effect?

If NO sound effects or musics are working (including the default ones), you need to set the system variable (This is for Windows only):
1) Go to "Control Panel\System and Security\System"
2) Click "Advanced System Settings" on the left panel
3) In the window that pops up, click "Environment Variables." It is toward the bottom.
4) Create a new variable called "QT_PLUGIN_PATH" (no quotes) and set it to the absolute path of the PGE editor program (inside qoutes) (ex. "C:\Users\Weslie\PGE\pge_editor.exe")

If just your CUSTOM sound effects aren't working:
1) Ensure that they are in .OGG format.
2) If they already are, try replacing this:

Code: Select all

Audio.playSFX("mySound.ogg")

with

Code: Select all

Audio.PlaySFX(Misc.resolveFile("mySound.ogg"))

where "mySound.ogg" is replaced with the name of your sound file. What Misc.resolveFile does is, it searches for the given file in:
1) The level's folder
2) The episode's folder
3) The LuaScriptsLib folder
4) The SMBX folder
... In that order. So, if the file is in any of those places, it should be able to find and play it.
Image
Current Project:
Image

Love Bodhi
Topic author, Close friend
Close friend
Avatar
Love Bodhi
Topic author, Close friend
Close friend
Age: 19
Reputation: 13
Posts: 89
Joined: 14 Nov 2014
Location: China

Post #5by Love Bodhi » 21 Apr 2016, 3:30

Sambo wrote:Are you having problems with sound effects not working in general, or are you trying to play a custom sound effect?

If NO sound effects or musics are working (including the default ones), you need to set the system variable (This is for Windows only):
1) Go to "Control Panel\System and Security\System"
2) Click "Advanced System Settings" on the left panel
3) In the window that pops up, click "Environment Variables." It is toward the bottom.
4) Create a new variable called "QT_PLUGIN_PATH" (no quotes) and set it to the absolute path of the PGE editor program (inside qoutes) (ex. "C:\Users\Weslie\PGE\pge_editor.exe")
I tried this,still no sound yet.This means I can't use SDL2 Mixer. Sorry.
Question 4:Lunaglobal.lua?
(Sorry for my bad English.I'm Chinese)
Image

Join my Discord: https://discord.gg/22GUfFq

花仙魔法使者,变身!
迎春花的精灵啊,听从我的召唤,赐予我温暖的心灵,将所有爱心、美丽、智慧的力量,汇集起一切的信念、坚定和希望,让奇迹之光重生,让生命之花绽放,魔法凝结!

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 20
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #6by Sambo » 22 Apr 2016, 20:54

I tried this,still no sound yet.This means I can't use SDL2 Mixer. Sorry.
You sure gave up easy.
Question 4:Lunaglobal.lua?
There is no global LunaLUA file, at least as far as I know. I don't know why you would want something like that, since changing the behavior of the engine on a global level could break other episodes anyway.
Image
Current Project:
Image

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 25
Reputation: 320
Posts: 1297
Joined: 15 Feb 2014
Location: Moscow, Russia
Website Skype YouTube

Post #7by Wohlstand » 23 Apr 2016, 23:08

Sambo wrote:4) Create a new variable called "QT_PLUGIN_PATH" (no quotes) and set it to the absolute path of the PGE editor program (inside qoutes) (ex. "C:\Users\Weslie\PGE\pge_editor.exe")
That no need because I fixed that bug long time ago. Latest PGE version (with most fresh SDL Mixer X which a my fork of SDL2 Mixer) plays all sounds and musics of any sample rate and supports any images and no more needs extra environment variables.

Sambo wrote:Audio.playSFX("mySound.ogg")
By default that sound is looking in level custom folder, to look in the episode folder must be:

Code: Select all

Audio.playSFX("../mySound.ogg")

Also, recent version of SDL Mixer X supports SFX formats: WAV, OGG, FLAC, MP3.
lunaworld.lua provides episode global code for all levels


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest