Royale Archer
Member
I'm following the tiny town tutorial to help develop learn the language but Sometimes it seems like in missing information, I'm in the sequences section and ive used all the code it provides in the proper places but when i press the S key i get an error that curSeqLayer is not set before the program reads it. this is all the code I have
room start
game start
key press - S
if the tutorial is correct i should be able to play my sequence when I press the S key but thats not what happens
room start
GML:
// Mark Sequences layer
if (layer_exists("Cutscenes")) {
curSeqLayer = "Cutscenes";
}
else {
curSeqLayer = "Instances";
}
GML:
// Sequence states
enum seqState {
notPlaying,
waiting,
playing,
finished,
}
// Sequence variables
sequenceState = seqState.notPlaying;
curSeqLayer = noone;
curSeq = noone;
GML:
// Set Sequence to centre of Camera view
var _camX =
camera_get_view_x(view_camera[0])+floor(camera_get_view_width(view_camera[0])*0.5)
;
var _camY =
camera_get_view_y(view_camera[0])+floor(camera_get_view_height(view_camera[0])*0.5
);
// Create Sequence on the proper layer
if !(layer_sequence_exists(curSeqLayer,seq_endGame)) {
if (layer_exists(curSeqLayer)) {
layer_sequence_create(curSeqLayer,_camX,_camY,seq_endGame);
// Make sure Cutscenes layer is above the action
layer_depth(curSeqLayer,-10000);
}
}