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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #930 on: December 20, 2015, 09:07:25 AM »
I'm wondering why after I running "th_dnh" in th_dnh_ph3
My keyboard somehow won't work, even though I update with the latest version of ph3
And I didn't make any single changes with the config
I still can press Alt F4 to quit from it though...
Besides running "th_dnh", I still can type normally without problems...

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #931 on: December 20, 2015, 01:02:03 PM »
Hi!
I want to get the X and Y (orat least the ID?) coordinate of any enemy shot deleted by a player shot. But I have no idea how I can do this...
Someone have a simple idea to do this? Or a miracle function I miss?

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #932 on: December 20, 2015, 02:14:20 PM »
Hello there!
I'm really bad at math,but was wondering how to make :
An oval of bullets(I mean their spawn form is oval) rotaiting clockwise
I mean..uhm..like this http://cs631629.vk.me/v631629252/5963/MDqfxQ15VHY.jpg
so bullet's spawn position is 'rotating' clockwise
I hope you understand u-u

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #933 on: December 20, 2015, 02:55:20 PM »
I don't test it but if you use something like this it didn't work?
Code: [Select]
CreateShotA1(x+R1*cos(a), y+R2*sin(a), speed, angle, graphic, delay;
R1 = r*cos(n);
R2 = r*sin(n);
n++;
Were "r" is the max distance from the center of spawn.

I really don't know if it works or not and if it's clear but I think I search in this direction if I want to do what you want...

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #934 on: December 20, 2015, 03:28:36 PM »
Hi!
I want to get the X and Y (orat least the ID?) coordinate of any enemy shot deleted by a player shot. But I have no idea how I can do this...
Someone have a simple idea to do this? Or a miracle function I miss?
Depends a bit what context this is and what you're trying to accomplish. If this is intended to be part of a player, you can use an item script to be able to gain access to the EV_DELETE_SHOT events and have fairly good control over the shots you delete. Depending on how you're deleting them you might have an easier method as well.


I'm wondering why after I running "th_dnh" in th_dnh_ph3
My keyboard somehow won't work, even though I update with the latest version of ph3
And I didn't make any single changes with the config
I still can press Alt F4 to quit from it though...
Besides running "th_dnh", I still can type normally without problems...
So, you can't control the characters or even navigate the menus? That sounds strange. Even though you didn't change the config, can you check what config.exe shows in the Key section?


Lefkada: Not quite, the math is a bit more complicated and involves rotation matrices :)
Hello there!
I'm really bad at math,but was wondering how to make :
An oval of bullets(I mean their spawn form is oval) rotaiting clockwise
I mean..uhm..like this http://cs631629.vk.me/v631629252/5963/MDqfxQ15VHY.jpg
so bullet's spawn position is 'rotating' clockwise
I hope you understand u-u
Code: [Select]
// x0 : origin x-coordinate
// y0 : origin y-coordinate
// width, height : size of ellipse
// u : angle of ellipse
// num : number of bullets
ascent(t in 0..360/num){
let x = x0 + width*cos(t*num)*cos(u) - height*sin(t*num)*sin(u);
let y = y0 + width*cos(t*num)*sin(u) + height*sin(t*num)*cos(u);
CreateShotA1(x, y, s, t*num + u, g, d); // s, g, d are same as usual
}

So what you'll want to do with this is set up the ellipse like you want, then loop this while incrementing u each time to rotate the ellipse.
« Last Edit: December 20, 2015, 03:33:31 PM 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 #935 on: December 21, 2015, 03:13:04 AM »
Quote
So, you can't control the characters or even navigate the menus? That sounds strange. Even though you didn't change the config, can you check what config.exe shows in the Key section?
Not like I can change it neither know how to change it though...
[attach=1]

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #936 on: December 21, 2015, 06:32:11 AM »
highlight the input you want to change and press a key on your keyboard or a button on your controller to change it

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #937 on: December 21, 2015, 10:41:58 AM »
highlight the input you want to change and press a key on your keyboard or a button on your controller to change it
I tried it along with several random tries but nothing is changed
Neither I tried pressing all the buttons on keyboard won't navigate me around inside the ph3

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #938 on: December 21, 2015, 02:52:25 PM »
Does your keyboard have some special settings, features, etc... that can be modified in order to get them to work in dnh? Your issue is very unusual. Remember that dnh uses the legacy DirectX API like alot of indie titles and small games, even worse than just using the visual tools, it uses DirectInput (depreciated by XInput) which may not be compatible with whatever keyboard you have, or whatever features it may support. Just a thought, other than that I have no idea what the problem could be.
« Last Edit: December 21, 2015, 02:56:56 PM by Sage Ω (Ultima) »

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #939 on: December 22, 2015, 06:34:54 AM »

Lefkada: Not quite, the math is a bit more complicated and involves rotation matrices :)
Code: [Select]
// x0 : origin x-coordinate
// y0 : origin y-coordinate
// width, height : size of ellipse
// u : angle of ellipse
// num : number of bullets
ascent(t in 0..360/num){
let x = x0 + width*cos(t*num)*cos(u) - height*sin(t*num)*sin(u);
let y = y0 + width*cos(t*num)*sin(u) + height*sin(t*num)*cos(u);
CreateShotA1(x, y, s, t*num + u, g, d); // s, g, d are same as usual
}

So what you'll want to do with this is set up the ellipse like you want, then loop this while incrementing u each time to rotate the ellipse.
Thank you! x3

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #940 on: December 22, 2015, 07:02:29 AM »
Does somebody know how to divide lifes/bombs in pieces. Like in last TouhouGames. When you collect 3 life-pieces, You will get one life. I hope somebody understands me  :V

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #941 on: December 22, 2015, 07:09:56 AM »
Does somebody know how to divide lifes/bombs in pieces. Like in last TouhouGames. When you collect 3 life-pieces, You will get one life. I hope somebody understands me  :V

Use a separate counter for the fragments, and if it reaches a high enough of a value, reset it (subtract it by the required quantity) and give one life.

It is also possible to give fractions of a life, but I don't recommend this method because of precision errors.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #942 on: December 22, 2015, 04:04:21 PM »
Quote
Depends a bit what context this is and what you're trying to accomplish. If this is intended to be part of a player, you can use an item script to be able to gain access to the EV_DELETE_SHOT events and have fairly good control over the shots you delete. Depending on how you're deleting them you might have an easier method as well.
I want to make a spell bullet that delete Enemy Shots and spawn Player Shot at their positions. I just use the ObjShot_SetEraseShot to delete enemy shots.
It work if I make an item script and if I use it in the player script? It does no issues if there is already an item script running in the main boss script? And how I can get the X and Y of the shot in the player script by using the EV_DELETE_SHOT of the item script (without using common data or tons of endless array)?

edit:
I found another wreid way to do that. Actually i'm using a ring of invisible detection bullets that delete enemy shots and are deleted themself. And when there are deleted, they spawn a player shot and respawn another detection bullet. It's not perfect but it seems it work almost well. But if you have a better way to do that, I'll take it (at least for another case like that).
« Last Edit: December 22, 2015, 07:30:49 PM by Lefkada »

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #943 on: December 22, 2015, 06:26:07 PM »
It is also possible to give fractions of a life, but I don't recommend this method because of precision errors.

I had mkm fix this in pre6 (not pre6a) before then the live and bomb values in replays would be saved as 32bit integers, now they save as floats. (assuming since that's what everything else uses)

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #944 on: December 22, 2015, 06:38:24 PM »
I had mkm fix this in pre6 (not pre6a) before then the live and bomb values in replays would be saved as 32bit integers, now they save as floats. (assuming since that's what everything else uses)

I meant rounding errors, as in 1/3+1/3+1/3 not being exactly 1.
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

Failure McFailFace

  • I'm h...a...p...p...y...
  • Impor
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #945 on: December 23, 2015, 02:27:02 AM »
Can someone explain tasks? I can't find any information anywhere, except for some info for 0.12.

Are they like functions, but they all run at the same time?
1cc Easy: DDC (all) | 1cc Normal: UFO (SanA autobomb),  DDC (ReiA, SakA) , LoLK (Sanae PD)| EX clears: DDC (MarB Ultra) | Puzzle Games: StB: 10-X, DS: Hatate unlock, ISC: All clear

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #946 on: December 23, 2015, 03:35:47 AM »
From a technical standpoint, tasks are what is generally known as coroutines. Coroutines are designed to emulate asynchronous-like behavior by pausing the execution of a script function until the next frame, this gives other coroutines (tasks) a chance to run. In danmakufu, the pause is represented by the "yield" keyword.

Yes, tasks work just like functions but you can use them to multitask which is something that is not possible in normal functions as they aren't designed to yield control to another task until the next frame.

Code: [Select]

task DoSomething(x,y)
{
        loop
        {
                CreateShotA1(x,y, ...);
                yield;
        }
}


You can run this as many times as you want, and they will all be running together. Now if you were to change task DoSomething into function DoSomething, you'd notice that only the first one would run, and since it is an infinite loop, any other time you call this function will not be ran because the first instance never ends.

So in short, tasks can run along side other tasks without blocking anything, functions can only be read one at a time and they block execution of anything else until they have finished.

Failure McFailFace

  • I'm h...a...p...p...y...
  • Impor
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #947 on: December 23, 2015, 09:00:24 PM »
Ah, so pretty much exactly what I'm expecting, then. Thanks!
1cc Easy: DDC (all) | 1cc Normal: UFO (SanA autobomb),  DDC (ReiA, SakA) , LoLK (Sanae PD)| EX clears: DDC (MarB Ultra) | Puzzle Games: StB: 10-X, DS: Hatate unlock, ISC: All clear

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #948 on: December 28, 2015, 10:20:55 AM »
Hello again
It's a stupid question
but how can I make multiple bosses?
like,more than one boss appears on the screen?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #949 on: December 28, 2015, 10:33:17 AM »
You can use a boss object for the main boss and enemy objetcs for the other bosses ;). It works almost the same way.


BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #950 on: December 28, 2015, 10:54:41 AM »
You can use a boss object for the main boss and enemy objetcs for the other bosses ;). It works almost the same way.

