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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #900 on: December 09, 2015, 08:34:52 AM »
Is there any method to unpack dat. files, that were archived by FileArchiver for ph3.
I lost my original scripts.

You can use X-Ripper, but it unpacks them with generic names like "file000, file001", etc.
Paty

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #901 on: December 09, 2015, 01:15:11 PM »
Here I am again-
I've got another question: how do I switch the HUD to "fullscreen" in a script?

Like this https://youtu.be/t9ICLqUh5vA?t=192
« Last Edit: December 09, 2015, 02:59:29 PM by Bic? »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #902 on: December 09, 2015, 03:52:22 PM »
Here I am again-
I've got another question: how do I switch the HUD to "fullscreen" in a script?

Like this https://youtu.be/t9ICLqUh5vA?t=192

To 'switch't to fullscreen... requires knowledge of how the System files work as well as a number of other things. Simply put, you will have to set a flag to move to fullscreen, and will then need to gradually change the default clips (for shots, player, etc) as well as a bunch of other things (such as the positioning of your score, etc) in order to reach fullscreen.

If you are new, I suggest not trying this right away, because it will most likely be a source of frustration without knowledge of how sprite lists and text are positioned, etc.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #903 on: December 09, 2015, 05:40:45 PM »
Is there any place that talks about how to spawn star patterns like Sanae's? I've been looking all over but can't find any. I tried looking at Ultima's MoF script but it kept crashing so I assume it's probably due to the version of the script being too old or something.

I do have an idea of how to spawn them but I'm worried it might be overly complicated. Is there any simple way to spawn them, and if so, could anyone share that?

Thanks!

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #904 on: December 09, 2015, 06:04:15 PM »
Is there any place that talks about how to spawn star patterns like Sanae's? I've been looking all over but can't find any. I tried looking at Ultima's MoF script but it kept crashing so I assume it's probably due to the version of the script being too old or something.

I do have an idea of how to spawn them but I'm worried it might be overly complicated. Is there any simple way to spawn them, and if so, could anyone share that?

Thanks!

The way ZUN does it was to spawn an invisible enemy and move the enemy around changing angles. Of course, we can do it abit differently than that, see the attached file. It isn't exactly how I did it in my old Sanae boss but this should prove to work better than that one anyway.

Here I am again-
I've got another question: how do I switch the HUD to "fullscreen" in a script?

Like this https://youtu.be/t9ICLqUh5vA?t=192

Disregarding what sparen said this is pretty simple to do, yes it does require you to modify the default system script (make sure to include this in your script when uploading it for others to play), but the task itself isn't particularly difficult at all for anyone.

You mainly just want to remove all of the HUD and use the SetStgFrame(left,top,right,bottom,min pri, max pri); the min and max priority arguments are 20 and 80 by default. For fullscreen you can use SetStgFrame(0,0,640,480,20,80);, to get the original screen back you use SetStgFrame(32,16,416,464,20,80);. The rest is just removing the HUD elements which are found within the system script, the default system script is located in script/default_system/ folder.
« Last Edit: December 09, 2015, 06:09:37 PM by Sage Ω (Ultima) »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #905 on: December 09, 2015, 06:12:20 PM »
I see, I had thought of spawning an invisible enemy to do the job as well. I didn't expect this other method though, thanks!

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #906 on: December 09, 2015, 06:24:32 PM »
Disregarding what sparen said this is pretty simple to do, yes it does require you to modify the default system script (make sure to include this in your script when uploading it for others to play), but the task itself isn't particularly difficult at all for anyone.

You mainly just want to remove all of the HUD and use the SetStgFrame(left,top,right,bottom,min pri, max pri); the min and max priority arguments are 20 and 80 by default. For fullscreen you can use SetStgFrame(0,0,640,480,20,80);, to get the original screen back you use SetStgFrame(32,16,416,464,20,80);. The rest is just removing the HUD elements which are found within the system script, the default system script is located in script/default_system/ folder.

Oh ok got it, thank you very much.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #907 on: December 09, 2015, 07:44:02 PM »
Just to make sure though; how does ZUN do it with the invisible enemy? I've been trying and I can't seem to get it to work no matter what I do. I mean maybe it's too advanced and should be saved for later but I didn't expect stars to be this difficult to make.

