Author Topic: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m [Closed, read last post!]  (Read 186283 times)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #330 on: September 10, 2013, 10:45:34 PM »
I feel stupid right now  :V

It's fine; it's just that since decimals are used, the boss may never actually hit the player target.


KuroArashi100

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #332 on: September 11, 2013, 04:44:22 PM »
You might want to explain exactly what you don't understand. I linked 2 pages, which explain what you were asking.
In this case, you might not understand the menu part, but it could be the stage chaining part too. Or both.
You might even not know those were links, and you might've come to a stop there.

The basic idea of my post is:
What part do you not understand? Otherwise others can't help you.

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #333 on: September 12, 2013, 05:42:26 AM »
Oh i just need to use functions? :derp: and how can i make the boss to move during the events?

KuroArashi100

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #334 on: September 12, 2013, 02:24:16 PM »
Oh i just need to use functions?
I have no idea what you mean. I give up.

and how can i make the boss to move during the events?

In the event script, you should place an event step:
Code: [Select]
script_event something{

@Initialize{
(image loading and stuff)
}

@MainLoop{
stuff happens;
SetStep(1); //sets the eventstep value to 1
more stuff happens;
}

@Finalize{
(image deleting etc.)
}
}

And then in the main script's @MainLoop:
Code: [Select]
@MainLoop{
if(GetEventStep==1){ makethebossmove;}
yield;
}

That should be the gist of it.



Now for a question of my own:
What exactly is common data?
From what I've seen, it is a value shared across scripts.
And while the Danmakufu wiki shows how it works, it doesn't explain some things:

1. If the above dfinition of common data is false, could someone post what it is supposed to be?

2. Where are these values stored exactly?

3. I was looking at Mewkyuu's Giratina script, and in the stage script, he used CreateEnemyFromFile together with common data to make the boss file.
But for the location to spawn the enemy, he used common data too instead of simply writing two variables to store this location in.
Are there any benefits when using common data?

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #335 on: September 12, 2013, 09:06:29 PM »
Can someone give me a tip on how to make the same ripple effect that SA-DDC has?(the one that makes the screen ripple where ever the boss is) I'm completely lost on where I would start.


Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #337 on: September 12, 2013, 10:21:00 PM »

Now for a question of my own:
What exactly is common data?
From what I've seen, it is a value shared across scripts.
And while the Danmakufu wiki shows how it works, it doesn't explain some things:

1. If the above dfinition of common data is false, could someone post what it is supposed to be?

2. Where are these values stored exactly?

3. I was looking at Mewkyuu's Giratina script, and in the stage script, he used CreateEnemyFromFile together with common data to make the boss file.
But for the location to spawn the enemy, he used common data too instead of simply writing two variables to store this location in.
Are there any benefits when using common data?

When you create a CommonData, it's default is "0" (I think).

He used the common data because otherwise, the enemies would spawn at weird places. You can think of Common Data as variables that exist in multiple scripts and can be accessed in multiple scripts. For example, if you want to make multiple difficulties, Common Data is a very efficient way to communicate to Single scripts what to do. Of course, you would use GetCommonDataDefault instead of GetCommonData.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #338 on: September 12, 2013, 10:26:53 PM »
http://www.shrinemaiden.org/forum/index.php/topic,5164.msg440550.html#msg440550
I know about that but I want it to work only for the boss. That script uses a separate image and makes it ripple but I want it to work like what you did in your ph3 mamizou script.

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #339 on: September 12, 2013, 10:49:21 PM »
I was able to do that because in ph3 you can re-render the entire gamefield, so I used that code and for the image I just used the rendered game field (background part). For a similar effect in 0.12m, I think the way to do it would be with render targets,  however I am unsure exactly how to do it, or if you can actually do it.

If you just want the effect to be centered on the boss itself, continue reading the code snippet, it tells you where to change GetPlayerX/Y to GetX/Y.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #340 on: September 12, 2013, 11:11:39 PM »
Ok, I'll look into render targets.

K+ ~ Bake-Danuki

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #341 on: September 15, 2013, 01:15:32 AM »
Is there a way to make a boss's movement animation play in reverse when coming to a stop?  (working with seija and it looks really choppy without the reverse to a stop)

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #342 on: September 15, 2013, 03:34:52 AM »
Just set up the animation order in reverse.

K+ ~ Bake-Danuki

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #343 on: September 15, 2013, 03:58:21 AM »
But that won't work because it could/will happen before she comes to a stop.

Shadow

  • Forever waiting for tomorrow
  • ...
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #344 on: September 15, 2013, 04:13:26 AM »
I don't understand what you mean there. Your animation logic should essentially have the boss perform the desired movement animations, "stall" the process altogether while it is moving, and then do the exact same but in reverse so it can transition smoothly back to an idle state.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #345 on: September 15, 2013, 04:51:32 AM »
Is there a way to get the animation library to work with enemy scripts? I tried it but the enemy won't animate. Instead it's stuck in still life on the first frame. The way I'm doing it seems very messy and using fast forward breaks the animations.

EDIT: It also causes graphical error to flicker on the screen if too many appear.
EDIT2: Nvm, calling the task in the Draw Loop was causing the problems. So I moved it to the mainloop and it works perfectly.
« Last Edit: September 15, 2013, 05:14:41 PM by Infinite Ultima Wave »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #346 on: September 15, 2013, 05:26:38 PM »
Can I make an object bullet not lose it's properties after the enemy is deleted?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #347 on: September 15, 2013, 06:23:21 PM »
Can I make an object bullet not lose it's properties after the enemy is deleted?

