Author Topic: ※ Danmakufu Q&A/Problem thread 3 ※  (Read 468861 times)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #780 on: September 01, 2017, 08:00:11 AM »
Thanks so much for all your help, I'm so happy right now  :) :) (well question no 2 is solved)
I found out the cut function worked out just fine, but its only without Backgrounds https://pastebin.com/rEHEszEK
with the backgrounds the cut in is failed to show, what is happening to the BG ?
« Last Edit: September 01, 2017, 11:30:56 AM by BananaCupcakey »
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #781 on: September 01, 2017, 01:18:38 PM »
I found out the cut function worked out just fine, but its only without Backgrounds https://pastebin.com/rEHEszEK
with the backgrounds the cut in is failed to show, what is happening to the BG ?

Consider this:

In one test, you clarified that the cutin function worked fine without the background task running, correct? Now, when you begin running the background task as well, it seems that the 'cutin fails to show' - but what exactly does this mean? Does the spell name show? Spell history? Cutin image? Cutin sound effect? See what does and does not perform as expected.

If only the image does not render, then check your render priorities. If the entirety of the cutin script fails to run, then perhaps your error is more fundamental.

Quick and effective debugging is an important skill. Make use of RaiseError() and other debug functions to figure out what code is running and what code is simply having its effects rendered invisible by another piece of code.

Additionally, I recommend background scripts for backgrounds.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #782 on: September 03, 2017, 07:35:16 PM »
I've been reading Sparen's tutorials (great thanks, Sparen, they are awesome!) and saw something here:
Quote
The assigned rects are SCREEN_WIDTH and SCREEN_HEIGHT, or 640 and 480 respectively (depending on what was set in your def file, if you use one).
I have the following in my th_dnf.def:
Code: [Select]
screen.width = 1024
screen.height = 768
But SCREEN_WIDTH/SCREEN_HEIGHT seem to provide old values (640 and 480, respectively) nonetheless. Why do they behave like that? Or should I write something else in .def file in order to get new values from these constants? Haven't seen anything related in this thread and wiki.
« Last Edit: September 04, 2017, 12:08:26 PM by Haedes »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #783 on: September 05, 2017, 12:17:02 PM »
SCREEN_WIDTH and SCREEN_HEIGHT are constants - they are set to 640 and 480 regardless.

To obtain the CURRENT width and height of the scree, use GetScreenWidth() and GetScreenHeight()

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #784 on: September 07, 2017, 11:45:09 AM »
When using CreateShotB, can you change the X and Y speed/acceleration after firing the bullet?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #785 on: September 07, 2017, 07:12:17 PM »
There is an AddPatternB series just like AddPatternA.

https://dmf.shrinemaiden.org/wiki/Move_Object_Functions#ObjMove_AddPatternB1

That being said, there is no such thing as directly setting "x-speed" and "y-speed" as you would with ObjMove_SetSpeed and SetAngle because CreateShotB and AddPatternB probably just convert into speed and angle anyways. If needed you can calculate this yourself with
Code: [Select]
speed = ( x_speed^2 + y_speed^2 )^0.5
angle = atan( y_speed / x_speed )
« Last Edit: September 07, 2017, 07:24:51 PM by Drake »

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

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #786 on: September 07, 2017, 07:40:25 PM »
There is an AddPatternB series just like AddPatternA.

https://dmf.shrinemaiden.org/wiki/Move_Object_Functions#ObjMove_AddPatternB1

That being said, there is no such thing as directly setting "x-speed" and "y-speed" as you would with ObjMove_SetSpeed and SetAngle because CreateShotB and AddPatternB probably just convert into speed and angle anyways. If needed you can calculate this yourself with
Code: [Select]
speed = ( x_speed^2 + y_speed^2 )^0.5
angle = atan( y_speed / x_speed )
Oh, I see. Sometimes I kinda forget AddPattern exists :V

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #787 on: September 07, 2017, 08:08:22 PM »
Yeah, but if you didn't want to use it, you could set up a task that changes the x-speed and y-speed by converting it to speed and angle with those formulas, and using ObjMove_SetSpeed and ObjMove_SetAngle instead.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #788 on: September 08, 2017, 04:24:26 PM »
Hi again from me, my creativity sucks
1。 firing questions, I can't make the style like after the laser spin its trail leaves bullets(and then the bullet falls)
How can I do that ? :
task fireA{
    while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
   wait(380);
   let lpcnt = 0;
   loop(4){
   let laser = CreateStraightLaserA1(ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),90*lpcnt,300,10,150,7,200);
   lasercontrol(laser);
   lpcnt++;
   }

  }
}
   
