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

Zerro

  • ERRORS,
  • ERRORS EVERYWHERE
Re: Need help with events
« Reply #930 on: June 09, 2010, 04:58:59 PM »
Ok, thanks.

If I have anymore questions I'll put them in that thread.

Life's a shmup, play on lunatic.

Re: Need help with events
« Reply #931 on: June 09, 2010, 05:40:03 PM »
or you can use this in @MainLoop

@MainLoop{ ~~
  if(OnEvent){ break; }
~~}

this phrase will stop all MainLoop task while event is ongoing.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Need help with events
« Reply #932 on: June 09, 2010, 09:32:01 PM »
Ok, thanks.

If I have anymore questions I'll put them in that thread.
You should have done that from the start as the sticky thread is there for a reason. Now science will end you, my condolence.

Merged threads...

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #933 on: June 10, 2010, 12:05:30 AM »
SaveCommonDataEx and LoadCommonDataEx saves and loads it from a .dat FILE

Here is what your code should actually look like:
Code: [Select]
CreateCommonDataArea("Test");
LoadCommonDataEx("Test",GetCurrentScriptDirectory~"new_2");
SetCommonDataEx("Test","lolwut",0);
SaveCommonDataEx("Test",GetCurrentScriptDirectory~"new_2");

also, make sure that before you use LoadCommonDataEx, that the .dat file already exists, else, an error will occur... this means, the first time you run the script, add a SaveCommonDataEx before calling it, or make sure that a SaveCommonDataEx is already called in the script before LoadCommonDataEx...
:V No wonder I was so confused...
Thanks.

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #934 on: June 10, 2010, 04:12:16 AM »
blah blah stuff about render targets here blah

Okay, cool, thanks. BV

Megayanma

  • Full of Small Bones
  • Totalitarian KFC
Re: Danmakufu Q&A/Problem Thread v3
« Reply #935 on: June 11, 2010, 02:34:40 AM »
Objects seem to elude me.  Would someone PLEASE tell me what is wrong with this script and why it gives me an error with the "ring;" line of code in Initialize?

Code: [Select]
#TouhouDanmakufu
#Title[aimed rings won't worrrrkkkkkk]
#Text[O.o]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{


let imgExRumia="script\ExRumia\img\ExRumia.png";
let frame = 0;
let angle = 0;
let frame2 = 0;
let angle2 = 0;
let angle3 = 0;
let speed = 0.5;
let frame3 = 0;
function wait(let frames){ loop(frames){yield;} }

let SupaShot = GetCurrentScriptDirectory~"\Supershot.txt";



@Initialize{
SetLife(3700);
SetTimer(60);
SetInvincibility(120);
LoadGraphic(imgExRumia); //Load the boss graphic.
SetMovePosition02(GetCenterX, GetCenterY - 120, 60); //Move the boss to the top center of the screen.
LoadUserShotData(SupaShot);
Concentration02(120);
MagicCircle(true);
ring;




}

@MainLoop{
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
frame++;
frame2++;
angle3++;
frame3++;

yield;



if(frame==120){







frame = 116;
angle += 16;
angle2+=6;
Slow(0);

}

if(frame2==120){

}

}
@DrawLoop{
//All this foolishness pertains to drawing the boss. Ignore everything in @Drawloop unless you have read and understand Nuclear Cheese's Drawing Tutorial.
SetColor(255,255,255);
SetRenderState(ALPHA);
SetTexture(imgExRumia);
SetGraphicRect(64,1,127,64);
DrawGraphic(GetX,GetY);
}

@Finalize
{
}
}

angle2 -= 12;

}

if(frame2==120){
frame2 = 60;
}
}
@DrawLoop{
All this foolishness pertains to drawing the boss. Ignore everything in @Drawloop unless you have read and understand Nuclear Cheese's Drawing Tutorial.
SetColor(255,255,255);
SetRenderState(ALPHA);
SetTexture(imgExRumia);
SetGraphicRect(64,1,127,64);
DrawGraphic(GetX,GetY);
}

