Author Topic: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry  (Read 242776 times)

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #540 on: April 27, 2015, 09:00:46 PM »
well, I mean,Simplified Chinese shows ????? in this game text.

our programmer solved this problem by adding an empty line in lib_boss.dnh and lib_enemylibs.dnh
[attach=1]
[attach=2]
line numbers of ?#include? goes wrong when changing to UTF-16.


eg.[attach=3]

[attach=4]

it should read "zakodraw", but it reads"/zakolib/zakolib/..."



edit:it causes more strange bugs, sad

You have to use an appropriate font.

Also, if you're talking about ObjFileB_ReadString, that function can read non-Shift-JIS text with the correct setting, but it will not output non-Shift-JIS characters. Read here for a workaround.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #541 on: April 29, 2015, 03:09:04 AM »
I'm getting a silent crash. No error; only a vague message at the end of the log, and sometimes even that doesn't appear:

Code: [Select]
2015/04/29 02:58:05.581 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/cut00.wav]
2015/04/29 02:58:05.583 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/eco01.wav]
2015/04/29 02:58:05.585 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/freeze07.wav]
2015/04/29 02:58:05.588 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/loop001.wav]
2015/04/29 02:58:05.589 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/on01.wav]
2015/04/29 02:58:05.590 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/paper00.wav]
2015/04/29 02:58:05.592 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/power14.wav]
2015/04/29 02:58:05.594 DirectInput:終了開始
2015/04/29 02:58:05.595 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/se/sha00.wav]
2015/04/29 02:58:05.596 DirectInput:終了完了
2015/04/29 02:58:05.600 DirectSound:終了開始
2015/04/29 02:58:05.600 DirectSound:音声データ解放[C:/Users/Kook/Desktop/TISTUFF/.touhou/th_dnh_ph3_1pre6/th_dnh_ph3/script/CYws/cy5/system/se/seUseSpellCard.wav]
2015/04/29 02:58:05.712 DirectSound:終了完了
2015/04/29 02:58:05.717 ShaderManager:Shaderを解放しました(Shader Released)[ float4 lightDirection; 
float4 materialAmbient : MATERIALA]
2015/04/29 02:58:05.719 TextureManager:テクスチャを解放しました[__RESERVED_RENDER_TARGET__2]
2015/04/29 02:58:05.720 TextureManager:テクスチャを解放しました[__RESERVED_RENDER_TARGET__1]
2015/04/29 02:58:05.721 TextureManager:テクスチャを解放しました[__RESERVED_RENDER_TARGET__0]
2015/04/29 02:58:05.722 TextureManager:テクスチャを解放しました[__RENDERTARGET_TRANSITION__]
2015/04/29 02:58:05.724 DirectGraphics:終了開始
2015/04/29 02:58:05.725 DirectGraphics:終了完了
2015/04/29 02:58:05.727 アプリケーション終了処理完了

Obligatory code:

Code: [Select]
#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["St1 Sp3"]
#Text["Third spell!"]
#Player["./../../player/player0.dnh"]
#System["./../../system/system.dnh"]
#include "./../../prologue.dnh"
#include "./../../player/shotc.dnh"
let id = 28;
let level = 7;
#include "./../spell_header.dnh"
#include "./render_boss.dnh"

@Event {
alternative (GetEventType)
case (EV_REQUEST_LIFE) {
SetScriptResult(6000);
}
case (EV_REQUEST_TIMER) {
SetScriptResult(72);
}
case (EV_REQUEST_IS_DURABLE_SPELL) {
SetScriptResult(true);
}
case (EV_REQUEST_SPELL_SCORE) {
SetScriptResult(spellBonus);
}
}

@Finalize {}