task lasercontrol(laser) {
let lpcnt = 0;
while(!Obj_IsDeleted(laser)){
   ObjStLaser_SetAngle(laser,ObjStLaser_GetAngle(laser)+0.7);
   lpcnt++;
   yield;
   }
}
« Last Edit: September 09, 2017, 10:00:28 AM by BananaCupcakey »
Just keep it neutral :3

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #789 on: September 09, 2017, 04:40:49 PM »
So basically you want bullets to spawn along the laser? You would do this by getting the position and angle of the laser, and then spawning bullets offset from that position, in a line along that angle. Conceptually it's the same as making a rings of bullets around a boss, for example, but the "ring" size is the laser length.

Code: [Select]
let x = ObjMove_GetX(laser);
let y = ObjMove_GetY(laser);
let a = ObjStLaser_GetAngle(laser);
let len = ObjLaser_GetLength(laser);
let num = 8;
ascent(i in 0..num){
  let dist = i*len/num;
  let shot = bullet(x + cos(a)*dist, y + sin(a)*dist); // make a bullet, this is just the xy position
  movebullet(shot);
}

task movebullet(shot){
  // do whatever bullet movement
}

Something like this.
« Last Edit: September 14, 2017, 10:20:29 PM by Drake »

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #790 on: September 10, 2017, 09:05:20 AM »
  let shot = bullet(x+cos(a)*(i*len/num), y+sin(a)*(i*len/num)); // this is just the xy position
Sorry I am dumb, May i know what and how is the "bullet" functioned ? I can't make it defined or getting it right
« Last Edit: September 10, 2017, 12:08:07 PM by BananaCupcakey »
Just keep it neutral :3

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #791 on: September 10, 2017, 03:59:31 PM »
By that I just mean firing a bullet at that position. The x-position is x + cos(a)*dist and the y-position is y + sin(a)*dist; anything else you want (like bullet angle and speed, or if you want to run another task for the bullet's behavior) you can choose yourself.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #792 on: September 12, 2017, 12:34:32 AM »
Hello!
I have another problem. I was following Sparen's tutorial for making snaking lasers, but the bullets don't appear at all. I'm not sure what to do.
Here is the script:

task MainTaskA{
   
      while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
      let wait = 180; 
      loop(wait){yield;} 
      fireA;
     
     
   }
   
   task fireA{
   let px = GetPlayerX();
        let py = GetPlayerY();
   let angleT = 0;
   ascent(i in 0..12){
   let obj = CreateCurveLaserA1(bossX, bossY, 4, GetAngleToPlayer(objBoss) + i*360/12, 60, 18, C_LASER_RED, 10);
   SnakePattern(obj, 1);
   }
   
   }
   
   task SnakePattern(obj, dir){
   let wvel = 1*dir;
   ascent(i in 0..12){
   ObjMove_AddPatternA2(obj, i*30, NO_CHANGE, NO_CHANGE, NO_CHANGE, wvel, NO_CHANGE);
   wvel *= -1;
   }
   }
   
   
   
}



Gregory

  • I draw stuffs
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #793 on: September 13, 2017, 04:41:31 AM »
Hello!
I have another problem. I was following Sparen's tutorial for making snaking lasers, but the bullets don't appear at all. I'm not sure what to do.
Here is the script:

