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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #300 on: June 15, 2011, 09:51:39 PM »
rogus247, I don't mean this in an insulting way, but from the questions you've been asking, it's very clear that you are lacking in the very fundamentals of programming/scripting. Take the time to learn how variables, conditionals, functions, and programming logic REALLY work, and most of the questions you ask could easily be answered by yourself with just a little bit of thinking. If you keep coming to the Q&A thread for every little problem you have, you won't really learn.

#danmakufu
<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.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #301 on: June 15, 2011, 09:56:52 PM »
Actually....your not insulting me at all. When it comes to math and stuff, im really good (top of my class btw). Danmakufu is the only thing that actually gives me trouble. I always miss the smallest of mistakes and dont see them. Also, your really right. I kinda learn, but i cant always depend on you guys...so yeah, sorry if i bombed you guys with like...40 questions already. Ill try to do more things on my own. (and also, i feel like theres an age requirement for danmakufu....and by that, i mean having more general knowlage and stuff...sucks when your young and dependent...xD)

EDIT: that last sentence....yeeeeeeah, i was kinda born to a family where i was just given everything! I never learned much on my own...:(
« Last Edit: June 15, 2011, 09:59:24 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

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #302 on: June 16, 2011, 06:04:25 AM »
I'm wondering how to replicate the hover effect in ZUN's games. Is it like:
Code: [Select]
if(GetSpeedX==0){SetY(GetY+sin(wave)*1)} or:
Code: [Select]
DrawGraphic(GetX,GetY+sin(wave)*1)
if(GetSpeedX==0){wave++;}
if(GetSpeedX<0 && GetSpeedX>0){wave=0;}
Doesn't look so smooth to me. :wat:

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #303 on: June 16, 2011, 06:05:55 AM »
Second option.
1 pixel of difference isn't that much. Also, I don't think you'll have to have that last line.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #304 on: June 16, 2011, 06:29:41 AM »
Never ever set the enemy's position in the float. You're supposed to draw them floating.

float += (1/((|GetSpeedX|)+1))*3;
DrawGraphic(GetEnemyX,GetEnemyY+sin(float)*8);

This is what I used in some script. Standing still, float increases by 3; moving increases it by 1.5.
« Last Edit: June 16, 2011, 07:46:33 AM by Drake »

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

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #305 on: June 16, 2011, 07:10:49 AM »
Worked perfectly fine Drake, thanks!

And yeah, one pixel was too little, when i tested the codes i needed at least four.

Quantum

  • Gaming Youkai
  • Master of the panicbomb, which I demonstrate often
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #306 on: June 19, 2011, 05:26:15 AM »
Warning: Incoming "Guy with noticeably less experience than those around him"

Okay, this has me stuck.  I began scripting in Danmakufu yesterday, and so far things have been going smooth enough.
I want my boss to, during nonspells, dart around the top area of the screen (similarly to actual Touhou bosses).  This is my latest attempt:
Code: [Select]
@Initialize {
 here be irrelevant code
  ...
        loop{
            wait(180);
            SetMovePositionRandom01(48, 48, 3, GetClipMinX, 32, GetClipMaxX, 128);
        }

...defining the following at the bottom, under @Finalize but before the end of script_enemy_main (taken from another thread):
Code: [Select]
function wait(t){
        loop(t){ yield; }
    }

In theory, the boss should make a movement every three seconds, moving at 3 frames/second (as I understand it).  Obviously, without wait() or some delayer, the boss just has what I'd call a seizure at the top of the screen.  In the unfortunate reality, running the script causes Danmakufu to stop responding and crash.  I suspect something to do with an infinite loop of some sort, but I've yet to isolate the issue.  Halp.
Now I'm working with Danmakufu...
But it's not working with me.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #307 on: June 19, 2011, 06:06:31 AM »
shut up

Alright, so let's explain this more carefully.
You don't put your loops in your @Initialize.
Instead, you call a task containing your "moving" functions, like so:
Code: [Select]
task MovingTask { loop{ wait(180); SetMovePositionRandom01(48, 48, 3, GetClipMinX, 32, GetClipMaxX, 128); } }
You then call MovingTask; in @Initialize, once only.

Is there something you missed out when you learned how to use tasks and yield (and not at all likely loops)?

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #308 on: June 19, 2011, 07:59:05 PM »
This is not exactly a Danmakufu problem, but I recall to seeing a thread about menu making or something, does anybody knows the thread or can provide a link to a place where I can learn that?
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Drake

  • *

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #311 on: June 24, 2011, 08:26:41 AM »
Hello , I have a question , or rather a "look at my script and see what is wrong" thing.  :V

So It's giving me the errors about my mid boss and my boss. But I followed every thing I need to fill in.

http://pastebin.com/Cmct5cwN

I don't know what's wrong  :wat: if the plural commands isn't working then why are the normal call out enemy commands don't have any problem ?

Edit : A little more information

Quote
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"talk2.txt", 0, 0, 0, 0, 0);
This somehow worked  :wat: it's a talk event. Now in the new script, it doesn't.

Quote
CreateEventFromScript(GetCurrentScriptDirectory~"talk2.txt");
There is no error message but nothing comes up on screen, the script doesn't continue

Quote
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"mid boss.txt", 0, 0, 0, 0, 0);
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"boss.txt", 0, 0, 0, 0, 0);


