Author Topic: Danmakufu Q&A/Problem Thread  (Read 172196 times)

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #390 on: July 28, 2009, 06:39:43 PM »
would it be possible to use such an if statement in a plural file?

Re: Danmakufu Q&A/Problem Thread
« Reply #391 on: July 28, 2009, 07:45:01 PM »
No, make a stage script that calls on serparate plural files based on conditional statements.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread
« Reply #392 on: July 29, 2009, 12:54:12 PM »
Em...
There are some spell card in the Touhou Series which is VERY difficult to remake, or even to get the algorithm.

I'm trying to remake something like Orin's "Blazing Wheel", then I encounter problems:

1. The starting position of the bullet is changing.
2. The speed of the bullets are different.
3. There is surely accelerations on the bullets :( (It can be considered a Danmakufu Question, right?)
Old/Forgotten member.

Old Patchouli Project was outdated but new one is in progress.

Hat

  • Just an unassuming chapeau.
  • I will never be ready.
Re: Danmakufu Q&A/Problem Thread
« Reply #393 on: July 30, 2009, 04:50:03 AM »
For Object-Object collision comparisons, do they have to be in the same task, or can I have two tasks for two different object bullets, and house the comparison blurb in, say, the MainLoop?

Thaws

  • _m廿廿m_
Re: Danmakufu Q&A/Problem Thread
« Reply #394 on: July 30, 2009, 05:16:27 AM »
For Object-Object collision comparisons, do they have to be in the same task, or can I have two tasks for two different object bullets, and house the comparison blurb in, say, the MainLoop?
No.

Only if both objects are created in the same task (then the collision comparison can only be used inside the task as well), or both objects are created in the @MainLoop can they be used for collision comparisons.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #395 on: July 30, 2009, 05:47:37 AM »
Actually, it still only works when the variables are the same or some other exceptions. Even if two object bullets with different names are in the same task, if collision detection is called afterward then it looks for the objects, but only for the first frame because the detection isn't called in any while loops. The task runs once and then runs next frame on different objects.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #396 on: July 30, 2009, 07:15:25 AM »
ahhh these questions are big and confusing! ??? ??? ??? i feel sad asking this but, how do you fire a laser? i try to scrypt them but they do not appear on the screen. ??? im stump'd

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #397 on: July 30, 2009, 01:06:30 PM »
ahhh these questions are big and confusing! ??? ??? ??? i feel sad asking this but, how do you fire a laser? i try to scrypt them but they do not appear on the screen. ??? im stump'd


Try this as a shot:

Code: [Select]
if(frame==60){
CreateLaser01(GetX,GetY,2,GetAngleToPlayer,200,20,RED01,0);
}


Can you tell which part is missing in your code?
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #398 on: July 30, 2009, 06:58:08 PM »
Two question:

I copied like 1on1 the 96% Great Galaxy of Spiritus spellcard from Uwabami. However, if you die there , the entire screen doesn't gets cleared (Like Kanako's SUPERB VERY LOVABLE VOWG spellcard).

So how is this excactly done upon death of the character? I know I have to use the function: 'DeleteShotsinCircle' but how can I call this upon dying?

2nd: How do I spawn a waving row of bullets. Like Sanae's card with the river thing, except horizontal while the bullets spawn from left and move to the right =S.
« Last Edit: July 30, 2009, 07:00:58 PM by Helepolis »

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #399 on: July 30, 2009, 07:04:41 PM »
Sanae's card is actually just a bunch of lasers superimposed on each other. They all have a set length, and it just spawns new ones every few frames. If you bomb it, watch as you see each laser spawn.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #400 on: July 30, 2009, 07:17:52 PM »
Sanae's card is actually just a bunch of lasers superimposed on each other. They all have a set length, and it just spawns new ones every few frames. If you bomb it, watch as you see each laser spawn.