task MainTaskA{
   
      while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
      let wait = 180; 
      loop(wait){yield;} 
      fireA;
     
     
   }
   
   task fireA{
   let px = GetPlayerX();
        let py = GetPlayerY();
   let angleT = 0;
   ascent(i in 0..12){
   let obj = CreateCurveLaserA1(bossX, bossY, 4, GetAngleToPlayer(objBoss) + i*360/12, 60, 18, C_LASER_RED, 10);
   SnakePattern(obj, 1);
   }
   
   }
   
   task SnakePattern(obj, dir){
   let wvel = 1*dir;
   ascent(i in 0..12){
   ObjMove_AddPatternA2(obj, i*30, NO_CHANGE, NO_CHANGE, NO_CHANGE, wvel, NO_CHANGE);
   wvel *= -1;
   }
   }
   
   
   
}

I have tried the code in my dmf, it seems the problem is in the AddPatternA2 with Acceleration (5) and MaxSpeed(7) shouldn't be typed "NO_CHANGE" since I switched it to 0, it worked perfectly

ObjMove_AddPatternA2(obj, 30*i, NO_CHANGE, NO_CHANGE, 0, snek, 0);

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #794 on: September 14, 2017, 03:23:25 PM »
  let shot = bullet(x + cos(a)*dist, y + sin(a)*dist); // this is just the xy position
I regret (probally) from posting this pathetic reply
I'm not sure what happened but i only have weekends to do this ...  https://pastebin.com/7HmveRuf
Problem :
sub and task cannot call in the statement.
(subやtaskは式中で呼べません)
I:/th_dnh_ph3/script/Improvement C11/test.txt
test.txt line(行)=93


    let shot = bullet(x + cos(a)*dist, y + sin(a)*dist); // this is just the xy position
}
   lpcnt++;
   }
  }
}
   
