D
ditherling
Guest
I... don't know how I can summarize what I'm asking for in the subject. So.
I'm trying to make a system that turns regular text files into visual novel scenes. Everything works up to the point of actually putting the data to use, and it's VEXING me because everything else has been relatively smooth sailing. I'm pretty new at doing this kind of problem-solving in code.
Basically, there's a line of text above the actual spoken dialogue which looks like this:
'ALCH' is a tag belonging to an element on the screen - here, it belongs to a sprite of the Alchemist character. The square brackets show all the commands for that element. Then you have actual commands inside.
Ideally, all these effects and movements will be done using the Novel_obj, using script_execute. The script, element tag, and arguments are passed into script_execute, and that works fine. It's the staging I'm struggling with.
Semi-colons are used to separate commands and command-sets that need to happen in sequence, one after the other. Without the semi-colons, they happen simultaneously.
BASICALLY IT WORKS LIKE THIS:
Then I'm trying to set up a system where there's 'command_stage[]' and 'set_stage' variables that start at 0, tick up when all the commands/sets in a stage are done, go back to 0 when the textbox clears.
Then I have 'command_stage_count[]' and 'set_stage_count', which track the stage the for loop is currently running through. Basically:
Can someone please help me tweak this so it does what I want? It's definitely not finished, but I'm stuck on what to do next. This is the most complicated thing I've ever tried to do. 0_0
also can someone show me how to do code formatting i've never used the forum before I'm big stupid.
I'm trying to make a system that turns regular text files into visual novel scenes. Everything works up to the point of actually putting the data to use, and it's VEXING me because everything else has been relatively smooth sailing. I'm pretty new at doing this kind of problem-solving in code.
Basically, there's a line of text above the actual spoken dialogue which looks like this:
Code:
> ALCH[MOVE(-1,LEFT,1); WAIT(0.5); MOVE(3,0.3,1)]; PAGE[MOVE(-1,RIGHT,1); WAIT(0.5); MOVE(3,0.7,1)]
Ideally, all these effects and movements will be done using the Novel_obj, using script_execute. The script, element tag, and arguments are passed into script_execute, and that works fine. It's the staging I'm struggling with.
Semi-colons are used to separate commands and command-sets that need to happen in sequence, one after the other. Without the semi-colons, they happen simultaneously.
BASICALLY IT WORKS LIKE THIS:
Code:
> ALCH[MOVE(3,LEFT,1);MOVE(3,RIGHT,1)]; PAGE[WAIT(0.5);MOVE(3,0.5,1)]
set_array[0,0] = "ALCH"
set_array[0,1] = alch_commmand_array
set_array[1,0] = "STAGE"
set_array[2,0] = "ALCH"
set_array[2,1] = page_commmand_array
alch_command_array[0,0] = "MOVE"
alch_command_array[0,1] = ["3","LEFT","1"]
alch_command_array[1,0] = "STAGE"
alch_command_array[2,0] = "MOVE"
alch_command_array[2,1] = ["3","RIGHT","1"]
alch_command_array[0,0] = "WAIT"
alch_command_array[0,1] = "0.5"
alch_command_array[1,0] = "STAGE"
alch_command_array[1,0] = "MOVE"
alch_command_array[1,0] = ["3","0.5","1"]
Then I have 'command_stage_count[]' and 'set_stage_count', which track the stage the for loop is currently running through. Basically:
Code:
// RESET COUNT
set_stage_count = 0;
for (var i = 0; i < array_length_1d(command_stage_count); i++)
{
command_stage_count = 0;
}
// EXECUTE COMMANDS
for (var set = 0; set < array_height_2d(set_array); set++)
{
if set_array[set,0] != "STAGE"
{
var element = set_array[set,0];
var commands = set_array[set,1];
for (var cmd = 0; cmd < array_height_2d(commands); cmd++)
{
if commands[cmd,0] != "STAGE"
{
if set_stage = set_stage_count and command_stage[set] = command_stage_count[set]
{
var command_script = commands[cmd,0];
var command_args = commands[cmd,1];
script_execute(command_script,element,command_args); // RETURNS TRUE IF DONE, FALSE IF NOT
}
}
else
{
command_stage_count[set]++;
}
}
}
else
{
set_stage_count++;
}
}
Last edited by a moderator: