Author Topic: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m [Closed, read last post!]  (Read 172298 times)

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #810 on: July 07, 2014, 12:57:24 AM »
So I think I found a dead-simple method of running Danmakufu without AppLocale. It involves downloading less than 1MB of files and copy-pasting them into the Danmakufu directory.
Would anyone mind testing it to see if it works?
https://www.shrinemaiden.org/forum/index.php/topic,17082.0.html
Playing Touhou since 18 March 2012. Playing video games since 19XX.
Normal 1CC: EoSD, PCB, IN, PoFV, MoF, SA, UFO, TD, DDC, HSiFS, CtC.
Extra 1CC: EoSD, PCB+Phantasm, IN, PoFV (K&S), MoF, SA, TD, HSiFS, CtC+Phantasm.
Hard 1CC: EoSD, PCB, IN, MoF, TD, CtC.
Lunatic 1CC: EoSD

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #811 on: July 07, 2014, 04:25:04 AM »
Python: Generally in the rest of the forum, double-posting should be avoided, but here I would recommend double-posting if you have another question afterwards, because it notifies people that there's been a new post that might need addressing. Otherwise it might be skipped over.

For my Boss Script, I want a Conversation to occur between the Fight and the Last Spells, so I added a Talk Event into the Script of the last
Attack and put this in @MainLoop:

Code: [Select]
if(GetPlayerScriptName == "player\Flandre\Flandre.txt" || "player\Flandre\FlandreB.txt" && GetLife < 1){
CreateEventFromScript("flan");
}

if(GetPlayerScriptName == "player\Remilia\RemiA.txt" || "player\Remilia\RemiB.txt" && GetLife < 1){
CreateEventFromScript("remi");
}

All Player Scripts exist, of Course.
However upon clearing the Spell Card, the Enemy just dies and the Script ends. Once the Talk Event showed up for about one Second and
then the Script ended. What am I doing wrong?
The statement a == b || c doesn't mean "a is either b or c", it means "either a is b, or c". So what you're looking for there is
GetPlayerScriptName == "string" || GetPlayerScriptName == "other string". Currently it wouldn't matter what player you were since any string or nonzero number will evaluate to true in an if statement.

Which means the problem is elsewhere anyways. It's probably that the script is just ending before the event actually plays out, but I can't tell without more. Maybe just pastebin the script you're talking about. Can you just run the event by itself (at the start of the script, for example) without any problems?

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Python

  • Plains of Chi-u have no end.
  • *
  • They are boundless and last forever.
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #812 on: July 07, 2014, 03:54:49 PM »
Have a look at my truly scrumptious scripts!.

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #813 on: July 08, 2014, 06:19:35 AM »
Oh. The problem is just that the script is ending before the event can be played. You can delay the next card after reaching zero health but it's more complicated than necessary. You can instead call the event from your final spell before anything actually starts, or you can make a dummy script that just contains the event. Not sure why I didn't catch that earlier.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Python

  • Plains of Chi-u have no end.
  • *
  • They are boundless and last forever.
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #814 on: July 08, 2014, 12:53:15 PM »
OK, thanks for your Help!
Yet another Question:

Is it possible to switch the Background Music in a Plural Script, like, have BGM1.wav for Spell 1 through 5 and then switch to BGM2.wav for Spells 6 through 8?
If so, how do you do it?
« Last Edit: July 08, 2014, 12:58:52 PM by Python »
Have a look at my truly scrumptious scripts!.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #815 on: July 08, 2014, 01:24:18 PM »
OK, thanks for your Help!
Yet another Question:

Is it possible to switch the Background Music in a Plural Script, like, have BGM1.wav for Spell 1 through 5 and then switch to BGM2.wav for Spells 6 through 8?
If so, how do you do it?
As far as I know, 0.12m only allows 1 music stream. If you simply stop the current music with the stop function then simply load + launch your new music and should be fine, make sure you do this in initialize. As long as you don't stop the music after loading, it will keep playing throughout the plural.

Python

  • Plains of Chi-u have no end.
  • *
  • They are boundless and last forever.
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #816 on: July 08, 2014, 04:41:02 PM »
Thank you.
Regarding the Talk Event:

You can instead call the event from your final spell before anything actually starts.

