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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #300 on: November 15, 2012, 01:42:00 AM »
I didn't get what you and Drake said at first, but then I realized that I forgot to close the spell_talisman task with a }. It was a typo.
Thanks!

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #301 on: November 15, 2012, 03:46:10 AM »
Ah, sorry, I wasn't very clear when I said take run() out.

Also, Danmakufu is a parsed language and one lazymode shortcut it provides is that you don't have to add the empty () to call a function with no parameters (whereas in compiled languages and whatnot you generally have to). I usually omit the parentheses myself, but when posting I would rather use them than not, since it makes it obvious that I'm talking about a function. That's all.

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #302 on: November 17, 2012, 06:10:25 PM »
I'm back again~
I have a similar problem from my last one. (The one with the stage and only the lead enemy would shoot the bullets.)
So I've fixed that problem, but now, when I kill an enemy, the others of it's kind's picture disappears. I know why, but I don't know how to fix it.
Do I just you like let w = GetArgument and then Loadgraphic(w); I don't even know if that would work though...
Currently a normal player

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #303 on: November 17, 2012, 08:34:11 PM »
In fairy's script, inside the shot task, try to use GetX and GetY instead of GetEnemyX/GetEnemyY.
EDIT : Sorry I misunderstand the question. Don't mind what I said.  :ohdear:
« Last Edit: November 18, 2012, 07:23:18 AM by Lunasa Prismriver »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #304 on: November 17, 2012, 11:24:41 PM »
You're using DeleteGraphic() when you kill a fairy; don't. DeleteGraphic is a global command that clears the image data that you loaded from the program memory as to free up space. When you call it, you're going to have to reload the graphic again in order to use it again. In other words, if you're going to be reusing the image, don't delete it.

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #305 on: November 18, 2012, 02:20:50 AM »
I want to make some minor changes to the original Danmakufu Reimu A/B and Marisa A/B, does anyone have them in a editable player script format?


Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #306 on: November 18, 2012, 07:22:21 AM »
Unfortunately, Danmakufu's default's players can't be edit and I don't think their code have been found in thdnh.dat yet  :ohdear: . You can try to remake them into new scripts as they are just PCB shot types.

SusiKette

  • @MainLoop { yield; }
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #307 on: November 18, 2012, 06:14:27 PM »
I'm not sure what caused this but for some reason Danmakufu started to give me an error about word "wait"

The error was in the main task:
Code: [Select]
task mainTask {
SetShotDirectionType(PLAYER);
wait(120);
SetMovePosition03(GetPlayerX, GetPlayerY, 7, 3);
fire01;
wait(120);
fire02;
}

It worked properly but then I did some changes to the fire01; task, and Danmakufu started to give me this error. ( I've had this problem few times before and undoing changes I did won't help)
Here is the wait function: (don't really think that you'll need to see it since I didn't do any changes to it)
Code: [Select]
function wait(w) {
loop(w) {yield;}
}

And here is task fire01; because doing changes there caused this error:
Code: [Select]
task fire01 {
loop {
CreateShotA(1, GetEnemyX, GetEnemyY, 10);
CreateShotA(2, GetEnemyX, GetEnemyY, 10);
CreateShotA(3, GetEnemyX, GetEnemyY, 10);
CreateShotA(4, GetEnemyX, GetEnemyY, 10);
SetShotDataA(1, 0, 0, 0, 0.5, 0.025, 5, RED02);
SetShotDataA(2, 0, 0, 90, 0.5, 0.025, 5, RED02);
SetShotDataA(3, 0, 0, 180, 0.5, 0.025, 5, RED02);
SetShotDataA(4, 0, 0, 270, 0.5, 0.025, 5, RED02);
FireShot(1);
FireShot(2);
FireShot(3);
FireShot(4);
PlaySE(CSD ~ "sfx\se_tan02.wav");
wait(5);
yield;
}
}
}

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #308 on: November 18, 2012, 06:46:03 PM »
I'm not sure what caused this but for some reason Danmakufu started to give me an error about word "wait"

