anything related to UI in general, splash screens, UI widgets, input and output etc.

Menu system

Re: Menu system

Postby planetX » 28 Aug 2017, 18:09

Hi,

there's something which is pissing me off since some time ago and not sure if it is a bug or just me... for some reason, the first time I hit play in the editor, the sounds are not available (I got a bell sound, which I guess it's the default one). Sometimes gets fixed when stop and play again, but sometimes the bell sound continues until I add the sounds folder to the resources in the asset manager. I have to add that folder to the resources every time I launch Skyline.

Here's the code related to the sounds:

Code: Select all
-- ======== SOUNDS ===========
sound_music = 0
sound_page = 0
sound_click = 0
sound_beep = 0
sound_check = 0
sound_error = 0
sound_cash = 0


-- |=================================================================
-- |    ON INIT
-- |=================================================================
function Sound_onInit()
   -- ========= SOUNDS ====================================
   LoadAllSounds()
   --PlaySound( "sound_music" )
   
end
-- |=================================================================
-- |    END ON INIT
-- |=================================================================


-- ============================== SOUNDS ===================================

function LoadAllSounds()
   sound_music = LoadSound( 1, 1, "MR_MUSIC_menu2.ogg", 0 )
   sound_page = LoadSound( 0, 1, "MR_MENU_page.ogg", 0 )
   sound_click = LoadSound( 0, 1, "MR_MENU_clic.ogg", 0 )
   sound_beep = LoadSound( 0, 0.5, "MR_MENU_beep.ogg", 0 )
   sound_check = LoadSound( 0, 1, "MR_MENU_check.ogg", 0 )
   sound_error = LoadSound( 0, 1, "MR_MENU_error.ogg", 0 )
   sound_cash = LoadSound( 0, 1, "MR_MENU_cash.ogg", 0 )
end

function LoadSound( loop, volume, soundfile, stream )
   sound.setLooped( loop )
   sound.setVolume( volume )
   sound.setSoundFile( soundfile )
   sound.setIsStreamed( stream )
   return sound.create2DSound()
end

function PlaySound( thesound )
   if (thesound == "sound_music") then sound.play2DSound( sound_music ) end
   if (thesound == "sound_page") then sound.play2DSound( sound_page ) end
   if (thesound == "sound_click") then sound.play2DSound( sound_click ) end
   if (thesound == "sound_beep") then sound.play2DSound( sound_beep ) end
   if (thesound == "sound_check") then sound.play2DSound( sound_check ) end
   if (thesound == "sound_error") then sound.play2DSound( sound_error ) end
   if (thesound == "sound_cash") then sound.play2DSound( sound_cash ) end
end


Sounds are .ogg format, not sure if they must be in a specific frequency, mono or stereo, etc.

This issue is prior to the script "splitting", so I'm pretty sure that's not the problem. If you need more info just tell me. :)

Cheers!

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 28 Aug 2017, 18:19

ok sorry to hear that and i feel your pain lol :P it would annoy us also, I will have to add this to my bug list to try as once its added to resources, then it should be fine and work every time.

Is this a project or made in the Asset Library?
and are the sounds in the project/sounds folder or asset library/sounds folder?

we will do our best to resolve this issue for you :)

Edit: Also to answer format, .ogg is fine whether mono or stereo, this will be a resource issue.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby planetX » 28 Aug 2017, 19:59

Hi, thanks for quick reply!... it's a project, so the sounds are in the project/sounds folder. Actually, I always work in a project, I don't like to mess with the assets library. Also, all the sound files have a prefix so they are unique, although that's not needed anymore right? ;)

And just in case it's useful for you to debug, it also happened before with a mesh... I could see the mesh textured in a new scene but not in the main scene. Had some weird issues but finally solved it somehow, so maybe I was doing something wrong.

Thank you!! ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 28 Aug 2017, 20:37

thanks for the information :)

The current dev version(v0.9.9.0) is using new resource workflow where unique names are not required and will be the next update you get. The version you are currently running(v0.9.8.13) still requires a unique naming scheme. So this issue may have already been solved in the process when converting the code... but it certainly needs checked as we cant have one of our users angry with the engine lol :P

Just a quick note, it might be wise to double check that the resource lists for the project contain the sounds and that they are not read only.

