Skyline Editor related tips n tricks!

3D Sound playing while loading

3D Sound playing while loading

Postby CreativeOcclusion » 13 Apr 2016, 20:01

When I add the 3D sound action to the models, all the sounds play while the scene is still loading...When the scene is fully loaded the sounds go to their normal 3D behavior...

What would be the best approach to fix this?...Should I disable them at the beginning?....Any advice on how to handle this will be appreciated...

I am wanting to do a narration at the beginning of the level...All these sounds will interfere with this narration...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 365
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: 3D Sound playing while loading

Postby StarFire » 13 Apr 2016, 22:25

I will have a look at this for you tmoz if you have not found a solution, poss problem in the action code. Also I think we are going to need some sort of audio mute and/or maybe limit sounds to game states?
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1420
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: 3D Sound playing while loading

Postby StarFire » 14 Apr 2016, 15:12

There was a small problem with the 2D and 3D audio action where by, if the action was disabled in scene edit mode it would not play when dynamically setting the action to enabled in play game mode. I have fixed the action for you and it will be in the next release. :D

Try this script when you get the update as it is designed to turn on/off the actions when entering or exiting a game state. This way you could enter the first state and do your narration then switch back to main state and the sounds will run.

Note:requires update for audio to work correctly.
Code: Select all
function onInit(objID)
   -- Set all audio objects tag name to "audio_1","audio_2","audio_3", "audio_x" etc
   -- then you could do the following:
   
   sky.setGameState(enum.GS_GamePaused());

   -- use the game paused events to do your intro naration
   -- then switch back to the main game state when ready to play.
end

function onKeyDown( key )
   if(key=="1") then sky.setGameState(enum.GS_GamePaused()); end
end

function onKeyDown_GamePaused( key )
   if(key=="2") then sky.setGameState(enum.GS_GameMain()); end
end

--Enter into the Paused game state and only use pause related functions.
function onEnter_GamePaused(  )
   for i=1,4 do enableAduio(i,"false"); end
end

-- Entering into the normal Main Game state.
function onEnter(  )
   for i=1,4 do enableAduio(1,"true"); end
end

function enableAduio(audioID, state)
   targetID = entity.getIDFromTag("audio_"..audioID)
   actionID = action.getActionID(targetID, "Audio - 3D Positional");
   action.setActionParam(targetID, actionID, "A3D Enabled", state);
end


At the moment I think this would be your best bet. :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1420
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: 3D Sound playing while loading

Postby CreativeOcclusion » 14 Apr 2016, 17:15

Thanks...I will work on something else until the update...I appreciate you taking the time to look into it...CO
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 365
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: 3D Sound playing while loading

Postby StarFire » 14 Apr 2016, 17:45

no problem :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1420
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer


Return to Skyline Editor

Who is online

Users browsing this forum: No registered users and 2 guests

cron