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

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #210 on: January 02, 2015, 08:29:17 PM »
I am creating a player script and want to set different shots for unfocused and focused movement. Is there a way to check whether the player is focused or is there something else for player scripts?
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #211 on: January 02, 2015, 08:45:15 PM »
I am creating a player script and want to set different shots for unfocused and focused movement. Is there a way to check whether the player is focused or is there something else for player scripts?

I suggest that you look at a player script for yourself and see how it is done.

Hint: Virtual Keys

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #212 on: January 02, 2015, 09:11:26 PM »
I suggest that you look at a player script for yourself and see how it is done.

Hint: Virtual Keys
I found out, but thanks anyway.

Edit: I can't figure out why this definition for TShot doesn't cause the player to fire bullets:

Edit Mk.II: Giving an absolute path to the image file in the shot data sheets fixes the problem, but I'd like to avoid absolute paths.

Edit Mk.III:
Code: [Select]
./../resource/playershots.png. That was so obvious.

Code: [Select]
task TShot {
loop {
let x = GetPlayerX;
let y = GetPlayerY - 4;
let shot = GetVirtualKeyState(VK_SHOT);
let focus = GetVirtualKeyState(VK_SLOWMOVE);
if (shot == KEY_PUSH || shot == KEY_HOLD) {
if (focus == KEY_PUSH || focus == KEY_HOLD) {
CreatePlayerShotA1(x - 2, y, 10, 270, 2, 1, SPIKED_SEED);
CreatePlayerShotA1(x + 2, y, 10, 270, 2, 1, SPIKED_SEED);
CreatePlayerShotA1(x - 2, y, 10, 235, 1, 1, SPIKED_SEED);
CreatePlayerShotA1(x + 2, y, 10, 315, 1, 1, SPIKED_SEED);
CreatePlayerShotA1(x - 2, y + 8, 10, 90, 1, 1, SPIKED_SEED);
CreatePlayerShotA1(x + 2, y + 8, 10, 90, 1, 1, SPIKED_SEED);
}
else {
CreatePlayerShotA1(x, y, 10, 270, 5, 1, SILVER_ARROW);
}
}
yield;
}
}
« Last Edit: January 02, 2015, 10:45:13 PM 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

Maple

  • Mukyuu!
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #213 on: January 03, 2015, 01:35:06 PM »
This may sound kind of dumb, but is there a way to save screenshots in the ph3 version? In the wiki i search for "screenshot" but there's only pressing "Home" for the 0.12m version. Googling* also didn't help much.

*I'm the paranoid who uses duckduckgo instead of google.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #214 on: January 03, 2015, 02:16:16 PM »
This may sound kind of dumb, but is there a way to save screenshots in the ph3 version? In the wiki i search for "screenshot" but there's only pressing "Home" for the 0.12m version. Googling* also didn't help much.

*I'm the paranoid who uses duckduckgo instead of google.

http://dmf.shrinemaiden.org/wiki/Render_Functions#SaveSnapShotA1

Is this what you mean? Or are you referring to a generic screenshot, which puu.sh and a number of other things support?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #215 on: January 03, 2015, 02:30:43 PM »
Hello again)
Now problem with Player directory script.

Package script

let ds = GetCurrentScriptDirectory();
let Module = GetModuleDirectory();
InitializeStageScene();
let pathMainScript = ds ~ "/Test.dnh";
//let pathPlayer = Module  ~ "script/SilentNight/Player/Arisa.txt";
let pathPlayer = Module ~ "script/player/default_player/Arisa.txt";
let indexStage = 1;
SetStageIndex(indexStage);
SetStageMainScript(pathMainScript);
SetStagePlayerScript(pathPlayer);
StartStageScene();


if use "Module  ~ "script/SilentNight/Player/Arisa.txt";" - player not found. But if copy to default folder - all ok.
"Arisa.txt" located in  "D:Danma   h_dnh_ph3scriptSilentNightPlayer"

If i run "Test.dnh" - all ok

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #216 on: January 03, 2015, 02:56:08 PM »
As my math is horrible at such moments, I have 2 questions on creating pattern/shots

First one is a "crawling" or continuous curving shot, like the ones from SA I think.
[attach=1]