@Finalize
{  DeleteSE(shot);


}

task ring{
wait(180+100);

let an;

loop{
an = rand_int(0,359);

loop(9){
Shot(an);
an += 360/9;
}

wait(300);
yield;
}
}

task Shot(an){
let obj = Obj_Create(OBJ_SHOT);
let count = 0;

Obj_SetPosition (obj, GetX+10*cos(an), GetY+10*sin(an));
Obj_SetAngle (obj, an);
Obj_SetSpeed (obj, 2);
ObjShot_SetGraphic (obj, RED12);
ObjShot_SetDelay (obj, 10);
ObjShot_SetBombResist (obj, false);

while(!Obj_BeDeleted(obj) ){
count++;
if(count < 45){
if(Obj_GetSpeed(obj) > 0){
Obj_SetSpeed (obj, Obj_GetSpeed(obj) -0.05);
}
}
if(count==60){
Obj_SetAngle(obj, atan2(GetPlayerY-Obj_GetY(obj) , GetPlayerX-Obj_GetX(obj) ) );
Obj_SetSpeed (obj, 2);
}
yield;
}
}
}

Re: Danmakufu Q&A/Problem Thread v3
« Reply #936 on: June 11, 2010, 02:42:51 AM »
Your copy pasting skills need work :V
After your first @Finalize, there is an additional closing brace. Not only that, but an additional @DrawLoop as well. Review your code to see what you have incorrectly copied and, provided that changing it doesn't fix the error, repost.

Hakurei Miko

Re: Danmakufu Q&A/Problem Thread v3
« Reply #937 on: June 11, 2010, 04:27:57 AM »
Please help this newb.

I'm new at this (honestly I only started yesterday), but now when I try to add in movement, it always has an error involving "wait(120);". D: Which I think is needed to make it move(Make it pause for 2 second*120 frames* so it can do the other command thing right?).

http://pastebin.com/G64xcDNb

I dun see what's wrong with it that'll cause that error . ???

---

And while I'm at it, *When I removed the "wait(120);"* my laser familiar only points straight down, I dun want it to do that.  :V I want it to shoot danmaku to the border of the area(so it can bounce off) and move up and down, and I also was going to make another familiar to do the same @ the right side.

Help would be greatly appreciated.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #938 on: June 11, 2010, 05:05:45 AM »
The } right before every instance of where you define the function closes the enemy script up, so "wait" isn't defined in the script. Get rid of those.

Other problem is just because the only value you give for the "angle" parameter is 180.
« Last Edit: June 11, 2010, 05:08:15 AM by Drake »

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

Megayanma

  • Full of Small Bones
  • Totalitarian KFC
Re: Danmakufu Q&A/Problem Thread v3
« Reply #939 on: June 11, 2010, 03:43:13 PM »
Your copy pasting skills need work :V
After your first @Finalize, there is an additional closing brace. Not only that, but an additional @DrawLoop as well. Review your code to see what you have incorrectly copied and, provided that changing it doesn't fix the error, repost.

Whoa, sorry about that!  I guess I'm a ⑨ in training.  :blush:

Hakurei Miko

Re: Danmakufu Q&A/Problem Thread v3
« Reply #940 on: June 11, 2010, 07:42:23 PM »
The } right before every instance of where you define the function closes the enemy script up, so "wait" isn't defined in the script. Get rid of those.

Other problem is just because the only value you give for the "angle" parameter is 180.

.... >.> The "wait" or the }'s? Cause when I get rid of (most) the }'s, it comes up with an error.

When I don't, my Danmakufu freezes.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #941 on: June 11, 2010, 09:15:11 PM »
Every time you set up the function you do this:

//SOMETHING GOES HERE

    }            //<-- THIS BRACKET RIGHT HERE WHAT IS IT DOING THERE

    // wait function
    function wait(w){
              loop(w){yield;}

    }


}            //<-- This bracket should be ending the enemy script, not the first

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #942 on: June 11, 2010, 09:58:43 PM »
Pro top for beginners: in case you have trouble knowing what bracket closes what add a comment on top of it or behind it. (Think behind should give problem either).