So I should do the same for the bullets? Like spawn bullet at MaxY, next one like -10 etc untill reaching a parabole shape?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #401 on: July 30, 2009, 07:22:13 PM »
Yeah, that sounds right. Then after the last one is finished, go back to the first, but alter the first bullet by another value, so it offsets the entire 'wave'. And so on so forth.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #402 on: July 30, 2009, 07:44:16 PM »
Right, that works great. Now I just need to use this to create a relative easy-patternized noncard.

What about the 1st question regarding 'Upon death = clear radius of bullets '

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #403 on: July 30, 2009, 08:14:49 PM »
if(OnPlayerMissed==true){delete shots etc}

alternatively,

When initializing variables,
let lives = GetPlayerLife;
let nextlives = GetPlayerLife;


And then each frame,
lives = GetPlayerLife;
if (lives < nextlives){
        nextlives = GetPlayerLife;
        delete shots etc
}

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #404 on: July 30, 2009, 08:50:39 PM »
if(OnPlayerMissed==true){delete shots etc}

alternatively,

When initializing variables,
let lives = GetPlayerLife;
let nextlives = GetPlayerLife;


And then each frame,
lives = GetPlayerLife;
if (lives < nextlives){
        nextlives = GetPlayerLife;
        delete shots etc
}


The first one did the job.

   if(OnPlayerMissed==true){DeleteEnemyShotInCircle(ALL,GetPlayerX,GetPlayerY,112);}
   if(OnBomb==true){DeleteEnemyShotInCircle(ALL,GetPlayerX,GetPlayerY,112);}

Thanks alot Drake. I am getting closer on releasing my v3 of my Showdown contest with one excact imitated card from Uwabami breakers (96% spiritus), playable Reimu, added sprites, tweaked spellcards and a Lunatic mode.

Re: Danmakufu Q&A/Problem Thread
« Reply #405 on: July 31, 2009, 03:33:05 AM »
ahhh these questions are big and confusing! ??? ??? ??? i feel sad asking this but, how do you fire a laser? i try to scrypt them but they do not appear on the screen. ??? im stump'd
T_T my danmakufu hates me, i tryed the script u gave me but it Didn't work >_<;!!!!!!!
i cant tell what is wrong with it to, i dont even get an error message. an what is FireShot used for? ???

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #406 on: July 31, 2009, 03:38:33 AM »

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

Re: Danmakufu Q&A/Problem Thread
« Reply #407 on: July 31, 2009, 03:49:47 AM »
Read some tutorials thank you bye.
Ive already read it, tryed it, and Failed T_T MISERABLY

Johnny Walker

  • Perdition Crisis~
