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

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #600 on: December 10, 2009, 06:10:00 AM »
Yep. Use AddLife. Though I also wonder why that SetLife command makes Danmakufu faceplant.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #601 on: December 10, 2009, 08:22:50 AM »
As far as I can tell, only one instance of SetLife is allowed to be run because that's what it uses to determine the length of life bars for a plural boss.

...Except that's not true either :V
It takes the first instance of SetLife in each script before any of the scripts are run, meaning if you have some conditionals that change how much life the enemy starts with (for different difficulties for example), you'll end up with messed up life bars sometimes. This is also true if the first instance of SetLife is in a comment, which I find really bizarre because IT'S IN A FREAKING COMMENT.
<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.

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #602 on: December 10, 2009, 03:37:57 PM »
okay...umm, what's the purpose of...or what exacly does MULTIPLY: multiplicative blend  in Object Effects?
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem Thread II
« Reply #603 on: December 10, 2009, 03:43:37 PM »
okay...umm, what's the purpose of...or what exacly does MULTIPLY: multiplicative blend  in Object Effects?

when I tried doing multiply in drawing (drawloop, not object effects, but I think the same principle applies), it's like a mix between subtract and add... so basically... it's both Dark and bright/shiny... it's just weird and hard to explain... it's like a dark shadow-like version of the basic Alpha... (hope this helps)
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #604 on: December 10, 2009, 05:13:38 PM »
http://en.wikipedia.org/wiki/Blend_modes

Alpha isn't mentioned there, but if it isn't obvious already, alpha just makes the top image show as it normally does and covers the bottom image.
<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.

Gc

  • youtu.be/pRZpjlrKM8A
Re: Danmakufu Q&A/Problem Thread II
« Reply #605 on: December 10, 2009, 05:24:46 PM »
Quick explanation of render modes:
(bg color + object color = result)

ALPHA: Default render mode. Draw the image exactly as it is in the image file over the background.

ADD: Add the overlaying hex values
255,000,000 + 000,255,000 = 255,255,000
063,127,191 + 191,127,063 = 255,255,255

SUBTRACT: Opposite of ADD, subtract the overlaying hex values
255,255,000 - 255,000,000 = 000,255,255
255,255,255 - 063,127,191 = 191,127,063 <-- invert colors when on white

MULTIPLY (starting to understand ?) : Multiply the overlaying hex values
no math example because I am lazy

edit: f u blargel

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #606 on: December 10, 2009, 06:17:03 PM »
when I tried doing multiply in drawing (drawloop, not object effects, but I think the same principle applies), it's like a mix between subtract and add... so basically... it's both Dark and bright/shiny... it's just weird and hard to explain... it's like a dark shadow-like version of the basic Alpha... (hope this helps)
umm...it helped me...not enough, thanks though...
Quick explanation of render modes:
(bg color + object color = result)

MULTIPLY (starting to understand ?) : Multiply the overlaying hex values
no math example because I am lazy
...meh...no matter...I have this...
http://en.wikipedia.org/wiki/Blend_modes
wow, wikipedia, really...no, no, this helped me figure it out...
edit: f u blargel
lol...wow...well thank you guys...& I will never need to know what ALPHA blend is, ever...!
« Last Edit: December 14, 2009, 04:03:29 PM by Lawence Codye »
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #607 on: December 10, 2009, 08:41:24 PM »
Okay, even though an unfortunate series of events has me still unable to run danmakufu, I didn't stop scripting stuff. No, I don't want you to playtest it for me, relax.  :P  Instead, I have a question:

I know that the size of a bullet hitbox is determined by the size of the image, not the size of the sprite inside the image. I think the hitbox of a bullet a circle/ an ellipse where the maximum horizontal radius is determined by the width and the vertical radius by the height of the image. However, how exactly is the relation between these?

Is the vertical diameter equal to half the width of the image? Two thirds? Or is it maybe a quadratic or, dare I say, logarithmic relation?

