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

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #720 on: May 08, 2010, 12:57:47 PM »
Hey GUYZ, Check out my first script:
Normal Vidaya
Lunatic Vidaya (speedhacked to prevent extra shitty mistakes)
BulletForge Project (no No download link yet)
Stuff changed since the video:
Final spell is now replaced with amulets.
Kanako's 1st sc has double the original health.
Kanako's Lunatic 1st sc name is now Unthinkable Natural Wind Curve instead of Unthinkable Unnatural wind curve well damnit wind is definitely natural
ALSO:
LOLMODIFYNAUT'SSANAE

so any comments or recommendations?

Also how do i stop this
Code: [Select]
DrawText("Graze "~ToString(GetGraze),GetCenterX .....
from generating
Graze 0.00000000000000
and instead getting
Graze 0

-Translation aka tl;dr-
Do not want = Graze 0.0000000000000
want = Graze 0
« Last Edit: May 09, 2010, 05:40:42 AM by GenericTouhouFan »

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 v3
« Reply #721 on: May 08, 2010, 01:08:48 PM »
Also how do i stop this
Code: [Select]
DrawText("Graze "~ToString(GetGraze),GetCenterX .....
from generating
Graze 0.00000000000000
and instead getting
Graze 0

function NumberToString(num){
    let string=ToString(num);
    let numberstring="";
    ascent(i in 0..length(string)){
        if(string[ i ]!='.'){
            numberstring=numberstring~string[ i ];
        }else{
            break;
        }
    }
    return numberstring;
}
OR
function NumberToString(num){
    let string=ToString(num);
    let numberstring="";
    let i=0;
    loop{
        if(string[ i ]!='.'){
            numberstring=numberstring~string[ i ];
        }else{
            break;
        }
    i++;
    }
    return numberstring;
}
OR
function NumberToString(num){
    let string=ToString(num);
    let numberstring="";
    let i=0;
    while(string[ i ]!='.'){
        numberstring=numberstring~string[ i ];
        i++;
    }
    return numberstring;
}

then just call it like this :
Code: [Select]
DrawText("Graze "~NumberToString(GetGraze),GetCenterX .....

Note: I didn't test the code, but I think that would work...


so any comments or recommendations?

it's just an idea... not sure if it's a good one, but... since the story's basically sanae looking for new spell card ideas, why not make her bombs/spell cards vary over time... like per stage or something...
« Last Edit: May 09, 2010, 02:09:11 AM by Kylesky »
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #722 on: May 08, 2010, 01:47:17 PM »
it's just an idea... not sure if it's a good one, but... since the story's basically sanae looking for new spell card ideas, why not make her bombs/spell cards vary over time... like per stage or something...
Err. Im not sure about tearing up naut's sanae further... besides It's not easy to come up with decent bomb ideas.
I'll consider.

Bananamatic

Re: Danmakufu Q&A/Problem Thread v3
« Reply #723 on: May 09, 2010, 12:00:31 AM »
Just started trying some basic stuff :V

One problem: Shot lasers don't appear. No error, but when I use CreateLaser01, the boss stands there and does nothing.

Is there some requirement to make them work? I tried copying a laser pattern from a different script which worked, but in mine it didn't.


Re: Danmakufu Q&A/Problem Thread v3
« Reply #724 on: May 09, 2010, 12:10:44 AM »
Post script

Bananamatic

Re: Danmakufu Q&A/Problem Thread v3
« Reply #725 on: May 09, 2010, 12:46:16 AM »
Post script
I don't believe it's required, as I simply copied this script from the tutorial to check if I have done anything wrong:
Code: [Select]
CreateLaser01(GetX, GetY, 2, GetAngleToPlayer, 200, 16, RED01, 20); No error, the boss just sits there doing absolutely nothing.
Tested a different laser script and it worked, but shot lasers don't do a thing.

Elementoid

  • Having a heated affair with feux-familiars
Re: Danmakufu Q&A/Problem Thread v3
« Reply #726 on: May 09, 2010, 12:53:31 AM »
Could you post the entire script that you're using? That's the right format for firing lasers, so there's probably something off about another part of the script.

Bananamatic

Re: Danmakufu Q&A/Problem Thread v3
« Reply #727 on: May 09, 2010, 01:14:03 AM »
nevermind, figured it out

had it spawning at the top of the screen which might work for bullets but not for these lasers

EDIT: I need help on several other things

1) bullets aimed at the player don't go behind the boss, so
2) How to make the boss do something depending on the player's position? Like, if the the player goes to Y<200, the boss unleashes an undodgeable wall

Also, why doesn't this work or rather, how to make frame== and loop work together and how to make several conditions at once?
I've looked at the tutorials, but I haven't found anything on that.

Code: [Select]
if (frame==5){
           loop(3)
{
            CreateShot01(240, 110, 7, GetAngleToPlayer+rand(-10, 10), RED01, 10);
            frame = 0;

}

It redirects me to DrawLoop with an error which I can't find in the Troubleshooting FAQ.

« Last Edit: May 09, 2010, 02:57:30 AM by Bananamatic »

Elementoid

  • Having a heated affair with feux-familiars
Re: Danmakufu Q&A/Problem Thread v3
« Reply #728 on: May 09, 2010, 03:27:19 AM »
1 - Aimed bullets should be able to go behind the boss. I'm not sure why this isn't working.

2 - Just use an if statement like:
Code: [Select]
if(GetPlayerY<200){
     Blah blah impenetrable wall
}

Your code seems to be missing a closing bracket (which might be raising the error?), unless there's more to it than just that loop. This is how I would have written it:
Code: [Select]
if (frame==5){
     loop(3){
          CreateShot01(GetX, GetY, 7, GetAngleToPlayer+Rand(-10, 10), RED01, 10);
     }
     frame=0;
}
First, there's the closing bracket. I changed the X and Y values so that the bullets would spawn directly on top of the boss. Then I stuck the frame=0; outside of the loop, since it's unnecessary to repeat it three times at once.

So every five frames, the boss will fire a varying spread of bullets towards the player
« Last Edit: May 09, 2010, 03:29:23 AM by Elementoid »

Bananamatic

Re: Danmakufu Q&A/Problem Thread v3
« Reply #729 on: May 09, 2010, 11:11:34 AM »
When I use GetX and GetY, it just shoots from the top of the screen.

Tried that too, still got an error.

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #730 on: May 09, 2010, 11:26:09 AM »
1. Could you paste your entire code at http://pastebin.com/? then give us the link.
2. If bullets are coming from the top of the screen you could.... A: Try using GetEnemyX GetEnemyY B: Ensure you did not forget a SetMovePosistion01() in @Initialize

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread v3
« Reply #731 on: May 09, 2010, 01:33:10 PM »
When I use GetX and GetY, it just shoots from the top of the screen.

Tried that too, still got an error.
This is because your BOSS is at the top of the screen. Use SetMovePosition02(GetCenterX,GetCenterY-120,60) in your @Initialize so that your boss is actually somewhere visible.

Also I will now shamelessly advertise these examples, since you appear to have read the tutorials but are still having trouble actually implementing the functions and stuff.

空SoraのNo鏡Kagami

  • Wolven Wind Warrior of the West (That's catchy)
  • Occupation: Hopeless Amazing Young Scriptor
Re: Danmakufu Q&A/Problem Thread v3
« Reply #732 on: May 09, 2010, 09:03:48 PM »
Is there some way to separate frames for things. Like, l want one shot to be x frames, and another to be another.
Me: Rapture is comin'
Person: OMG WHEN!
Me: Naow, APOCALYPSE SIGN "RAPTURE"!

Re: Danmakufu Q&A/Problem Thread v3
« Reply #733 on: May 09, 2010, 09:19:56 PM »
if i understood you right:

if(frame==5){
do stuff;}

if(frame==10){
do stuff;}

is what your looking for.


You want to fire a shot when frame equals a number right?
or
if you want to do the same thing you use the "||"


if(frame==5 || frame==10 || frame==15){
do stuff;}
« Last Edit: May 09, 2010, 09:48:36 PM by Demonbman »

Elementoid

  • Having a heated affair with feux-familiars
Re: Danmakufu Q&A/Problem Thread v3
« Reply #734 on: May 09, 2010, 09:43:24 PM »
Something important to remember relating to that.
Code: [Select]
if(frame==5){
Task1;
frame=0;
}
if(frame==10){
Task2;
frame=0;
}
frame++;

This will only do Task1 every five frames, since the frame is reset every time it happens, so the frame count never reaches 10. If you take out frame=0; from the first part, then the script will alternate between Task1 and Task2 every five frames.

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #735 on: May 09, 2010, 09:59:59 PM »
Try using modulos:
Code: [Select]
if (frame%5 == 0) {
   Task1;
}
if (frame%10 == 0) {
   Task2;
}
frame++;

The modulo is the % symbol, and it returns the remainder of the first number divided by the second number. E.g., 12%5 would equal 2, since the remainder of 12/5 is 2.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #736 on: May 09, 2010, 10:22:46 PM »
nvm work around
« Last Edit: May 10, 2010, 03:14:53 AM by Demonbman »

空SoraのNo鏡Kagami

  • Wolven Wind Warrior of the West (That's catchy)
  • Occupation: Hopeless Amazing Young Scriptor
Re: Danmakufu Q&A/Problem Thread v3
« Reply #737 on: May 10, 2010, 12:32:12 AM »
TO ALL THOSE WHO RESPONDED TO MY "FRAMES" PROBLEM (Quoting you all was too long)

Uhh... I'll say it again, to make sure we aren't wasting time here. Basically, I want one section of bullets to spawn less bullets at a time, and the other, to spawn more... because I haven't a real clue what was put down.  ???
« Last Edit: May 10, 2010, 12:41:12 AM by SoraOokami »
Me: Rapture is comin'
Person: OMG WHEN!
Me: Naow, APOCALYPSE SIGN "RAPTURE"!

Re: Danmakufu Q&A/Problem Thread v3
« Reply #738 on: May 10, 2010, 01:06:39 AM »
I think i understand now


Code: [Select]
let a = 10 //or how many you want to start out with




if(frame==5){
 a++;
loop(a+a){
Bullets;}
}


if(frame==10){
loop(a-(a/2){
Bullets;}
frame=0;
}


Pretty much, a increases


Pretty Much, a will increase when frame is 5
the number of bullets fired when frame is 5 is "a" plus "a"
the number of bullets fired when frame is 10 is "a" minus half of "a"


Thus as time goes on, more bullets will be fired if frame equals 5, and less at a 10
so it at first will fire
20 at 5
5 at 10
22 at 5
etc..

Re: Danmakufu Q&A/Problem Thread v3
« Reply #739 on: May 10, 2010, 02:06:56 AM »
sup


I know what this means and how to fix it, I'm just posting to fuck with your minds a bit. Azure has probably seen this.

空SoraのNo鏡Kagami

  • Wolven Wind Warrior of the West (That's catchy)
  • Occupation: Hopeless Amazing Young Scriptor
Re: Danmakufu Q&A/Problem Thread v3
« Reply #740 on: May 10, 2010, 02:53:58 AM »
*Sigh* Sorry Bman, I think I'll postpone that until I understand variables more. And on to a problem I've had ever since i downloaded Danmakufu... LASERS DON'T WORK

huh, that's weird... it just spontaneously started working again... On somewhat related news, I spelled spontaneous right!
« Last Edit: May 10, 2010, 03:02:55 AM by SoraOokami »
Me: Rapture is comin'
Person: OMG WHEN!
Me: Naow, APOCALYPSE SIGN "RAPTURE"!

Re: Danmakufu Q&A/Problem Thread v3
« Reply #741 on: May 10, 2010, 02:59:16 AM »
sup


I know what this means and how to fix it, I'm just posting to fuck with your minds a bit. Azure has probably seen this.
Dammit Naut

Re: Danmakufu Q&A/Problem Thread v3
« Reply #742 on: May 10, 2010, 03:17:41 AM »
For somereason my little detection snippet:
Code: [Select]

if(PosX<Pos2X+5 && PosX>Pos2X-5 && PosY<Pos2Y+20 && PosY>Pos2Y-20){yield;
ShootDownPlayer;}


is not working, and instead if I go to a corner of the screen, usually the lower right, I die when nothing is around me


i also have


Code: [Select]

let PosX = Obj_GetX(id);
let PosY = Obj_GetY(id);
let Pos2X = Obj_GetX(objid);
let Pos2Y = Obj_GetY(objid);



to check for positions.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #743 on: May 10, 2010, 03:31:08 AM »
For somereason my little detection snippet:
dfasghrjyew4
is not working, and instead if I go to a corner of the screen, usually the lower right, I die when nothing is around me

Sounds like your problem lies elsewhere. Post the whole script?

Re: Danmakufu Q&A/Problem Thread v3
« Reply #744 on: May 10, 2010, 03:57:40 AM »
Code: [Select]

#TouhouDanmakufu
#Title[Spell 1]
#Text[Spell 1]
#Player[FREE]
#BackGround[User(.\img.png)]
#ScriptVersion[2]


script_enemy_main{
let BossImg = GetCurrentScriptDirectory~"bossimg.png";
#include_function ".\S_I_Load.txt"
#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
let frame = 10;
let acc = 0;
let s1 = 1.5;
let angle = 0;
let  l =60;
let move = 0;
let o = 15;
let n = 12;
let side = 0;
let NewX = 0;
let NewY = 0;
let imagefile = GetCurrentScriptDirectory ~ "bossimg.png";
let objLaz1=Obj_Create(OBJ_LASER);
let objid = Obj_Create(OBJ_EFFECT);




task Laser{
      Obj_SetAngle(objLaz1, 90);
      ObjLaser_SetLength(objLaz1, 490);
      ObjLaser_SetWidth(objLaz1, 17);
      ObjShot_SetDelay(objLaz1, 60);
      ObjShot_SetGraphic(objLaz1, WHITE60);
      Obj_SetSpeed(objLaz1, 0);
      Obj_SetY(objLaz1, 0);
      while(Obj_BeDeleted(objLaz1)==false) {
                  Obj_SetX(objLaz1, GetCenterX);
                  Obj_SetCollisionToObject(objLaz1, true);
                  ObjShot_SetBombResist(objLaz1, true);
            yield;
      }
}


task HitShot(id,x,y,speed,angle,graphic,delay){
let lol = 0;
let n = 0;
let numbe = 0;
let id=Obj_Create(OBJ_SHOT);


Obj_SetPosition(id,x,y);
Obj_SetAngle(id, angle);
Obj_SetSpeed(id, speed);
ObjShot_SetGraphic(id, graphic);
ObjShot_SetDelay  (id, delay);
ObjShot_SetBombResist (id, false);


while(Obj_BeDeleted(id)==false){
let PosX = Obj_GetX(id);
let PosY = Obj_GetY(id);
let Pos2X = Obj_GetX(objid);
let Pos2Y = Obj_GetY(objid);
yield;


if(PosX<Pos2X+5 && PosX>Pos2X-5
&& PosY<Pos2Y+20 && PosY>Pos2Y-20){yield;
ShootDownPlayer;}
}
}




    @Initialize {
SoundLoad;
        LoadGraphic(BossImg);
LoadGraphic(imagefile);
SetMovePosition02(GetCenterX, GetCenterY-120, 0);
        SetLife(300);
        SetEnemyMarker(true);
        Concentration01(60);
        Concentration02(60);
        MagicCircle(true);
shotinit;
Laser;


    }


    @MainLoop {yield;
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 24);
        frame+=1;

if(frame==30){
ReflectPlayer;
     }


if(frame%2==0){
HitShot(frame+1,GetX,GetY,3,rand(0,360),SP03,10);
}
}
@DrawLoop{yield;


SetTexture(BossImg);
SetRenderState(ALPHA); SetAlpha(255);
SetGraphicScale(1.25,1.25);
SetGraphicAngle(0,0,0);
if(int(GetSpeed())==0){SetGraphicRect(0,0,33,63);}
if(GetSpeedX()<0){SetGraphicRect(32,0,69,62);}


if(GetSpeedX()>0){ SetGraphicAngle(180,0,0);
SetGraphicRect(32,0,69,62);}
DrawGraphic(GetX,GetY);


}
@Finalize{
//DeleteGraphic(BossImg);
}




task ReflectPlayer{


 
  ObjEffect_SetTexture(objid,imagefile);
          ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLEFAN);
          ObjEffect_CreateVertex(objid, 4);
  ObjEffect_SetScale(objid,1,1);
  ObjEffect_SetRenderState(objid,ALPHA);
  Obj_SetAlpha(objid,255);


while(Obj_BeDeleted(objid)==false){yield;


NewX = (GetCenterX - GetPlayerX) + GetCenterX;
NewY = GetPlayerY;


          ObjEffect_SetVertexXY(objid, 0, NewX-30, NewY-30);
          ObjEffect_SetVertexUV(objid, 0, 0, 0);
 
          ObjEffect_SetVertexXY(objid, 1, NewX+30, NewY-30);
          ObjEffect_SetVertexUV(objid, 1, 33, 0);
 
          ObjEffect_SetVertexXY(objid, 2, NewX+30, NewY+30);
          ObjEffect_SetVertexUV(objid, 2, 33, 63);


          ObjEffect_SetVertexXY(objid, 3, NewX-30, NewY+30);
          ObjEffect_SetVertexUV(objid, 3, 0, 63);


  ObjEffect_SetLayer(objid, 7);

}
}
}

Re: Danmakufu Q&A/Problem Thread v3
« Reply #745 on: May 10, 2010, 04:03:24 AM »
You don't set the position of the object named "objid" (setting graphic coordinates does not set it's position). Declare NewX and NewY globally and use those instead of Obj_GetX(objid) and Obj_GetY(objid).

空SoraのNo鏡Kagami

  • Wolven Wind Warrior of the West (That's catchy)
  • Occupation: Hopeless Amazing Young Scriptor
Re: Danmakufu Q&A/Problem Thread v3
« Reply #746 on: May 13, 2010, 03:15:40 AM »
Okay... Major problem... Any new Spell or anything, I try to make... it doesn't show up
Me: Rapture is comin'
Person: OMG WHEN!
Me: Naow, APOCALYPSE SIGN "RAPTURE"!

Re: Danmakufu Q&A/Problem Thread v3
« Reply #747 on: May 13, 2010, 03:18:10 AM »
Post Script Please


It could be a problem when you forgot to include
#TouhouDanmakufu




Or maybe


#Title[]
and
#Text[]

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #748 on: May 13, 2010, 03:42:34 AM »
Okay... Major problem... Any new Spell or anything, I try to make... it doesn't show up
Don't do this. Please. Ever. We don't know what the fuck that would mean, and even if someone guesses correctly, it's still a horrible horrible thing to do stop it.

Give as much info as you possibly can.

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

空SoraのNo鏡Kagami

  • Wolven Wind Warrior of the West (That's catchy)
  • Occupation: Hopeless Amazing Young Scriptor
Re: Danmakufu Q&A/Problem Thread v3
« Reply #749 on: May 14, 2010, 01:22:08 AM »
Post Script Please


It could be a problem when you forgot to include
#TouhouDanmakufu

How could I miss that! I'm dumb, I blame school.

Don't do this. Please. Ever. We don't know what the fuck that would mean, and even if someone guesses correctly, it's still a horrible horrible thing to do stop it.

Give as much info as you possibly can.

I'm afraid I don't follow, I gave you info... The spell, clearly doesn't show up. If the spell didn't show up when I chose it, I would have said so, if that's what you meant.

Me: Rapture is comin'
Person: OMG WHEN!
Me: Naow, APOCALYPSE SIGN "RAPTURE"!