Help with Visual Novel Engine (CAPX included)

Get help using Construct 2

Post » Sat Nov 16, 2013 6:08 am

Good day, o wise patrons of Scirra! I have been making a prototype visual novel for two days now, and I just want to ask you guys for advice before this little project of mine gets out of hand.

You see, I am having trouble figuring out the best/most-code-efficient way to program my game's script. Basically what sprite and background to show, what text to display for dialog and names, what animations and transitions to play, and what BGMs, SFXs and Voices to play. I am trying my best to use arrays because I believe they are the most effective to use in this situation. However, am having trouble deciding how to input my data into the array's indices.

Using traditional XY coordinates makes it difficult to remove dialog once it's been written in (from editing the script for example), as if it's been set in stone because it would leave big gaping holes inside my array. And I only increment my current position variable one at a time. I figured I could just write a little line that said that whenever my position is in an index with a value of 0 (an empty array index) just increment my position by 1. However I can't seem to find the right place to put this line as my text display code is in a group that gets activated and deactivated per dialog line. (You can thank Construct2 genius Kyatric for that one! Space Jinx was extremely helpful for this little project.)

The second method I tried was using the Push & Pop method. This method lets me easily remove dialog even after I've written it because they don't leave gaping holes in my array. However this freedom comes at the price of me not being able to easily find at what index I should trigger an event like an animation change.

Should I just use one array for each aspect of my script? eg. One for the dialog, name of speaker, background, sprite, sprite animation, sprite transition, bgm, sfx and voice?

I am also having problems figuring out the best way to input story paths that are actually affected by choices (not just simple one-liners like most linear visual novels, as I'm trying for a classic, branching storyline with multiple endings).

Please help me out guys, I've tried my best here and I keep coding myself into a corner - and not even writing my ideas down on paper helps!

Here are both of my Capx's, commented as best as I can, for those who are brave enough to look at my messy code. Oh, and please don't laugh at my graphics. They are just place holders. Thank you for your time.

EDIT: They're animated, by the way! Might want to check them out.

Using XY input method
https://www.dropbox.com/s/atczxz3o3ba41cf/Kouji%27s%20VN%20Engine%20Beta%20XY%20input.capx

Using push&pop input method
https://www.dropbox.com/s/s1ukt8g04w7c7p9/Kouji%27s%20VN%20Engine%20Beta%20PUSHPOP%20input.capx floatingsunfish2013-11-16 12:27:13
(insert subliminal message here.)
B
15
S
4
G
1
Posts: 18
Reputation: 955

Post » Sat Nov 16, 2013 11:03 am

I've prototyped a visual novel engine for free Construct 2 (intended to write a tutorial for it) and just put everything into one array. Worked well, imported via CSVtoArray and blank fields are set to -1 and ignored later in the script.

Why would you need to remove anything from the array in the process? Modify maybe, but even that is not really necessary oO.mindfaQ2013-11-16 11:04:36
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sat Nov 16, 2013 11:15 am

Thank you for the reply mindfaQ.

Because the script is still being constructed, some lines of dialog may one day need to be removed (like a bunch of sentences that don't contribute to the story all that much). This causes problems in my system because they're basically inside cells that need to be read one by one - which causes problems due to my line-reading group that only reads one line at a time. Any blank fields cannot simply be skipped because they get read as 0's.

From what you say maybe I could just use the second dimension of my array to add 1's and 0's to determine whether a certain line needs to be skipped? Hmm..

Oh, and if you don't mind, could you please clarify what you meant by "CSVtoArray and blank fields are set to -1 and ignored later in the script"? I'm afraid I didn't quite catch that.

I'm looking forward to your tutorial if ever it comes into fruition. Please drop the link below if you find the time to make it! Thanks again!
(insert subliminal message here.)
B
15
S
4
G
1
Posts: 18
Reputation: 955

Post » Sat Nov 16, 2013 11:34 am

CSVtoArray is a Construct 2 plugin. I can write the dialog lines and actions into a table in LibreOffice Calc or Excel, then import the contents into Construct 2.

My data looks like this:

you see only few fields are filled. Only the filled cells will be processed. The empty ones will be set to -1 in Construct 2 and thus be ignored by the code via a simple condition.

If you later on wanna add or remove lines inbetween, this is easy to do in Excel/Calc by adding/removing rows.

And as you said - you could also add a column that tells the script whether to completely ignore the line or not.

I am at the fifth page of my tutorial, but all the explainations make it really long - so I've paused the writing atm.mindfaQ2013-11-16 11:38:23
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sat Nov 16, 2013 11:48 am

Thanks again for the quick reply. Wow, that plugin sounds like a lifesaver! Man, I've been missing out, haha!

Anyway, best of luck on your tutorial! Know you always have a fan in me, and drop me a link once it's finished! I'd love to see what you've come up with. Really looking forward to it!

Oh, and for those of you who happen to read this, please continue to post your tips and advice here! Also feel free to modify my .capx and post your improved version here for all to see! Let's help introduce Construct 2 to the world of Visual Novel-making!    floatingsunfish2013-11-16 12:48:46
(insert subliminal message here.)
B
15
S
4
G
1
Posts: 18
Reputation: 955

Post » Fri Dec 06, 2013 2:05 am

Can somebody make a Visual Novel creation detailed tutorial please?
B
8
S
2
Posts: 7
Reputation: 516

Post » Fri Dec 06, 2013 2:38 am

Make external txt file with array, add that file to your project, and fill it up with dialog ( look up how arrays look in json form) then use ajax to load array from json string. For choices use tokenat and numeriacal variable. same for outcomes.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Mar 03, 2014 10:15 pm

um,.if any of you guys need music for VN please contact me. Here's some samples, Thank you

soundcloud.com/danguvibe/sets/visual-novel-musics
B
8
S
1
Posts: 14
Reputation: 414


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 25 guests