Thanks,I think I got it..

=====================

And how do I make enemies that share 1 lifebar?
« Last Edit: December 28, 2015, 05:45:17 PM by BobTheTanuki »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #951 on: December 29, 2015, 03:20:56 AM »
And how do I make enemies that share 1 lifebar?

The quick and dirty way is to place a hitbox on the non-boss enemies while directing the damage to the boss.

Ex:
Code: [Select]
ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
        ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 32);
        ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 24);

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #952 on: December 30, 2015, 07:54:21 AM »
The quick and dirty way is to place a hitbox on the non-boss enemies while directing the damage to the boss.

Ex:
Code: [Select]
ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
        ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 32);
        ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 24);

Thanks a lot!
Aslo,I wonder how do I make statement like "if Boss' health is less than (insert number here)" :0
I made this once and forgot how to do it ,_,

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #953 on: December 30, 2015, 08:16:41 AM »
if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) < x)
You should already have it in your script to check if the boss isn't dead yet.

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

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #954 on: December 30, 2015, 08:35:33 AM »
if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) < x)
You should already have it in your script to check if the boss isn't dead yet.

YAS
thankssss

===========================
Also,I want to make boss stop doing anything,when something happens
So it's interesting to know how to make boss just stop doing anything : tasks and stuff.
Is there an easy way to do that?
« Last Edit: December 30, 2015, 01:04:35 PM by BobTheTanuki »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #955 on: January 01, 2016, 08:16:10 PM »
Hi.
I see some peoples using their own curved lasers instead of default laggy&shitty curved lasers. But I don't really understand how it works and how I can do this. Someone have some ideas and can help me? I already watch into custom lasers scripts but It's hard to understand with almost no informations and help.

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #956 on: January 02, 2016, 12:55:51 PM »
Hi all again
I wonder how should I change the timer from 80 to 40 for ex.
ObjEnemyBossScene_SetSpellTimer is not working :u

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #957 on: January 02, 2016, 12:59:11 PM »
Hi.
I see some peoples using their own curved lasers instead of default laggy&shitty curved lasers. But I don't really understand how it works and how I can do this. Someone have some ideas and can help me? I already watch into custom lasers scripts but It's hard to understand with almost no informations and help.
Well sometimes people create their own by using Object Lasers and build it off from there , or another option is a trail of (ADD) bullets instead which is much harder and could potentially lag, it's just a matter of imagination i guess
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #958 on: January 02, 2016, 04:48:53 PM »
Hi all again
I wonder how should I change the timer from 80 to 40 for ex.
ObjEnemyBossScene_SetSpellTimer is not working :u
Wrong function and code. You need EV_REQUEST_TIME see here:
Code: [Select]
@Event {
alternative(GetEventType())
case(EV_REQUEST_LIFE) {
SetScriptResult(x);
}
case(EV_REQUEST_TIMER) {
SetScriptResult(y);
}
case(EV_REQUEST_SPELL_SCORE) {
SetScriptResult(z);
}
}

I was quite surprised with this question, it is basic stuff actually.

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #959 on: January 02, 2016, 04:56:55 PM »
Wrong function and code. You need EV_REQUEST_TIME see here:
Code: [Select]
@Event {
alternative(GetEventType())
case(EV_REQUEST_LIFE) {
SetScriptResult(x);
}
case(EV_REQUEST_TIMER) {
SetScriptResult(y);
}
case(EV_REQUEST_SPELL_SCORE) {
SetScriptResult(z);
}
}

I was quite surprised with this question, it is basic stuff actually.

((9
I know thisss
I mean I need to change the timer WHILE spellcard is active
like,suddenly change the timer