Need help with .hx Video Stuff #298
-
I was making a cutscene intro for the game so that after the BetaWarning Screen, it transitions to an MP4 (which I made a separate .hx file for). Unfortunately, I'm stupid and only learned LUA so I had to go off of existing .hx files and improvise by making educated guesses of what each one line of code did. Using that, I made, with some help from Nex, this beauty of a script (/s): package funkin.menus;
import funkin.game.cutscenes.ScriptedCutscene;
class PeterCutsceneIntro extends ScriptedCutscene {
public function new() {
super(Paths.video("betergriffin"), function() {
FlxG.switchState(new TitleState());
});
};
} Surely nothing will go wrong... If anybody is intelligent, please help me out here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
According to the script you provided, it seems you're trying to access a video file. In that case, it would be better to extend the Following this, change the
Changing this is necessary, because the I added comments to show how everything works. Here is the finalized result: package funkin.menus;
// Import the VideoCutscene class for use.
import funkin.game.cutscenes.VideoCutscene;
// Begin the class, extending VideoCutscene.
class PeterCutsceneIntro extends VideoCutscene {
public function new() {
// Call super() just as you would in a class with an extended class.
// Make sure that the video file in the first argument is named correctly, otherwise it likely will not work.
// For the second argument, switch states as you normally would.
super(Paths.video("betergriffin", "mp4"), FlxG.switchState(new TitleState()))
};
}
// EOF If there seem to be any more problems, please tell me. I haven't tested this, so there may be some small errors. |
Beta Was this translation helpful? Give feedback.
Ah, it might be on my end, then. I don't usually interact with substates, but since
BetaWarningState
is supposed to open up a state and not a substate, it might not work by default. I'd recommend importingflixel.FlxSubState
in that case intoBetaWarningState
, and then replace yourFlxG.switchState(new PeterCutsceneIntro())
withopenSubState(new PeterCutsceneIntro())
instead.