task TWork {
let height = GetStgFrameHeight;
let width = GetStgFrameWidth;
ObjEnemy_SetDamageRate(objBoss, 0, 0);
let d = getDifficulty;
let speed = 1 + 0.1 * d;
let count = truncate(1 + 0.34 * d);
let period = 240 / (1 + 0.15 * d);
let ways = 16 + 4 * d;
ascent (i in 0 .. 21) {
loop (count) {
let s = createCircleShot(width / 2, height / 2, 15 * i, period / rand(-1, 1), rand(0, 360),
DS_BALL_M_A_RED + truncate(rand(0, 8)), 120, 99999);
ObjShot_SetSpellResist(s, true);
ObjShot_SetAutoDelete(s, false);
}
}
task amulet(s, g) {
ObjMove_SetAngularVelocity(s, m * g);
wait(30);
ObjMove_SetAngularVelocity(s, 0);
}
let m = 1;
while (!isDead) {
let g = randomSign;
let a = GetAngleToPlayer(objBoss - 30 * m * g);
loop (ways) {
let s = CreateShotOA1(objBoss, 2.9, a, DS_BILL_RED, 0);
amulet(s, g);
a += 360 / ways;
}
m += 0.05;
wait(period / 3);
}
ObjEnemy_SetDamageRate(objBoss, 100, 100);
}

And no, it's probably not a divide-by-zero error.

Edit: yep, misplaced parenthesis. I don't know why DNH doesn't show an error such as "Attempted operation on invalid object".
« Last Edit: April 29, 2015, 03:18:28 AM by Fluffy8x »
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #542 on: April 29, 2015, 12:07:41 PM »
I have a question regarding BGM and sounds.

When I load my Stage, i am loading the BGM with
        let objBGM = ObjSound_Create;
   ObjSound_Load(objBGM,BGMPath);
Everything works great, i can play it later with

   ObjSound_Play(objBGM);

But as soon as I spawn some enemys, the strange thing starts.
After 5-6 Enemy explosion sounds, the BGM "jumps" a few seconds forward and then continues playing normally. It happens again after ~2min (when the stage is already over) that the music "jumps" again

Enemy Explosion sound:
The enemy starts the sound with this Task as soon as it dies:

task PlaySFX(name, Volume){
   let SFXPath = "script/ShatteredSky/snd/SFX";
   let objSound = ObjSound_Create;
   ObjSound_Load(objSound,SFXPath ~ name);
   ObjSound_SetVolumeRate(objSound,Volume);
   ObjSound_Play(objSound);
   loop(180) { yield; }
   Obj_Delete(objSound);
}

The enemy itself has a loop of 200 frames before the script closes.
€dit2: I figured out that not deleting the sound object (SFX) fixes the problem. But I don't want to not-unload them, because I don't want it to affect the framerate.

Can you help me?
Edit: didn't wanted to post it that early ._. Keyboard WHYY??
« Last Edit: April 29, 2015, 01:30:09 PM by Eredom »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #543 on: April 29, 2015, 01:32:43 PM »
I have a question regarding BGM and sounds.

?dit2: I figured out that not deleting the sound object (SFX) fixes the problem. But I don't want to not-unload them, because I don't want it to affect the framerate.

Can you help me?
Edit: didn't wanted to post it that early ._. Keyboard WHYY??

ObjSound_SetSoundDivision

Use this - if DNH treats a BGM as a Sound Effect, strange things happen. Other way as well.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #544 on: April 29, 2015, 01:46:15 PM »
Thank you for your answer :P
I am using SoundDivision, still doesn't work the way I want it to.


task PlayMusic(Volume){
   ObjSound_SetVolumeRate(objBGM,Volume);
   ObjSound_SetSoundDivision(objBGM,SOUND_BGM);
        ObjSound_SetRestartEnable(objBGM, true);
        ObjSound_SetLoopEnable(objBGM, true);
        ObjSound_SetLoopTime(objBGM, 1,204);
   ObjSound_Play(objBGM);
}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #545 on: April 29, 2015, 01:54:13 PM »
Hi!
I try to implement a Continue system. I try to do this in the EndScene script. When the player has no remaining lives, the EndScene start and all work well but the stage script end and I can't return to it at the exact point where it stopped. I search in the function list on the wiki but i found nothing useful that can help me.
I also try to use a pause-like script but I can't pause the entire game while the pause-like script is running. I try to use PauseStageScene function but it don't work on a stage script.

