~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
Danmakufu Q&A Thread 4 - V3 Edition.
Nickster206:
Thank you so much for your reply! I tried messing around with the .def file after seeing your sample, and I figured out the problem!
I had declared package.script.main before window.title, and my window title had a "~" character in it. Even though the window would work with the ~ and launch to the regular danmakufu window, after removing it, it launched the package!
For further context, I am using your Woo version of Danmakufu, if that makes any difference in how the .exe interprets the .def. Either way, thank you for your help! It is greatly appreciated. :D
Hyouiibara:
I'm new to danmakufu, and each time I tried to run the engine, it crashes and leaves a file called "Gcprojectcrash", I already used locale emulator and I downloaded the Ph3 version
I already posted it in Moriya shrine, but no one replied
Thank you for your reply!
Pichuun! :power: :power: :power: :bigpower: :power: :power: :power:
WishMakers:
--- Quote ---I'm new to danmakufu, and each time I tried to run the engine, it crashes and leaves a file called "Gcprojectcrash", I already used locale emulator and I downloaded the Ph3 version
--- End quote ---
Can you explain your problem in more detail? What script were you trying to run, if any? When and where does it crash?
For the record, for PH3 Locale Emulator shouldn't be necessary so if you turn that off I think you'll be fine.
Lapis Lazuli:
Hello friends!
So I've been following Sparen's Danmakufu ph3 tutorials for a while, but I've gotten stuck at the process of creating a plural. Whenever I create a plural and try to run it in Danmakufu, the game refuses to give me an error warning and simply crashes on the spot, even though I've created the simplest plural imaginable. But, still, here's the text file for it:
--- Code: ---#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["Vs. Momiji"]
#Text["For Kiiro"]
@Event
{
}
@Initialize
{
TPlural;
}
@MainLoop
{
yield;
}
task TPlural
{
let dir = GetCurrentScriptDirectory();
let obj = ObjEnemyBossScene_Create();
// ObjEnemyBossScene_Add(obj, 0, dir ~ "momiji 1.txt");
ObjEnemyBossScene_Add(obj, 0, dir ~ "momiji spell 1.txt");
ObjEnemyBossScene_LoadInThread(obj);
ObjEnemyBossScene_Regist(obj);
while(!Obj_IsDeleted(obj)){
yield;
}
CloseScript(GetOwnScriptID());
}
--- End code ---
Again, I get no error message, so I have no idea what could be going wrong. Can anyone give me a hand, please? Thank you so much.
EDIT: Figured it out! Turns out it has to do with how notepad++ saves .txt files.
Nickster206:
I've got some trouble working with Package scripts now. When I run all my singles, plurals, and the stage through the normal menu everything works as intended. However, when I launch the game through the package script, something strange happens.
Whenever I hit "Retry from Beginning" in my pause script which returns RESULT_RETRY, it keeps the game paused, and a new instance of the game opens up in the same window while the previous instance remains paused. At this point, there will be a paused instance of the stage and a running instance of the stage, and only the running instance detects key inputs. If I repeatedly select retry, more instances of the stage will open in the same way.
If I hit "Return to Title" for RESULT_END, the currently running instance of the stage will close because of TerminateStageScene(), and the most recent previous instance of the game will render and begin accepting key inputs. This will continue until all instances of the stage are closed, at which point, the package will close.
The code for my package script is below.
EDIT: I found out what the problem was. I was restarting the stage from the pause menu, meaning I couldn't finalize the stage scene. I moved the recursive TStageScene call to a point after calling FinalizeStageScene and now it works.
--- Code: ---#TouhouDanmakufu[Package]
#Title["Touhou ~ Forlorn Souls of Wicked Past"]
#Text["-NL"]
#System["./system/Default_System.dnh"]
#Player["./player/player_reimu.dnh"]
@Initialize{
TStageScene(GetCurrentScriptDirectory ~ "x1/stage1.dnh", GetCurrentScriptDirectory ~ "player/player_reimu.dnh", "");
}
@MainLoop{
yield;
}
@Finalize{}
// STAGE SCENE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task TStageScene(let stagePath, let playerPath, let replayPath){
ClearCommonData;
// Prepare the Stage Scene ------------------------------
InitializeStageScene();
// If a replay was called ------------------------------
if(length(replayPath) > 0){
SetStageReplayFile(replayPath);
}
let indexStage = 1;
SetStageIndex(indexStage);
SetStageMainScript(stagePath);
SetStagePlayerScript(playerPath);
StartStageScene();
loop{
// Hitting the pause key
if(GetVirtualKeyState(VK_PAUSE) == KEY_PUSH){
let resPause = RunPauseScene();
alternative(resPause)
case(RESULT_RETRY){
if(!IsReplay()){
TerminateStageScene();
TStageScene(stagePath, playerPath, replayPath);
ClearCommonData;
}
}
case(RESULT_END){
TerminateStageScene();
// ClosePackage();
}
}
let stgSceneState = GetStageSceneState();
if(stgSceneState == STAGE_STATE_FINISHED){
let stageResult = GetStageSceneResult();
alternative(stageResult)
case(STAGE_RESULT_CLEARED){
TEndScene();
break;
}
case(STAGE_RESULT_PLAYER_DOWN){
TEndScene();
break;
}
case(STAGE_RESULT_BREAK_OFF){
// TTitleScene();
TEndScene();
// ClosePackage();
break;
}
}
yield;
}
}
// PAUSE SCENE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function RunPauseScene{
RenderSceneToTransitionTexture();
PauseStageScene(true);
let pathScript = GetCurrentScriptDirectory ~ "system/New_Pause.dnh";
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript)){
yield;
}
PauseStageScene(false);
let res = GetScriptResult(idScript);
return res;
}
// END SCENE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task TEndScene{
if(IsReplay){
// TTitleScene();
return;
}
FinalizeStageScene();
while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;}
let dirModule = GetModuleDirectory();
let pathScript = GetCurrentScriptDirectory ~ "system/New_EndScene.dnh";
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript)){
yield;
}
let result = GetScriptResult(idScript);
alternative(result)
case(RESULT_SAVE_REPLAY){
TReplaySaveScene();
}
case(RESULT_END){
// TTitleScene();
ClosePackage();
}
case(RESULT_RETRY){
TStageScene("","","");
}
}
// REPLAY SAVE SCENE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task TReplaySaveScene{
let dirModule = GetModuleDirectory();
let pathScript = GetCurrentScriptDirectory ~ "system/New_ReplaySaveScene.dnh";
let idScript = LoadScript(pathScript);
StartScript(idScript);
while(!IsCloseScript(idScript)){
yield;
}
// TTitleScene();
ClosePackage();
}
function RenderSceneToTransitionTexture{
let textureName = GetTransitionRenderTargetName();
RenderToTextureA1(textureName, 0, 100, true);
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version