I tried inserting the Code calling the Event into @Initialize, however the Talk Event still doesn't work. I also removed the && GetLife < 1, otherwise
it wouldn't load anyways.
Have a look at my truly scrumptious scripts!.

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #817 on: July 09, 2014, 01:07:52 AM »
Ugh, it sucks having to remember all this 0.12-specific stuff. The problem now is just that GetPlayerScriptName() gives you the filename of the player script, without the path. So all you want is "RemiA.txt" instead of "player\Remilia\RemiA.txt".

Really though dude you should be testing these things to make sure the individual parts work at all. Does calling the talk event without the conditions work? If so, then the problem is obviously with the conditions. Can you force the condition to evaluate to true at all? What are the functions involved? What are they supposed to return and what do they actually return? This stuff is important.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Python

  • Plains of Chi-u have no end.
  • *
  • They are boundless and last forever.
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #818 on: July 09, 2014, 12:42:29 PM »
Yeah, I apologize.
I changed the File Path to just the Script Name and now it works.
Have a look at my truly scrumptious scripts!.

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #819 on: August 31, 2014, 11:55:21 AM »
This ain't a problem on my danmakufu. Somebody else that does not knows this forum )and cannot speak english) had this trouble, so I'm here on his behalf:

http://s11.postimg.org/jt9qayz6r/ZZZZZZZ.png

He installed Applocale, he has the japanese fonts, his OS is Windows 7 32 Bits and Danmakufu simply does not runs. Any ideas? Is there any other info I must ask him?
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #820 on: August 31, 2014, 12:03:43 PM »
He likely isn't actually running Danmakufu through AppLocale, since the window title is still mojibake. I can see "th_dnh.exe" selected in the file explorer window too.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #821 on: October 03, 2014, 09:05:36 AM »
So, I returned to Danmakufu after a long break, and I can't figure out what this error means (see attachment).

Here is the script: http://pastebin.com/t23gkMgF

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #822 on: October 03, 2014, 09:35:35 AM »
== is a logical operator. You're currently evaluating the expression (x == 0) and trying to execute the result (true or false), which makes no sense. The error is just that you can't call a variable (although in this case it's just a constant value) as though it were a function.

Really you just messed up = and ==.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #823 on: October 03, 2014, 02:07:05 PM »
I see. I guess I forgot. I haven't programmed anything C-like in a while. (I have done 6502 assembly lately which is completely different in structure).

Anyway, I wanted to make the boss to fire a wavy stream, but I can't figure out now to do it properly (I'm trying to use arrays to give the extra direction to add or subtract to the direction of the shot). I just can't seem to find how to read arrays so that it goes through the array, and goes to the beginning when the array ends. The task seems to just read the first value of the array.

Code: [Select]
task fire01 {
let Array = [0, 1, 1.75, 2.25, 2.5, 2.25, 1.75, 1, 0, -1, -1.75, -2.25, -2.5, -2.25, -1.75, -1, -0];
loop {
CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer+Array, BLUE12, 10);
PlaySE(CSD ~ "SFX\se_tan02.wav");
wait(1);
}
}

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #824 on: October 04, 2014, 03:52:41 AM »
Code: [Select]
ascent(i in 0..length(Array)){
    CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer + Array[i], BLUE12, 10);
}

Elements of an array are accessed by their index in the array. Syntax is as above. An ascent loop creates a temporary variable that starts at the lower value and increments on each loop until it hits the top value.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #825 on: October 04, 2014, 10:11:19 AM »
Got it working. Thanks.

By the way; Is there any way to play replays in Danmakufu since it doesn't seem to have it as a built in feature in 0.12m version.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #826 on: October 04, 2014, 02:20:10 PM »
Got it working. Thanks.

By the way; Is there any way to play replays in Danmakufu since it doesn't seem to have it as a built in feature in 0.12m version.

...It's built in. Go to the script you have a replay of, click it, and there should be "Play" followed by all replays of that script.

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #827 on: October 04, 2014, 08:16:11 PM »
...It's built in. Go to the script you have a replay of, click it, and there should be "Play" followed by all replays of that script.

What? It's there? I never actually looked there since I usually "spam" through the menus after I choose the script because I always use Reimu A. :D

7636kei

  • The Stardust Jannisary
  • You hear about that thing down in Samothrace?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #828 on: October 09, 2014, 08:50:30 AM »
What? It's there? I never actually looked there since I usually "spam" through the menus after I choose the script because I always use Reimu A. :D

Why, yes, they're there. Just before you get to choose who will play the script, if there's any replay, there will be a few lines below the Play menu. To replay it, just choose the replay. Mind that if you changed the script after the replay has been made, expect to face desynch.

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #829 on: October 10, 2014, 09:04:00 AM »
Mind that if you changed the script after the replay has been made, expect to face desynch.