Example
Code: [Select]
script_enemy_main {

task charisma {
let Scarlet = 999999999;

while (CHA > 0) {
GUNGNIR AND STUFF
RED THE NIGHTLESS CASTLE

}

} // bracket charisma

CODING AND STUFF
CODING AND STUFF
CODING AND STUFF
CODING AND STUFF
CODING AND STUFF
CODING AND STUFF

} // bracket enemy main

Or you can just count them how many you open and close. Same goes for parentheses. Logically, this example is useless if your tabbing is not properly done.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #943 on: June 12, 2010, 11:43:34 AM »
(plz excuse my poor english)
I have a question. How can I make a shake effect (like a [Master Spark]) without a lagging?

I used a method that putting all objects into 'bullets' array, and when an anchor stops, I shook all objects in array with task.

But the number of objects exceeds 100, and there's horrible lagging -_- how can i solve this problem? Please help me.

here's a part of my script to shake effect.

let bullets=[];
task Shot01(~~){
   let obj1=Obj_Create(OBJ_SHOT);
   bullets=bullets~[obj1];
   ~~
   while(!Obj_BeDeleted(obj1)){
      ~~ yield;}
   let num=0;
   while(num<length(bullets)){
       if(bullets[num]==obj1){    bullets=erase(bullets,num);
      break;}
   num++;}
   Obj_Delete(obj1);
}

task Anchor(~~){
   ~~~
   while(!Obj_BeDeleted(obj)){
    ~~
      ascent(j in 0..length(bullets)){
          TrembleShot(bullets[j],rand(-1,1)*6,rand(-1,1)*6);}
      ~~ yield;}
   Obj_Delete(obj);
}

task TrembleShot(let objec,let qX,let qY){
   let trem=Obj_Create(OBJ_SHOT);
   loop(1){Obj_SetPosition(objec,Obj_GetX(objec)+qX,Obj_GetY(objec)+qY);
      yield;}
   loop(1){Obj_SetPosition(objec,Obj_GetX(objec)-qX,Obj_GetY(objec)-qY);
      yield;}
   Obj_Delete(trem);
}
« Last Edit: June 12, 2010, 11:46:13 AM by Flyer »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #944 on: June 12, 2010, 01:00:01 PM »
Well, you are doing a great lot of stuff per frame...

One thing I would change is the Tremble task.

task TrembleShot(let objec,let qX,let qY){
        Obj_SetPosition(objec,Obj_GetX(objec)+qX,Obj_GetY(objec)+qY);
        yield;
        Obj_SetPosition(objec,Obj_GetX(objec)-qX,Obj_GetY(objec)-qY);
}


No need for the trem object or the loop. This code does pretty much exactly the same as the one you have now, but shorter and with less work for the cpu.

Also, the line Obj_Delete(obj1); in the Shot01 task is redundant, as for the code to get to that line the object has to already be deleted.