Thanks in advance.
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."

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #608 on: December 10, 2009, 08:51:20 PM »
Ellipse. Width-radius of image's width and height-radius of image's height.

EDIT: v
« Last Edit: December 10, 2009, 08:53:53 PM by Drake »

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #609 on: December 10, 2009, 08:52:24 PM »
^ ...Half of the...
Edit: It's actually closer to three quarters or two thirds, now that I think about it.

Approximately. I kinda wish it was logarithmic, since there is absolutely no use for logs in danmakufu.


Fuck it all, I'll Alwaysthe9 edit this fucker:

After some more unecessary thought, now I don't think it's an ellipse. Think of the Tenshi boulders from Johnny Walker's Tenshi mini-stage. Huge horizontal hitbox, small vertical hitbox, at least when compared to the image. I'd say it's a perfect circle.
« Last Edit: December 10, 2009, 09:02:19 PM by Naut »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #610 on: December 10, 2009, 09:00:07 PM »
Muchas graci?s.

Now to hope that bullets done with MS PAINT will only look like crap and not like utter crap.  :V
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 II
« Reply #611 on: December 10, 2009, 09:01:47 PM »
Make sure to ADDitive blend the shit out of them, hides our MSPaint skills so that people don't explode from awesomeness.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread II
« Reply #612 on: December 10, 2009, 09:19:06 PM »
The hitbox is a circle (diameter is somewhere around 2/3 width or height, whichever is smaller). I had a 32x128 bullet before, and only the center had collision. Lasers I believe are rectangular, though.

Re: Danmakufu Q&A/Problem Thread II
« Reply #613 on: December 10, 2009, 11:14:31 PM »
Just realized that the problem is in fact NOT the AddLife/SetLife functions. Something else is causing the problem.

I shall look over it.
« Last Edit: December 10, 2009, 11:17:22 PM by Frazer »

Re: Danmakufu Q&A/Problem Thread II
« Reply #614 on: December 11, 2009, 04:11:31 AM »
Does having a lot of scripts in your script folder slow danmakufu down? It seems to for me although I don't really have any concrete evidence for it...

Re: Danmakufu Q&A/Problem Thread II
« Reply #615 on: December 11, 2009, 04:19:09 AM »
It only slows the time it takes danmakufu to archive those scripts (load them in a menu). Doesnt affect anything else. Not unloading images/music in your scripts may affect things over time, if you keep danmakufu open for a while, but I think that's the only thing that could.

Also, 149 pages of scripts when I try to load up the single manu. Takes ages to load (this is what lead me to my previous conclusion). I only use directory nowadays...

Re: Danmakufu Q&A/Problem Thread II
« Reply #616 on: December 11, 2009, 04:34:38 AM »
It only slows the time it takes danmakufu to archive those scripts (load them in a menu). Doesnt affect anything else. Not unloading images/music in your scripts may affect things over time, if you keep danmakufu open for a while, but I think that's the only thing that could.

Also, 149 pages of scripts when I try to load up the single manu. Takes ages to load (this is what lead me to my previous conclusion). I only use directory nowadays...
Yeah that's what I suspected. But the thing is I can't seem to run my Nitori GET DOWN script at 60 fps anymore and the only thing that I can see is different is I have more scripts.

brb testin

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #617 on: December 11, 2009, 06:53:21 PM »
I moved ALL my scripts to another partition as backup and only keeping DanceContest in there and in a seperate folder Ijiatsu.

I had 10 scripts myself and loading the menus for one minute or more started pissing me off. Especially when you need to test your script 100x because Danmakufu critical errors.

KomeijiKoishi

