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

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #270 on: June 12, 2011, 01:27:30 AM »
umm...wheres is that happening? Can you show me so i know how to it next time so i dont have to bug you about it? xD
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #271 on: June 12, 2011, 01:33:59 AM »
That's simply what your script currently does. If you get it working you'll notice.

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

Serina

  • Evening Star
  • I like Danmakufu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #272 on: June 12, 2011, 01:40:34 AM »
Oh boy, I must be retarded.

Quote
if (Obj_GetX(bala) > GetClipMaxX){
      Obj_SetAngle (bala, 140);
      ObjShot_SetGraphic (bala, 53);}

Why my bullet isn't bouncing and changing color? ;_; It just goes and disappears offscreen.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #273 on: June 12, 2011, 01:47:30 AM »
kk it works! The knives do fire...but they arent firing from the knife. They fire from the boss after a certain time. How do i make it so that it comes from the knife?
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

CK Crash

  • boozer
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #274 on: June 12, 2011, 01:52:37 AM »
Oh boy, I must be retarded.

Why my bullet isn't bouncing and changing color? ;_; It just goes and disappears offscreen.
Are you running that code in a while(!Obj_BeDeleted(obj) ){yield;} loop? Are you sure that 140 is a valid id in the shot data?

Serina

  • Evening Star
  • I like Danmakufu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #275 on: June 12, 2011, 01:57:58 AM »
Are you running that code in a while(!Obj_BeDeleted(obj) ){yield;} loop? Are you sure that 140 is a valid id in the shot data?

Well, I'm using the MainLoop.... so no yield, right? I tried to put the while and now Danmakufu freezes. The IDs are valid. Thanks anyway!

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #276 on: June 12, 2011, 06:45:31 AM »
kk it works! The knives do fire...but they arent firing from the knife. They fire from the boss after a certain time. How do i make it so that it comes from the knife?

Even if you fire them using Obj_GetX(obj), it won't work cause this code is the one that places the bullet:
Code: [Select]
Obj_SetPosition(obj,GetEnemyX,GetEnemyY);
There's the problem. But actually, Drake already said this as well.
He wants the x and y, only his initial call is supposed to spawn on the enemy. In which case,

bullet(GetEnemyX,GetEnemyY,1,anactualnumber,ORANGE32,0);

//...

