Page 1 of 1

Various Questions

Posted: 20 Apr 2016, 14:28
by Elf of H & L
I don't know how to disable hud on lunalua
2nd question:Can use Lunalua in global codes?(Not single level)

Posted: 20 Apr 2016, 15:36
by h2643
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

Posted: 21 Apr 2016, 1:47
by Elf of H & L
Question 3:What?SDL2 Mixer don't play any sounds whatever the path correction.

Posted: 21 Apr 2016, 2:34
by Sambo
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.

Posted: 21 Apr 2016, 3:30
by Elf of H & L
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?

Posted: 22 Apr 2016, 20:54
by Sambo
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.

Posted: 23 Apr 2016, 23:08
by Wohlstand
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