How do I add audio to specific lines of JSON code?

0 favourites
  • 2 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Hello! I'm a new user to Construct 3. I am currently using the Visual Novel Example template in the system to create a similar Visual Novel game. The main mechanic of this template is a JSON file that goes through and displays the text and images in a linear fashion. Something that I have been looking to do is add audio to my game via the Events tab. So far, I have been able to add a constant loop of background music and a repeating blip to play while the typewriter function is active. What I am currently looking to do is see if I can add more than one sound to play at different lines of the JSON file, as this novel features the voices of multiple characters that I want to simulate in the game. I was wondering if there was a system to tag the lines of the file to a certain common name to separate the voices and assign them with different audio files? I am looking for some guidance here from folks who have more experience with this software than me, and I appreciate any help I can get. Thank you!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • JSON is just a data storage format. You can add any values to it, but you will need to program the events to process these values. For example:

    JSON has ".Sound" key : Audio play by name JSON.Get(".Sound")
    

    .

    Wait, did you mean "Custom Visual Novel Engine" template? In this case all the information is loaded into an array, it's not using JSON object.

    You can add another column to the array for sounds:

    StatesArr Value at (9, gameState)≠""
     : Audio Play StatesArr.At(9, gameState) 
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)