Other than that, I remember Blargel saying that danmakufu is very vulnerable to overly long arrays. Other than making the code a little bit more efficient, I don't know what to do about your problem, sorry.
  :(

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 v3
« Reply #945 on: June 12, 2010, 01:43:17 PM »
Well, you are doing a great lot of stuff per frame...

One thing I would change is the Tremble task.

task TrembleShot(let objec,let qX,let qY){
        Obj_SetPosition(objec,Obj_GetX(objec)+qX,Obj_GetY(objec)+qY);
        yield;
        Obj_SetPosition(objec,Obj_GetX(objec)-qX,Obj_GetY(objec)-qY);
}


No need for the trem object or the loop. This code does pretty much exactly the same as the one you have now, but shorter and with less work for the cpu.

Also, the line Obj_Delete(obj1); in the Shot01 task is redundant, as for the code to get to that line the object has to already be deleted.

Other than that, I remember Blargel saying that danmakufu is very vulnerable to overly long arrays. Other than making the code a little bit more efficient, I don't know what to do about your problem, sorry.
  :(

I changed those tasks as your reply, and frame has slightly increased! About 3~5 fps. :D

Thank you for your kind answer!

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #946 on: June 12, 2010, 01:44:46 PM »
No problem. Say, how much slow down does the effect give you in total?
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 v3
« Reply #947 on: June 12, 2010, 01:52:36 PM »
57fps -> 30~45fps. High difficulty = more frame drop.

Moving bullets seems to produce more lag with Tremble task.

I recorded that script a little before.

http://tvpot.daum.net/my/ClipView.do?ownerid=yKpAyDlCKZE0&clipid=24626333&q=

Sound quality is terrible so turn down the volume  :V
« Last Edit: June 12, 2010, 01:56:37 PM by Flyer »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #948 on: June 12, 2010, 02:02:14 PM »
Hm, I'm wondering...


Could you not integrate the code that makes the bullet shake into the bullet code? That way you could have less tasks running, which may improve the performance even if code code that actually does stuff is almost the same.

You could keep track of the number of Anchor objects by having a variable that increases if you call the task and decreases at the end of the task after the while(Obj_BeDeleted(obj)==false){} part.
Then you put the shaking code in the Shot01 task and make that it happens if the valuable that keeps track of the Anchor objects is greater than 0.

I don't know if this is going to work, but you could try it, I guess...


Edit: typing errors are stupid y.y
« Last Edit: June 12, 2010, 02:04:09 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."

Re: Danmakufu Q&A/Problem Thread v3
« Reply #949 on: June 12, 2010, 02:20:48 PM »
Oh my... you're a genius  :]
Using CommonData solved this frame drop trouble. Frame rate has increased from 38~50fps to 45~55fps.
Thank you very much!

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #950 on: June 12, 2010, 06:47:35 PM »
I know I'm still not good at the whole Danmakufu business, but I've made use of the player script tutorial to make a custom spellcard of my own. What I wanted to do was spawn spontaneous lightning strikes (160x600 long) lengthwise along the playing field, followed by a flash of white. However, when I tested it out, it wouldn't run as nothing happened. The following code for activation is here:
Code: [Select]
@Spellcard{
  SetSpeed(1, 1);
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
UseSpellCard("CCoil", 0);
CutIn(KOUMA,"SlowSpell",cutimg);
}else{
//UseSpellCard("LBurst", 0);
CutIn(KOUMA,"FreeSpell",cutimg);
}
  }

Everything looks fine and all, but here's the entire for "CCoil", which is what I'm starting off with:
Code: [Select]
script_spell CCoil{
let lightning=get~".\img\teslalightningtex.png
let spellcount=0;
task LightningRipple(){
let objlightning=Obj_Create(OBJ_SPELL);
let xpos=GetCenterX+rand(0,416);
let ypos=GetCenterY;
Obj_SetAlpha(objlightning,200);
ObjEffect_SetTexture(objlightning,lightning);
ObjEffect_SetRenderState(objlightning,ADD);
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,0,600);
ObjEffect_SetVertexUV(objlightning,3,160,600);
while(!Obj_BeDeleted(objlightning)){
ObjEffect_SetVertexXY(objlightning,0,xpos+(60*cos(120)),ypos+(60*sin(120)));
ObjEffect_SetVertexXY(objlightning,1,xpos+(60*cos(240)),ypos+(60*sin(240)));
ObjEffect_SetVertexXY(objlightning,2,xpos+(60*cos(300)),ypos+(60*sin(300)));
ObjEffect_SetVertexXY(objlightning,3,xpos+(60*cos(60)),ypos+(60*sin(60)));
ObjSpell_SetIntersecrionLine(objlightning,xpos+(60*cos(120)),ypos+(60*sin(120)),xpos+(60*cos(60)),ypos+(60*sin(60)),5,10,true);
yield;
}
}
}
task run{
SetPlayerInvincibility(300);
ForbidShot(true);
loop(45){yield;}
while(spellcount<101){
if spellcount%10==0{
LightningRipple();
LightningRipple();
LightningRipple();
PlaySE(GetCurrentScriptDirectory()~"lightning.wav");
if(spellcount==101){
PlaySE(GetCurrentScriptDirectory()~"crash.wav");}
}
spellcount++;
yield;
}

ForbidShot(false);
SetSpeed(3.5,2.5);
loop(90){yield;}
End();
}
 
