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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #870 on: December 01, 2015, 07:26:36 PM »
Sorry please..
How do I point CreateStraightLaserA1 angle, to object, that moves with ObjMove_SetAngularVelocity.
When I make this, lasers angle points to object askew.

What are you trying to do? Are you trying to move the base of the laser depending on the location of a bullet or are you aiming the laser at a specific place? You need to state your intention more clearly.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #871 on: December 01, 2015, 07:30:45 PM »
What are you trying to do? Are you trying to move the base of the laser depending on the location of a bullet or are you aiming the laser at a specific place? You need to state your intention more clearly.
Sorry my English.
Aiming lasers to Shot object that moving in angular velocity.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #872 on: December 01, 2015, 07:52:47 PM »
Sorry my English.
Aiming lasers to Shot object that moving in angular velocity.

You can't use ObjMove_SetAngularVelocity for that. You need to use a task.
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 #873 on: December 01, 2015, 08:15:37 PM »
You can't use ObjMove_SetAngularVelocity for that. You need to use a task.

Approximately I had this

Code: [Select]
task Lantern{

ascent(ang in 0..20){
     let obj = CreateShotA1( … );
     Laser(obj);
     }

     task Laser(object){
          ObjMove_SetAngularVelocity(object, 0.5);
          let laser = CreateStraightLaserA1( … );
          while(!Obj_IsDeleted(object)){
                 ObjStLaser_SetAngle(laser, ObjMove_GetAngle(object));
          yield;
     }}


Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #874 on: December 01, 2015, 08:51:19 PM »
Approximately I had this

Code: [Select]
task Lantern{
?
ascent(ang in 0..20){
     let obj = CreateShotA1( ? );
     Laser(obj);
     }

     task Laser(object){
          ObjMove_SetAngularVelocity(object, 0.5);
          let laser = CreateStraightLaserA1( ? );
          while(!Obj_IsDeleted(object)){
                 ObjStLaser_SetAngle(laser, ObjMove_GetAngle(object));
          yield;
     }}
?

Change it to

Code: [Select]
task Laser(object){
          let laser = CreateStraightLaserA1( ? );
          while(!Obj_IsDeleted(object)){
                 ObjStLaser_SetAngle(laser, ObjMove_GetAngle(object) + 0.5);
                 yield;
          }
     }
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 #875 on: December 01, 2015, 09:03:24 PM »
Change it to

Code: [Select]
task Laser(object){
          let laser = CreateStraightLaserA1( ? );
          while(!Obj_IsDeleted(object)){
                 ObjStLaser_SetAngle(laser, ObjMove_GetAngle(object) + 0.5);
                 yield;
          }
     }

Also askew..
Laser angle doesn't aiming exactly to shot object.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #876 on: December 02, 2015, 12:32:11 AM »
I've been messing around with PlaySyncBgm. I have a loop of 33 seconds of music with an in game visual cue that loops every 1980 (viz 60*33) frames. With regular music the script lags behind the music, with PlatSyncBgm at 60fps the music is slightly slower than the script,but only on the first loop, it seems to get more accurate with each passing loop. The music stopping is noticeable on 40 fps and for all intents and purposes mutes the audio at 30 fps. As the framerate gets slower it seems to be less accurate It slows the music too much. It sounds like a skipping record so that likely means the skip_param needs to be raised if you expect to go to such extreme lag. I have a very small sample size and I know that all my scripts seem to lag in the first few frames of running which would explain why it is off on the first loop.

I'm a little confused by:
Code: [Select]
if(sdt*60 > skip_param/2){
sdt -= skip_param/60;
ObjSound_Stop(bgm);
c = 0;
}

skip_param/2 : The only thing I can think of is to center the swing of time around sdt=0 and not higher. I don't see why the math would be wrong, this basically just uses GetStageTime to calculate the real fps instead of calling fps. There may be some error in calculating GetStageTime or not enough precision in the system's calculations such that enough time gets lost in the rounding. Also if you raise skip param there are greater local extremes where the music would be off sync. so even if it does stay holistically synced you would be able to notice if it just happened to be at sdt=((skip_param/120)-1) when you have an audio cue and would seem off-sync.

tl:dr Works pretty well at baseline conditions on my comp, much better than before, wouldn't recommend for lag worse than 55 fps. Thanks for the help
my Twitch Stream I play shmups sometimes

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #877 on: December 02, 2015, 12:50:32 AM »
Yes, the intention is to limit any potential music offsets between the range [-skip_param/2, skip_param/2], rather than [0, skip_param]. This way the average offset is as close to 0 as possible. And yes, skip_param should be raised if it's slowing down enough that it sounds like skipping.

Something playing at 40~30fps sounds completely unusable and I pretty much expected that. Clearly it isn't anything close to normal and you couldn't possibly have a method that could fix it without literally slowing down the music to half speed. I'm going to tentatively guess that because I'm trying to aim for a zero center with regular FPS conditions (~60), what's happening as the FPS gets really low is that more time is spent near the beginning [-skip_param/2, 0] half due to constant resets, and when the music plays it very quickly reaches skip_param/2 and resets again. Maybe look into changing it so that the range really is [0, skip_param] and see if it works for you.

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 #878 on: December 03, 2015, 08:48:31 PM »
Good day.
How can I forbid 'backskape' key in Package script?
I want forbid players to retry game with this key method. Only: -> Esc -> Retry.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #879 on: December 03, 2015, 09:22:52 PM »
Good day.
How can I forbid 'backskape' key in Package script?
I want forbid players to retry game with this key method. Only: -> Esc -> Retry.

As long as you don't explicitly program this functionality in, pressing backspace shouldn't retry the stage.
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 #880 on: December 03, 2015, 10:10:55 PM »
As long as you don't explicitly program this functionality in, pressing backspace shouldn't retry the stage.
Pressing "Backspace", stage will always start from the beginning (like a retry)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #881 on: December 04, 2015, 04:28:39 AM »
Pressing "Backspace", stage will always start from the beginning (like a retry)

This is programmed into the default package, I believe.

Ctrl-F for KEY_BACK in your package and you will find it.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #882 on: December 04, 2015, 06:45:03 AM »
No that is not the case. Fluffy is right here. The Backspace will never restart a script if you're playing it through package mode. By default it gets disabled. The CTRL function (speed up) doesn't gets disabled, so that needs to be done manually in the package script.

Most likely, Zhan isn't playing/launching his game as a package. Make sure you are.

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #883 on: December 04, 2015, 09:33:59 AM »
no, sparen is right lol (well fluffy is technically right too)

Code: [Select]
if(!IsReplay() && GetKeyState(KEY_BACK) == KEY_PUSH){
TerminateStageScene();
TStageScene("");
return;
}

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 #884 on: December 04, 2015, 11:59:44 PM »
Where can I find documentation on how to change the magic circle graphic or remove it altogether? I can't seem to find it anywhere. Thanks in advance.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #885 on: December 05, 2015, 12:11:43 AM »
Ops, sorry.
It was in the Package script, Thank you all.
( I was using Rumia's Package script as a example, and haven't see this function )

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #886 on: December 05, 2015, 01:43:34 AM »
Where can I find documentation on how to change the magic circle graphic or remove it altogether? I can't seem to find it anywhere. Thanks in advance.

The default magic circle is located in your System file. If you do not specifically state your system file, that defaults to the default system file in your default_system/Default_System. This is calling the script Default_System_MagicCircle.txt.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #887 on: December 05, 2015, 03:30:11 AM »
Ahh, I see. Thanks! Also, is there a way to rotate a primitive object around its axis? I made a pentagram for my boss that flickers, "breathes" and wobbles behind her slightly, but it looks kind of dull without the pentagram itself rotating as well. ObjMove doesn't seem to work on it. Would I have to register it as some type of object to be able to apply rotation to it? Since ObjRender_SetAngle doesn't really do that, it just spins it in a 3D-ish sort of way.

Thanks again!

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #888 on: December 05, 2015, 03:59:18 AM »
Ahh, I see. Thanks! Also, is there a way to rotate a primitive object around its axis? I made a pentagram for my boss that flickers, "breathes" and wobbles behind her slightly, but it looks kind of dull without the pentagram itself rotating as well. ObjMove doesn't seem to work on it. Would I have to register it as some type of object to be able to apply rotation to it? Since ObjRender_SetAngle doesn't really do that, it just spins it in a 3D-ish sort of way.

Thanks again!

You need to center it at (0, 0, 0) and use ObjMove_SetPosition and ObjMove_SetAngleZ.
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 #889 on: December 05, 2015, 04:07:01 AM »
You need to center it at (0, 0, 0) and use ObjMove_SetPosition and ObjMove_SetAngleZ.

Fluffy. You can't use ObjMove functions on primitive objects.

Ahh, I see. Thanks! Also, is there a way to rotate a primitive object around its axis? I made a pentagram for my boss that flickers, "breathes" and wobbles behind her slightly, but it looks kind of dull without the pentagram itself rotating as well. ObjMove doesn't seem to work on it. Would I have to register it as some type of object to be able to apply rotation to it? Since ObjRender_SetAngle doesn't really do that, it just spins it in a 3D-ish sort of way.

Thanks again!

The standard way is to (if you are manually setting vertices), to use trigonometry and apply a transform to each vertex depending on the angle you want. Otherwise, keep in mind that ObjRender_SetAngleXYZ has three separate components that rotate in different axes, with x being side to side, y being front to back, and z being up/down (correct me if I am wrong).
« Last Edit: December 05, 2015, 04:08:58 AM by Sparen »

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #890 on: December 05, 2015, 04:15:39 AM »
Fluffy. You can't use ObjMove functions on primitive objects.

Whoops. I mean ObjRender.
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 #891 on: December 05, 2015, 04:45:19 AM »
ObjRender_SetAngleXYZ is indeed what you want.



As you can see here, the axis "facing" the screen (normal/perpendicuar to the 2D plane) is the z-axis, so rotating along the z-axis is what you want to be doing.
« Last Edit: December 05, 2015, 04:48:05 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 #892 on: December 05, 2015, 11:37:20 AM »
Alright, so I've been messing with the Z axis (since I already had something for the X and Y axes that gave the pentagram a slight wobble) but it doesn't seem to really achieve what I want. It kinda looks like I'd have to choose between either the 3D-looking wobble or the 2D rotation, since even a full rotation on the Z axis doesn't really seem to do the job. For the record, here's the task I wrote for the pentagram, maybe I did something that I didn't notice that you guys can see(I ommitted the Z axis line because nothing I tried even got remotely close)

Code: [Select]
task Penta{ // Pentagram to surround her that rotates

let objPen = ObjPrim_Create(OBJ_SPRITE_2D);
let scale = 0.7;
let angle = 180;
let switch = 0.001;

ObjPrim_SetTexture(objPen, cDir ~ "sprite/fx/penta.png");
ObjSprite2D_SetSourceRect(objPen, 0, 0, 256, 256);
ObjSprite2D_SetDestCenter(objPen);
ObjRender_SetBlendType(objPen, BLEND_ALPHA);
Obj_SetRenderPriorityI(objPen, 21);
ObjMove_SetAngularVelocity(objPen, 2);

while(BossLife > 0){
ObjRender_SetPosition(objPen, BossX, BossY, 0);
ObjRender_SetAlpha(objPen, rand_int(155, 255)); // Flickering
ObjRender_SetScaleXYZ(objPen, scale, scale, scale); // Breathing
ObjRender_SetAngleX(objPen, 40 * cos(angle)); // Wobbling/rotating
ObjRender_SetAngleY(objPen, 40 * sin(angle));

angle += 0.5;
scale += switch;
if(scale >= 0.8 || scale <= 0.7){switch *= -1;}

yield;
}


}
« Last Edit: December 05, 2015, 11:41:50 AM by Chrysalis »

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #893 on: December 05, 2015, 12:18:17 PM »
Adding something like ObjRender_SetAngleZ(objPen, angle*6) isn't what you want?

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 #894 on: December 05, 2015, 12:29:07 PM »
I expected the answer to be something simple but damn ;_;. That worked perfectly, thanks again!

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #895 on: December 05, 2015, 03:00:53 PM »
I expected the answer to be something simple but damn ;_;. That worked perfectly, thanks again!

When you said it was a primitive, I expected something significantly more complicated. But yeah, what Drake said is *all you need* for 2D sprites.

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #896 on: December 07, 2015, 08:56:07 PM »
Hi! I'm a newbie of Danmakufu and this is my first post. Also due to my age, I haven't much knowledge of trigonometry and stuff like that.
So, I have a question:  how do apply gravity to a bullet? I mean, if I shoot a bullet upward, how can I make it go downward.
Like in the Suwako's spell "Froggy Braves the Elements"

Sorry my English by the way-

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #897 on: December 07, 2015, 10:41:38 PM »
Hi! I'm a newbie of Danmakufu and this is my first post. Also due to my age, I haven't much knowledge of trigonometry and stuff like that.
So, I have a question:  how do apply gravity to a bullet? I mean, if I shoot a bullet upward, how can I make it go downward.
Like in the Suwako's spell "Froggy Braves the Elements"

Sorry my English by the way-

The easiest way to apply gravity to bullets in Danmakufu is to use CreateShotB2. By giving the bullets a positive y acceleration and no x acceleration, they will fall towards the bottom of the screen.

Bic?-

  • Da best n00bie evah 'u'
  • Fufufufufu--
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #898 on: December 07, 2015, 11:34:31 PM »
Ok thanks, got it... It looks gorgeous **

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