Author Topic: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)  (Read 140429 times)

TraceTheKriken

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #690 on: December 12, 2011, 02:04:23 PM »
Define it outside the drawloop so it'll not always reset to zero. Also join those two ifs doing the same thing.

Doesn't work. I also tried moving let spin = 0; outside @DrawLoop because it didn't recognize it while it was there.
I'm starting to wonder if the part of the script that should make the sprite to rotate even works.

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #691 on: December 12, 2011, 02:07:48 PM »
also what does
Code: [Select]
if( spriteangle != 0 ){
    spriteangle += spin;
}
mean? Is it supposed to ever perform?
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


TraceTheKriken

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #692 on: December 12, 2011, 02:15:42 PM »
also what does
Code: [Select]
if( spriteangle != 0 ){
    spriteangle += spin;
}
mean? Is it supposed to ever perform?

Here is the answer:

//in enemy sprite drawing, where spriteangle and spin are predefined
if( GetSpeedX != 0){ spin = GetSpeedX; }  //GetSpeedX returns 1 if enemy is moving right and -1 is enemy is moving left
if( spriteangle != 0 ){  //needed so when the enemy stops it keeps spinning until upright   
                 spriteangle += spin;
}

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #693 on: December 12, 2011, 02:29:46 PM »
Here is the answer:

In your code it's never supposed to perform. I've edited it to something like this
Code: [Select]
let spin = 0;
let spriteangle = 0;


@DrawLoop {
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1, 1);

if(trunc(GetSpeedX())==0) {
if(spriteangle==0){spin=0;}
SetGraphicAngle(0, 0, spriteangle);
if(f<5){ SetGraphicRect(7, 197, 43, 256); }
if(f>=5 && f<10){ SetGraphicRect(55, 197, 91, 256); }
if(f>=10 && f<15){ SetGraphicRect(103, 197, 139, 256); }
if(f>=15 && f<20){ SetGraphicRect(151, 197, 187, 256); }
f2=0;
}else{
spin = GetSpeedX;
if(f2<5){ SetGraphicRect(11, 324, 41, 384); }
if(f2>=5 && f2<10){ SetGraphicRect(56, 328, 88, 384); }
if(f2>=10){ SetGraphicRect(107, 331, 136, 377); }
f2++;
if(GetSpeedX()>0) {
SetGraphicAngle(0, 0, spriteangle);
}
if(GetSpeedX()<0) {
SetGraphicAngle(180, 0, spriteangle);
}
}

spriteangle += spin;

DrawGraphic(GetX, GetY);

f++;
if(f==20) {f=0;}
}

Havent tried it cause i havent those sprites'n'shit.

Oh. And lets stop flooding the thread already and go IRC and talk there
« Last Edit: December 13, 2011, 04:41:06 PM by MMX »
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #694 on: December 12, 2011, 09:09:12 PM »
Can someone make a SA ReimuA player? I just want it because I'm pure lazy
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #695 on: December 12, 2011, 11:30:13 PM »
make options circle around the player, fire shots forward at a constant rate
if not focusing and not shooting and the player leans against a wall and taps twice in that direction, the player warps to the other side of the screen

code this

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #696 on: December 13, 2011, 01:39:28 AM »
Oh, i see. Meh. It'll be done after i'm not lazy
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #697 on: December 13, 2011, 01:42:28 AM »
then stop being lazy