I'm still not used to creating objects, so I don't know what I did wrong. The whole setting of the vertices and putting them on the field is rather confusing, as well as the use of other mathematical equations such as trigonometric functions and modulus. I didn't come into an error for some reason, but the spell just removed a counter and that was it.

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #951 on: June 12, 2010, 06:56:33 PM »
Just a quick lookover, you omitted the @Initialize and stuff in what you pasted, right? In that pasted blurb of code there's an extra close bracket before run() which would end CCoil() prematurely, that's not there in the file is it?

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #952 on: June 12, 2010, 07:26:52 PM »
Just a quick lookover, you omitted the @Initialize and stuff in what you pasted, right? In that pasted blurb of code there's an extra close bracket before run() which would end CCoil() prematurely, that's not there in the file is it?
I took off the other parts of the spell script 'cause it seemed irrelevant. The @Initialize only has the LoadGraphic for the texture and the run task, the @MainLoop has CollectItems and @Finalize deletes the texture. I also deleted the extra bracket (silly me, I don't seem to organize properly), but it still had the same outcome.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #953 on: June 12, 2010, 07:34:12 PM »
Hmm, a possible error is detected:

Quote
      ObjEffect_SetVertexUV(objlightning,0,0,0);
      ObjEffect_SetVertexUV(objlightning,1,160,0);
      ObjEffect_SetVertexUV(objlightning,2,0,600);
      ObjEffect_SetVertexUV(objlightning,3,160,600);
I believe vertext 2 and 3 needs to be exchanged. What you want is for the vertices to be aligned like this:
0  1
3  2
You have them like this:
0  1
2  3
This will naturally distort the image and can possibly make it invisible.

Looking for other stuff...

Edit: Hm, I'm not certain about this, but in case of doubt I would advise you to call both SetVertexXY and SetVertexUV every frame
« Last Edit: June 12, 2010, 07:39:37 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."

Hakurei Miko

Re: Danmakufu Q&A/Problem Thread v3
« Reply #954 on: June 12, 2010, 09:32:00 PM »
Every time you set up the function you do this:

//SOMETHING GOES HERE

    }            //<-- THIS BRACKET RIGHT HERE WHAT IS IT DOING THERE

    // wait function
    function wait(w){
              loop(w){yield;}

    }


}            //<-- This bracket should be ending the enemy script, not the first


*Dams my computer*

I removed it, sure, the problem about it not detecting "wait" is gone, but now every time I try to start the spell up, Danmakufu freezes on me.  :V

