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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #750 on: September 29, 2015, 04:21:44 PM »
Ok, did extensive trial & error with various changes /codes. The only reason it is crashing is because your filename is most likely wrong. If I straight copy-paste your code and name my Single script  SandboxFile2.txt it will work. No errors, no crashes.

If I misstype SandboxFile2.txt  then it will crash. Check your file names on your computer. Make sure it is called SandboxFile2.txt and make sure it is in the same directory as your plural.

Doesn't matter whether you change lifebar number or not. That has nothing to do with the actual processing of plurals. That number becomes important when you're tracking Attack steps for lifebar purposes (Intermediate/Expert stuff when you want custom lifebars) or want to use the default Lifebar of ph3 and show the correct sizes. Though it is always good practise to stay consistent and keep clean code. As I discussed on IRC with Ginko and you, don't add variables and things you're not using. @Event thread is even not required here unless you want to catch / process Events.

« Last Edit: September 29, 2015, 04:28:09 PM by Helepolis »

GuardianTempest

  • Adorably Awkward Android
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #751 on: September 29, 2015, 04:30:18 PM »
Thank you so much for your assistance, I'll go to sleep now and resume work tomorrow. I'll make sure that this won't happen again.

EDIT: I now have figured out one of the roots of my problem. It seems that my plural script doesn't recognize .dnh files even if I explicitly said "SandboxFile3.dnh" It looks like I have to convert all my files to txt.

EDIT2: I also discovered that it doesn't support backslashes in file paths. My only problem now is why isn't my boss sprite disappearing? Disregard that, I figured it out.
« Last Edit: September 30, 2015, 12:24:57 AM by GuardianTempest »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #752 on: October 01, 2015, 10:00:15 AM »
Hello there, I'm new over here and with Danmakufu and with programming in general. I'm learning with Sparen's tutorial and I think they are amazingly well done.

Anyway, just a simple doubt about bullet graphics. In game, some bullets apprear "above" others and I don't know how to control this.

http://puu.sh/kuys8/b5fc8c4b29.jpg

Note that the small bullets are below the bigger ones, so this makes difficult playing since you cannot see them very well.

Thanks.
Paty

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #753 on: October 01, 2015, 01:08:48 PM »
Primarily, order of spawning will auto layer the bullets. So if you want to order the bullets you can do two things:
- Mind the spawn order of the bullets
- Force layers by using Obj bullets and use the layer function to set the desired layers. In ph3, we can now work with double digits for layers instead of single digit. So gives more flexibility.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #754 on: October 01, 2015, 01:36:16 PM »
- Force layers by using Obj bullets and use the layer function to set the desired layers. In ph3, we can now work with double digits for layers instead of single digit. So gives more flexibility.

Mind to explain with an example? Sorry I don't get it how to use that.
Paty

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #755 on: October 01, 2015, 02:31:11 PM »
Do you know about Object bullets (or spawning bullets as obj for complicated behaviour / modifying) ? If not, then it is my advise to look into this. Because that way you have more control over a specific bullet, including the layer order. (See tutorials / wiki)

Layer order means the bullet is placed on a specific order. Layer 100 is most highest and 0 being lowest. If I am not mistaking, by default bullets are layer 40 / 50 and player layer 30. (See wiki about Layer functions for Objects)

So for example you can force a bullet on layer 41 and another on on layer 40 so the layer 41 will be always on top, no matter when or where you spawn them.

TL DR: Suggesting to learn how to spawn a bullet as an object.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #756 on: October 01, 2015, 02:59:50 PM »
Do you mean tasks and "let obj=createshot..."? I already know how those work but I can't find anything related to layers in the tutorials or wiki. And the tutorials about object bullets are for 0.12 (and don't mention layers either).
Paty

GuardianTempest

  • Adorably Awkward Android
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #757 on: October 01, 2015, 04:09:16 PM »
http://pastebin.com/M3dnaGwC

I'm having problems with my package script, for a reason I probably fail to understand. When I reach running the Stage script through it, it gives me an error saying "LoadEnemyShotData is not defined" (or some other function that should be default). However it works when I try to run the Stage.txt itself so it's nothing inside there, and I've been told that I have to define the basic functions on the package. My question is: How? I've tried using #Include but that's obviously wrong.