On that note; is it possible to spawn bullets in a line between two points? Like, let's say I have two enemies standing diagonal from each other across the screen, is it possible to spawn a line of bullets between them? Thanks!

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #908 on: December 09, 2015, 08:24:54 PM »
You can use X-Ripper, but it unpacks them with generic names like "file000, file001", etc.
Good program, but it unpacks only graphics, audio and video. Ok. But I have .txt files too. How to unpack them?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #909 on: December 09, 2015, 08:25:24 PM »
tween two points? Like, let's say I have two enemies standing diagonal from each other across the screen, is it possible to spawn a line of bullets between them? Thanks!

Yes it is. You take the two enemy positions (or positions in general), and first find the total distance and the angle from the first enemy to the second (using atan2). Then you figure out how many bullets you want to spawn.

If you want to spawn on the enemies as well, the space between bullets will be the total distance divided by (number of bullets - 1). Then start from the first enemy and use a for loop.
Code: [Select]
ascent (i in 0..numbullets) {
    //CreateShot at Enemy1X + i*(totaldistance/numbullets - 1)*cos(angle), Enemy1Y + i*(totaldistance/numbullets - 1)*sin(angle)
}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #910 on: December 09, 2015, 08:37:17 PM »
Ahh, I see. Is there a function for getting the distance between two objects or would I have to make one manually? I vaguely recall reading about something like that in the documentation but I can't seem to find it right now.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #911 on: December 09, 2015, 08:58:57 PM »
Ahh, I see. Is there a function for getting the distance between two objects or would I have to make one manually? I vaguely recall reading about something like that in the documentation but I can't seem to find it right now.

Use the distance formula, or use http://dmf.shrinemaiden.org/wiki/Other_Functions#GetObjectDistance

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #912 on: December 10, 2015, 12:28:27 AM »
Ahh, I knew there was one. Thanks!

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #913 on: December 10, 2015, 02:19:58 AM »
Sparen did the same thing I did a while back:



Except "frames" here is the number of bullets - 1 because you want to spawn at 0 too. Don't need an angle to draw a line when you already have the two points that define the line!

Code: [Select]
function bulletLine(x1, y1, x2, y2, n){
let dx = (x2 - x1) / (n - 1);
let dy = (y2 - y1) / (n - 1);
ascent(i in 0..n){
bullet(x1 + i*dx, y1+ i*dy);
}
}

Really this is just a matter of "I don't want to bloat by using distance and trigonometric functions when unneeded". It's still correct but yeah.

EDIT: fixed
« Last Edit: December 11, 2015, 11:19:42 AM by Drake »

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #914 on: December 10, 2015, 04:37:31 AM »

o_O

I completely forgot that you could do it that way.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #915 on: December 10, 2015, 10:41:44 PM »
My god I need to brush up on my mathematics. I have no idea what that code does just by reading it.

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #916 on: December 11, 2015, 07:23:14 AM »
dx and dy are the changes in x-position and y-position between each bullet. Takes the x-distance (and y-distance) between the two points (  (|x|) is absolute value of x) difference in x-position (and y-position) between the two points and divides it into n-1 chunks.

Say the second point is 60 pixels to the right from the first point, and 80 pixels downwards, and you want to make 21 bullets. Then dx is 60/20 = 3 and dy is 80/20 = 4, so each bullet is separated by +3 pixels horizontally and +4 pixels vertically. The loop starts by making a bullet at the same position as the first point (x1 + 0*3, y1 + 0*4) = (x1, y1) and it increments to put bullets (+3, +4) away from the first point, (+6, +8) away, (+9, +12) away, and so on until it eventually reaches the second point. You can see by looking at the picture that if you do this it makes a line.
« Last Edit: December 11, 2015, 11:22:00 AM by Drake »

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

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #917 on: December 11, 2015, 10:12:13 AM »
Actually, the code isn't correct if it uses the absolute value of the difference.
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

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #918 on: December 11, 2015, 11:16:13 AM »
Uh, yup. My bad.
« Last Edit: December 11, 2015, 11:21:08 AM by Drake »

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #919 on: December 11, 2015, 04:58:45 PM »
Ahhh, I see. That makes a lot of sense, thanks!

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #920 on: December 11, 2015, 07:21:26 PM »
Help  ???
Is there programm that can extract .dat files that where archived by FileArchiver Ph3. There gives programm that could extract pictures and audio. But no one extract .txt files. I have archived some .txt files, and accidentally deleted original one. Help!

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #921 on: December 12, 2015, 01:52:17 AM »
There is no way to get them back, and no one has made an archive dumper for ph3. Never delete your backups and always keep backups for this exact reason.