I know. That's just logical.

Anyway, does anyone know how I can custom libraries for Danmakufu? You probably know about the CtC Shot Replace library. It's similar, but instead of shots, it contains my custom functions. It will become handy to keep scripts nice and clean.

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #830 on: October 10, 2014, 10:16:16 AM »
If you know how to use the CtC shot replace thing then you've already answered your question.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #831 on: October 10, 2014, 10:24:56 AM »
If you know how to use the CtC shot replace thing then you've already answered your question.

But the shot replace files use .dnh format. I don't know how to create them.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #832 on: October 10, 2014, 10:54:37 AM »
But the shot replace files use .dnh format. I don't know how to create them.
They can just be opened with notepad afaik. They don't use any encryption or anything last time I check their code.

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #833 on: October 10, 2014, 11:00:50 AM »
".dnh files" are just text files saved with a .dnh file extension instead of .txt. You can tell your computer to open all .dnh files with a text editor if you want.

The point is that you can just write up your functions in a separate script, just like how the shot replace script has a shot_init function in it, and use #include_function to include those functions in your script, just as you've already been doing when using the shot replace script.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #834 on: October 22, 2014, 05:48:35 PM »
I just got a new problem. I'm getting error that Danmakufu doesn't recognize "obj2" in "Collision_Obj_Obj(obj, obj2)" even though is clearly exists right under "task BreakerShot(x, y, v, dir, graphic, delay)". I also tried firing a BreakerShot first to make sure that the "obj2" is initialized before ShotA is fired, but it didn't change anything. I also tried setting "task BreakerShot" before "task ShotA", but that didn't work either.

Code: [Select]
task ShotA(x, y, v, dir, graphic, delay) {
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, v);
Obj_SetAngle(obj, dir);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
ObjShot_SetBombResist(obj, false);

let c = 0;
while(!Obj_BeDeleted(obj)) {
if(Collision_Obj_Obj(obj, obj2) == true) {
loop(25) {
CreateShot01(Obj_GetX(obj), Obj_GetY(obj), rand(2, 3.5), rand_int(0, 359), RED23, 5);
}
Obj_BeDeleted(obj);
}
wait(360);
ObjShot_FadeDelete(obj);
}
}

task BreakerShot(x, y, v, dir, graphic, delay) {
let obj2 = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj2, x, y);
Obj_SetSpeed(obj2, v);
Obj_SetAngle(obj2, dir);
ObjShot_SetGraphic(obj2, graphic);
ObjShot_SetDelay(obj2, delay);
ObjShot_SetBombResist(obj2, false);

let c = 0;
while(!Obj_BeDeleted(obj2)) {
yield;
}
}

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #835 on: October 22, 2014, 05:51:52 PM »
I just got a new problem. I'm getting error that Danmakufu doesn't recognize "obj2" in "Collision_Obj_Obj(obj, obj2)" even though is clearly exists right under "task BreakerShot(x, y, v, dir, graphic, delay)". I also tried firing a BreakerShot first to make sure that the "obj2" is initialized before ShotA is fired, but it didn't change anything. I also tried setting "task BreakerShot" before "task ShotA", but that didn't work either.

[ code has been removed from quote ]

When you define a variable inside of a task/function (a local variable), it only exists within that given task or function. Therefore, the object created in BreakerShot does not exist outside of BreakerShot and therefore cannot be accessed by ShotA.

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #836 on: October 22, 2014, 06:14:58 PM »
To add, even if you could access the same obj2 value across tasks, if you call BreakerShot() more than once then suddenly it's impossible to tell what obj2 means.

You're going to run into trouble with what you're doing. You have two sets of objects that you want to check collision between, but you can't simply tell any ShotA() object to collide with any BreakerShot() object. In order to be able to do what you want, you'll have to have an array of one kind of object, accessible by the other objects so they can loop through it and check collision. Or have an array for each, and a separate process to perform collision. (Or some other structure.)

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #837 on: October 23, 2014, 07:34:58 AM »
I not that familiar with arrays so someone probably has to explain me how I should do this. Just a basic array that goes through different values (like shot types) are not that hard, but I have no idea how to do it with object shots.

EDIT: I got a new problem now (the above one is still unsolved, but forget that for now). The @DrawLoop isn't working reliably. This means that the animation to a specific direction works sometimes, and sometimes it doesn't. It always loads the first sprite of the animation, but doesn't always "play" it. Also, when the boss stops, it rarely goes to the "idle" animation. I'm not really sure why this happens.