This is my last hurdle, after which I can start piling everything together.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #758 on: October 01, 2015, 05:12:35 PM »
Do you mean tasks and "let obj=createshot..."? I already know how those work but I can't find anything related to layers in the tutorials or wiki. And the tutorials about object bullets are for 0.12 (and don't mention layers either).

Layers are as follows. Please note that this only applies for Render Priorities between 0.2 and 0.8.

Let's say you have a bullet rendered with the default render priority (50?). Now, if we were to do the following:

let obj = CreateShotA1(192, 224, 0, 0, 0, 0);
Obj_SetRenderPriority(obj, 0.51);

Then this new object would render above all other shot objects on the screen due to its render priority being higher than those of the other shots. In fact, it will render above all things with a render priority below 0.51. If multiple objects are spawned with the same render priority, the ones created later will render over the ones created earlier.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #759 on: October 01, 2015, 05:16:21 PM »
http://pastebin.com/M3dnaGwC

I'm having problems with my package script, for a reason I probably fail to understand. When I reach running the Stage script through it, it gives me an error saying "LoadEnemyShotData is not defined" (or some other function that should be default). However it works when I try to run the Stage.txt itself so it's nothing inside there, and I've been told that I have to define the basic functions on the package. My question is: How? I've tried using #Include but that's obviously wrong.

This is my last hurdle, after which I can start piling everything together.

In Package Mode, which you are in, you cannot simply load a plural script and play it - the system is very different. You must start a Stage and inside the stage, load your plural.

To make a Stage Scene, you must
InitializeStageScene();//Loads stage path
SetStageIndex(indexStage); //where index Stage is the stage number
SetStageMainScript(pathMainScript); //stage path
SetStagePlayerScript(pathPlayer);//replays ignore this
StartStageScene();

After this, you use TerminateStageScene(); to terminate the stage scene (if you want to) and use STAGE_STATE_FINISHED as your control statement.

See http://dmf.shrinemaiden.org/wiki/Package_Functions for more information

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #760 on: October 01, 2015, 05:53:17 PM »
Layers are as follows. Please note that this only applies for Render Priorities between 0.2 and 0.8.

Let's say you have a bullet rendered with the default render priority (50?). Now, if we were to do the following:

let obj = CreateShotA1(192, 224, 0, 0, 0, 0);
Obj_SetRenderPriority(obj, 0.51);

Then this new object would render above all other shot objects on the screen due to its render priority being higher than those of the other shots. In fact, it will render above all things with a render priority below 0.51. If multiple objects are spawned with the same render priority, the ones created later will render over the ones created earlier.

Thank you! That worked just fine.
Paty

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #761 on: October 01, 2015, 06:40:00 PM »
(I hope this is the right place to ask this question ><)