task bullet(x,y,v,a,g,d){
    Obj_SetPosition(obj,x,y);

puremrz

  • Can't stop playing Minecraft!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #277 on: June 12, 2011, 01:30:47 PM »
*Raises hand*
Is there a way to disable saving replays? I'm making it possible to save/quit after each stage because my game is rather long, and naturally replays don't like that. So I want to disable saving a replay if you continue from a saved game.
Making an error message pop up during a replay would be a bit crude, so I'd rather disable replays instead. If that's possible.
Fixing the syncing of the replay is out of the question by the way. :X
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

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #278 on: June 12, 2011, 10:53:58 PM »
I recall AzureLove saying something about a maxsplit command? how does that work?
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #279 on: June 12, 2011, 11:32:53 PM »
It isn't a command. She was telling you that as your script was, it would just continuously spawn and stop and spawn three bullets from every bullet every four frames. That is 15 times every second. You're not going to do the math, so it's 3x3x3x3x3x3x3x3x3x3x3x3x3x3x3 bullets in one second minus the deleted bullets. Or 3^15 = 14348907 bullets. Azure was telling you to fix it.

Figure out how to not do this. This isn't rocket science.

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #280 on: June 13, 2011, 02:56:45 AM »
Spoiler:
lol "azurelove"
[/s][/sub][/size]

Is there a different way to tile only part of an image, other than using loops/ascents?

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #281 on: June 13, 2011, 03:03:46 AM »
Cropping it in an image editor and saving it as a new image is pretty much the only way.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #282 on: June 13, 2011, 04:07:22 PM »
you could draw it in a render target and use that, though cropping it would probably work better...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #283 on: June 14, 2011, 07:54:15 PM »
ok, after all this time, i finally figured out (Im stupid, as you can tell xD) After fixing it up to work, i realized that it keeps making more and more knives because the variable that created the knife wont reset! so it will go on forever creating knives. The question is, how do i reset the variable after some time? Something like this i would assume:

If(counter==1200){let x = 0;}
or
if(counter==1200){reset x}

I know thats wrong, but im trying to think of an example...
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #284 on: June 14, 2011, 08:36:52 PM »
If(counter==1200){x = 0;}

Fixed, even though I have a feeling I won't be able to take a liking to you.

(I'm sorry! It's just because you've somehow been mean to me (or I took it the wrong way) and I can't forget it...)
* みゅーキュゥ bows
« Last Edit: June 14, 2011, 08:43:33 PM by みゅーキュゥ »

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #285 on: June 14, 2011, 08:53:20 PM »
2 things:

1: Im sorry for whatever i did!  :ohdear: (I cant recall...but i bet i did do something)

2: The command i put in...it doesnt work. I think it doesnt want to reset the number of (x knives) i create.

http://pastebin.com/iJnH9erD
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #286 on: June 14, 2011, 09:08:15 PM »
Ahem

Ah, there we go!
* みゅーキュゥ goes to check



It seems d (the last parameter of bullet) is unused.
Also, what are you actually trying to accomplish?
« Last Edit: June 14, 2011, 09:13:06 PM by みゅーキュゥ »

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #287 on: June 14, 2011, 09:11:09 PM »
O THAT? I wasnt mocking you! I was just experianced is all! xD No need to take it like that! And im glad you got it on your third try! :D

EDIT: Im trying to make it stop making infinite bullets. Like, reset it to firing just the 3, not making like...400 at once.
« Last Edit: June 14, 2011, 09:15:32 PM by rogus247 »
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #288 on: June 14, 2011, 09:34:43 PM »
O THAT? I wasnt mocking you! I was just experianced is all! xD No need to take it like that! And im glad you got it on your third try! :D
I will fight you :V PoFV LUNATIC BEST 2 OF 3 TONIGHT

Anyways, http://pastebin.com/Y5hJUJKs

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #289 on: June 14, 2011, 09:40:40 PM »
Quote
I will fight you  PoFV LUNATIC BEST 2 OF 3 TONIGHT

CHALLENGE ACCEPTED...BUT YOU HAVE TO SHOW ME HOW FIRST............... :derp:
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #290 on: June 14, 2011, 09:43:44 PM »
CHALLENGE ACCEPTED...BUT YOU HAVE TO SHOW ME HOW FIRST............... :derp:

MEET YOU ON #danmakufu TONIGHT.
NOW BACK ON TOPIC

I changed a few things in the text file from mainTask downwards. It seems I gave some use to d, which stops every bullet from continuously spawning 3 bullets each time - you won't want too much lag!

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #291 on: June 14, 2011, 10:07:03 PM »
and suddenly, script enemy main! Now ill be on the hunt for that missing bracket! xD
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #292 on: June 14, 2011, 10:16:59 PM »
and suddenly, script enemy main! Now ill be on the hunt for that missing bracket! xD

Add the closing bracket after the last one. Did you accidentally delete it when you replaced your code with mine?

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #293 on: June 14, 2011, 10:28:37 PM »
wow....thats...really cool! xD

Oh, and btw, what if i didnt want them to home? Do i just set an angle for the knives?
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #294 on: June 14, 2011, 11:12:45 PM »
wow....thats...really cool! xD

Oh, and btw, what if i didnt want them to home? Do i just set an angle for the knives?
I made it so that they home in on the player. Just take out the atan2 and everything around its parantheses, then replace it with other angles if you want.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #295 on: June 15, 2011, 05:33:53 PM »
Ok, the obj shots working great! Say if i want to make it so they bounce off the walls...where would i put it?

http://pastebin.com/wBwSew62
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #296 on: June 15, 2011, 06:21:55 PM »
You'd put it after
while(!Obj_BeDeleted(obj)){

So the checking for the object bouncing is always performed every frame while the object exists.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #297 on: June 15, 2011, 09:25:46 PM »
Code: [Select]
#TouhouDanmakufu
#Title[Hell "- Edge of the fire blade -"]
#Text[Not everyone can see...]
#Player[FREE]
#ScriptVersion[2]
#BGM[bgm\Medicine.mp3]

script_enemy_main{

let CSD = GetCurrentScriptDirectory;

let imgBoss = CSD ~ "system\Kora.png";
let cut = CSD ~ "system\Koracut.png";
let bg = CSD ~ "system\Temple.png";

@Initialize{
SetLife(5000);
SetTimer(100);
SetScore(100000);
SetMovePosition01(GetCenterX,GetCenterY,5);
LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);

CutIn(YOUMU,"Hell - Edge of the fire blade -",cut,0,0,300,384);

mainTask;
}

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

@DrawLoop{

// data for the boss
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(225);
SetGraphicRect(0,0,110,110);
SetGraphicScale(0.5,0.5);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);

}

@BackGround{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(225);
SetGraphicRect(0,0,512,512);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);

}

@Finalize{
// delete the image from memory
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);

}

task mainTask{
wait(120);
yield;
fire;
}


task fire{
//loop{
bullet(GetEnemyX,GetEnemyY,0.5,270,ORANGE32,0);
wait(240);
yield;
//}
}

    task bullet(x,y,v,a,g,d){
    let counter=0;
    let obj=Obj_Create(OBJ_SHOT);
    Obj_SetPosition(obj,x,y);
    Obj_SetAngle(obj,a);
    Obj_SetSpeed(obj,0.9);
    ObjShot_SetGraphic(obj,ORANGE32);
    ObjShot_SetDelay(obj,20);
    while(!Obj_BeDeleted(obj)){
if(Obj_GetY(obj) > GetClipMaxY) {
Obj_SetAngle(obj,-dir);
}
        counter++;
        if(counter==140){Obj_SetAngle(obj, atan2(GetPlayerY-Obj_GetY(obj),GetPlayerX-Obj_GetX(obj)));}
if(counter==180){Obj_SetSpeed(obj,2);}
        if(counter==260&&d<=5){
            bullet(Obj_GetX(obj),Obj_GetY(obj),1,Obj_GetAngle(obj)+35+180,ORANGE32,d+1);
            bullet(Obj_GetX(obj),Obj_GetY(obj),2,Obj_GetAngle(obj)+0+180,ORANGE32,d+1);
            bullet(Obj_GetX(obj),Obj_GetY(obj),3,Obj_GetAngle(obj)-35+180,ORANGE32,d+1);
        }
//if(counter==300){d = 0;}
yield;
    }
}

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




}

Theres apparently a problem with my -dir command...it wont work...do i have to define direction? :V

EDIT: Also, do i have to add a loop to make it loop?
« Last Edit: June 15, 2011, 09:28:14 PM by rogus247 »
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #298 on: June 15, 2011, 09:41:52 PM »
You forgot to put a let statement for dir.

No, the while already does that.

Meet me on #danmakufu. Right now.

EDIT: PASTEBIN PLEASE

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #299 on: June 15, 2011, 09:48:38 PM »
2 things:

1) well..............that explains a lot.

2).....................im gonna get slapped for this, but whats #danmakufu? *hides face*

http://pastebin.com/0HyYRG8K

"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus