Author Topic: Danmakufu Q&A/Problem thread number 4  (Read 207238 times)

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #150 on: July 20, 2010, 12:11:48 AM »
SetCollisionB is the much easier method. The only problem is that it won't give you graze.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #151 on: July 20, 2010, 12:19:42 AM »
How do you call SetCollisionB for an effect object?  ???
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #152 on: July 20, 2010, 12:34:21 AM »
It has three parameters - X, Y, and size. Who says X and Y need to be centered on the boss? You can use more than one, so it won't interfere with boss-player collision.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #153 on: July 20, 2010, 09:50:07 AM »
It has three parameters - X, Y, and size. Who says X and Y need to be centered on the boss? You can use more than one, so it won't interfere with boss-player collision.

God dammit!
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #154 on: July 20, 2010, 10:56:46 AM »
It said so on the wiki, but in Engrish. I went and fixed it, as well as clarifying some other stuff. (Side note: I also moved my post about render targets to the wiki, since it had no information at all about them, and I thought it would be helpful.)
« Last Edit: July 20, 2010, 11:11:33 AM by Azure Lazuline »

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem thread number 4
« Reply #155 on: July 21, 2010, 09:24:48 AM »
Dumb Question #234980012a
ZUNsuns
ADD render or ALPHA render? (I know there are two layers)


puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #156 on: July 21, 2010, 10:04:17 AM »
Dumb Question #234980012a
ZUNsuns
ADD render or ALPHA render? (I know there are two layers)


Both ADD. Be sure to give both files a black background if they don't have it yet.
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

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem thread number 4
« Reply #157 on: July 21, 2010, 01:10:24 PM »

Both ADD. Be sure to give both files a black background if they don't have it yet.
Thanks
Shit I have zero photoshop skills

Zerro

  • ERRORS,
  • ERRORS EVERYWHERE
Re: Danmakufu Q&A/Problem thread number 4
« Reply #158 on: July 22, 2010, 02:22:56 AM »
I know this is lolfacepalm but how do you call tasks?

And also, because I know it involves tasks, how do you make lasers move, like in Flandre's Laevetinn(or however the hell you spell it)?
Life's a shmup, play on lunatic.

Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem thread number 4
« Reply #159 on: July 22, 2010, 02:29:44 AM »
I know this is lolfacepalm but how do you call tasks?

And also, because I know it involves tasks, how do you make lasers move, like in Flandre's Laevetinn(or however the hell you spell it)?

It's really easy to call a task. Once you have it made, all you do is type the name in and any parameters you've set for it.

Code: [Select]
task Ha ha, old chap!{
   ShootDownPlayer;
}

task main{
   loop{
      Ha ha, old chap!;
      yield;
   }
}

And as for moving lasers, it depends on what type. CreateLaser01, CreateLaserA,B,C, or object?

Re: Danmakufu Q&A/Problem thread number 4
« Reply #160 on: July 22, 2010, 02:32:22 AM »
I know this is lolfacepalm but how do you call tasks?

Make one by typing

task NameMeAnythingAtAll{
   //shit goes here
}


Call one by typing

NameMeAnythingAtAll;

And also, because I know it involves tasks, how do you make lasers move, like in Flandre's Laevetinn(or however the hell you spell it)?

By changing their position  :ohdear:

while(!Obj_BeDeleted(obj)){
   Obj_SetPosition(obj, x, y);
   x++;
   y++;
   yield;
}




Please refer to the intermediate tutorial for tasking basics.



And uh

task Ha ha, old chap!{
   ShootDownPlayer;
}

task main{
   loop{
      Ha ha, old chap!;
      yield;
   }
}

Commas, spaces and exclamation points are illegal in functions/tasks.

But since you're just saying el oh el, get owned by shitty wordfilters  :ohdear:
« Last Edit: July 22, 2010, 02:34:01 AM by Naut »

Zerro

  • ERRORS,
  • ERRORS EVERYWHERE
Re: Danmakufu Q&A/Problem thread number 4
« Reply #161 on: July 22, 2010, 02:37:03 AM »
Thanks, I've read the tutorial, and tasks are just something I need to get better at. :derp:
Life's a shmup, play on lunatic.

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem thread number 4
« Reply #162 on: July 22, 2010, 09:00:12 AM »
This task will allow an object laser to move based on it's angle and speed, same as a bullet.

Code: [Select]
task AutoMoveLaser(obj)
{
while(!Obj_BeDeleted(obj))
{
Obj_SetPosition(obj,Obj_GetX(obj)+cos(Obj_GetAngle(obj))*Obj_GetSpeed(obj),Obj_GetY(obj)+sin(Obj_GetAngle(obj))*Obj_GetSpeed(obj));
yield;
}
}