I have this already but apparently I seem to fail (feel free to laugh). The problem is that my shot doesn't even behave like this and doesn't even aim at the player initially.
Code: [Select]
task fireAfroCrawlShot00(obj) {

let sf = 0;
let dir = 0;

let crawlShot00 = CreateShotA(ObjMove_GetX(obj),ObjMove_GetY(obj),10);
let crawlShot01 = CreateShotA(ObjMove_GetX(obj),ObjMove_GetY(obj),10);

dir = GetAngleToPlayer(obj);

SetShotDataA(crawlShot00,0,3,dir,0,0,3,87);
SetShotDataA(crawlShot01,0,3,dir,0,0,3,87);

while(!Obj_IsDeleted(obj)) {
ObjMove_SetAngle(crawlShot00,dir);
ObjMove_SetAngle(crawlShot01,-dir);
dir = 12*sin(sf);
sf+=8;

yield;
}
}

Second one: How do I produce shapes using the correct math? Like a square, triangle, star. I've been staring at graphs and other gifs on the internet but I simply don't get how to transform the correct code. If someone can show me a simple example I can perhaps try to understand what is going on.




« Last Edit: January 03, 2015, 03:14:09 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 #217 on: January 03, 2015, 03:09:18 PM »
Second one: How do I produce shapes using the correct math? Like a square, triangle, star. I've been staring at graphs and other gifs on the internet but I simply don't get how to transform the correct code. If someone can show me a simple example I can perhaps try to understand what is going on.
I assume you are not referring to ShootShape.

There are ways to use polar and parametric equations in Danmakufu, and then you can use a rotation matrix to alter the angle of given shape. You can also define a 2D array with the shape you would like or read from a binary text file, and then apply the rotation matrix there as well.

I used a star formed from a polar equation in my ICM contest entry - note that the code was meant for Miransu's custom 3D danmaku system and that it will require tweaking in order to be altered to standard polar/parametric:

Code: [Select]
    task SpawnStarA1(n){
if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}//Default kill to prevent (0,0) spawning
let randx = rand(-75,75);
let randy = rand(-75,75);
let angleT = 0;//0 needed for nice star
loop(90){
  let modulus = 12/cos((2/n)*acos(cos(n*angleT/2)));//where n is number of sides. Flip across y = x to get pentagram
  CreateBullet(randx+modulus*sin(angleT),randy+modulus*cos(angleT), 0);
  angleT+=9;//Cycle 810 degrees.
}
    }
The
Code: [Select]
let modulus is the radius portion of the polar coordinate of each given spawn point, while angleT is the angle portion.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #218 on: January 03, 2015, 03:20:27 PM »
I assume you are not referring to ShootShape.
ShootShape?

There are ways to use polar and parametric equations in Danmakufu, and then you can use a rotation matrix to alter the angle of given shape. You can also define a 2D array with the shape you would like or read from a binary text file, and then apply the rotation matrix there as well.
I'll be honest to say that none of this actually makes sense to me. It feels like magic, honestly. Even if I am allowed to use your code as example, just blatantly copy/pasting it and adjusting here and there still won't make me understand it though.

Maple

  • Mukyuu!
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #219 on: January 03, 2015, 03:33:29 PM »
Is this what you mean? Or are you referring to a generic screenshot, which puu.sh and a number of other things support?

I was referring to generic ones. 0.12m allows for entire screen, playfield, playfield 1/4. I'm interested playfield simple, specifically. Does ph3 have a (combination of) key(s) to take these without other programs?

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #220 on: January 03, 2015, 06:01:36 PM »
First one is a "crawling" or continuous curving shot, like the ones from SA I think.
In your code, you are replacing dir (which is GetAngleToPlayer) with 12*sin(sf),, causing it to oscillate around the angle 0. Adding another variable, like let shift = 0, then putting shift = 12*sin(sf) in the loop, and putting dir+shift and dir-shift as the angles should do the trick.

Second one: How do I produce shapes using the correct math? Like a square, triangle, star. I've been staring at graphs and other gifs on the internet but I simply don't get how to transform the correct code. If someone can show me a simple example I can perhaps try to understand what is going on.

Wish I could help more, but this is rather complicated for me as well. An alternative to drawing shapes like triangles/squares/etc, would be to ascent through the number of sides, and draw a line of bullets in the angle (360/sides*i). Here's an example,



Code: [Select]
let sides = 8; //number of edges
let bullets = 24; //number of bullets in each edge
let size = 48; //how large each edge is
let x = EnemyX;
let y = EnemyY;
ascent(i in 0..sides){
let sangle = 360/sides*i; // angle of the edge
let xinc = (size/bullets)*cos(sangle);
let yinc = (size/bullets)*sin(sangle);
ascent(b in 0..bullets){
CreateShotA1(x, y, 0, sangle, 30, 10);
x+=xinc;
y+=yinc;
}
}