I (might) want to make a Double Spoiler-style danmakufu game so I am trying to re-create the shooting mechanics. I found this author (E.Over0.01) who already made the engine (website: http://anythingfantasy.blog104.fc2.com/blog-entry-137.html ) although it is not compatible with the latest version of ph3. The last seen activity from the author is at Feb 2014 so do I still try to seek permission from him to use the systems? Or is it alright to help translate the codes without permission, but still giving him the credit?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #762 on: October 01, 2015, 08:29:55 PM »
(I hope this is the right place to ask this question ><)

I (might) want to make a Double Spoiler-style danmakufu game so I am trying to re-create the shooting mechanics. I found this author (E.Over0.01) who already made the engine (website: http://anythingfantasy.blog104.fc2.com/blog-entry-137.html ) although it is not compatible with the latest version of ph3. The last seen activity from the author is at Feb 2014 so do I still try to seek permission from him to use the systems? Or is it alright to help translate the codes without permission, but still giving him the credit?

If you are porting the code, you must give credit to the original source. It is highly recommended that you seek permission when possible. If the language barrier is an issue, then check with someone familiar with the language before sending the e-mail, just to make sure that your writing is clear. You may want to write your request in both Japanese and English.

GuardianTempest

  • Adorably Awkward Android
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #763 on: October 01, 2015, 11:48:33 PM »
In Package Mode, which you are in, you cannot simply load a plural script and play it - the system is very different. You must start a Stage and inside the stage, load your plural.

To make a Stage Scene, you must
InitializeStageScene();//Loads stage path
SetStageIndex(indexStage); //where index Stage is the stage number
SetStageMainScript(pathMainScript); //stage path
SetStagePlayerScript(pathPlayer);//replays ignore this
StartStageScene();

After this, you use TerminateStageScene(); to terminate the stage scene (if you want to) and use STAGE_STATE_FINISHED as your control statement.

See http://dmf.shrinemaiden.org/wiki/Package_Functions for more information

Thank you for the reply, although when I tried the code as-is, the stage automatically stops upon playing. Nope, I just don't know how to stave-off ClosePackage().

All I got so far is while(stageSceneState!=STAGE_STATE_FINISHED){yield;} but that doesn't work.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #764 on: October 02, 2015, 12:44:16 AM »
Thank you for the reply, although when I tried the code as-is, the stage automatically stops upon playing. Nope, I just don't know how to stave-off ClosePackage().

All I got so far is while(stageSceneState!=STAGE_STATE_FINISHED){yield;} but that doesn't work.

In most standard packages, you have a royal mess of if statements and cyclomatic complexity dealing with pause scenes, end scenes, input, and the like. Inside that while loop, my package for SeitenTouji has about 60 lines of code controlling the three possibilities for GetStageSceneResult. You'll want to have a thing in your while loop controlling the pause menu options, and you'll also want a switch statement controlling the following:
STAGE_RESULT_CLEARED
STAGE_RESULT_PLAYER_DOWN
STAGE_RESULT_BREAK_OFF


GuardianTempest

  • Adorably Awkward Android
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #765 on: October 02, 2015, 02:20:27 AM »
Yikes, what if I just want the loop to keep yielding until the stage script is finished?

EDIT: Eureka! I got it!

Code: [Select]
while(GetStageSceneState()!=STAGE_STATE_FINISHED){yield;}

ClosePackage;
break;

Barebones, but that's what I'm aiming for.
« Last Edit: October 02, 2015, 02:57:10 AM by GuardianTempest »

Miplouf Saigyouki

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #766 on: October 07, 2015, 11:29:03 AM »
Hey there, I'm currently experimenting with text objects and I would like to know how to return to the next line in a text string.

Code: [Select]
AttackName("SUPER ULTRA MEGA GIGA DEATH VORTEX OF ULTIMATE DOOM EX ++ MARK II ENHANCED FROM HELL AND STUFF OMG I AM RUNNING OUT OF THINGS TO SAY RIGHT NOW BUT IT'S OKAY YOU'RE GONNA DIE BY THE TIME YOU'RE DONE READING THIS ","RED");

Do i have to add spaces until it returns to the next line? Or is there a way to do so quicker?

(Don't ask me why i wrote that though, it was but a simple spiral at first)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #767 on: October 07, 2015, 01:21:02 PM »
Use  [r]. Example:

Code: [Select]
"This is a very long piece of text [r] but this part will be put on the next line"

Put [r] for the next line from desired point. Otherwise, ph3 will auto next line depending on the width you forced using the text object functions. But that cuts off by the character. So better to manually use the commands.
« Last Edit: October 07, 2015, 01:23:02 PM by Helepolis »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #768 on: October 07, 2015, 01:23:14 PM »
Use
Code: [Select]
[r] to next line. Otherwise, ph3 will auto next line depending on the width you forced using the text object functions. But that cuts off by the character. So better to manually use the commands.

Depending on your operating system, the width of each character and the space between each character may change, however, so the Max Width method actually even less reliable than it seems.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #769 on: October 07, 2015, 01:26:00 PM »
Huh? Is that so? How come though? Isn't there a specific font set by default? And there is also default width and spacing between characters. You can even manipulate these with the text object commands.

Curious. Which OS difference btw?

Edit
Tbh, by default you don't want to rely on the max width and let ph3 cut it for you. It cuts characters and not words.

Miplouf Saigyouki

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #770 on: October 07, 2015, 01:46:37 PM »
Aaah thank you :)
I can now make unnecessary long attack names with no problems :)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #771 on: October 07, 2015, 02:58:20 PM »
Huh? Is that so? How come though? Isn't there a specific font set by default? And there is also default width and spacing between characters. You can even manipulate these with the text object commands.

Curious. Which OS difference btw?

Edit
Tbh, by default you don't want to rely on the max width and let ph3 cut it for you. It cuts characters and not words.

On Mac, fonts are rendered with less width than on Windows, etc. So like, I had an issue where the last letter of some words was dumped onto a new line. It was annoying.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #772 on: October 07, 2015, 05:03:24 PM »
On Mac, fonts are rendered with less width than on Windows, etc. So like, I had an issue where the last letter of some words was dumped onto a new line. It was annoying.
Oh, that is good to know. In that case it would be safer to use [r] with plenty of space left compared to actual width of the object.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #773 on: October 07, 2015, 09:58:34 PM »
Hi. Is there a tutorial or something to leark how to make custom players? I search in the wiki but can't find anything for ph3, the same with the videtutorials, I only found Helepolis' but they are for 0.12.

Thanks.
« Last Edit: October 07, 2015, 10:00:20 PM by Paty »
Paty

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #774 on: October 07, 2015, 10:58:38 PM »
Hi. Is there a tutorial or something to leark how to make custom players? I search in the wiki but can't find anything for ph3, the same with the videtutorials, I only found Helepolis' but they are for 0.12.

Thanks.

There is currently no tutorials (afaik) for making player scripts.

Once you have gained proficiency with Render, Primitive, and Movement objects, as well as @Event and other aspects of the language, implementing your own player based off of the default is a relatively simple task.

Aka Kyuketsuki

  • Team αlternative Σnding
  • Making it rain
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #775 on: October 09, 2015, 10:02:13 AM »
Hi again, wanted to ask, how do I make an object collision circle radius ? All I can do for now is a square radius :

Code: [Select]
if(ObjMove_GetX(id) <= GetPlayerX+50 && ObjMove_GetX(id) >= GetPlayerX-50 && ObjMove_GetY(id)<=GetPlayerY+50 && ObjMove_GetY(id)>=GetPlayerY-50){
//stuff happens;
}

Is it possible to make this radius circular ?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #776 on: October 09, 2015, 01:16:41 PM »
Hi again, wanted to ask, how do I make an object collision circle radius ? All I can do for now is a square radius :

Code: [Select]
if(ObjMove_GetX(id) <= GetPlayerX+50 && ObjMove_GetX(id) >= GetPlayerX-50 && ObjMove_GetY(id)<=GetPlayerY+50 && ObjMove_GetY(id)>=GetPlayerY-50){
//stuff happens;
}

Is it possible to make this radius circular ?

Of course! The general algorithm for radial collision detection is to see if the distance between the centers of the two objects (given by the distance formula) is less than the sum of their collision radii. So if you have an object with radius 5 and an object of radius 3, they will be considered colliding as long as the distance between their center points is less than 8.

Aka Kyuketsuki

  • Team αlternative Σnding
  • Making it rain
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #777 on: October 09, 2015, 05:08:32 PM »
Hum, can you make an example as a code please ? Because I don't really understand how to use that formula in a code  :ohdear:
I'm not talking about bullets' hitboxes or anything, just a radius zone where thing happens if a bullet is inside (named "id").
[attach=1] [attach=2]
(Excuse the poorly made pictures  :V)

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #778 on: October 09, 2015, 05:17:36 PM »
Hum, can you make an example as a code please ? Because I don't really understand how to use that formula in a code  :ohdear:
I'm not talking about bullets' hitboxes or anything, just a radius zone where thing happens if a bullet is inside (named "id").
[attach=1] [attach=2]
(Excuse the poorly made pictures  :V)

Code: [Select]
if (GetObjectDistance(player, bullet) < radius) {
  doStuff();
}
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

Aka Kyuketsuki

  • Team αlternative Σnding
  • Making it rain
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #779 on: October 09, 2015, 06:10:31 PM »
Thanks a lot ! I didn't know about this function before  :3