task lasercontrol(laser) {
let lpcnt = 0;
while(!Obj_IsDeleted(laser)){
   ObjStLaser_SetAngle(laser,ObjStLaser_GetAngle(laser)+0.7);

~~~
Now good, I wish i could solve this complicated question because I'm simply too young to understand

« Last Edit: September 14, 2017, 03:25:39 PM by BananaCupcakey »
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #795 on: September 14, 2017, 05:42:15 PM »
Now good, I wish i could solve this complicated question because I'm simply too young to understand

bullet() is a task. Tasks have no return values.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #796 on: September 14, 2017, 10:23:39 PM »
Woah, that was actually my fault. I originally had correct statements and then later edited to that, must have been tired.

You either want to keep bullet a task and have both the bullet creation and its running stuff within that task, and remove just the let shot = that expects a return value,
or
You make bullet a function that returns a shot object (or use a CreateShot function), and write a task that works on that object (as I've edited back into my original post).


You've misunderstood what I I want you to do with the bullet() call. I literally just mean fire whatever bullet you want, but at that specific position.
First of all, you should move the code block. The point is to be spawning bullets every so often while the laser is spinning, so you could move it into lasercontrol or make a separate task. Then replace the line
Code: [Select]
let shot = bullet(x + cos(a)*dist, y + sin(a)*dist);with
Code: [Select]
let shot = CreateShotA1(x + cos(a)*dist, y + sin(a)*dist, 2, 90, 45, 10);Just to show what it should be doing. This should spawn individual bullets that just move down, but because they're in that ascent loop there will be eight of them at once.

Here is the fireA task with the above changes: https://pastebin.com/ce7T4PXY
« Last Edit: September 14, 2017, 11:06:18 PM by Drake »

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #797 on: September 20, 2017, 02:33:38 PM »
Eee, im so new to this scripting stuff can someone tell me, how to make two bosses with hitboxes and its own hp? like yatsuhashi and benben or satono and mai fight? Im using aldryn system btw
« Last Edit: September 20, 2017, 02:38:47 PM by MitoriKawashiro »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #798 on: September 20, 2017, 04:01:55 PM »
Eee, im so new to this scripting stuff can someone tell me, how to make two bosses with hitboxes and its own hp? like yatsuhashi and benben or satono and mai fight? Im using aldryn system btw
Making two bosses is done spawning the second boss as a regular enemy. Enemies logically have their own hitbox and life before they "die". See the wiki for the required functions to define these.

I have no idea what an aldryn system is. Google isn't helping me either.

Since you're new to this stuff. What kind of experience do you even have when it comes to Danmakufu?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #799 on: September 20, 2017, 07:15:55 PM »
Im using aldryn system btw

If you're using Jan Aldryn Bio's system, then you'll have to ask him how to use it. Nobody except the creator understands their system fully.

Additionally, if you don't understand how his system works on a fundamental level, I highly advise you start from scratch - that way you can learn and master the basics on your own. See https://dmf.shrinemaiden.org/wiki/Tutorials_(ph3) for tutorials

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #800 on: September 21, 2017, 12:31:35 AM »
Making two bosses is done spawning the second boss as a regular enemy. Enemies logically have their own hitbox and life before they "die". See the wiki for the required functions to define these.

I have no idea what an aldryn system is. Google isn't helping me either.

Since you're new to this stuff. What kind of experience do you even have when it comes to Danmakufu?

Eh, sorry, i mean, with circle lifebar like TD, GFW, DDC, LoLK, HSIFS, etc.

im suddenly addicted with bullet patterns tho, so i only focused in composing such patterns by myself, and im learning from some presets like spell card collection

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #801 on: September 21, 2017, 07:30:20 AM »
im suddenly addicted with bullet patterns tho, so i only focused in composing such patterns by myself, and im learning from some presets like spell card collection
I was actually wondering about your technical knowledge, such as objects, primitives, sprites, methods and so on. Have you ever created 2D and 3D sprite effects?
« Last Edit: September 21, 2017, 07:51:18 AM by Helepolis »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #802 on: September 21, 2017, 12:34:39 PM »
I was actually wondering about your technical knowledge, such as objects, primitives, sprites, methods and so on. Have you ever created 2D and 3D sprite effects?
Mmmno, im using some completed single script and just change the sprite using gizmo's sprite library, i never create such render object before
« Last Edit: September 21, 2017, 12:38:01 PM by MitoriKawashiro »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #803 on: September 21, 2017, 12:53:16 PM »
Mmmno, im using some completed single script and just change the sprite using gizmo's sprite library, i never create such render object before
I was afraid of that. Nothing personal, however, explaining things now isn't going to help you. I am not going to program it for you. If somebody else already has such a feature and allowing it to be used then that would be easiest for you. I don't have circular life bars in my own game so my help ends here.


Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #804 on: September 21, 2017, 01:07:02 PM »
I was afraid of that. Nothing personal, however, explaining things now isn't going to help you. I am not going to program it for you. If somebody else already has such a feature and allowing it to be used then that would be easiest for you. I don't have circular life bars in my own game so my help ends here.

Oh, My bad

Also, How to make a Ring of bullet that will drops down like CreateShotB2?
« Last Edit: September 21, 2017, 01:19:37 PM by MitoriKawashiro »

Gregory

  • I draw stuffs
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #805 on: September 21, 2017, 05:14:34 PM »
Oh, My bad

Also, How to make a Ring of bullet that will drops down like CreateShotB2?

if you meant it acted like it has gravity then try using ObjMove_AddPatternB2

also, how can I let the script read before going to the plural script, it took like 4 ,5s to read every single script in the plural and that makes all players nervous...

« Last Edit: September 21, 2017, 05:17:50 PM by Gregory »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #806 on: September 22, 2017, 05:13:30 AM »
if you meant it acted like it has gravity then try using ObjMove_AddPatternB2


yeah but in a default or simple ring before the bullets separated away

Drake

  • *

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

Gregory

  • I draw stuffs
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #808 on: September 22, 2017, 06:28:18 AM »
yeah but in a default or simple ring before the bullets separated away

uhhh... first you shoot a ring then AddPatternB2 to it, what do you mean by default ?

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #809 on: September 25, 2017, 03:15:05 AM »
Hello!
It's Dire again here. The wiki doesn't really have any tips on making a dialogue scene, so how do I do that? How does one go about making a dialogue scene in danmakufu?
Thanks!
« Last Edit: September 25, 2017, 03:58:06 AM by Dire29 »