Ok, so just wondering - why can't enemies and object effects be created on the first frame?
(Though it's easily avoidable.)
« Last Edit: December 13, 2011, 01:55:15 AM by alt-kyuu-kyuu »

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #698 on: December 13, 2011, 01:55:20 AM »
Fine. *Opening folder* *Open's notepad* *Does long work* *Searches for god damn purple needles and yin-yang orbs* *Goes to work*

THE END  :D

Since I'm not gonna be lazy anymore, anyone know where to find yin-yang orbs and purple needles of death? ( You get my cookies if you give me a link ).

There is no reason for double posting. Please edit your posts. -Helepolis
« Last Edit: December 16, 2011, 09:25:18 PM by Yuuka »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #699 on: December 13, 2011, 02:07:00 AM »

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #700 on: December 13, 2011, 03:20:58 AM »
Ok, so just wondering - why can't enemies and object effects be created on the first frame?
I'm pretty certain it's because the engine hasn't initialized for drawing yet, basically.  It's similar to why DrawLoop and Object Effects seem to draw on different frames.

-> script reading
--> variables initialize and errors show up
-> @initialize
--> drawing task
---> trying to draw things, no render available, abort abort
--> other tasks
---> yield; exits thread, no other active yield available, continue program flow
-> @mainloop
--> yield; no other active yield available, continue program flow
-> @drawloop
--> set up current frame rende
--> render drawing
-> frame finished; computer threads to other programs, updates monitor

-> @mainloop
--> yield; threads to task stack
--> tasks
---> yield to next task etcetcetc
--> last task yields; no other active yield available, continue program flow
-> @drawloop
--> set up current frame render
--> render drawing
-> frame finished; computer threads to other programs, updates monitor


Something along those lines. It's also possible danmakufu threads over after MainLoop and not after DrawLoop, maybe. I don't really know.

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

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #701 on: December 13, 2011, 05:03:11 AM »
Is it possible to check for whether a player's shots are colliding with an object or enemy? I want to have bullets fired back if a particular target is shot, similar to how Parsee's second spellcard works in SA.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #702 on: December 13, 2011, 05:35:04 AM »
Well, if you're going to do it in the way Parsee's card does, you'd just need GetHitCount.

So like, if(GetHitCount > 0) { FIREMOREBULLETS!!!; }
In the enemy script, of course.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #703 on: December 13, 2011, 06:37:34 AM »
Be careful about that though, since that returns the number of hits in the previous frame, not the damage. If you just created a set number of bullets per hit, a rapid-fire player would get completely swamped but a single-shot powerful player would have no trouble at all. The better thing to do would be to store the enemy's current life, and next frame see what the difference is with its current life, so it's based on how much damage you're doing instead of the number of hits.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #704 on: December 13, 2011, 06:45:03 AM »
Like this? (Typing from memory instead of actually stealing from my own code since I'm hella tired right now.)

let diffinlife = 0;
task updatelife {
   let nL = GetLife;
   loop {
      diffinlife = GetLife-nL;
      yield;
      nL = GetLife;
   }
}

thencallupdatelife,anddostuffwithdiffinlife

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #705 on: December 13, 2011, 10:03:54 AM »
That wont do it like Small box, Large box. You actually need to track wich shots attack wich target. This should be checked with Obj_IsIntersected and comparing projectile coordinates in enemy script via common data exchange.

Jesus. What a BS i wrote. Of course you can count enemy hits if you spawn a "Parsee clone" like a child enemy. More like
Code: [Select]
shitty code that doesnt work
« Last Edit: December 13, 2011, 05:10:44 PM by MMX »
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #706 on: December 13, 2011, 04:37:37 PM »
Nope.

Since you're creating the count variable in @Initialize, it will only be available in the @Initialize block of code. Which means @MainLoop can't use it.

Also, since you're making it that you have to hit the boss with more bullets every time you hit it, you'd quickly become not able to get the boss to fire any more bullets. Also, it's a while, so :infiniteloop: after that happens.



I think that's what's up there.

Discussion in IRC.
« Last Edit: December 13, 2011, 05:33:14 PM by alt-kyuu-kyuu »

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #707 on: December 13, 2011, 05:12:13 PM »
http://pastebin.com/7TGgjedk now it works like i wanted.
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #708 on: December 15, 2011, 12:22:33 AM »
Anyone have a CTC Marisa sprite?
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #709 on: December 15, 2011, 12:46:28 AM »
Something tells me you're not in the right thread. Also, which type? Player? Boss sprite?

I think I can probably find a boss-type CtC Marisa sprite.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #710 on: December 15, 2011, 01:27:30 AM »
Something tells me you're not in the right thread. Also, which type? Player? Boss sprite?

I think I can probably find a boss-type CtC Marisa sprite.

Oops. It's suppose to be in the request thread. Sorry. Anyway, boss sprite please.

( WHY THE F**K DO I POST IN THE WRONG THREAD!!!??? Meh. This headache is getting my nerves today)...
« Last Edit: December 15, 2011, 01:33:31 AM by Marisa X Reimu »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Lukesky180

  • Knight of the Hungry Ghost
  • Yuyuko-sama!
    • HSE-Endeavor's Robotics Team
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #711 on: December 16, 2011, 03:16:36 AM »
I have a question:

Are there any tutorials that I can use (I am a beginner)? All the ones in the Danmakufu tutorial thread are so confusing! Is there an easy turorial, please?
>This is the little mistress.
>Oh, hello little one!
Is this my dream, the destiny to behold?
~Sister of Scarlet~

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #712 on: December 16, 2011, 04:02:18 AM »
Yeah, there's this one and then there are a few more over here.

:D

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #713 on: December 16, 2011, 04:03:22 AM »
If you've looked at my beginner tutorial and said it's too difficult, then we're going to have some problems. It starts at the basics of computer languages, variables and control statements. There's nothing that's simpler than that. Now, I have considered starting a video tutorial series on YouTube parallel to Helepolis's, but it's a daunting task and I don't think I'd be able to keep it going long enough to teach everything.

My advice is to try reading my beginner tutorial again slowly. Read a section and try to absorb the information. If you didn't get it that time, try again another day. Sometimes looking at something confusing again after you had a chance to sleep helps.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

TraceTheKriken

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #714 on: December 16, 2011, 03:30:11 PM »
Is there a way to make the music loop from cetrain spot?

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #715 on: December 16, 2011, 03:55:47 PM »
Um... Not exactly.
But, you can do something like...

http://pastebin.com/P5sMRrNQ

I'm actually not entirely sure myself, because I haven't tested that. Yet. But it does seem to work in games like Never Extinguished Flame.
« Last Edit: December 16, 2011, 04:05:48 PM by alt-kyuu-kyuu »

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #716 on: December 16, 2011, 05:07:49 PM »
Is there a way to choose player after the script started? The only idea coming to my mind is to make some "universal" player script, containing all shottypes and then tell it wich one to choose via common data :wat:
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #717 on: December 16, 2011, 09:59:19 PM »
Yeah, that'd be the way. You can still use separate files as long as you import them properly.

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

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #718 on: December 16, 2011, 10:47:36 PM »
Another question: how the fuck danmakufu defines bullet's hitbox by graphic loaded? Is it always a circle with a radius measured by graphic size? And what about stretched sprites?
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #719 on: December 16, 2011, 11:47:14 PM »
Another question: how the fuck danmakufu defines bullet's hitbox by graphic loaded? Is it always a circle with a radius measured by graphic size? And what about stretched sprites?
Yes, it's a circle of radius [smallest dimension of graphic] / 2, or 3, or at least something close to that. Bullets themselves cannot be resized, though. If you define an object bullet and use another render object to draw it, it doesn't affect the hitbox. If you use a laser to stretch it though, then danmakufu calculates a new hitbox as it does for all lasers.

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