Re: Danmakufu Q&A/Problem Thread II
« Reply #618 on: December 12, 2009, 04:06:59 PM »
Code: [Select]
#TouhouDanmakufu
#Title[China's Punch "Time To Revive The Color"]
#Text[Test script]
#BackGround[User(.\black.png, 1, 1)]
#BGM[script/st6boss2.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let ImgBoss = "script\img\ExRumia.png";

    let count = -120;

    let SMT = 0;
   
    let fire = 0;

    @Initialize {
        SetLife(400);
        SetDamageRate(10, 20);
        SetTimer(256);
        SetInvincibility( 200 );
        LoadGraphic(ImgBoss);

        SetMovePosition02(GetCenterX, GetCenterY-120, 120);
        CutIn(YOUMU, "Non-Spell 2"\", "", 0, 0, 0, 0);
        LoadUserShotData("\lib\SHOT_REPLACE\shot_All.dnh");
        SetGraphicRect(0, 0, 64, 64);
    }

    @MainLoop {
    SetCollisionA(GetX, GetY, 32);
    SetCollisionB(GetX, GetY, 16);

    if ((count == 0)){
    particle;
    }


    if ((count == 150)){
    count = 0;
    }
   
    count++;
    SMT++;
    yield;
    }

    @DrawLoop {
      SetTexture(ImgBoss);
      DrawGraphic(GetX, GetY);
    }

    @Finalize {
      DeleteGraphic(ImgBoss);
    }

   
   task particle{
   let b = 180;
   let bup = 13.3;
   let reverse = 0;
   let lrar = 0;
   let kput = 1;
   let krar = 360/kput;
   
   
   let Length = 30;
   yield;

   let x = 2.3;
   
   let n = 0;
   
   let q = 0;
   
   let RollerX;
   let RollerY;
   let random;
   
   loop{
   
   PlaySE(GetCurrentScriptDirectory~"SE\se_tan01.wav");
    ascent(a in 1..kput+1){
    RollerX = GetClipMinX - 10 + (GetClipMaxX-GetClipMinX) / 150 * count;
    RollerY = GetY - 0 + sin(SMT*11.3) * 80;
   CreateLaserA(1, RollerX, RollerY, 400, 8, 41, 20);
   SetLaserDataA(1, 0, 0, (a*krar+b), 0, 0, 0);
   SetShotKillTime(2, 120); 
   FireShot(1);
   TheshotUp(RollerX, RollerY, 0, (a*krar+b)+120, 42, 20);
   TheshotUp(RollerX, RollerY, 0, (a*krar+b)-120, 43, 20);



    }
   if (reverse == 0){
   if (bup > -0.7){
   bup += 0;
   }
   else{
   reverse++;
   }
   }
   else{
   if (bup > 120){
   bup -= 0;
   }
   else{
   reverse--;
   }
   }
   b += bup;
   if (Length > -200){
   Length -= 0;
   }
   
   loop(1){
   yield;
   }
   }
   }

 




    task TheshotUp(x, y, v, angle, graphic, delay){
        let obj = Obj_Create(OBJ_SHOT);
      let a = 0;
      let b = 0;
      let dir = angle;
        Obj_SetX(obj, x);
        Obj_SetY(obj, y);
        Obj_SetSpeed(obj, v);
        Obj_SetAngle(obj, angle);
        ObjShot_SetGraphic(obj, graphic);
        ObjShot_SetDelay(obj, delay);
   Obj_SetAutoDelete(obj, false);
        while (!Obj_BeDeleted(obj)){
      if (count == 150){
   Obj_SetAutoDelete(obj, true);
        Obj_SetSpeed(obj, 2);
     }
      a++;
      b++;
      yield;
      }
}

    task TheshotCircle(x, y, v, angle, graphic, delay){
        let obj = Obj_Create(OBJ_SHOT);
      let a = 0;
      let b = 0;
      let dir = angle;
        Obj_SetX(obj, x);
        Obj_SetY(obj, y);
        Obj_SetSpeed(obj, v);
        Obj_SetAngle(obj, angle);
        ObjShot_SetGraphic(obj, graphic);
        ObjShot_SetDelay(obj, delay);
      ObjShot_SetBombResist(obj, true);
        while (!Obj_BeDeleted(obj)){
      if (a == 120){
        Obj_SetSpeed(obj, v*8);
     }
      a++;
      b++;
      yield;
      }
}

}