For more complicated shapes, you would need to account for the angle in a different manner, as this example only works for simple polygons. This example is also not centered.

I can't answer your original question fully (which I assume you mean you want to use equations, not loops), as I don't understand it either. It's one of my questions, as well.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #221 on: January 04, 2015, 07:24:25 AM »
Another bug is stumping me. For some reason, the yield statement in this code doesn't seem to function.

Code: [Select]
task renderScore(x, y, amt, color) {
let pathDigit = GetCurrentScriptDirectory ~ "../resource/digits_small.png";
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
ObjPrim_SetTexture(obj, pathDigit);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
ObjRender_SetAlpha(obj, 127);
ObjRender_SetColor(obj, color[0], color[1], color[2]);
let listNum = DigitToArrayBaseWC(amt, 16);
let digits = length(listNum);
ascent (j in 0 .. 30) {
ObjRender_SetY(obj, y - 8 - j);
ObjSpriteList2D_ClearVertexCount(obj);
ascent (iObj in 0 .. digits) {
let num = listNum[iObj];
ObjRender_SetX(obj, x + 2 * digits - 4 * iObj);
ObjSpriteList2D_SetSourceRect(obj, num * 16, 0, (num + 1) * 16, 16);
ObjSpriteList2D_SetDestRect(obj, 0, 0, 8, 8);
ObjSpriteList2D_AddVertex(obj);
}
// This one.
yield;
}
ObjSpriteList2D_ClearVertexCount(obj);
ObjRender_SetY(obj, y - 22);
Obj_Delete(obj);
}
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 #222 on: January 04, 2015, 07:41:37 AM »
Are you sure it's the yield? If that were the case, then all you would notice is that the object doesn't show up, which doesn't indicate a whole lot. What tests have you done? Have you tried commenting out the inner loop and doing something else more noticeable to confirm it is the yield?

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 #223 on: January 04, 2015, 08:05:53 AM »
Are you sure it's the yield? If that were the case, then all you would notice is that the object doesn't show up, which doesn't indicate a whole lot. What tests have you done? Have you tried commenting out the inner loop and doing something else more noticeable to confirm it is the yield?
I put an error message right after the loop, and it didn't show; in other words, the loop doesn't break. In case you're curious, here's the whole file (it's an item script):

Code: [Select]
#include "../item/itemConsts.dnh"
#include "../prologue.dnh"

@Initialize {
LoadItemData(GetCurrentScriptDirectory ~ "../item/items.dnh");
SetDefaultBonusItemEnable(false);
}

task getItem(type, objItem) {
let x = ObjMove_GetX(objItem);
let y = ObjMove_GetY(objItem);
alternative (type)
case (POINT_ITEM) {
let piv = getPIV;
let y = GetPlayerY;
let multiplier = min(1.0, 1.25 - y / 600);
addScore(multiplier * piv);
addElemPoints(FIRE, multiplier * multiplier * 16);
renderScore(x, y, roundScore(multiplier * piv), [[255, 255, 255], [255, 255, 64]][multiplier == 1]);
}
case (GREEN_ITEM) {
addPIV(32);
renderScore(x, y, 32, [64, 192, 64]);
}
case (LIFE_FRAGMENT) {
setLifeFrag(getLifeFrag + 1);
if (getLifeFrag >= getLifeFragR) {
setLifeFrag(getLifeFrag - getLifeFragR);
SetPlayerLife(GetPlayerLife + 1);
setLifeFragR(getLifeFragRR + 1);
}
renderScore(x, y, 1, [255, 64, 255]);
}
case (BOMB_FRAGMENT) {
setBombFrag(getBombFrag + 1);
if (getBombFrag >= getBombFragR) {
setBombFrag(getBombFrag - getBombFragR);
SetPlayerSpell(GetPlayerSpell + 1);
}
renderScore(x, y, 1, [202, 255, 192]);
}
}

task renderScore(x, y, amt, color) {
let pathDigit = GetCurrentScriptDirectory ~ "../resource/digits_small.png";
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
ObjPrim_SetTexture(obj, pathDigit);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
ObjRender_SetAlpha(obj, 127);
ObjRender_SetColor(obj, color[0], color[1], color[2]);
let listNum = DigitToArrayBaseWC(amt, 16);
let digits = length(listNum);
ascent (j in 0 .. 30) {
ObjRender_SetY(obj, y - 8 - j);
ObjSpriteList2D_ClearVertexCount(obj);
ascent (iObj in 0 .. digits) {
let num = listNum[iObj];
ObjRender_SetX(obj, x + 2 * digits - 4 * iObj);
ObjSpriteList2D_SetSourceRect(obj, num * 16, 0, (num + 1) * 16, 16);
ObjSpriteList2D_SetDestRect(obj, 0, 0, 8, 8);
ObjSpriteList2D_AddVertex(obj);
}
yield;
}
ObjSpriteList2D_ClearVertexCount(obj);
ObjRender_SetY(obj, y - 22);
Obj_Delete(obj);
}

@Event {
alternative (GetEventType)
case (EV_DELETE_SHOT_TO_ITEM) {
let shot = GetEventArgument(0);
let position = GetEventArgument(1);
if (length(position) > 0) {
createItemU1(GREEN_ITEM, position[0], position[1], 0);
}
CollectAllItems;
}
case (EV_GET_ITEM) {
getItem(GetEventArgument(0), GetEventArgument(1));
}
}

Replacing task with function gets rid of the infinite loop, but the digits don't appear at all.
« Last Edit: January 04, 2015, 08:33:33 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

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #224 on: January 04, 2015, 11:32:13 AM »
The problem isn't that the yield isn't working, but that the loop doesn't end. That's a big difference; if the yield wasn't working, you'd expect the loop to end, just instantly.

Keeping that difference in mind, the yield works fine, but the problem is that it yields to nothing. An item script is basically the same as any other, structurally. You probably know you need a yield in the @MainLoop for boss scripts, and this (along with plural, stage, and player scripts) is no different.

To explain: where does this yield statement lead to? Nowhere, right? The script hits the yield statement, it goes "ok I'll stop here and resume later". Maybe some other events are triggered, maybe some other functions or tasks are run. If any of them yield, "ok I'll stop here and resume later". But right now, there's nothing that ever resumes the threads. If you stick a yield in @MainLoop, which runs every frame, then @MainLoop will yield over to whatever is next in the thread queue and everything will work as intended.
« Last Edit: January 04, 2015, 11:33:45 AM by Drake »

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #225 on: January 04, 2015, 01:34:16 PM »
In your code, you are replacing dir (which is GetAngleToPlayer) with 12*sin(sf),, causing it to oscillate around the angle 0. Adding another variable, like let shift = 0, then putting shift = 12*sin(sf) in the loop, and putting dir+shift and dir-shift as the angles should do the trick.
Gaaaah it was that easy I see. Now I understand my error as well. Working like a charm now, thank you for the help all.

The whole shape thing is a pain in the butt huh. I did manage to take a look at the example of Sparen. It draws a nice pentagram but seems the bullets are more spaced out towards the points of the star. I'm not trying to create anything extremely complicated. A simple square / triangle for example and maybe star at max. I'll study Sparen and your examples and get cracking on the shapes and such tonight after dinner and after some work on Stage 2 of my game (it is near completion). Will inform about the success of the shapes.




Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #226 on: January 04, 2015, 01:37:13 PM »
Gaaaah it was that easy I see. Now I understand my error as well. Working like a charm now, thank you for the help all.

The whole shape thing is a pain in the butt huh. I did manage to take a look at the example of Sparen. It draws a nice pentagram but seems the bullets are more spaced out towards the points of the star. I'm not trying to create anything extremely complicated. A simple square / triangle for example and maybe star at max. I'll study Sparen and your examples and get cracking on the shapes and such tonight after dinner and after some work on Stage 2 of my game (it is near completion). Will inform about the success of the shapes.

Yeah, that's the main problem with polar and parametric equations. The bullets will never be spaced out the way you want them to be. It'd require a lot of work to force the distance between bullets to be equal (you would have to use trig in your angle incrementation, most likely). It has its uses though.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #227 on: January 04, 2015, 04:32:47 PM »
The problem isn't that the yield isn't working, but that the loop doesn't end. That's a big difference; if the yield wasn't working, you'd expect the loop to end, just instantly.

Keeping that difference in mind, the yield works fine, but the problem is that it yields to nothing. An item script is basically the same as any other, structurally. You probably know you need a yield in the @MainLoop for boss scripts, and this (along with plural, stage, and player scripts) is no different.

To explain: where does this yield statement lead to? Nowhere, right? The script hits the yield statement, it goes "ok I'll stop here and resume later". Maybe some other events are triggered, maybe some other functions or tasks are run. If any of them yield, "ok I'll stop here and resume later". But right now, there's nothing that ever resumes the threads. If you stick a yield in @MainLoop, which runs every frame, then @MainLoop will yield over to whatever is next in the thread queue and everything will work as intended.

Well that fixed the problem, thank you. I meant to say that the yield wasn't working properly.
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #228 on: January 04, 2015, 09:30:44 PM »
A reminder that a new version of Danmakufu has been released.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #229 on: January 04, 2015, 09:42:40 PM »
A reminder that a new version of Danmakufu has been released.

Finally, custom bullet scripts! (Though what are the advantages over using tasks?)
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

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #230 on: January 04, 2015, 10:27:27 PM »
No idea just yet, the documentation has not yet been updated, nor are there any samples yet. I'm assuming it might be like Item Scripts, though.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #231 on: January 04, 2015, 10:39:12 PM »
Nice to see Miransu and others from western community committing testing feedback for bugs and such. Mkm is doing a good job with the engine development.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #232 on: January 04, 2015, 11:01:54 PM »
By the way, is it possible to change the background at runtime?
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #233 on: January 04, 2015, 11:49:19 PM »
By the way, is it possible to change the background at runtime?

What do you mean? By using CommonData, you can change the background at will.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #234 on: January 04, 2015, 11:51:54 PM »
What do you mean? By using CommonData, you can change the background at will.

Could you please elaborate or show an example?
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #235 on: January 05, 2015, 12:19:21 AM »
Could you please elaborate or show an example?

Have a CommonData in your stage that changes once a certain thing has happened. Have a counter in your Background file, and have an if statement in the main loop of your background that, if the CommonData has been triggered and the counter is within a certain value, something changes and the counter is incremented.

I would show an example but my DEC Stage 6 background code is probably overkill for an example.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #236 on: January 05, 2015, 12:30:13 AM »
Have a CommonData in your stage that changes once a certain thing has happened. Have a counter in your Background file, and have an if statement in the main loop of your background that, if the CommonData has been triggered and the counter is within a certain value, something changes and the counter is incremented.

I would show an example but my DEC Stage 6 background code is probably overkill for an example.

One question: why would I need a counter?
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #237 on: January 05, 2015, 01:33:09 AM »
One question: why would I need a counter?

For smooth transitioning from one background to another. If you just set completely different stuff within one frame, it is extremely disorienting

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #238 on: January 05, 2015, 02:26:16 AM »
For smooth transitioning from one background to another. If you just set completely different stuff within one frame, it is extremely disorienting

I happened to do this without a counter:

Code: [Select]
// background

#include "./../prologue.dnh"

let bSpell = false;
let current = GetCurrentScriptDirectory();
let w = GetStgFrameWidth;
let h = GetStgFrameHeight;
let obj;

@Initialize {
let path = current ~ backgroundImage[getBGIndex];
obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(obj, path);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
ObjSprite2D_SetSourceRect(obj, 0, 0, w, h);
ObjSprite2D_SetDestRect(obj, 0, 0, w, h);
Obj_SetRenderPriority(obj, 0.21);
changeBackground;
}

@MainLoop {
let objScene = GetEnemyBossSceneObjectID();
bSpell = objScene != ID_INVALID && ObjEnemyBossScene_GetInfo(objScene, INFO_IS_SPELL);
yield;
}

task changeBackground {
let prev = getBGIndex;
loop {
if (getBGIndex != prev) {
let path = current ~ backgroundImage[getBGIndex];
let newObj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(newObj, path);
ObjRender_SetBlendType(newObj, BLEND_ALPHA);
ObjSprite2D_SetSourceRect(newObj, 0, 0, w, h);
ObjSprite2D_SetDestRect(newObj, 0, 0, w, h);
Obj_SetRenderPriority(newObj, 0.21);
ascent (i in 0 .. 120) {
ObjRender_SetAlpha(obj, 255 - (i / 120 * 255));
ObjRender_SetAlpha(newObj, i / 120 * 255);
yield;
}
obj = newObj;
}
prev = getBGIndex;
yield;
}
}

@Finalize {
Obj_Delete(obj);
}

I think I beat you this time.
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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #239 on: January 05, 2015, 03:19:12 AM »
I happened to do this without a counter:

I think I beat you this time.

There's more than one way to do it.