You could probably do some trick with ObjFile objects and reprint the text from the files in the archive assuming you know the name of them.

Code: [Select]
task TxtExtractor(filepath)
{
let objF = ObjFile_Create(OBJ_FILE_TEXT); // create a text file stream object
ObjFile_Open(objF,filepath); // open the file (not entirely sure if this part will work on archive files but worth a try)
ObjFile_Store(objF); // store the file again, since dnh itself cannot write to files it should make a copy on the HDD
Obj_Delete(objF); // cleanup
}

Tell me if it works since I don't have time to try it myself. If it doesn't then the data will be permanently stored in the archive.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #922 on: December 12, 2015, 09:42:25 AM »
There is no way to get them back, and no one has made an archive dumper for ph3. Never delete your backups and always keep backups for this exact reason.

You could probably do some trick with ObjFile objects and reprint the text from the files in the archive assuming you know the name of them.

Code: [Select]
task TxtExtractor(filepath)
{
let objF = ObjFile_Create(OBJ_FILE_TEXT); // create a text file stream object
ObjFile_Open(objF,filepath); // open the file (not entirely sure if this part will work on archive files but worth a try)
ObjFile_Store(objF); // store the file again, since dnh itself cannot write to files it should make a copy on the HDD
Obj_Delete(objF); // cleanup
}

Tell me if it works since I don't have time to try it myself. If it doesn't then the data will be permanently stored in the archive.

Unfortunately, it doesn't work. If using <ObjFile_OpenNW>* then it saves empty file, but of course with the same name.
Also thanks a lot for helping!

Edit:Danmkufu ph3 engine could see this .txt files in .dat files
« Last Edit: December 12, 2015, 09:57:49 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 #923 on: December 12, 2015, 10:56:35 AM »
and no one has made an archive dumper for ph3.

Not this?
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

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #924 on: December 12, 2015, 03:54:15 PM »
That was written for 12m, not ph3.


Unfortunately, it doesn't work. If using <ObjFile_OpenNW>* then it saves empty file, but of course with the same name.
Also thanks a lot for helping!

Edit:Danmkufu ph3 engine could see this .txt files in .dat files

Using NW will create a file if one doesn't exist. Before making sure you did this correctly, did you test the function after using the AddArchiveFile() feature? If so, then you are out of luck.
« Last Edit: December 12, 2015, 03:56:44 PM by Sage Ω (Ultima) »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #925 on: December 12, 2015, 05:59:06 PM »
That was written for 12m, not ph3.


Using NW will create a file if one doesn't exist. Before making sure you did this correctly, did you test the function after using the AddArchiveFile() feature? If so, then you are out of luck.

I did it after AddArchiveFile() too. And many other different way, and nothing works  :( I'm out of luck.

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #926 on: December 16, 2015, 08:20:35 PM »
How can I create bullets that are constantly aimed at you? Like in "Fantasy Seal", so to say.
« Last Edit: December 16, 2015, 08:43:04 PM by Bic?- »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #927 on: December 16, 2015, 09:37:17 PM »
How can I create bullets that are constantly aimed at you? Like in "Fantasy Seal", so to say.

Pass the bullet ID as a parameter to a task. In that task, have a statement where, while the bullet has not been deleted and the boss is not dead (if applicable), the bullet sets its angle to GetAngleToPlayer(bullet) every x frames. Make sure to yield in @MainLoop as well as in the while loop.

Ex:
Code: [Select]
task BulletCommandsA1(obj) {
    while (!Obj_IsDeleted(obj) && ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0) {
        ObjMove_SetAngle(obj, GetAngleToPlayer(obj));
        yield;
    }
}

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #928 on: December 17, 2015, 04:45:02 PM »
Pass the bullet ID as a parameter to a task. In that task, have a statement where, while the bullet has not been deleted and the boss is not dead (if applicable), the bullet sets its angle to GetAngleToPlayer(bullet) every x frames. Make sure to yield in @MainLoop as well as in the while loop.

Ex:
Code: [Select]
task BulletCommandsA1(obj) {
    while (!Obj_IsDeleted(obj) && ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0) {
        ObjMove_SetAngle(obj, GetAngleToPlayer(obj));
        yield;
    }
}

And if I want the bullet to stop following the player after like 60 frames, what do I do?

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #929 on: December 17, 2015, 04:49:51 PM »
And if I want the bullet to stop following the player after like 60 frames, what do I do?

Exit the task after 60 frames if it hasn't already.
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