Code: [Select]
@DrawLoop {
SetTexture(Boss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(2, 2);
SetGraphicAngle(0, 0, 0);

if(int(GetSpeedX())==0 && int(GetSpeedY())==0) {
if(frame<40){ SetGraphicRect(0, 0, 31, 31); }
if(frame>=40){ SetGraphicRect(32, 0, 64, 31); }
frame+=4;
frame2 = 0;
}

if(GetAngle()>=315 && GetAngle()<=360) {
if(frame2<20){ SetGraphicRect(0, 96, 31, 128); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 96, 63, 128); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 96, 95, 128); }
if(frame2>60){ SetGraphicRect(32, 96, 63, 128); }
frame = 0;
frame2+=4;
}

if(GetAngle()>=0 && GetAngle()<=45) {
if(frame2<20){ SetGraphicRect(0, 96, 31, 128); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 96, 63, 128); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 96, 95, 128); }
if(frame2>60){ SetGraphicRect(32, 96, 63, 128); }
frame = 0;
frame2+=4;
}

if(GetAngle()>=135 && GetAngle()<=225) {
if(frame2<20){ SetGraphicRect(0, 64, 31, 96); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 64, 63, 96); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 64, 95, 96); }
if(frame2>60){ SetGraphicRect(32, 64, 63, 96); }
frame = 0;
frame2+=4;
}

if(GetAngle()>225 && GetAngle()<315) {
if(frame2<20){ SetGraphicRect(64, 32, 95, 63); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 32, 63, 63); }
if(frame2>40 && frame2<60){ SetGraphicRect(0, 32, 31, 63); }
if(frame2>60){ SetGraphicRect(32, 32, 63, 63); }
frame = 0;
frame2+=4;
}

if(GetAngle()>45 && GetAngle()<135) {
if(frame2<20){ SetGraphicRect(0, 32, 31, 63); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 32, 63, 63); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 32, 95, 63); }
if(frame2>60){ SetGraphicRect(32, 32, 63, 63); }
frame = 0;
frame2+=4;
}

if(frame == 80) {
frame = 0;
}

if(frame2 == 80) {
frame2 = 0;
}

DrawGraphic(GetX, GetY);
}

EDIT 2: I also need to make a custom shot sheet. Doing that is not the problem itself. What I can't figure out is that how do you actually fire the custom shot. There is literally no information about this anywhere...
« Last Edit: November 09, 2014, 03:57:04 PM by Yukkuri_Yukkuri_Yukkuri »

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #838 on: November 15, 2014, 05:55:19 PM »
Sotty for double post, but I have this enemy script: http://pastebin.com/qyeiirz5
Running it causes danmakufu to completely crash (not just freeze). I don't know why.

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #839 on: November 15, 2014, 06:06:11 PM »
Quote
EDIT 2: I also need to make a custom shot sheet. Doing that is not the problem itself. What I can't figure out is that how do you actually fire the custom shot. There is literally no information about this anywhere...
LoadUserShotData("shotdatapath"); for load the shot data and use the shot ID (set in the shot file) instead of the default shot's RED01 ?
Something like:

CreateShot01(x,y,speed,angle,1,delay); for spawn the shot with the ID=1.

For the animation, do you use frame1 and frame2 in the mainloop?
To make this I do somthing like that (adapted from ph3 so functions are not necessary good but is almost the same way in 0.12m):
Code: [Select]

        let anim = 0;
        let timer_anim = 0;
timer_anim++;
if(timer_anim == 0) {anim = 0;}
if(timer_anim == 10) {anim = 1;}
if(timer_anim == 2*10) {
anim = 2;
timer_anim = -1;
}
if((bossSpeed < 0) {
SetGraphicRect(1+32*anim, 0, 32+32*anim, 32);
} else if((bossSpeed > 0) {
SetGraphicRect(32+32*anim, 32, 64+32*anim, 64);
} else {
SetGraphicRect(1+32*anim, 64, 32+32*anim, 96);
}
The animation frames on the boss graphic file are 32x32 squares. And the "anim" variable horizontally shift the GraphicRect by 32 to shift to the next square.
I think you can also use a task instead of the drawloop.

(i hope it's clear).

Edit: for the enemy script problem, CDS is not defined in the script. And enemy have no life (it die immediatly after being created)
« Last Edit: November 15, 2014, 06:19:37 PM by Lefkada »