Go to "$(YourProject)/Resource"
* then right click the files then go to properties and make sure read only is unchecked otherwise they will not be able to be written to again.
* Next open the "SkylineResources.cfg" and check if the sounds you are using exist in that list.
* Finally, it doesnt harm to delete both those files and allow the engine to regenerate them when you load the project or project scene as it may correct itself.

We will be testing projects in the next couple of days, so we will do some checks on your error to see if it happens for us.
Will let you know how it goes :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby planetX » 28 Aug 2017, 21:23

SolarPortal wrote: * Next open the "SkylineResources.cfg" and check if the sounds you are using exist in that list.


The sound files were repeated a lot of times, as many times I've added them I guess... :mrgreen:

But deleting the resource files did the trick. I didn't even know that there was such file in the project folder (stupid of me) I was deleting the resource files from Data/Resources all the time... but yeah, now I get it. Thanks to you for the info. ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 28 Aug 2017, 21:42

lol, glad that you have it working again, we should add something to stop multiple references, were they using different paths?
as this might cause that sort of error.

But good to hear its functioning again lol :P
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby planetX » 11 Sep 2017, 18:00

Hi there,

I'm having problems trying to run a function when a key or a joystick button is pressed... I've checked everything and still can't make it work, hope you can see what I'm doing wrong. The function is working, as I call it from clicking in a UI element, like this:

Code: Select all
<div class="button right"
   onclick="lua(scenescript,SetValue,car,more);">
   <div class="arrow right"></div>
</div>


... so the called function is something like this:

Code: Select all
SetValue( car , more )


As I said, if I click with the mouse, the thing is working, but when I call the function through the keyboard or joystick, nothing happens:

Code: Select all
if ( pressed_key == "right" or joy_direction == "East" ) then
   SetValue( car , more )
end


I have other functions which are fired from the keyboard/joystick, so you can relax, it's not a bug. I'm just doing something wrong.

Any clue? :oops:

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby StarFire » 11 Sep 2017, 21:58

Hi, it looks like the args for setValue() what does car = ? same with more = ?. They look like they are strings sent from the ui. Whereas from the keys you are passing a variable named car which must equal something.

If its not the above idea, do you have more example you could show?
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Menu system

Postby planetX » 12 Sep 2017, 08:07

I'm so stupid... :roll: I had the same issue before and you gave me the same solution:

StarFire wrote:They look like they are strings sent from the ui.


That was all... I just had to call the function in this way:

Code: Select all
SetValue( "car", "more" )


... and everything is working.

Sorry for the continuous stupidity, I have problems to differentiate variables from values when passing them as arguments.

Thanks a lot!! :D

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 12 Sep 2017, 09:01

lol no problem! Even i make the same mistakes in lua as there is no type definition like in c++, so its hard to tell what type a variable is. But that's why we are here to help :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby planetX » 17 Sep 2017, 16:08

Hi there,

has been a while since the last progress update. I've made huge structural changes and finally got everything working again. I had to change the navigation concept a lil bit to allow the player to use the joystick, the keyboard and the mouse. I've also changed the fonts and layouts to fit in a 1024x768 screen.

So basically, I've rewritten the whole thing and optimized all the lua scripts, the rml pages and the rcss styles. Still need to finish some sections and fix some bugs (I see in the video some flickering maps flying around, which I can't see in the engine ^^ ) but the basics are done. Hope you like it! ;)


My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 17 Sep 2017, 17:16

Superb! Love the switching of control types... i guess your close to starting the levels now :)
The UI is looking really sleek and professional now not too mentioned polished! Really great work and love your stuff :)
Keep it up!

:D

p.s. Just a quick note, on the next version of skyline, the audio has been slightly changed as sounds will now self delete, so if you reuse the same sound over and over without deleting or want manual holding of the sounds, then you will need to pass a 0 into the sound.createSound() function in the next version... when its released, ask me then if you have problems :P
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby planetX » 17 Sep 2017, 20:19

Thanks, glad you like it.

Yeah, I will continue with the race some day... there will be a bunch of GUI elements there too. :lol: Also waiting for the ribbons.

About the sounds, no problem. There's not much code there anyway, we'll see. ;)

Cheers

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Menu system

Postby SolarPortal » 17 Sep 2017, 20:26

Ribbons are on the list to be done ;)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Menu system

Postby StarFire » 17 Sep 2017, 20:29

Nice work as always :D
if the rest of the game is like your interface, we are all in for a treat :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Previous

Return to UI

Who is online

Users browsing this forum: No registered users and 4 guests

cron