How I can do a clean and simple Continue system? Is there a way to integrate this in my EndScene script? I am a bit out of ideas...
« Last Edit: April 29, 2015, 01:56:17 PM by Lefkada »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #546 on: April 29, 2015, 03:11:18 PM »
I still have no idea how to solve my problem, I tried EVERYTHING!!!

- Playing BGM with #BGM
- Playing BGM with ObjSound
- Playing BGM with PlayBGM

- Playing SFX with Obj_Sound
- Playing SFX with PlaySE

For Obj_Sound I always used SetSoundDivision.
I made it working, that the SFX of the Enemys exploding doesn't make the BGM jump (by removing the Obj_Delete) , but as soon as the Midboss explodes (with a different explosion sound), the BGM jumps around again .__________.
Using my own shottype makes the music jump as well, using a downloaded shottype is fine. I looked into the script and there's no difference (both scripts load the SFX with LoadSound and play it with PlaySE)

It feels like Danmakufu just doesn't like me!

Edit: Here's a video of the problem. https://youtu.be/0kUzadDvsmI
The Script for loading the stage enemy explosion sound is the same as the one for loading the boss explosion at ~1:00.
But the BossExplosion buggs the music, the stage explosion doesn't. I just don't get it!
« Last Edit: April 29, 2015, 03:31:55 PM by Eredom »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #547 on: April 29, 2015, 03:39:38 PM »
@ Eredom, post entire script in pastebin.com here please. I think we're having trouble reading your code because you are posting bits of it.

Hi!
I try to implement a Continue system. I try to do this in the EndScene script. When the player has no remaining lives, the EndScene start and all work well but the stage script end and I can't return to it at the exact point where it stopped. I search in the function list on the wiki but i found nothing useful that can help me.
When a player dies or has no more remaining lives, GetStageSceneResult is mutated but also GetPlayerState is mutated. Debug text output those result and see what happens. What you need to do is prevent your stage script from closing. I have no continue mechanics but the pause method pretty much works the same way is my guess. A player who runs out of lives does nothing. Just like boss scripts, you need to define what happens when the game "ends".

Don't call CloseStgScene when your player died. Create a 'hearbeat / listener' inside your stage which tracks for if(GetPlayerState == STATE_END). Inside this loop, force a pause with a special menu or w/e you wish. Treat the menu like a normal pause and decide what happens. You can try to add lives here and then force continue the game to see what happens.

Most important is to mutate GetPlayerState, but I think that automatically happens if you add lives. Because STATE_END means no more lives left.

Debug text your values and see what happens. This is all I can come up with for now.

Quote
I also try to use a pause-like script but I can't pause the entire game while the pause-like script is running
This makes no sense. If you call the pause functions, everything in the stage script will stop running. PauseStageScene(bool); will enforce this.

Edit:
[attach=1]

This is how I have my game composed. The core script kicks off a loop which will track the ESC button and Stage results. The stage script contains the heartbeat/listener for player state.
« Last Edit: April 29, 2015, 03:51:35 PM by Helepolis »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #548 on: April 29, 2015, 03:54:26 PM »
Hey Helepolis :)

Here's the paste http://pastebin.com/BVGU0Mxc

It's not Everything but I think the most important stuff :P
The script was running on pre3, but i tried it with pre6a too and the error stayed the same.
I also uploaded the entire script folder to MediaFire: http://www.mediafire.com/download/dyw2go5ce1ohhe1/ShattSky.zip

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #549 on: April 29, 2015, 04:16:24 PM »
Hey Helepolis :)