I'm very sorry if I'm asking too many questions, its just that its starting to get on my nerves a bit. ^^;

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #955 on: June 12, 2010, 09:48:54 PM »
    task fire{
             loop{
                     yukarilaser(GetX, GetY, 2, 180, 100, 16, PURPLE01);
                     yield;
              }

    //why is there no } here

task yukarilaser(x, y, v, angle, maxLen, width, graphic) {


check your damn bracketssssss

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

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #956 on: June 13, 2010, 03:00:31 AM »
Hmm, a possible error is detected:
I believe vertext 2 and 3 needs to be exchanged. What you want is for the vertices to be aligned like this:
0  1
3  2
You have them like this:
0  1
2  3
This will naturally distort the image and can possibly make it invisible.

Looking for other stuff...

Edit: Hm, I'm not certain about this, but in case of doubt I would advise you to call both SetVertexXY and SetVertexUV every frame
Nope, didn't get any errors. What pretty much happened was that a bomb counter was used up with nothing happening and everything going normally. Nothing changed when Stuffman mentioned the extra bracket and I removed it. I've changed the vertex order as you mentioned, but what do you mean by calling the functions "every frame"? Do you mean putting a loop over the two?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #957 on: June 13, 2010, 03:22:34 AM »
Sorry I didn't get to you, totally missed your post somehow. I must unconsciously just skip posts that don't bother to use pastebin and make a huge waste of space of the page. However, I'm going to be a hypocrite and use a large post to demonstrate with color.


script_spell CCoil{

   let lightning=get~".\img\teslalightningtex.png   //OH HEY LOOK NO END TO THE STRING GUESS WHAT HAPPENS NOW
   let spellcount=0;

   task LightningRipple(){
      let objlightning=Obj_Create(OBJ_SPELL);
      let xpos=GetCenterX+rand(0,416);
      let ypos=GetCenterY;
      Obj_SetAlpha(objlightning,200);   //Setting Alpha values does not work on Effect Objects!! Use ObjEffect_SetVertexColor() !!
      ObjEffect_SetTexture(objlightning,lightning);
      ObjEffect_SetRenderState(objlightning,ADD);
      ObjEffect_CreateVertex(objlightning,4);
      ObjEffect_SetPrimitiveType(objlightning,PRIMITIVE_TRIANGLEFAN);   //Don't use a fan for this! Fans are for things shaped like fans!! Use STRIP!!
      ObjEffect_SetVertexUV(objlightning,0,0,0);
      ObjEffect_SetVertexUV(objlightning,1,160,0);
      ObjEffect_SetVertexUV(objlightning,2,0,600);
      ObjEffect_SetVertexUV(objlightning,3,160,600);
      while(!Obj_BeDeleted(objlightning)){
         ObjEffect_SetVertexXY(objlightning,0,xpos+(60*cos(120)),ypos+(60*sin(120)));
         ObjEffect_SetVertexXY(objlightning,1,xpos+(60*cos(240)),ypos+(60*sin(240)));
         ObjEffect_SetVertexXY(objlightning,2,xpos+(60*cos(300)),ypos+(60*sin(300)));
         ObjEffect_SetVertexXY(objlightning,3,xpos+(60*cos(60)),ypos+(60*sin(60)));
         ObjSpell_SetIntersecrionLine(objlightning,xpos+(60*cos(120)),ypos+(60*sin(120)),xpos+(60*cos(60)),ypos+(60*sin(60)),5,10,true);   
         yield;
      }
   }
}   //You already said this shouldn't be here so yeah

task run{
   SetPlayerInvincibility(300);
   ForbidShot(true);
   loop(45){yield;}
   while(spellcount<101){
      if spellcount%10==0{   //HOLY SHIT NO BRACKETS
         LightningRipple();
         LightningRipple();
         LightningRipple();
         PlaySE(GetCurrentScriptDirectory()~"lightning.wav");
         if(spellcount==101){
            PlaySE(GetCurrentScriptDirectory()~"crash.wav");
         }
      }
      spellcount++;
      yield;
   }
   ForbidShot(false);
   SetSpeed(3.5,2.5);
   loop(90){yield;}
   End();
}


Well the color stuff was pretty redundant lol. I dunno fix that stuff see what happens

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

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #958 on: June 13, 2010, 03:35:31 AM »
Well the color stuff was pretty redundant lol. I dunno fix that stuff see what happens
Dang, I missed that one on the if statement....It still doesn't work, though...I could swear it has something to do with the vertex positions, but still...with the activation syntax above, would the CutIn still have worked despite nothing happening in UseSpellCard?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #959 on: June 13, 2010, 03:56:07 AM »
Well, let xpos=GetCenterX+rand(0,416); should probably be let xpos=rand_int(0,416);
Second, you aren't setting the object's position which means it's nowhere. You don't control object position through XY vertices.
Third, xpos+(60*cos(120)),ypos+(60*sin(120)) should be xpos-80,ypos-300 i.e half the UV for each segment. This means the object's position is in the center of the graphic.
Fourth, vertices don't have anything to do with how your spell runs. There would still be the cutin and sound effect.

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