I do not believe it to be possible without workarounds.

You will have to clear the enemy graphic but keep the enemy alive until the commands have been executed.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #348 on: September 15, 2013, 07:21:54 PM »
I do not believe it to be possible without workarounds.

You will have to clear the enemy graphic but keep the enemy alive until the commands have been executed.
Ok, and I hve another related question: How do I use VanishEnemy; without running Finalize?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #349 on: September 15, 2013, 07:32:52 PM »
Ok, and I hve another related question: How do I use VanishEnemy; without running Finalize?

if(GetLife<10){VanishEnemy;} should work.

You can't skip running Finalize. Just dump Vanish Enemy inside an if statement in @MainLoop or a task.

[And again. LOCAA will give you a faster reply]

The Noodles Guy

  • Flip the screen
  • What if Seija met a guy with bipolar disease?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #350 on: September 16, 2013, 08:08:24 PM »
Silly question. How do I make bullets that 'explode' into more bullets?

Like some of Miko's nonspells.
Easy Modo? That's for kids, and for me.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #351 on: September 16, 2013, 09:20:36 PM »
Silly question. How do I make bullets that 'explode' into more bullets?

Like some of Miko's nonspells.

Use CreateShotA with AddShot.

Or use an Object Bullet that shoots a ring of bullets before Obj_Delete

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #352 on: September 16, 2013, 10:20:55 PM »
How would I create the damage sound effect that plays while the enemy/boss is being shot at? I can't seem to figure it out.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #353 on: September 16, 2013, 11:24:21 PM »
How would I create the damage sound effect that plays while the enemy/boss is being shot at? I can't seem to figure it out.
1. Make a damage task thing.
2. Make the GetLife a variable. (I put enemylife)
3. Wait like 3 frames.
4. Make an if statement that checks if the life is low.
5. Make an if in that if that checks if the current life is less than enemylife. (The life a few frames ago.)
6. If so then the boss is being damaged! Play a sound effect.
7. Loop that and reset enemylife.

I think this is right:

task damage{
 let enemylife = GetLife;
  loop{
  wait(3);

   if(GetLife < 600 && GetLife > 300){
    if(GetLife < enemylife){
     PlaySE(damageSE);
    }
   }

  enemylife = GetLife;
 }
}

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #354 on: September 16, 2013, 11:41:07 PM »
After making some modifications to your task it worked. Thanks.

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #355 on: September 21, 2013, 02:46:37 PM »
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #356 on: September 21, 2013, 03:34:01 PM »
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1

Here is a circle.

let angle = 0;
loop(30){CreateShot01(GetX+60*cos(angle), GetY+60*sin(angle), 2, angle, RED01, 5); angle+=360/30;}

This code requires Sine and Cosine. You won't be able to make anything extremely advanced without knowledge of sin/cos/atan, and it will help you in life.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #357 on: September 21, 2013, 04:20:08 PM »
Since I've finished stage 2 of MMS I wanted to create my own SetScore function. Why? Danmakufu has some weird graphical glitch on effect objects and it makes some things look bad for the duration of the spell. Not to mention the actual score you set isn't what you get at the end of the spell(you can see it during the spell too)

My question is how does Danmakufu figure out how much score to subtract per second?

Maths ~Angelic Version~

  • Aspiring Mathematician of Brilliant Laziness
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #358 on: September 21, 2013, 04:36:30 PM »
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1
Why do you ask about this? Don't you know how sines and cosines work? If you don't, I recommend that you try to find it out (I suggest reading about trigonometry or something like that). If the sin/cos functions for some reason don't work, then sorry, I don't know what to do.
For instance, the best way to make a simple circle is this:
Code: [Select]
let angle=0;
let radius=50;
loop(40)
{
CreateShot01(GetX radius*cos(angle),GetY radius*sin(angle),0,angle,BLUE12,60);
angle =360/40;
}
There *is* an alternative way to make a circle that doesn't need sines/cosines, but it gives an uneven distribution of bullets, and it's annoying to get their angles right (you either have to use atan or atan2, which includes sin/cos anyway, or have the circle dissolve another way entirely (Thanks, Drake)). Here's the awkward method:
Code: [Select]
let radius=50;
let x=-radius;
loop(20)
{
let y=(radius^2-x^2)^0.5;
CreateShot01(GetX x,GetY y,0,atan2(y,x),RED12,0);
CreateShot01(GetX x,GetY-y,0,atan2(-y,x),RED12,0);
x =2*radius/(20-1);
}
As Sparen said, sines and cosines will make your life a lot easier. Many patterns, particularly more complex patterns, are difficult/impossible/ugly if you try to create them without sines and cosines.
Edit: Fixed plus signs and added a sentence. Thanks, Drake.
« Last Edit: September 21, 2013, 11:30:33 PM by Maths ~Angelic Version~ »

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #359 on: September 21, 2013, 09:44:50 PM »
If you throw an atan in there you're automatically using sin and cos (in a sense) so that doesn't really get around it. Of course the problem is really just a lack of understanding rather than the functions themselves, but yeah.

Your plus symbols didn't show up by the way.

Since I've finished stage 2 of MMS I wanted to create my own SetScore function. Why? Danmakufu has some weird graphical glitch on effect objects and it makes some things look bad for the duration of the spell. Not to mention the actual score you set isn't what you get at the end of the spell(you can see it during the spell too)

My question is how does Danmakufu figure out how much score to subtract per second?
1. What graphical glitch
2. Why do you need to know how DNH calculates spell score if you were going to make a new one anyways

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