Here's the paste http://pastebin.com/BVGU0Mxc

It's not Everything but I think the most important stuff :P
The script was running on pre3, but i tried it with pre6a too and the error stayed the same.
I also uploaded the entire script folder to MediaFire: http://www.mediafire.com/download/dyw2go5ce1ohhe1/ShattSky.zip
Try the following.
- Don't create global var for your music object like that (let musicobj = sound_create) etc.
- Change task PlayMusic into function prepareMusic(path) (remove the other parameters)
- Move the global let objBGM into your function.
- Remove the ObjSound_Play function.
- Add as final line in the function return objBGM;

Now create your sound obj by typing  for example: let music01 = prepareMusic(pathname); And then use  ObjSound_Play(music01) to play the music obj or w/e you want to do with it.

Important:
- Music files have to be OGG for lesser problems. Convert them to OGG if they aren't.
- Don't use  ObjSound_SetLoopTime but use ObjSound_SetLoopSampleCount and work with samples to define the loop region. More accurate and works better.

Try that first.
« Last Edit: April 29, 2015, 04:19:20 PM by Helepolis »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #550 on: April 29, 2015, 04:19:08 PM »
Helepolis> Thanks. I do that (in fact it's done since a long time but I call another CloseStgScene in an include of the script)
Code: [Select]
task TCloseScript {
while(GetPlayerState() != STATE_END) {yield;}
loop(140){yield;}
if(GetScore >= GetAreaCommonData(CDAN, "HiScore",1000000)) {SetAreaCommonData(CDAN, "HiScore", GetScore);}
SaveCommonDataAreaA1(CDAN);
loop(10){yield;}
if(GetCommonData("CONTINUES",-1) < 0) {
CloseStgScene();
} else {

}
}
When the player is out of lives, the script don't end and continue to run. But I have still no idea how to manually call a PauseScene in this else:
Code: [Select]
if(GetCommonData("CONTINUES",-1) < 0) {
CloseStgScene();
} else {

}
I call a script with    
Code: [Select]
StartScript(LoadScriptInThread(path)); but the stage don't stop running like in a Pause Script.
Oh and I do that out of a Package Script for the moment.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #551 on: April 29, 2015, 04:24:06 PM »
Helepolis> Thanks. I do that (in fact it's done since a long time but I call another CloseStgScene in an include of the script)
Code: [Select]
task TCloseScript {
while(GetPlayerState() != STATE_END) {yield;}
loop(140){yield;}
if(GetScore >= GetAreaCommonData(CDAN, "HiScore",1000000)) {SetAreaCommonData(CDAN, "HiScore", GetScore);}
SaveCommonDataAreaA1(CDAN);
loop(10){yield;}
if(GetCommonData("CONTINUES",-1) < 0) {
CloseStgScene();
} else {

}
}
When the player is out of lives, the script don't end and continue to run. But I have still no idea how to manually call a PauseScene in this else:
Code: [Select]
if(GetCommonData("CONTINUES",-1) < 0) {
CloseStgScene();
} else {

}
I call a script with    
Code: [Select]
StartScript(LoadScriptInThread(path)); but the stage don't stop running like in a Pause Script.
Oh and I do that out of a Package Script for the moment.
I don't think you should call anything manual. My core script isn't a package either. It is a normal loaded script. Stage script is basically Stg. I have 2 listeners in my game:  One runs inside the core script (for pause / stageresult) and one runs inside the stage script.

Did you try to move your TCloseScript into a perma running loop outside of the stage script? Don't use it as included part of the Stage script. I think your problem is there as you said yourself. Did you also try to catch a PlayerState outside the stage script?

Edit: Something like this:
Code: [Select]
Inside [ Core script or w/e.txt ]
{
Initialize stage(ry;
StateListener;
}

task StateListener {
// Pause menu
if(pressed ESC) { pausemenu; }

if(playerstate == DED && hascontinues > 0) {
launch special continue pause menu;
}

// To handle when a stage is cleared/player ded/stage disrupted
if(stageSceneState == STAGE_STATE_FINISHED) { }
}

« Last Edit: April 29, 2015, 04:28:48 PM by Helepolis »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #552 on: April 29, 2015, 04:39:38 PM »
Try the following.
- Don't create global var for your music object like that (let musicobj = sound_create) etc.
- Change task PlayMusic into function prepareMusic(path) (remove the other parameters)
- Move the global let objBGM into your function.
- Remove the ObjSound_Play function.
- Add as final line in the function return objBGM;

Now create your sound obj by typing  for example: let music01 = prepareMusic(pathname); And then use  ObjSound_Play(music01) to play the music obj or w/e you want to do with it.

Important:
- Music files have to be OGG for lesser problems. Convert them to OGG if they aren't.
- Don't use  ObjSound_SetLoopTime but use ObjSound_SetLoopSampleCount and work with samples to define the loop region. More accurate and works better.

Try that first.

Thank you for your answer :)
I changed the task into this function now:

function prepareMusic(path){
   let objBGM = ObjSound_Create;
   ObjSound_Load(objBGM, path);
   ObjSound_SetVolumeRate(objBGM,100);
   ObjSound_SetSoundDivision(objBGM,SOUND_BGM);
        ObjSound_SetRestartEnable(objBGM, true);
        ObjSound_SetLoopEnable(objBGM, true);
   return objBGM;
}

and I am calling it like this now in my stage script (in @Initalize):

   let music01 = prepareMusic(BGMPath);
   ObjSound_Play(music01);

But it didn't  work, the music is still bugging. (skipping a few seconds as soon as the midboss explodes).
I am using .ogg for the stage bgm and .wav for the sfx

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #553 on: April 29, 2015, 04:48:17 PM »
* Helepolis shrugs

That is strange. And what happens if you disable / comment out the SFX?. Disable all SFX in your game by commenting out (especially boss) and then play through. What happens when the enemies spawn and die?


Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #554 on: April 29, 2015, 04:51:50 PM »
If I disable
   // PlaySFX("/Enemy/ExplosionBoss(PH).wav", 90);
in my Midboss Script it works fine.

I have to go now for ~3 hours. (Stream) :/
Thank you very much for your help!

Oh and the enemys are loaded with entire scripts like a midboss (just declared as OBJ_ENEMY and not as OBJ_ENEMY_BOSS).

If they die, this gets executed (example is from the midboss):
{
   while(ObjEnemy_GetInfo(F1, INFO_LIFE) > 0)
   {
      yield;
   }

   let ex = ObjMove_GetX(F1);
   let ey = ObjMove_GetY(F1);
   PlaySFX("/Enemy/ExplosionBoss(PH).wav", 90);
   loop(10){
   DieAnimationBoss(ex,ey);
   }
   Obj_Delete(F1);
   Obj_Delete(Mark);
   DeleteShotAll(TYPE_ALL, TYPE_ITEM);
   loop(120){
   DeleteShotAll(TYPE_ALL, TYPE_ITEM);
   yield;
   }

   CloseScript(GetOwnScriptID());
}
« Last Edit: April 29, 2015, 04:53:47 PM by Eredom »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #555 on: April 29, 2015, 05:26:23 PM »
Helepolis> Actually my core script is the stage (with the #TouhouDanmakufu[Stage] label a the begening) script in witch I call another script for each stage.
Code: [Select]
if(pressed ESC) { pausemenu; } How I can do that? for the pressed ESC I know but for the pausemenu;... ?
Or it's a script different from the Default Pause Script? And if it's the case, how I can stop the stages and bosses scripts during this Script run?

edit:
I don't see that:
Quote
I see how you do but it don't work for me.
I make this:

CORE SCRIPT (which is a stage script in fact)
V
STAGES SCRIPTS loaded one after the other like that in a task called at in@Initialize
Code: [Select]
StartScript(stg1ID);
while(!IsCloseScript(stg1ID)) {yield;}
loop(10){yield;}
StartScript(stg2ID);
while(!IsCloseScript(stg2ID)) {yield;}
        etc.
V
BOSSES and other stuff loaded in each stage script with the same way.

I already try to use PauseStageScene(bool) but it don't work and danmakufu return me an error like "function not defined".

edit2:
Oh! I don't know StartStageScript exist. Maybe it can help me... or maybe not :(

edit3: Ok it just work in package script in fact :(
« Last Edit: April 29, 2015, 05:55:59 PM by Lefkada »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #556 on: April 29, 2015, 06:51:15 PM »
@ Eredom > I have no idea any more to be honest. Something tells me something is wrong with the sound files you use themselves but not quite sure about that.

@ Lefkada, So you got it working now or? I couldn't really get it from your last edit.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #557 on: April 29, 2015, 07:05:26 PM »
Nope. Nothing work and if I have understand how you do in your game I can't do this for the moment. You use Packages scripts's functions that don't work in stage scripts. But I'll work on a package script to handle all this stuff and I think I can do something like you.
Thanks for your help and sorry for the waste of time :(

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #558 on: April 29, 2015, 07:21:02 PM »
lol, I am sure none of this is a waste of my time. Otherwise I wouldn't bother helping now would I ? :V

I am using package functions indeed, and they aren't called from my StageScript. That is why I showed you the diagram. My title script is my actual package script. So I guess because I am running the core script from my Title (package) it allows me to use those. The stage script runs as a separate instance as also shown and is only booted by the StartStageScript function. Personally to me it sounds you got an issue with your core mechanics like the way you handle menus/stages and such which is preventing you from effectively using package functions.

Makes me bit curious how you actually Terminate and Initialize the stages. (TerminateStageScene etc).

Also I've been struggling really hard with the whole menus and stuff as well and for now, I have found this method the most effective (maybe not most efficient).

Once my game is finished and uploaded as online version, feel free to elicit / use code in there as learning sample. (Goes to every dnh person here, I don't mind people using my code to learn/change). But for that you need to have patience with that until I am back from Japan.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #559 on: April 29, 2015, 07:46:00 PM »
I tried using a BGM of white names spoiled past and dadada - works ._. but WHYYY? ._____. what's wrong with the file I have here? That's the big question

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #560 on: April 29, 2015, 08:04:22 PM »
For the moment my project is a giant work in progress mess so I don't have title script or menus yet. Therefore to test my stuff I just use a simple stage script to load/start/do all my stuff. My core script is just a stage script which call other stages scripts in fact. But it's just temporary. I planned to do something like you with just one more step (a package-title script, a core script to do all I need to do, a general stage script and several sub stages scripts).
To initialize the stages I start them with
Code: [Select]
StartScript and to end them I use
Code: [Select]
CloseScript(GetOwnScriptID);.

Thanks for the proposition. I'll download the online version to play it anyway :)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #561 on: April 29, 2015, 08:39:05 PM »
Oh I see. I intend also to expand my video tutorials now that I got more time on my hands. Sparen is already doing great job with the written ones so the videos will be simply visual aid.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #562 on: May 01, 2015, 06:25:32 PM »
Is there a good tutorial to learn how to make custom Item scripts out there?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #563 on: May 01, 2015, 07:36:52 PM »
Is there a good tutorial to learn how to make custom Item scripts out there?

As of right now, there is no such thing.

I could potentially write one, but Ultima is the person to ask for that, since he actually knows what he's doing when he works with items.

But basically, you will need a sprite sheet, an item shot sheet, perhaps specialized functions to create your items, and an item script that handles the EV_GET_ITEM and EV_DELETE_SHOT_TO_ITEM event cases. The item shot sheet functions as any other shot sheet:
Code: [Select]
#UserItemData

item_image = "./img/Item.png"

ItemData{
id = 1 //StrabiBonus
//type = POINTS
                rect = (0, 0, 19, 19)
render = ALPHA
out = (0, 23, 19, 37)
}

As for the item script, it can get a little confusing. Just make sure to do the following somewhere (preferably in @Initialize of your System file):
Code: [Select]
StartItemScript(GetCurrentScriptDirectory~"./../Item.dnh");
LoadItemData(GetCurrentScriptDirectory~"./../item_shotsheet.dnh");
The first line sets the given item script to your item script, and the second one loads the item shot sheet.

EDIT: I accidentally HTML.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #564 on: May 02, 2015, 10:13:35 AM »
One more question regarding Items.
I have a custom item that is dropped by a boss. But if I collect it, nothing happens. The EV_GET_ITEM in my player script doesn't trigger. (I placed a bullet shoot function in it to see IF it triggers and nothing happened).

Or is there a way to have the EV_GET_ITEM called in a non-player script?

I just don't get it.

EV_GET_ITEM is not defined.
(EV_GET_ITEMは未定義の識別子です)
script/ShatteredSky/SYSTEM/CustomItemScript.dnh
CustomItemScript.dnh line(行)=13

?dit: There's one thing I really don't understand. Why can't I call "EV_GET_ITEM" in my item script? It keeps saying EV_GET_ITEM is not defined.

That's everything in the item script atm:
@Initialize{
   LoadItemData("script/ShatteredSky/SYSTEM/lib_Item.dnh");
   SetDefaultBonusItemEnable(false);
}
@MainLoop{
   yield;
}
@Event{
   alternative(GetEventType())
   case(EV_USER+3){
      CreateItem(200, 200);
   }
   case(EV_GET_ITEM){
   }
}

(CreateItem Task down here)

and it keeps saying that EV_GET_ITEM isn't defined ._.
How can I get EV_GET_ITEM called when collecting a custom item?


Nevermind... After 4 hours I found my problem and I feel really dumb now ._.
I copy/pasted stupidly and had the item script always loaded as normal script
And I needed 4 hours to find that out!

Stupid me
« Last Edit: May 02, 2015, 12:24:20 PM by Eredom »

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #565 on: May 06, 2015, 01:30:50 AM »
Is it possible to save a screenshot as a .png, instead of always being stuck with .bmp?
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #566 on: May 16, 2015, 10:26:15 AM »
SOS!   ???  I have a problem with items. I tried different ways. When enemies die by player they spawn items. okay. But when enemy were not killed by player, and flew outside the screen (their lifes = 0) items spawn on x=0, y=0.

task ManageEnemy_Spirit(object,color){
            while(!Obj_IsDeleted(object) && ObjEnemy_GetInfo(object,INFO_LIFE)>0{
            ...
            yield;}
      loop(10){CreateItemA1(...);}}
      Obj_Delete(object);
« Last Edit: May 16, 2015, 10:27:54 AM by Zhan_fox »

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #567 on: May 16, 2015, 10:34:06 AM »
Code: [Select]
if (canDeleteEnemy(enemy)) {Obj_Delete(enemy); return;}
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #568 on: May 16, 2015, 12:02:33 PM »
Is it possible to save a screenshot as a .png, instead of always being stuck with .bmp?
Afaik you can't. 0.12m did also defaults also bmp files.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #569 on: May 18, 2015, 10:49:08 PM »
Is it possible to spawn enemy shots in a player script? For some reason CreateShotA1 won't work in a player script... is it designed that way or am I doing something wrong?
My name is Tres. It sounds like "Tray". Tressert is "Tray-zurt"; like Tres dessert.
I've cleared every touhou game on Lunatic, and beaten every extra except SoEW.
NMNB: MoF Hard, SA Extra, UFO Extra