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

Snaka

  • Do I post too fast
  • Or does everyone else post too slow
Re: Danmakufu Q&A/Problem Thread II
« Reply #150 on: November 02, 2009, 12:44:17 PM »
Ok, I will check the INTERMEDIATE TUTORIAL :D

The five magic rolling stones

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #151 on: November 02, 2009, 12:46:32 PM »
^.^  good. Then you will be atleast "one of the few" who reads the stickies.

Re: Danmakufu Q&A/Problem Thread II
« Reply #152 on: November 02, 2009, 05:03:26 PM »
Yeah seriously guys, read the freakin' stickies before you ask questions. Mainly the FAQ and TUTORIALS. They might have information in them, but hey, what do I know.

Blaman

Re: Danmakufu Q&A/Problem Thread II
« Reply #153 on: November 02, 2009, 05:31:40 PM »
My apologies if this is one of those things that've already been asked, but I was wodering how to get an event script to stop everything else from continuing. What I mean is when I have an event script start right before the boss, the boss will still come in and start their first attack while the conversation is still going on. I'd appreciate it if someone could let me know. :)

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #154 on: November 02, 2009, 05:53:08 PM »
My apologies if this is one of those things that've already been asked, but I was wodering how to get an event script to stop everything else from continuing. What I mean is when I have an event script start right before the boss, the boss will still come in and start their first attack while the conversation is still going on. I'd appreciate it if someone could let me know. :)
in the first boss attack script:
Code: [Select]
if(!OnEvent) {
functions; //including like, incr.ing counting variables... and stuff.
}
From my memory, so I can't be 100% sure if this is how you do it.
}

Re: Danmakufu Q&A/Problem Thread II
« Reply #155 on: November 02, 2009, 06:44:13 PM »
What AlwaysThe⑨ posted is incorrect, if(!OnEvent){} means "if not currently playing an event". If you're using the way I taught in the intermediate tutorial (tasks), simply put:

Code: [Select]
CreateEventFromScript("talk");
while(OnEvent==true){
    yield;
}
CreateEnemyBossFromFile(...);

The while code get if an event is currently running, and suspends the task until it finishes. Thus, when your event script ends, the boss script starts.

Blaman

Re: Danmakufu Q&A/Problem Thread II
« Reply #156 on: November 02, 2009, 06:59:38 PM »
Yeah, I read through the intermediate course you posted. Thank you very much for the help. :D

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #157 on: November 02, 2009, 08:46:38 PM »
What AlwaysThe⑨ posted is incorrect, if(!OnEvent){} means "if not currently playing an event". If you're using the way I taught in the intermediate tutorial (tasks), simply put:

Code: [Select]
CreateEventFromScript("talk");
while(OnEvent==true){
    yield;
}
CreateEnemyBossFromFile(...);

The while code get if an event is currently running, and suspends the task until it finishes. Thus, when your event script ends, the boss script starts.

Ah, crap. I should be dooing this stuff more often. Either that or post a link to the tutorials.
Edit: Lemme try out that code you posted...
Edit: I'll just make an enemy just for an event, then wait until it dies (finishes the event), then continue the stage or something. it works better (for me, personally). \(^o^)/
« Last Edit: November 02, 2009, 09:04:55 PM by AlwaysThe⑨ »

Re: Danmakufu Q&A/Problem Thread II
« Reply #158 on: November 02, 2009, 10:42:51 PM »
Uh, I can't seem to get CreateLaserA to work.
i just start the script and no green laser ever appears, and i tried different X Y starting points that getx and gety but i still don't know how to make the laser happen. (this was based on an issue i had on the last page)
using:
Code: [Select]
{
            if (frame == 200)

    {
        CreateLaserA(1, GetX, GetY, 300, 20, GREEN01,0);
SetLaserDataA(1, 90, 0, 0, 0, 0, 180);

frame=0;

        CreateLaser01(230,200, 50, GetAngleToPlayer, 9000000, 30, YELLOW05, 10);
frame=0;

CreateLaser01(+rand(37, 230),+rand(0, 200), 50, +rand(0, 90), 9000000, 30, RED05, 60);
frame=0;


    }
            frame++;
}
Just wanted to shout out and say thanks for all the time and effort your putin in to make sure smogon has then best VGC'ers around.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #159 on: November 02, 2009, 10:53:21 PM »
Uh, I can't seem to get CreateLaserA to work.
i just start the script and no green laser ever appears, and i tried different X Y starting points that getx and gety but i still don't know how to make the laser happen. (this was based on an issue i had on the last page)
using:
Code: [Select]
{
            if (frame == 200)

    {
        CreateLaserA(1, GetX, GetY, 300, 20, GREEN01,0);
SetLaserDataA(1, 90, 0, 0, 0, 0, 180);

frame=0;

        CreateLaser01(230,200, 50, GetAngleToPlayer, 9000000, 30, YELLOW05, 10);
frame=0;

CreateLaser01(+rand(37, 230),+rand(0, 200), 50, +rand(0, 90), 9000000, 30, RED05, 60);
frame=0;


    }
            frame++;
}
You need a FireShot(1);  in there.