« Last Edit: June 24, 2011, 08:47:40 AM by Foremoster »
Hey There !

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #312 on: June 24, 2011, 01:58:57 PM »
Code: [Select]
CreateEventFromScript(GetCurrentScriptDirectory~"talk2.txt");This says CreateEventFromScript, not CreateEventFromFile (which doesn't even exist by the way).



Code: [Select]
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"mid boss.txt", 0, 0, 0, 0, 0);
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"boss.txt", 0, 0, 0, 0, 0);
Only one boss enemy will be existant at one time, so you'll have to put some kind of function that delays until the Midboss is defeated to spawn the boss.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #313 on: June 24, 2011, 05:47:25 PM »
Code: [Select]
CreateEventFromScript(GetCurrentScriptDirectory~"talk2.txt");This says CreateEventFromScript, not CreateEventFromFile (which doesn't even exist by the way).

Adding to this, what you need to do is something like this instead:
Code: [Select]
script_enemy_main {
    @Initialize {
        // blah blah blah....
        CreateEventFromScript("talk2");
    }

   // blah blah blah...
}

script_event talk2 { // I honestly don't remember if you need to put talk2 in quotes or not... if this doesn't work, try it with quotes
    // blah blah blah...
}

All of that is in the same file.
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #314 on: June 27, 2011, 04:08:34 AM »
Something I've been stumped on for sometime about danmakufu...How does danmakufu determine appriopriate hitbox size of bullets? In the ShotReplaceScripts I see no mention of hitbox size.
Code: [Select]
ShotData{
id = 1
rect = ( 0, 0, 12, 12 )
delay_color = ( 255, 63, 63 )
}
..which leads me to believe that  all bullets are automatically given hitbox sizes from the sprite based on some sort of formula. Is that correct or is there some other explanation?  :wat:

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #315 on: June 27, 2011, 04:33:44 AM »
Pretty much rect/2 or rect/3 depending on who you ask.

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #316 on: June 27, 2011, 04:48:34 AM »
Based off of what little testing has been done around here, it seems to be a circle with a diameter that's maybe half the length of the shorter side of the graphic rectangle that you define in the shot definitions.
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #317 on: June 28, 2011, 09:00:37 AM »
Danmakufu does not let me assign numbers to a 2-dimensional array, while it can read those values. What brings error is any assignment of the kind
Code: [Select]
a[i][j]=n;

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #318 on: June 28, 2011, 11:30:17 AM »
When dealing with 2d arrays Danmakufu is stupid and can't change a single value. IIRC your only option is to redefine the second array completely. I could use some confirmation, I don't have Danmakufu at hand to test this.

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 #319 on: June 28, 2011, 03:27:00 PM »
That's true about the arrays... IIRC, I think all, or most, real programming languages are like that also...

Well your only option is, like zengar said, to redefine the second array...
Code: [Select]
let temp=a[i];
temp[j]=n;
a[i]=temp;
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: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #320 on: June 28, 2011, 04:50:44 PM »
That's true about the arrays... IIRC, I think all, or most, real programming languages are like that also...

If it were true for more programming languages, people wouldn't be so confused and annoyed when learning about this in Danmakufu. :V
Another thing about Danmakufu's arrays is that it can't store multiple data types when many programming languages can.
<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.

Quantum

  • Gaming Youkai
  • Master of the panicbomb, which I demonstrate often
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #321 on: June 28, 2011, 06:31:42 PM »
How can I define the value of a variable as "any integer"?
Now I'm working with Danmakufu...
But it's not working with me.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #322 on: June 28, 2011, 06:45:53 PM »
How can I define the value of a variable as "any integer"?

Uh.
You want a random integer?
Spoiler:
rand_int(min, max)
Putting that into the let statement you have, you'd get
let variablename = rand_int(min,max);

Quantum

  • Gaming Youkai
  • Master of the panicbomb, which I demonstrate often
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #323 on: June 28, 2011, 08:08:06 PM »
Not necessarily.  I was more going for "equals any and all real integers at all times".  In other words, a variable that's ACTUALLY variable.
Now I'm working with Danmakufu...
But it's not working with me.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #324 on: June 28, 2011, 09:13:10 PM »
Not necessarily.  I was more going for "equals any and all real integers at all times".  In other words, a variable that's ACTUALLY variable.

You can't have a variable be ALL real integers at all times (like -100000 and 1006 at the same time)
That just isn't a function.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #325 on: June 28, 2011, 09:35:57 PM »
Not necessarily.  I was more going for "equals any and all real integers at all times".  In other words, a variable that's ACTUALLY variable.
wat

How can I define the value of a variable as "any integer"?
Danmakufu can only store numbers as floats. If you want to check that the value is an integer in the sense that all the decimals are 0s, you can do variable%1 == 0. If it's true, it's an integer. Otherwise it has nonzero decimal values.

EDIT: Perhaps we should be asking what you're trying to accomplish instead of answering your question directly. As it is now, your question is kind of nonsensical. No programming language let's you store ALL real integers in a single variable because there are an infinite amount of them...
« Last Edit: June 28, 2011, 09:39:01 PM by Blargel »
<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.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #326 on: June 29, 2011, 06:53:45 PM »
Finally, i got what Lucas told me in Q&A thread 4 to work.

http://pastebin.com/PaLW9Qzj

But about this:

Code: [Select]
ascent(i in 0..length(objarr)){ //Go through all objects and remove self
if(objarr[i] == ID1){
objarr = erase(objarr,i);
break;
}
}

What does the command break do? And why does it have to be after the closing bracket of
Code: [Select]
while(!Obj_BeDeleted(ID1)){?

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #327 on: June 29, 2011, 08:19:27 PM »
Finally, i got what Lucas told me in Q&A thread 4 to work.

http://pastebin.com/PaLW9Qzj

But about this:

Code: [Select]
ascent(i in 0..length(objarr)){ //Go through all objects and remove self
if(objarr[i] == ID1){
objarr = erase(objarr,i);
break;
}
}

What does the command break do? And why does it have to be after the closing bracket of
Code: [Select]
while(!Obj_BeDeleted(ID1)){?

break is used to break
Spoiler:
haha I'm so clever
out of a loop, while, ascent, or descent prematurely. In your first example, the code is searching through objarr to delete the value that ID1 matches from it. When it enters the if block, since it had accomplished what it was trying to do already, it just breaks out of the loop to avoid wasting processing time checking the rest of the array. It's not being used in the while loop because if you break out of the while loop, it won't wait for the bullet to be deleted before it removes the id from the array.
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #328 on: June 30, 2011, 12:22:36 AM »
Before I ask for help, I'd just like to say that I started using Danmakufu yesterday and I have little to no idea as to what I'm doing...so bear with the stupidity :)

I'm looking to make bullets and lasers to wait before firing in this script:

CreateShotA(1, GetCenterX, GetCenterY-90, 10);
SetShotDataA(1, 0, 5, 0, 1.9, 0, 5, RED22);
ascent(i in 1..2){
    CreateShotA(2, 0, 0, 10);
    SetShotDataA_XY(2, 0, rand(-1, 1), rand(-1, 1), 0, 0.1, 0, 1, PURPLE31);
    AddShot(i*0, 1, 2, 0);
    i++;
   
      }
   CreateLaserB(3, 800, 12, BLUE01, 130);
   SetLaserDataB(3, 0, 0, 0, 0, rand(0, 360), 0, rand(0, 360), 0);
        SetShotKillTime(3, 190);
FireShot(1);
FireShot(3);
}
 
}