How can I make the lasers stop flickering around?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #619 on: December 12, 2009, 05:43:46 PM »
Code: [Select]
   SetLaserDataA(1, 0, 0, (a*krar+b), 0, 0, 0);

The angular velocity of your lasers is (a*krar+b).

(a*krar+b) = (1..n)*360 + 180

So yeah, an angular velocity of a high value is going to raep your eyes anywhere, anytime. I am not shure what you tried to accomplish with this, but whatever it may be, in this statement lies the error.  ;)
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."

KomeijiKoishi

Re: Danmakufu Q&A/Problem Thread II
« Reply #620 on: December 12, 2009, 05:53:22 PM »
Code: [Select]
   SetLaserDataA(1, 0, 0, (a*krar+b), 0, 0, 0);

The angular velocity of your lasers is (a*krar+b).

(a*krar+b) = (1..n)*360 + 180

So yeah, an angular velocity of a high value is going to raep your eyes anywhere, anytime. I am not shure what you tried to accomplish with this, but whatever it may be, in this statement lies the error.  ;)
I want the lasers to point in different directions. If you have played the script, you should see why.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #621 on: December 12, 2009, 06:03:25 PM »
In that case, why not give each laser a different starting angle, then? For exampe, what if you exchange
Code: [Select]
SetLaserDataA(1, 0, 0, (a*krar+b), 0, 0, 0);for 
Code: [Select]
SetLaserDataA(1, 0, (a*krar+b), 0, 0, 0, 0);?

Also, you should make the SetShotKillTime refer to the laser, which means replacing the argument 2 with 1. Otherwise you will eventuall have 95% of the screen covered with lasers.
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."

KomeijiKoishi

Re: Danmakufu Q&A/Problem Thread II
« Reply #622 on: December 12, 2009, 06:17:07 PM »
In that case, why not give each laser a different starting angle, then? For exampe, what if you exchange
Code: [Select]
SetLaserDataA(1, 0, 0, (a*krar+b), 0, 0, 0);for 
Code: [Select]
SetLaserDataA(1, 0, (a*krar+b), 0, 0, 0, 0);?

Also, you should make the SetShotKillTime refer to the laser, which means replacing the argument 2 with 1. Otherwise you will eventuall have 95% of the screen covered with lasers.

I just found the problem (working more often with lasers should do it). That's the result:

Code: [Select]
#TouhouDanmakufu
#Title[China's Punch "Time To Revive The Color"]
#Text[Test script]
#BackGround[User(.\black.png, 1, 1)]
#BGM[script/st6boss2.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let ImgBoss = "script\img\ExRumia.png";

    let count = -120;

    let SMT = 0;
   
    let fire = 0;

    @Initialize {
        SetLife(400);
        SetDamageRate(10, 20);
        SetTimer(256);
        SetInvincibility( 200 );
        LoadGraphic(ImgBoss);

        SetMovePosition02(GetCenterX, GetCenterY-120, 120);
        CutIn(YOUMU, "Non-Spell 2"\", "", 0, 0, 0, 0);
        LoadUserShotData("\lib\SHOT_REPLACE\shot_All.dnh");
        SetGraphicRect(0, 0, 64, 64);
    }

    @MainLoop {
    SetCollisionA(GetX, GetY, 32);
    SetCollisionB(GetX, GetY, 16);

    if ((count == 0)){
    particle;
    }


    if ((count == 90)){
    count = 0;
    }
   
    count++;
    SMT++;
    yield;
    }

    @DrawLoop {
      SetTexture(ImgBoss);
      DrawGraphic(GetX, GetY);
    }

    @Finalize {
      DeleteGraphic(ImgBoss);
    }

   
   task particle{
   let b = 180;
   let bup = 13.3;
   let reverse = 0;
   let lrar = 0;
   let kput = 1;
   let krar = 360/kput;
   
   
   let Length = 30;
   yield;

   let x = 2.3;
   
   let n = 0;
   
   let q = 0;
   
   let RollerX;
   let RollerY;
   let random;
   
   loop{
   
   PlaySE(GetCurrentScriptDirectory~"SE\se_tan01.wav");
    ascent(a in 1..kput+1){
    RollerX = GetClipMinX - 10 + (GetClipMaxX-GetClipMinX) / 90 * count;
    RollerY = GetY - 0 + sin(SMT*6.3) * 80;
   CreateLaserA(1, RollerX, RollerY, 800, 8, 41, 40);
   SetLaserDataA(1, 0, (a*krar+b), 0, 0, 0, 0);
   SetShotKillTime(1, 90); 
   FireShot(1);
    CreateLaserA(1, RollerX, RollerY, 800, 8, 42, 40);
   SetLaserDataA(1, 0, (a*krar+b)+120, 0, 0, 0, 0);
   SetShotKillTime(1, 90); 
   FireShot(1);
    CreateLaserA(1, RollerX, RollerY, 800, 8, 43, 40);
   SetLaserDataA(1, 0, (a*krar+b)-120, 0, 0, 0, 0);
   SetShotKillTime(1, 90); 
   FireShot(1);
   TheshotUp(RollerX, RollerY, 0, (a*krar+b)+60, 41, 20);
   TheshotUp(RollerX, RollerY, 0, (a*krar+b)+180, 42, 20);
   TheshotUp(RollerX, RollerY, 0, (a*krar+b)-60, 43, 20);



    }
   if (reverse == 0){
   if (bup > -0.7){
   bup += 0;
   }
   else{
   reverse++;
   }
   }
   else{
   if (bup > 120){
   bup -= 0;
   }
   else{
   reverse--;
   }
   }
   b += bup;
   if (Length > -200){
   Length -= 0;
   }
   
   loop(3){
   yield;
   }
   }
   }

 




    task TheshotUp(x, y, v, angle, graphic, delay){
        let obj = Obj_Create(OBJ_SHOT);
      let a = 0;
      let b = 0;
      let dir = angle;
        Obj_SetX(obj, x);
        Obj_SetY(obj, y);
        Obj_SetSpeed(obj, v);
        Obj_SetAngle(obj, angle);
        ObjShot_SetGraphic(obj, graphic);
        ObjShot_SetDelay(obj, delay);
   Obj_SetAutoDelete(obj, false);
        while (!Obj_BeDeleted(obj)){
      if (count == 90){
   Obj_SetAutoDelete(obj, true);
        Obj_SetSpeed(obj, 2);
     }
      a++;
      b++;
      yield;
      }
}

    task TheshotCircle(x, y, v, angle, graphic, delay){
        let obj = Obj_Create(OBJ_SHOT);
      let a = 0;
      let b = 0;
      let dir = angle;
        Obj_SetX(obj, x);
        Obj_SetY(obj, y);
        Obj_SetSpeed(obj, v);
        Obj_SetAngle(obj, angle);
        ObjShot_SetGraphic(obj, graphic);
        ObjShot_SetDelay(obj, delay);
      ObjShot_SetBombResist(obj, true);
        while (!Obj_BeDeleted(obj)){
      if (a == 120){
        Obj_SetSpeed(obj, v*8);
     }
      a++;
      b++;
      yield;
      }
}

}


Drake

  • *

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

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #624 on: December 12, 2009, 11:03:29 PM »
Please tell me that you can change the ALPHA value of an effect object retroactively...

 :-X
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 II
« Reply #625 on: December 13, 2009, 12:53:01 AM »
ObjEffect_SetVertexColor(obj,vertex,alpha,r,g,b);

You have to set it for each vertex individually, since Obj_SetAlpha doesn't work for effects.

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread II
« Reply #626 on: December 13, 2009, 01:25:11 AM »
Best way to do it if you don't plan on using blending is:

ascent(i in 0..4){ObjEffect_SetVertexColor(obj,i,alpha,255,255,255);}

Effect objects are a pain :(

Re: Danmakufu Q&A/Problem Thread II
« Reply #627 on: December 13, 2009, 04:39:00 AM »
Does having a lot of scripts in your script folder slow danmakufu down? It seems to for me although I don't really have any concrete evidence for it...
Holy shit I am a moron. I just realized I had my power settings on "power saver" mode. I switched it to "high performance" and BAM, 60 glorious fps.

Derpity derp derp

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #628 on: December 14, 2009, 02:37:20 PM »
more & more questions...I mean, I did something like this...
Code: [Select]
task mainTask{
loop{
if(Season==1){FireSign("First");}
else if(Season==2){WaterSign("Fifth");}
if(Season2==1){FireSign("Second");}
else if(Season2==2){WaterSign("Sixth");}
if(Season3==1){FireSign("Third");}
else if(Season3==2){WaterSign("Seventh");}
if(Season4==1){FireSign("Fourth");}
else if(Season4==2){WaterSign("Eighth");}
yield;
}
}

task FireSign(position){
let hfire = Obj_Create(OBJ_EFFECT);
Obj_SetAlpha(hfire, 200);
ObjEffect_SetTexture(hfire, imgSprite);
ObjEffect_SetRenderState(hfire, ALPHA);
ObjEffect_SetLayer(hfire, 1);
ObjEffect_SetPrimitiveType(hfire, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(hfire, 4);
ObjEffect_SetVertexUV(hfire, 0, 106, 152);
ObjEffect_SetVertexUV(hfire, 1, 119, 152);
ObjEffect_SetVertexUV(hfire, 2, 119, 165);
ObjEffect_SetVertexUV(hfire, 3, 106, 165);
if(position=="First"){
            while(!Obj_BeDeleted(hfire)){
               ObjEffect_SetVertexXY(hfire,0,GetPlayerX-oxp2-

7,GetPlayerY+oyp3-7);
               ObjEffect_SetVertexXY(hfire,1,GetPlayerX-

oxp2+7,GetPlayerY+oyp3-7);
               ObjEffect_SetVertexXY(hfire,2,GetPlayerX-

oxp2+7,GetPlayerY+oyp3+7);
               ObjEffect_SetVertexXY(hfire,3,GetPlayerX-oxp2-

7,GetPlayerY+oyp3+7);
               if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
                  if(count%6 == 3){
                     i=2;
                     while(i<=2){
                         CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3-7, 20, 275, 4.0, 1, 1);
                         i++
                     }
                  }
              }else{
                 if(count%8 == 4){
                    i=2;
                    while(i<=2){
                       CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3-7, 20, 275, 4.0, 1, 1);
                       i++;
                    }
                 }
              }
              yield;
         }
}if(position=="Second"){
         while(!Obj_BeDeleted(hfire)){
            ObjEffect_SetVertexXY(hfire,0,GetPlayerX+oxp2-

7,GetPlayerY+oyp3-7);
            ObjEffect_SetVertexXY

(hfire,1,GetPlayerX+oxp2+7,GetPlayerY+oyp3-7);
            ObjEffect_SetVertexXY

(hfire,2,GetPlayerX+oxp2+7,GetPlayerY+oyp3+7);
            ObjEffect_SetVertexXY(hfire,3,GetPlayerX+oxp2-

7,GetPlayerY+oyp3+7);
            if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
               if(count%6 == 3){
                  i=2;
                  while(i<=2){
                      CreatePlayerShot01(GetPlayerX()

+oxp2, GetPlayerY()+oyp3-7, 20, 265, 4.0, 1, 1);
                      i++
                  }
               }
            }else{
               if(count%8 == 4){
                  i=2;
                  while(i<=2){
                     CreatePlayerShot01(GetPlayerX()

+oxp2, GetPlayerY()+oyp3-7, 20, 265, 4.0, 1, 1);
                     i++;
                  }
               }
           }
           yield;
         }
}if(position=="Third"){
         while(!Obj_BeDeleted(hfire)){
            ObjEffect_SetVertexXY(hfire,0,GetPlayerX-oxp-

7,GetPlayerY+oyp2-7);
            ObjEffect_SetVertexXY(hfire,1,GetPlayerX-

oxp+7,GetPlayerY+oyp2-7);
            ObjEffect_SetVertexXY(hfire,2,GetPlayerX-

oxp+7,GetPlayerY+oyp2+7);
            ObjEffect_SetVertexXY(hfire,3,GetPlayerX-oxp-

7,GetPlayerY+oyp2+7);
            if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
               if(count%6 == 3){
                  i=2;
                  while(i<=2){
                      CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2-7, 20, 276, 4.0, 1, 1);
                      i++
                  }
               }
           }else{
              if(count%8 == 4){
                 i=2;
                 while(i<=2){
                   CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2-7, 20, 276, 4.0, 1, 1);
                    i++;
                 }
              }
           }
           yield;
}
}if(position=="Fourth"){
while(!Obj_BeDeleted(hfire)){
ObjEffect_SetVertexXY(hfire,0,GetPlayerX+oxp-

7,GetPlayerY+oyp2-7);
ObjEffect_SetVertexXY

(hfire,1,GetPlayerX+oxp+7,GetPlayerY+oyp2-7);
ObjEffect_SetVertexXY

(hfire,2,GetPlayerX+oxp+7,GetPlayerY+oyp2+7);
ObjEffect_SetVertexXY(hfire,3,GetPlayerX+oxp-

7,GetPlayerY+oyp2+7);
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
if(count%6 == 3){
i=2;
while(i<=2){
CreatePlayerShot01(GetPlayerX()

+oxp, GetPlayerY()+oyp2-7, 20, 264, 4.0, 1, 1);
i++
}
}
}else{
if(count%8 == 4){
i=2;
while(i<=2){
CreatePlayerShot01(GetPlayerX()

+oxp, GetPlayerY()+oyp2-7, 20, 264, 4.0, 1, 1);
                     i++;
                  }
            }
            }
            yield;
         }
}
}

task WaterSign(position){
let hwater = Obj_Create(OBJ_EFFECT);
Obj_SetAlpha(hwater, 200);
ObjEffect_SetTexture(hwater, imgSprite);
ObjEffect_SetRenderState(hwater, ALPHA);
ObjEffect_SetLayer(hwater, 1);
ObjEffect_SetPrimitiveType(hwater, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(hwater, 4);
ObjEffect_SetVertexUV(hwater, 0, 106, 168);
ObjEffect_SetVertexUV(hwater, 1, 119, 168);
ObjEffect_SetVertexUV(hwater, 2, 119, 181);
ObjEffect_SetVertexUV(hwater, 3, 106, 181);
if(position=="Fifth"){
            while(!Obj_BeDeleted(hwater)){
               ObjEffect_SetVertexXY(hwater,0,GetPlayerX-oxp2-

7,GetPlayerY+oyp3-7);
               ObjEffect_SetVertexXY(hwater,1,GetPlayerX-

oxp2+7,GetPlayerY+oyp3-7);
               ObjEffect_SetVertexXY(hwater,2,GetPlayerX-

oxp2+7,GetPlayerY+oyp3+7);
               ObjEffect_SetVertexXY(hwater,3,GetPlayerX-oxp2-

7,GetPlayerY+oyp3+7);
               if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
                  if(count%6 == 3){
                     i=2;
                     while(i<=2){
                         CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 275, 3.0, 1, 2);
                         i++
                     }
                  }
              }else{
                 if(count%8 == 4){
                    i=2;
                    while(i<=2){
                       CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 275, 3.0, 1, 2);
                       i++;
                    }
                 }
              }
              yield;
         }
}if(position=="Sixth"){
         while(!Obj_BeDeleted(hwater)){
            ObjEffect_SetVertexXY(hwater,0,GetPlayerX+oxp2-

7,GetPlayerY+oyp3-7);
            ObjEffect_SetVertexXY

(hwater,1,GetPlayerX+oxp2+7,GetPlayerY+oyp3-7);
            ObjEffect_SetVertexXY

(hwater,2,GetPlayerX+oxp2+7,GetPlayerY+oyp3+7);
            ObjEffect_SetVertexXY(hwater,3,GetPlayerX+oxp2-

7,GetPlayerY+oyp3+7);
            if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
               if(count%6 == 3){
                  i=2;
                  while(i<=2){
                      CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 275, 3.0, 1, 2);
                      i++
                  }
               }
            }else{
               if(count%8 == 4){
                  i=2;
                  while(i<=2){
                     CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp2, GetPlayerY()+oyp3, 20, 275, 3.0, 1, 2);
                     i++;
                  }
               }
           }
           yield;
         }
}if(position=="Seventh"){
         while(!Obj_BeDeleted(hwater)){
            ObjEffect_SetVertexXY(hwater,0,GetPlayerX-oxp-

7,GetPlayerY+oyp2-7);
            ObjEffect_SetVertexXY(hwater,1,GetPlayerX-

oxp+7,GetPlayerY+oyp2-7);
            ObjEffect_SetVertexXY(hwater,2,GetPlayerX-

oxp+7,GetPlayerY+oyp2+7);
            ObjEffect_SetVertexXY(hwater,3,GetPlayerX-oxp-

7,GetPlayerY+oyp2+7);
            if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
               if(count%6 == 3){
                  i=2;
                  while(i<=2){
                      CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 275, 3.0, 1, 2);
                      i++
                  }
               }
           }else{
              if(count%8 == 4){
                 i=2;
                 while(i<=2){
                   CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 275, 3.0, 1, 2);
                    i++;
                 }
              }
           }
           yield;
}
}if(position=="Eighth"){
while(!Obj_BeDeleted(hwater)){
ObjEffect_SetVertexXY(hwater,0,GetPlayerX+oxp-

7,GetPlayerY+oyp2-7);
ObjEffect_SetVertexXY

(hwater,1,GetPlayerX+oxp+7,GetPlayerY+oyp2-7);
ObjEffect_SetVertexXY

(hwater,2,GetPlayerX+oxp+7,GetPlayerY+oyp2+7);
ObjEffect_SetVertexXY(hwater,3,GetPlayerX+oxp-

7,GetPlayerY+oyp2+7);
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH ||

GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
if(count%6 == 3){
i=2;
while(i<=2){
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 275, 3.0, 1, 2);
i++
}
}
}else{
if(count%8 == 4){
i=2;
while(i<=2){
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 265, 3.0, 1, 2);
CreatePlayerShot01(GetPlayerX()-

oxp, GetPlayerY()+oyp2, 20, 275, 3.0, 1, 2);
                     i++;
                  }
            }
            }
            yield;
         }
}
}

function wait(w){
loop(w){yield;}
}
}
yeah...but when I start a script problems occur in the following order...
1. fps comes crashing down down down...I'm talking all the way to around 9.65fps per say...
2. then when I press USER yes stuff changes but not the way I want it to...
3. what goes right, the graphic changes like it's suppose to...
4. what goes wrong, the shot type changes but then the first shot type is still shooting wth...& when I change it back...graphic changes correctly again but still with the all shot type at once stuff...
5. also when I shoot...let's see the bullets do outrageous damage even though I have it set up not to...they only shoot out of one option & it also causes slightly more slowdown then normal...
I'm certain that it's in this part of the script...as it was working fine until I starting stocking up on the task...which I'm also sure isn't the problem...oh & if I remove the loop{} from mainTask...welp, I get all problems fixed except no switch what-so-ever...
« Last Edit: December 14, 2009, 02:41:16 PM by Lawence Codye »
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #629 on: December 14, 2009, 02:57:49 PM »
Well, if you want the previous object to stop shooting, maybe you should put something like

if(Season=!1){ Obj_Delete(hfire); } somewhere in the while statements.  :V




I cannot give you any further information because... ohgodsomuchcode...
« Last Edit: December 14, 2009, 03:02:51 PM by Iryan »
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."