There is almost bound to be a typo in there, so be warned :V

Nonnie Grey

  • Contradictory Statement
  • The Anonymity formerly known as Kayorei
Re: Danmakufu Q&A/Problem thread number 4
« Reply #163 on: July 23, 2010, 10:24:16 AM »
This is more a curiosity question than anything as it's not really an issue, but...

What dictates the background on a spellcard when SetScore is declared and nothing is specified in @BackGround or #BackGround? Sometimes, I get that watery-looking default background, but other times there isn't a background at all; just black. I can't seem to find any difference between the way the spellcards were coded, either, though whatever background they wind up with, they stay with.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #164 on: July 23, 2010, 10:43:50 AM »
Afaik, if you leave @BackGround{} out completely, you will get the default wavery lines stuff. If put @Background{} in the script but put nothing inside it, you will get a black screen.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Re: Danmakufu Q&A/Problem thread number 4
« Reply #165 on: July 23, 2010, 06:30:20 PM »
I have some questions  :ohdear:

So recently I've been trying to master spark. But epic failed , How do I make my spell fade after using it? I tried (obj)

Code: [Select]
ObjShot_FadeDelete(obj);
Code: [Select]
ObjLaser_FadeDelete(obj);
Code: [Select]
Obj_FadeDelete(obj);
It's a player's spell. Obj_Delete just erase it and it looks kinda arkward.  :V
and also, the supershot only has 1 colour (white), how do I make it change colour without having to change the supershot sheet

That's not all, I have some more questions but I forogt for now ME AND MY POOR MEMORY
Hey There !

Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem thread number 4
« Reply #166 on: July 23, 2010, 06:46:09 PM »
I have some questions  :ohdear:

So recently I've been trying to master spark. But epic failed , How do I make my spell fade after using it? I tried (obj)

Code: [Select]
ObjShot_FadeDelete(obj);
Code: [Select]
ObjLaser_FadeDelete(obj);
Code: [Select]
Obj_FadeDelete(obj);
It's a player's spell. Obj_Delete just erase it and it looks kinda arkward.  :V
and also, the supershot only has 1 colour (white), how do I make it change colour without having to change the supershot sheet


Your spell? Do you mean the laser? Then I would assume your answer would be the first one. It applies to both shots and lasers, but there's no control over it. The other two don't exist.

As for the supershot problem, there's no other solution that I know of, if you want to use it as a shot.
The only other method I know of changing bullet colors without changing the bullet is to turn it into an object. Then you can change the color using SetAlpha for ALPHA blend and SetColor for ADD blend, but you'd also have to set collision circles (which isn't that hard but don't forget them).
If there's an easier way, I'd like to know that too.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #167 on: July 23, 2010, 07:05:50 PM »
Master Spark should be an effect object, not a laser object. Can get the rainbow, fading, multiple image blends, etc.

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #168 on: July 24, 2010, 06:11:54 AM »
SetColor for ADD blend

But how do you do SetColor for Add blend ? I did
Code: [Select]
ObjEffect_SetRenderState(obj,ADD);
SetColor(rand(0,255),rand(0,255),rand(0,255));

but Danmakufu give me a error saying something about SetColor

Master Spark should be an effect object, not a laser object. Can get the rainbow, fading, multiple image blends, etc.

Does effect object works the same ? and when I try rainbow multiple image blends, it doesn't work, it only works for ADD [I must had done something wrong  :/]
Hey There !

Re: Danmakufu Q&A/Problem thread number 4
« Reply #169 on: July 24, 2010, 06:15:40 AM »
ObjEffect_SetVertexColor(id, vertex, alpha, red, blue, green);

Only functions that start with Obj work with Objects.

Here's a list of them.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #170 on: July 24, 2010, 07:35:52 AM »
This is a bit confusing  ??? but now the spell doesn't even show on the screen.

Code: [Select]
///////////////////////////////////////////////////
task Star(s,angle,l){
let obj = Obj_Create(OBJ_EFFECT);
  let counter = 0;
  let counterb = 0;
 

  Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
Obj_SetSpeed(obj,s);
//ObjLaser_SetWidth(obj, 10);
//ObjLaser_SetLength(obj, l);
Obj_SetAlpha(obj,100);

ObjEffect_SetRenderState(obj,ALPHA);
//ObjEffect_SetLayer(obj,3);[color=pink] // I don't see the difference between any numbers[/color]
ObjEffect_SetTexture(obj,img_spell);
ObjEffect_CreateVertex(obj,4);
ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetVertexUV(obj,0,1,514);
ObjEffect_SetVertexUV(obj,1,514,514);
ObjEffect_SetVertexUV(obj,2,514,767);
ObjEffect_SetVertexUV(obj,3,514,767);
ObjEffect_SetVertexColor(obj,0,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,1,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,2,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,3,100,rand(0,255),rand(0,255),rand(0,255));

Obj_SetAngle(obj,angle);
//ObjShot_SetGraphic(obj,254);
ObjShot_SetDamage(obj,5);
ObjShot_SetPenetration(obj,1000);
while(!Obj_BeDeleted(obj)){
Wait(1);
counter+=1;
counterb+=1;
if(counter==1){
Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
//ObjLaser_SetWidth(obj, 500);

ObjEffect_SetVertexColor(obj,0,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,1,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,2,100,rand(0,255),rand(0,255),rand(0,255));
ObjEffect_SetVertexColor(obj,3,100,rand(0,255),rand(0,255),rand(0,255));
counter=0;}
if(counterb==300){ObjShot_FadeDelete(obj);}
}
 ///////////////////////////////////////////////////
I think the vertex should be correct [(0,514,122,767)]
Massive headache* seizure I'm going to die T_T
« Last Edit: July 24, 2010, 07:38:54 AM by Foremoster »
Hey There !

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #171 on: July 24, 2010, 09:42:23 AM »
Ahem:

   ObjEffect_SetVertexUV(obj,0,1,514);
   ObjEffect_SetVertexUV(obj,1,514,514);
   ObjEffect_SetVertexUV(obj,2,514,767);
   ObjEffect_SetVertexUV(obj,3,514,767);


On another note, the shenanigans with your variable "counter" are completeley unnecessary. The way you increment it and set it back, it still happens once every frame.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Re: Danmakufu Q&A/Problem thread number 4
« Reply #172 on: July 24, 2010, 11:01:22 AM »
That's weird, it's still not showing up, vertex is still incorrect ?

   ObjEffect_SetVertexUV(obj,0,1,1);
   ObjEffect_SetVertexUV(obj,1,514,1);
   ObjEffect_SetVertexUV(obj,2,1,514);
   ObjEffect_SetVertexUV(obj,3,514,514);



Edit :

   ObjEffect_SetVertexUV(obj,0,1,1);
   ObjEffect_SetVertexUV(obj,1,514,1);
   ObjEffect_SetVertexUV(obj,2,1,764);
   ObjEffect_SetVertexUV(obj,3,514,764);

still doesn't show, I'm starting to think it's not the vertex
« Last Edit: July 24, 2010, 11:04:33 AM by Foremoster »
Hey There !

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #173 on: July 24, 2010, 11:08:20 AM »
If you were using TRIANGLESTRIP, that would be correct.

However, you are using TRIANGLEFAN. That means the vertex alignment you would want is:

0 --1
|  \
3   2

And even then, it is still possible that there is a less obvious error that prevents the image from showing properly, so...
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #174 on: July 24, 2010, 03:49:50 PM »
Look at the "diagram" I made. It is a triangle FAN.

0 --1
|  \
3   2

You have them in a strip:

0--1
  /
2--3


Oh, and the reason they don'T show up is because you are missing youe SetVertexXY.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #175 on: July 26, 2010, 10:34:51 PM »
Hi! I've returned from a long hiatus. I finally got the bomb (from the last thread) working perfectly, but the texture I used for the bomb blocks the visibility of the field. Is there any way to change the transparency of the texture? I tried doing so with Obj_SetAlpha, but it has no effect, as seen on the code and the screen. Is there also a way to make the object appear about half a second rather than longer? I'm not sure about this one, since I don't know the total duration of the while loop in the object. I was hoping the object spell would flash for a short amount of time before the next one appears, since I've set it up to go on a <-o-> direction. The o being the center of the field.
Code: [Select]
task LightningRipple(xpos){
let objlightning=Obj_Create(OBJ_SPELL);
Obj_SetAlpha(objlightning,50);
Obj_SetAngle(objlightning,90);
ObjEffect_SetTexture(objlightning,lightning);
ObjEffect_SetRenderState(objlightning,ALPHA);
ObjEffect_SetScale(objlightning,2,2);
ObjEffect_CreateVertex(objlightning,4);
ObjEffect_SetPrimitiveType(objlightning,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetVertexUV(objlightning,0,0,0);
ObjEffect_SetVertexUV(objlightning,1,160,0);
ObjEffect_SetVertexUV(objlightning,2,160,600);
ObjEffect_SetVertexUV(objlightning,3,0,600);
while(!Obj_BeDeleted(objlightning)){
ObjEffect_SetVertexXY(objlightning,0,0+xpos,0);
ObjEffect_SetVertexXY(objlightning,1,52+xpos,0);
ObjEffect_SetVertexXY(objlightning,2,52+xpos,464);
ObjEffect_SetVertexXY(objlightning,3,0+xpos,464);
ObjSpell_SetIntersecrionLine(objlightning,0,0,52+xpos,464,464,5,true);
yield;
}
}

task run{
SetPlayerInvincibility(300);
ForbidShot(true);
loop(45){yield;}
while(spellcount<31){
if (spellcount%10==0){
LightningRipple(xpos1);
LightningRipple(xpos2);
xpos2+=25;
xpos1-=25;
PlaySE(lightningwav);
if(spellcount==31){
     Flash;
     PlaySE(crash);
}
}
       spellcount++;
       yield;
       }
ForbidShot(false);
SetSpeed(3.5,2.5);
loop(90){yield;}
End();
}
Result:

Also, I've been using Blargel's Animation Handling library, which really helps a great deal by the way...but is there away to scale the image being used to animate as well as change the alpha as well while using the custom functions? There's no parameter for them, but I'm guessing I have to use SetTexture?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #176 on: July 26, 2010, 11:00:04 PM »
If you want to change the alpha value of an effect object, you need to set it for each vector seperately, like this:

Code: [Select]
ascent(i in 0..4){
ObjEffect_SetVertexColor(objlightning, i, the_alpha_you_want, 255, 255, 255);
}

If you want the object to be removed after some time, you need to create a variable at the beginning of the task, let's call it "death", and give it a value. Then you have it decrease the value of "death" by 1 during each run of the while{} part and then, if it is below 0, remove the object. Although removing it instantly usually looks back, so I'd advise you to create two variables instead: "death" and "visibility". Visibility starts out at the alpha value the object should have and decreases drastically every frame once "death" is below 0. Then you delete the object once "visibility" reaches zero.

Code: [Select]
      let death=30;
      let visibility = 100;

...
ascent(i in 0..4){
ObjEffect_SetVertexColor(objlightning, i, the_alpha_you_want, 255, 255, 255);
}

            death--;
            if(death<=0){ visibility-=10; }
            if(visibility<=0){ Obj_Delete(objlightning); }
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #177 on: July 27, 2010, 01:05:11 AM »
If you want to change the alpha value of an effect object, you need to set it for each vector seperately, like this:

Code: [Select]
ascent(i in 0..4){
ObjEffect_SetVertexColor(objlightning, i, the_alpha_you_want, 255, 255, 255);
}

If you want the object to be removed after some time, you need to create a variable at the beginning of the task, let's call it "death", and give it a value. Then you have it decrease the value of "death" by 1 during each run of the while{} part and then, if it is below 0, remove the object. Although removing it instantly usually looks back, so I'd advise you to create two variables instead: "death" and "visibility". Visibility starts out at the alpha value the object should have and decreases drastically every frame once "death" is below 0. Then you delete the object once "visibility" reaches zero.

Code: [Select]
      let death=30;
      let visibility = 100;

...
ascent(i in 0..4){
ObjEffect_SetVertexColor(objlightning, i, the_alpha_you_want, 255, 255, 255);
}

            death--;
            if(death<=0){ visibility-=10; }
            if(visibility<=0){ Obj_Delete(objlightning); }

I like it! It works really well, but the only problem is that since I'm spawning instances of the object, calling Obj_Delete wipes out all of them. Does this mean I would have to make each effect object individual to get the effect I need?

Man, I know nothing about ascent and descent, much less arrays and other intermediate math functions...most of the stuff I've been doing are simply basic operations and if statements. I wish I knew more about those...

I'm still wondering about setting scale and alpha with Blargel's custom function library...

Formless God

Re: Danmakufu Q&A/Problem thread number 4
« Reply #178 on: July 27, 2010, 01:25:21 AM »
Question question, can Danmakufu draw the screen flickering effect ? (like what happens behind those MoF/SA/UFO bosses)

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #179 on: July 27, 2010, 02:21:02 AM »
Question question, can Danmakufu draw the screen flickering effect ? (like what happens behind those MoF/SA/UFO bosses)

I'm sure it's been discussed before, but I wasn't there.
I don't think so. Do you mean the wavering background or the burning aura?