I did use Blargel's tutorial script as a basis for this, so if it looks familiar, that's why...I'd like to make both the Butterfly bullets and the lasers wait so they are not constantly being drawn...I'm unsure how to make use of a wait function, so any and all help would be appreciated so I don't end up dodging perpetually forming lasers! What I'd like to do in the end is create a few randomly angled lasers which delay for a few frames and then fire, a lot like Minoriko Aki's "Bumper Crop - Promise of the Wheat God" in MoF. Any help and a great deal of patience for my stupidity is appreciated!!!

Thanks,
Ace
« Last Edit: June 30, 2011, 12:25:40 AM by ByakuganAce »

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #329 on: June 30, 2011, 06:24:31 AM »

I did use Blargel's tutorial script as a basis for this, so if it looks familiar, that's why...I'd like to make both the Butterfly bullets and the lasers wait so they are not constantly being drawn...I'm unsure how to make use of a wait function, so any and all help would be appreciated so I don't end up dodging perpetually forming lasers! What I'd like to do in the end is create a few randomly angled lasers which delay for a few frames and then fire, a lot like Minoriko Aki's "Bumper Crop - Promise of the Wheat God" in MoF. Any help and a great deal of patience for my stupidity is appreciated!!!

Thanks,
Ace

IF you are using tasks, just insert this in the script_enemy_main:
Code: [Select]
function wait(t){loop(t){yield;}}
Then, after your FireShot part, just insert wait( t ), where t is a number of frames the task should pause for. Like this:
Code: [Select]
FireShot(1);
FireShot(3);
}
wait(120);
This will stop the task from continuing for 120 frames.