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! <img src="smileys/smiley29.gif" border="0" align="middle" />
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.<img src="smileys/smiley17.gif" border="0" align="middle" /> Thank you for your time.
EDIT: They're animated, by the way! Might want to check them out. <img src="smileys/smiley2.gif" border="0" align="middle" />
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