Re: Danmakufu Q&A/Problem Thread II
« Reply #160 on: November 02, 2009, 11:04:47 PM »
Ok, that worked.

thanks
« Last Edit: November 02, 2009, 11:26:30 PM by NOVA »
Just wanted to shout out and say thanks for all the time and effort your putin in to make sure smogon has then best VGC'ers around.

Re: Danmakufu Q&A/Problem Thread II
« Reply #161 on: November 02, 2009, 11:44:40 PM »
is there a way to use atan2 when the bullets are firing at random?

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #162 on: November 02, 2009, 11:49:56 PM »
atan2 is usually used to find the angle from a certain point from boss (or anywhere else a bullet is spawned) to a player (or some other destination, whatever you want)

You put this one in the angle parameter, it's used to get the angle from the boss to the player.
Quote
atan2(GetPlayerY - GetY, GetPlayerX - GetX)

Uh, is that what you're looking for?

Re: Danmakufu Q&A/Problem Thread II
« Reply #163 on: November 03, 2009, 12:01:32 AM »
atan2 is usually used to find the angle from a certain point from boss (or anywhere else a bullet is spawned) to a player (or some other destination, whatever you want)

You put this one in the angle parameter, it's used to get the angle from the boss to the player.
Uh, is that what you're looking for?

not exactly, i want to fire bullets randomly from the bottom of the screen that float up, and after a certain amount of time is up and they are on the top of the screen, to fire down at the player...

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread II
« Reply #164 on: November 03, 2009, 12:26:31 AM »
Code: [Select]
task bullet1
{
let obj = Obj_Create(OBJ_SHOT);
*insert the typical stuff*
while(Obj_BeDeleted(obj)==false && Obj_GetY(obj)>GetClipMinY+16){yield;} //yield while still existing and not at top of screen
if (Obj_BeDeleted(obj)==false){Obj_SetAngle(obj,atan2(GetPlayerY-Obj_GetY(obj),GetPlayerX-Obj_GetX(obj)));} //if bullet still exists, aim it at player
}

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #165 on: November 03, 2009, 01:10:04 AM »
stupid question

Code: [Select]
angletoitem = atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX);

if(Obj_GetY(obj) - GetPlayerY <= sin(angletoitem) * 50 && Obj_GetX(obj) - GetPlayerX <=cos (angletoitem) * 50){
    Obj_Delete(obj);
}

This is supposed to delete the object when it gets within a certain radius of the player. It only works properly when the object is of positive x and y distance from the player. Why is this.

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #166 on: November 03, 2009, 01:46:48 AM »
Because atan2 gets and angle between (-180, 180].

A better way to code it would be:

if(((Obj_GetX(obj) - GetPlayerX)^2 + (Obj_GetY(obj) - GetPlayerY)^2)^0.5 < 50){
    Obj_Delete(obj);
}

If the distance between the player and the item is less than 50, delete it.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #167 on: November 03, 2009, 02:26:17 AM »
This is driving me insane.



Why can't I get this thing right?!

I need help with this.  Can someone tell me how I can get it down properly?

Re: Danmakufu Q&A/Problem Thread II
« Reply #168 on: November 03, 2009, 02:59:44 AM »
Create an object effect with 12 vertices (or 24, or 48, blah blah, any number you want to divide evenly really), and bring in every second vertex towards the center. Creating it with 12 vertices is shown below:



This would be how I would do it, anyway.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #169 on: November 03, 2009, 03:41:05 AM »
This would be how I would do it, anyway.

Uh, the one to the right would work, but I don't see how the one to the left will actually be curvy, seeing how it's done.  Actually, I don't even know how to attack it properly.  I've been at it for about a week, and still got nowhere and can't get it down.  Sorry if I'm asking for so much... but here's what I came out with so far.

Maybe you can take a look at it...

Re: Danmakufu Q&A/Problem Thread II
« Reply #170 on: November 03, 2009, 03:47:07 AM »
The left picture is how the actual graphic looks, the right picture is how you would code it using vertices. So for the top half, you have your circular graphic mapped out using twelve vertices. By reducing the radius on every second vertex (as illustrated by the bottom right picture), the image will bend and contort to look like the bottom left picture, which is what you're tyring to acheive, I thought.