Re: Danmakufu Q&A/Problem Thread
« Reply #408 on: July 31, 2009, 04:00:32 AM »
Ive already read it, tryed it, and Failed T_T MISERABLY
There is a very basic script in the Basic Tutorial who helped me a lot to learn a lot of danmakufu stuff. It's very very useful.
Or you can Download some other scripts and modify them little by little to see what happens with each line each time you change it.

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #409 on: July 31, 2009, 04:52:51 AM »
Does anyone know the exact coordinates for everything that's in system.png? I've already figured out the life bar, event text box, Nullify box, Bomb icon, boss marker, things-that-fly-around-boss, and the HITBOX. (If I'm looking at it correctly, the area is 4, 91 for top-left corner and 9, 96 for bottom-right corner for the hitbox. I do recall someone mentioning that they wanted to get rid of this~) However, I'm having trouble with some other things, such as the invincibility circle for the player, the bars under the spellcard names, and the various ONE-PIXEL-TALL PIECES of the lifebar seperators. (If I've sized this file right, the thing is spread out to various locations one row of pixels at a time, with each turned about 90 degrees...in some direction, can't tell which. Seriously, what's up with that?) I'd honestly like some help with this... I'd love to have an accurate mapping of the system.png file so people can easily edit it.

For reference, this is what I did to the poor file:



(I swear I did this for laughs. HONESTLY! D: )


:D (Needs an awesomeface smiley. :/ )


For other reference, here's the coordinates I currently have, in case anyone would like to know that currently doesn't:

Format:
Piece: Left,Top;Right,Bottom

Hitbox: 4,91;9,96
Lifebars: 0,0;127,11
Bomb icon: 1,64;16,81
Nullify box: 0,180;?,198 (I cannot figure out exactly where it ends on the right, because if I put it where it seems to end, I somehow get a blotch of black where I'm using the 0,0,0 color, which should be invisible in Danmakufu... Or maybe it's just me not seeing it well. Can't tell. In any case, what SEEMS to be the end is about...127. But I'd honestly advise putting it around 3 for the left bounce and 124 for the right bound, as there's no reason to actually stretch it across the whole thing.)
Boss marker: 1,160;48,174
Things-that-fly-around-boss (What the heck ARE these things...?): 0,134;22,156

...and that's currently all I've figured out so far! ...I bet others here have already figured out all this stuff before I did, though. :P

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #410 on: July 31, 2009, 05:21:34 AM »
Yeah. I found some of them out after someone mentioned it a while back. Hitbox is useful if you just want to get rid of the terrible icantseethis one, but being only five pixels wide is hindering. I've toyed around with the bomb icon and position marker before but it really doesn't matter much to me so I keep them at default.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #411 on: July 31, 2009, 05:31:29 AM »
For other reference, here's the coordinates I currently have, in case anyone would like to know that currently doesn't:

Format:
Piece: Left,Top;Right,Bottom

Hitbox: 4,91;9,96
Lifebars: 0,0;127,11
Bomb icon: 1,64;16,81
Nullify box: 0,180;?,198 (I cannot figure out exactly where it ends on the right, because if I put it where it seems to end, I somehow get a blotch of black where I'm using the 0,0,0 color, which should be invisible in Danmakufu... Or maybe it's just me not seeing it well. Can't tell. In any case, what SEEMS to be the end is about...127. But I'd honestly advise putting it around 3 for the left bounce and 124 for the right bound, as there's no reason to actually stretch it across the whole thing.)
Boss marker: 1,160;48,174
Things-that-fly-around-boss (What the heck ARE these things...?): 0,134;22,156

...and that's currently all I've figured out so far! ...I bet others here have already figured out all this stuff before I did, though. :P
Awesome! I have been looking for a few of these. Was going to ask a question also regarding this but it seems you already have them. Especially the hitbox is very useful.

The things  that fly around the boss are just magical effects, look at the original Touhou games.

Cabblecorento

  • I'm a cat!
  • MEOW.
Re: Danmakufu Q&A/Problem Thread
« Reply #412 on: July 31, 2009, 04:15:29 PM »
How are you able to spawn enemies inside spell cards?

and then how are you able to take them from one card the the next?

After this I'll have my first boss ready.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #413 on: July 31, 2009, 04:23:26 PM »
How are you able to spawn enemies inside spell cards?

and then how are you able to take them from one card the the next?

After this I'll have my first boss ready.

Enemies are often marked as familiars. If you want to spawn them you need to use CreateEnemyFromScript. But what do you mean with "take them to the next?" Like using them in the next spellcard aswell? In that case using CreateEnemyFromFile would be more sufficient. So you need to declare the enemies once inside a txt file and can be called from any other spellcard (Hence how stages also work).

Cabblecorento

  • I'm a cat!
  • MEOW.
Re: Danmakufu Q&A/Problem Thread
« Reply #414 on: July 31, 2009, 04:44:03 PM »
Aha, thanks.

Also, out of curiosity, what file type do 3d objects have to be?

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #415 on: July 31, 2009, 04:54:13 PM »
Danmakufu's 3D functions are nowhere near that sophisticated. You can't import models or anything, you'll need to manually rotate and draw each polygon using the 3D drawing functions. Nuclear Cheese's tutorial on the matter is the best way to get a grasp of how they work.

Cabblecorento

  • I'm a cat!
  • MEOW.
Re: Danmakufu Q&A/Problem Thread
« Reply #416 on: July 31, 2009, 05:15:54 PM »
I just read it.

I can't see how you were able to make those mountains.

Cabblecorento

  • I'm a cat!
  • MEOW.
Re: Danmakufu Q&A/Problem Thread
« Reply #417 on: July 31, 2009, 06:13:19 PM »
Ok, while making my boss I encountered a problem

I'm trying to get a wave of bullets to spawn again and again each time faster.

Code: [Select]
#TouhouDanmakufu
#Title[Darkness Sign "Blind from the Bottom"]
#Text[De-Coronation]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let angle2 = 500;
let angle = 0;
   let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
   let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
    let frame = 0;
@Initialize {
SetMovePosition01(224,120,10);
   SetGraphicRect(1,1,64,64);
        LoadGraphic(imgExRumia);
   LoadGraphic(imgExRumiaBack);
        SetLife(1);
        SetDamageRate(0, 0);
        SetTimer(30);
        CutIn(YOUMU, "Darkness Sign [Blind from the Bottom]", imgExRumia, 0, 0, 200, 600);
        SetScore(500000);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 24);
        if(frame==angle2){
CreateShot01(rand(1,448), 1, 7, 90, RED12, 20);
CreateShot01(rand(1,448), 1, 6, 90, RED12, 20);
CreateShot01(rand(1,448), 1, 5, 90, RED12, 20);
CreateShot01(rand(1,448), 1, 4, 90, RED12, 20);
CreateShot01(rand(1,448), 1, 3, 90, RED12, 20);
CreateShot01(rand(1,448), 1, 2, 90, RED12, 20);
            frame = 0;
        }
if(angle2<0){
angle2=1;
}

        frame++;
angle++;
angle2--;
    }

    @DrawLoop {
      SetAlpha(255);
      SetTexture(imgExRumia);
SetGraphicRect(0,0,64,64);
      DrawGraphic(GetX(),GetY());
       
    }
    @BackGround {
SetTexture(imgExRumiaBack);
SetGraphicRect(0,0,384,448);
DrawGraphic(224,240);
}

    @Finalize {
    }
}

Anyone know what's wrong with that?

Sorry for being such a noob  :V

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #418 on: July 31, 2009, 06:25:13 PM »
Quote
I can't see how you were able to make those mountains.
The trick is that the polygons the mountains are made of are not actually triangles. The image itself used for them is square, with the non-triangular part blacked out for transparency.

Creating the mountains with that texture was a matter of trial and error, I started by laying one texture out at an angle, then adding another and fiddling with its position and angle until its edge was close enough to the first to look like they were joined. Every mountain is the same, just drawn repeatedly at different positions and heights.

Quote
Ok, while making my boss I encountered a problem
You need to think about what's happening each loop. Frame starts at 0 and angle2 starts at 500. Frame goes up each loop and angle2 goes down, so they should meet at frame==250 the first time. Frame resets at 0 and angle2 keeps going down, next time they meet at frame==125. Reset again, meeting halfway they would need to meet at frame==62.5 which obviously can't happen, so you don't get any more shots. Also, eventually frame2 goes below 0, and doesn't get reset to 1 until after the if loop so that won't help.

I'd advise not having frame2 decrease every loop, only when shots are fired.

Cabblecorento

  • I'm a cat!
  • MEOW.
Re: Danmakufu Q&A/Problem Thread
« Reply #419 on: July 31, 2009, 06:52:35 PM »
Mmk, thanks for the help!

With a ton of editing, I changed it to it decreases by 1 every shot fired, and angle 2 is 60.

It works fine now. (I can't get into the spirit of danmakufu very well...)