You have an extra bracket in the loop. Also for future reference, generally when you have tasks/functions that worked without error, then do a change anywhere in the script, and suddenly Danmakufu says it's undefined, you probably have an extra bracket somewhere.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #309 on: November 19, 2012, 12:23:35 AM »
After seeing the above, how does Danmakufu respond when you assign loop without a number? Does it hit yield, loop indefinitely, or does it loop once?

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #310 on: November 19, 2012, 12:41:25 AM »
Indefinitely, unless you yield away of course (but it's still a basically indefinite loop). Danmakufu ends the thread and seems to do some garbage collection once the host of the task is deleted, so there's no immediate concern with looping indefinitely as there would "normally" be in most programming languages. You still have to watch out for things like infinitely incrementing variables that can lead to memory leaks, but for common purposes it's a completely normal usage.
« Last Edit: November 19, 2012, 12:44:10 AM by Drakums »

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

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #311 on: November 19, 2012, 03:02:25 AM »
I keep getting this error every time I try spawning danmaku in a circle.
http://tinypic.com/r/2vbmvis/6

My script:
http://pastebin.com/QDkqHPk5

I am following Helepolis' tutorial, and I've followed what he'd done and I still get this error...  :ohdear:

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #312 on: November 19, 2012, 03:12:31 AM »
your lack of proper indentation makes me cry

Your dir+=360/36 just doesn't have a semicolon at the end.

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #313 on: November 19, 2012, 09:21:30 PM »
I've come across a minor issue.

Code: [Select]
@SpellCard {
    CutIn(KOUMA, "Seiryuu: Talisman Eruption", img_cutin);
    //SetSpeed(4,2);
    //UseSpellCard("TalismanEruption", 0);
  }

Basically, after bombing, the text in the bottom left that show the spell name just stays there and doesn't disappear.

If this is because the spell is commented out, then I'll have to fix it within the spell (which does not work at all).

Code: [Select]
//Temporary Spell. Currently just shoots blasts of talismans.
//Req: first, slowly fill ring with talismans, which are still. Then, they blast off. Then, twice, they erupt into three.
script_spell TalismanEruption{
  let spellcount=0;
  let spellangle=0;
  let spellimg_suiroga = GetCurrentScriptDirectory()~"suiroga.png";
  task spell_talisman(angle){
    let objtalisman=Obj_Create(OBJ_SPELL);
    let talismanxpos=GetPlayerX;
    let talismanypos=GetPlayerY;
    let talismanangle=angle;
    Obj_SetAlpha(objtalisman,200);
    ObjEffect_SetTexture(objtalisman,spellimg_suiroga);
    ObjEffect_SetRenderState(objtalisman,ADD);
    ObjEffect_CreateVertex(objtalisman,4);
    ObjEffect_SetPrimitiveType(objtalisman,PRIMITIVE_TRIANGLEFAN);
    ObjEffect_SetVertexUV(objtalisman,0,10,7);
    ObjEffect_SetVertexUV(objtalisman,1,27,7);
    ObjEffect_SetVertexUV(objtalisman,2,27,31);
    ObjEffect_SetVertexUV(objtalisman,3,10,31);
    while(!Obj_BeDeleted(objtalisman)){
      ObjSpell_SetIntersecrionCircle(objtalisman,talismanxpos,talismanypos,30,10,true);
      yield;
    }
  }
  task run{
    ForbidShot(false);
    loop(60){yield;} //When casting
    while(spellcount < 240){
      if(spellcount % 60 == 0){
spellangle = 0;
loop(45){
  spell_talisman(spellangle);
  spellangle += 8;
  }
}
      spellcount++;
      yield;
      }
    SetSpeed(5,3); //Restore it!
    loop(240){yield;} //Delay after for bullets to fly
    End();
  }

  @Initialize{
    SetPlayerInvincibility(480);
    LoadGraphic(spellimg_suiroga);
    //LoadSE
    run();
  }

  @MainLoop{
    CollectItems();
    yield;
  }

  @Finalize{
    DeleteGraphic(spellimg_suiroga);
  }
}

There are most likely mountains of issues with this code, but all I am certain of is that it raises an error and Danmakufu returns to the directory screen afterwards.
Req: states what I want the spell to do; I'm not yet experienced enough to do it.

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #314 on: November 19, 2012, 09:43:37 PM »
your lack of proper indentation makes me cry

Your dir+=360/36 just doesn't have a semicolon at the end.
OHWOW I feel so dumb x3 Thanks~  :V

Byronyello

  • "The Western Non-Otaku That Respects and Likes Touhou"
  • I guess that'd be my title in a Touhou game...
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #315 on: November 20, 2012, 12:16:23 AM »
I don't think you can circumvent it, at least not easily. It's used to exit a repeating procedure, so a script would go crazy and overload commands if it were removed.

That's not really what I meant. I was trying to ask how to handle object bullets without giving them their own thread - is there a way to do this? And sorry for not making my question obvious...
(Strike-through indicates a clear)
Hard Clears: EoSD, PCB, IN, MoF, SA, UFO, TD, DDC.
Lunatic Clears: Someday, perhaps.
Extra Clears: EoSD, PCB, PCB Phantasm, IN, MoF, SA, UFO, TD, DDC.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #316 on: November 20, 2012, 12:33:28 AM »
Another error. >.<
But this one is different, I have a player script error. I can't seem to load the player.
Here's the script.
Here's the error message. For anyone wonder, I crossed out the part with personal data. I don't know why they included that.  :3
« Last Edit: November 20, 2012, 02:02:12 AM by Lavalake131 »
Currently a normal player

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #317 on: November 20, 2012, 01:16:31 AM »
That's not really what I meant. I was trying to ask how to handle object bullets without giving them their own thread - is there a way to do this? And sorry for not making my question obvious...
You can use SetShotDataA (Click). However, beyond anything more complex than that, there's nothing you can do without their own threads.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #318 on: November 20, 2012, 02:34:35 AM »
I've noticed that to make a bullet that can actually react to events, you have to use object bullets, and it seems, subsequently, that you also have to use 'yield;'s. Is there anyway to circumvent this, because my computer can barely handle more than 100 bullets yield;-ing at any one time, which isn't really that good for danmaku. (And certainly not for making patterns for higher difficulties.)
I was trying to ask how to handle object bullets without giving them their own thread - is there a way to do this? And sorry for not making my question obvious...
Yielding takes essentially no extra processing, the underlying procedures are still at work. Microthreading is basically process organization.
Many bullets "reacting to events" can be cheesed just by using bullets that follow timed patterns (i.e. CreateShotA) and properly timing everything. But microthreading does absolutely nothing special besides really easy organization; I have trouble believing that your problem is inherent to yields.

Lavalake: It says it can't find Reimu. Not Reimu A, as your #Menu says. I'm not sure what the problem is but it's clearly something like naming issues.

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 6 ※ for OLD Danmakufu version (0.12m)
« Reply #319 on: November 20, 2012, 09:09:39 AM »
That's not really what I meant. I was trying to ask how to handle object bullets without giving them their own thread - is there a way to do this? And sorry for not making my question obvious...

In addition to what Drake mentioned above, I'd like to point out that the tasks that Danmakufu uses are not truly threads that run independently. If they were threads, they would indeed have some overhead processing that occurs when context switching. However, tasks are actually coroutines which are very different from threads. While threads are for concurrent processing, coroutines are still sequential so there is no context switching to process. It's really just a fancy way to give a sequence of directions to the program while writing it in a non-sequential way.

tl;dr Tasks are not threads and are not slow.

Also, have a stackoverflow link.
« Last Edit: November 20, 2012, 09:11:20 AM 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.

Byronyello

  • "The Western Non-Otaku That Respects and Likes Touhou"
  • I guess that'd be my title in a Touhou game...
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #320 on: November 21, 2012, 12:28:06 PM »
Ah! Thank you for correcting me. It seems then, that object bullets inherently are slower compared to those created with CreateShotX()... Or at least, that's what the speed of my scripts show. Hmm. (Maybe I should just try to get a less crappy computer so that it can handle all of this object bullet crap.) Anyway, surely CreateShotX and objecy bullets would have the same underlying code? (Waits to be corrected.)
(Strike-through indicates a clear)
Hard Clears: EoSD, PCB, IN, MoF, SA, UFO, TD, DDC.
Lunatic Clears: Someday, perhaps.
Extra Clears: EoSD, PCB, PCB Phantasm, IN, MoF, SA, UFO, TD, DDC.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #321 on: November 22, 2012, 12:26:12 AM »
/* please don't kill me because of my poor English */

Maybe a small detail but...

I was reading some script and I can't help but notice ";" was missing in some subroutine like "return" and such, but it doesn't prevent the script to work perfectly
I usually code in C/C++ and to see such a thing without the final ";" is well very irritating? shocking? unbearable XD ?
And here is my question (the question itself seems to be the answer, so I need a confirmation :D ) :

how does Danmakufu handle that ?
and for include_function "something.txt" and UserShotData script cases ? (it doesn't work with ";"  for the latter, why?)

« Last Edit: November 22, 2012, 12:29:03 AM by nono_kaki »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #322 on: November 22, 2012, 01:19:21 AM »
I got applocale working, and the script doesn't have any errors (because I copied it), and when I click any script, I click play and nothing happans, i click again and Danmakufu X's out.
« Last Edit: January 18, 2013, 10:09:48 PM by Qwertyzxcv »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #323 on: November 22, 2012, 02:58:32 AM »
Chaque script est interpr?t? compl?tement par le moteur de script de Danmakufu, alors c'est simplement un caprice de l'interpr?teur. Les scripts de balle-d?finition n'ont besoin pas des points-virgules, car aucun d?claration y est ex?cut?; il pourrait aussi bien ?tre XML ou quelque chose. D?clarations avec # sont headers donc ils sont aussi interpr?t?s. Les d?clarations #include sont remplac?s par le script r?f?renc?, alors encore rien est ex?cut?, et on ne besoin pas des points-virgules.

Je ne suis pas certain si return toujours y besoin des points-virgules, je ne les utiliserais pas quand m?me. Mais je sais que Danmakufu vous permet d'omettre les points-virgules s'il y a seulement une d?claration dans des brackets comme while(x > y){ z = a } mais c'est tr?s bizarre et je ne ferais jamais sugg?rer les omettant seulement parce que vous le pouvez.

(EN: Everything is interpreted by Danmakufu's scripting engine, so it's basically just an interpreter quirk. Shot data scripts need no semicolons because no statements are being executed, it might as well be XML or something. Statements with # are headers and are also just interpreted. The #include statements are just replaced by the referenced script, so again nothing is being executed.

Not too sure about return not requiring semicolons since I always use them anyways. I do know Danmakufu allows you to omit semicolons if a statement is the only one in a bracket, like while(x > y){ z = a } but it's still really weird and I would never suggest omitting them just because you can.)
« Last Edit: November 22, 2012, 03:31:07 AM by Drakums »

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #324 on: November 22, 2012, 05:09:59 AM »
How do I use Lymia's .dat packer to make a .dat file and have it run in danmakufu?

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #325 on: November 22, 2012, 07:05:26 AM »
Drag your folder onto compress.bat or pack.bat (/verbose) and put the output.dat in your script folder.

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #326 on: November 22, 2012, 05:37:51 PM »
How do I use the command line interface in Windows XP? Right now i am getting an error message that reads, "Error: Unable to access jarfile th_dnh_archiver.jar" by clicking and dragging.
« Last Edit: November 22, 2012, 06:05:10 PM by Swerfawe »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #327 on: November 22, 2012, 10:20:30 PM »
With the command line, it is always possible to cd (change directory) to the directory in which the jar is located and then open it that way. On Windows, however, I can't help.

Delfigamer

  • * Merry, bride, absolute (HR)
  • of course the best girl never wins
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #328 on: November 22, 2012, 11:10:10 PM »
How do I use the command line interface in Windows XP?
[Win+R], type "cmd" and press [Enter].

Right now i am getting an error message that reads, "Error: Unable to access jarfile th_dnh_archiver.jar" by clicking and dragging.
Are you sure "th_dnh_archiver.jar" and that .bat file are in the same folder? Didn't you move that .bat without other files?

The Jealous Witch did nothing wrong.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #329 on: November 23, 2012, 02:32:00 AM »
Everything is in the same file, and I only ever moved it as a whole folder. To make sure, I redownloaded the files and extracted them without moving anything and got the same problem. None of the .bat files seem to know the .jar file is in the same folder.