I'll take a look anyways, but I have no promises and I'm not going to code it for you. You'll learn something out of this, damn it!

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #171 on: November 03, 2009, 03:48:39 AM »
thank you naut and stuff

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

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #172 on: November 03, 2009, 03:57:27 AM »
You'll learn something out of this, damn it!

I'm trying, I'm trying!  :'(

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 #173 on: November 03, 2009, 09:14:38 AM »
I have a problem that I've just been dealing with since when I started using danmakufu, but lately... It's getting really annoying... I just wanna fix it already...

ok, here's the problem... Danmakufu doesn't display text and some graphics properly for me... I'll give some examples (I used my multiply to upload the images so there might be "multiply" at the bottom right of the picture)


the hell... I have to squint just to read...


Can't read spell card name, score, graze, point and FPS


Can't even see spell card bonus


I have absolutely no idea what the hell happens here


(I used helepolis' Halloween entry cause it's the first script I thought of that makes use of events) Can't even read what they're saying...



This is what I get when pressing the home button...


Can someone help me?  :-\
I've already tried redownloading it 4 times... and it works properly on the computers of other people I know... I just don't know why my computer can't make it work properly...
This isn't even the worst yet... I was lucky that it showed solid text today... sometimes it shows extremely thin text that's really hard to read... and once, it wasn't showing text AT ALL
For those who are wondering, I use Windows XP with 1GB ram and 2GHz...
« Last Edit: November 03, 2009, 09:19:25 AM by kyle_090594 »
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 #174 on: November 03, 2009, 03:32:25 PM »
Despite your edit, I'll answer your question anyways. ObjEffect_SetVertexUV declares the vertices on your image, ObjEffect_SetVertexXY plots the corresponding vertices on to the Danmakufu field. You're missing the XY portion of an ObjEffect (you're not telling Danmakufu where to draw the image), so nothing is drawn.

Before you say "yes I am", Obj_SetPosition does not work with ObjEffects, nor does Obj_SetAlpha for that matter (to set the alpha value of an ObjEffect, you need to use ObjEffect_SetVertexColor(id, vertex, alpha, red, green, blue); ). A pain in the ass, but setting each vertex also allows you to bend and distort the image however you please. Useful when you get used to it.
Ah, I see. Well, hopefully I'll get it right the second time when I really need to use an effect object for something. Thanks!

Well then, I managed to create and manage a 50-vertex effect object just recently. I think I understand how they work now. Just thanking you again Naut.
<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.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #175 on: November 03, 2009, 03:46:40 PM »
kyle, it almost looks like a graphical problem. Like videocard drivers or settings. But I never encountered such a thing before.

Re: Danmakufu Q&A/Problem Thread II
« Reply #176 on: November 03, 2009, 04:36:33 PM »
Blah, how do I get atan2 to work again if I want to aim a shot that's not on the Boss to the player?

Re: Danmakufu Q&A/Problem Thread II
« Reply #177 on: November 03, 2009, 04:38:32 PM »
atan2(GetPlayerY - BulletY, GetPlayerX - BulletX)

Bullet spawned on (224, 240):

CreateShot01(224, 240, 3, atan2(GetPlayerY - 240, GetPlayerX - 224), RED01, 10);


Re: Danmakufu Q&A/Problem Thread II
« Reply #178 on: November 03, 2009, 04:39:21 PM »
atan2(GetPlayerY - BulletY, GetPlayerX - BulletX)

Bullet spawned on (224, 240):

CreateShot01(224, 240, 3, atan2(GetPlayerY - 240, GetPlayerX - 224), RED01, 10);
Thank you very much Naut :3

Nonnie Grey

  • Contradictory Statement
  • The Anonymity formerly known as Kayorei
Re: Danmakufu Q&A/Problem Thread II
« Reply #179 on: November 03, 2009, 08:53:06 PM »
Pardon this newbie's barging in. ^_^* I know most of the questions posted here are concerning coding, but I'd like a bit of insight on a problem with the software itself.

For some reason, Danmakufu won't let me open it in anything other than fullscreen mode. Whenever I set it up to open in window mode, it comes up for a split second, then disappears (I suspect a crash), but in fullscreen, it works perfectly fine to my knowledge. Pressing Home for screenshots doesn't work, though.

The only other problems I have with it involve graphics.


An example... The framerate's low because this computer is pretty slow. Maybe that's a factor?

Something tells me those black boxes aren't supposed to be there. Also, some bullets with semitransparent parts (like the wings on the butterfly bullets) have transparency issues and when I clear a script, the "playing field" part of the screen disappears and leaves me with just the word "Clear" on the screen.

Any reason why it might be doing this?