Various Questions

Description: Archive discussion
============================
Original 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.

Yingchun Soul M
Topic author, Viscount
Viscount
Avatar
Yingchun Soul M
Topic author, Viscount
Viscount
Age: 25
Reputation: 98
Posts: 370
Joined: 14 Nov 2014
English Pronouns: he / him
Location: China
Website

Post #1by Yingchun Soul » 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 Yingchun Soul on 21 Apr 2016, 1:48, edited 1 time in total.
迎春心情 (迎春心语 Alt.) in Chinese
Alt. nickname: "Elf of Happy and Love / 快乐爱的小精灵"

Check out my 2D Platform / TheXTech Assets:
Fairy Tale World
Nostalgic Paradise
Third Returns (Hiatus)

迎春花的精灵啊,请赋予我无尽的爱和指引,让每一座城在光明中重生,将大自然的力量和爱的力量集于一身吧!魔法凝结!

h2643 M
Forum admin
Forum admin
Avatar
h2643 M
Forum admin
Forum admin
Age: 23
Reputation: 112
Posts: 330
Joined: 15 Feb 2014
Location: Ukraine
YouTube

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

Yingchun Soul M
Topic author, Viscount
Viscount
Avatar
Yingchun Soul M
Topic author, Viscount
Viscount
Age: 25
Reputation: 98
Posts: 370
Joined: 14 Nov 2014
English Pronouns: he / him
Location: China
Website

Post #3by Yingchun Soul » 21 Apr 2016, 1:47

Question 3:What?SDL2 Mixer don't play any sounds whatever the path correction.
迎春心情 (迎春心语 Alt.) in Chinese
Alt. nickname: "Elf of Happy and Love / 快乐爱的小精灵"

Check out my 2D Platform / TheXTech Assets:
Fairy Tale World
Nostalgic Paradise
Third Returns (Hiatus)

迎春花的精灵啊,请赋予我无尽的爱和指引,让每一座城在光明中重生,将大自然的力量和爱的力量集于一身吧!魔法凝结!

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 26
Reputation: 15
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

Yingchun Soul M
Topic author, Viscount
Viscount
Avatar
Yingchun Soul M
Topic author, Viscount
Viscount
Age: 25
Reputation: 98
Posts: 370
Joined: 14 Nov 2014
English Pronouns: he / him
Location: China
Website

Post #5by Yingchun Soul » 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?
迎春心情 (迎春心语 Alt.) in Chinese
Alt. nickname: "Elf of Happy and Love / 快乐爱的小精灵"

Check out my 2D Platform / TheXTech Assets:
Fairy Tale World
Nostalgic Paradise
Third Returns (Hiatus)

迎春花的精灵啊,请赋予我无尽的爱和指引,让每一座城在光明中重生,将大自然的力量和爱的力量集于一身吧!魔法凝结!

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 26
Reputation: 15
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: 31
Reputation: 507
Posts: 1825
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

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
Image


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 4 guests