Author Topic: ※ Danmakufu Q&A/Problem thread 3 ※  (Read 468359 times)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #420 on: November 28, 2016, 07:13:26 AM »
Thank you so much for your help!! I think I figured it out. If you have another way, I'd love to see it as well.

Thank you so much for the hints. They really helped!! All I added in "task BulletCommands(objBullet)" was "if(Obj_IsDeleted(objBullet)) {return;}" and it seems to work perfectly. Again thank you so much!!
Ah, you figured it out with the easiest and most effective solution.

An alternative I also designed was enclosing the loop section in the while-statement. The difference is, if I am not mistaking, that in your case the loop is always executed but "returned" due to the check and in my alternative case, the loop is never executed if the master bullet is gone. Not that there is a huge performance difference for this. So you're fine. Well done.

Keep in mind that this problem goes for any object, not just bullets. For example: If you try to spawn familiars from a fairy which is gone, the familiars will also have no XY to spawn and thus default appear at 0,0. If you're curious about this: You can always debug the X Y values of the master using the text objects to draw them on screen.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #421 on: December 03, 2016, 11:00:12 PM »
Hi! I have had some experience with Danmakufu and I am ready to move into stage scripts with stage enemies in it. However, I am experiencing strange issues where the stage enemies do not render correctly because they do not spawn with hit boxes and do not animate. When I put a wait function before spawning the enemies, they will not spawn at all. I am not sure if it is a rendering issue or if I am doing something wrong with the stage script itself.  :ohdear:

Here are the two scripts:
Fairy Rendering Script: http://pastebin.com/jjSp70eV
Stage Script: http://pastebin.com/uDJEC0Af

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #422 on: December 05, 2016, 06:10:01 AM »
Shouldn't your rendering function be a rendering task instead?
Since it's a function, danmakufu waits until the function is complete to continue with the main section of code.
As a result, the script will wait until the render function is complete before moving on, and since the render function doesn't complete until the fairy is deleted, following enemies wouldn't spawn.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #423 on: December 06, 2016, 12:00:47 AM »
Okay, so I turned the function into a task instead and there hasn't been a change. The fairies still act strange and I am still trying to find a solution for this, but thank you for the suggestion. It narrows down the issue more since I have been stuck on this issue for several months now. It could be possible that I just haven't found a correct way to summon them.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #424 on: December 06, 2016, 05:25:07 PM »
Hi again.
I've done some further testing with your provided code and I have a question:
When you say the fairy doesn't animate, do you mean it gets stuck at the first frame? or do you mean it freezes at the end?
If the latter, that's because that fits with the code. Since animFrame2 is never set back to 0 like animFrame, it continues to be >45 forever
If the former, I'm afraid I can't help you, because I don't understand the issue.
I was also unable to reproduce your issue with hitboxes.

P.S As an unrelated note, I noticed that you use absolute pathing in your stage script
That is, your paths all start with "script/Stage Test/<path>"
This shouldn't break anything, but it's generally considered to bad.
This is because if, for example, you moved or renamed the Stage Test folder,
or released it onto the internet, every  "script/Stage Test/<path>" would have to be changed manually
You can easily fix this by making the paths relative
That is, replace  "script/Stage Test/" with GetCurrentScriptDirectory() ~ "<path>
As the name suggests, GetCurrentScriptDirectory() gets the folder containing the current script's path and returns it as a string.

Sorry I couldn't be more help.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #425 on: December 06, 2016, 05:53:56 PM »
None of that matters. He misspelled main loop. Loop needs to be with a capital L >> @MainLoop

The best thing about Danmakufu is that it totally accepts Mainloop. However, because it is not THE actual MainLoop, it will create one for you implicitly (behind the scenes). Meaning that his MainLoop is never yielded.

This is also the reason why none of your tasks or functions or collision handling works. For the engine to look for other tasks/routines to perform, the MainLoop needs a yield.

Edit: You can add:
Code: [Select]
@DumbFakeShit {

}
To your code and Danmakufu won't even complain for one bit.

Always return back to basics when you're having issues. Don't start trying everything when you haven't checked the basics. Of course, this is also a matter of experience for effectively conducting trial & error. I'll explain:

I didn't instantly catch the error at first glance. I first simplified his code and merged it so it was one file. Then I ditched the entire render codeblock and spawned 1 fairy just on the screen with just the collision functions. Fairy was there, but my bullets went through and the homing amulets of my Reimu were going crazy. Neither she would go Pichuun when touching. The following question popped into my mind:
Q: Why isn't there collision? 
A: Collision functions are definitely spelled correctly (quadruple checked on wiki). The while loop is solid. Not the problem.

Q: Is there something wrong with the script?
A: Dunno. Is there? Well, let us find out. Let's write a new stage file from scratch in a different file with a @Initialize  @MainLoop @Finalize and paste the same exact code -> WTF, it works now?

Q: So what is going on with the structure or the old file?
A: Comparing time! Check @Initialize -> spelled correctly,   check Mainloop. . . Mainloop? Lower case L? Aha! Gotcha!

Mistakes were made, hopefully lessons were learned.


Edit2:
This shouldn't break anything, but it's generally considered to bad.
This is because if, for example, you moved or renamed the Stage Test folder,
or released it onto the internet, every  "script/Stage Test/<path>" would have to be changed manually
Actually, nothing is considered bad. Both relative and absolute pathing are fine to use. It is up to the programmer to deal with it correctly. While it is true that renaming would cause things to break, it has nothing to do with releasing to the internet as if you ship the entire structure. The downloader just has to unpack it inside the script directory. He/she shouldn't touch the folder structure or names, obviously.
« Last Edit: December 06, 2016, 07:06:36 PM by Helepolis »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #426 on: December 07, 2016, 02:55:20 AM »
So the error was because I had to captialize the L  :o Thank you so much for solving this really simple error. I feel extremely stupid.

and @Asthmagician, I was planning to use relative pathing soon in the future after I finished creating the script. Thanks for being extremely helpful and requesting solutions.

update: So after having the stage enemy issue solved, I continued working on the stage script and letting them shoot bullets until I realized there's another issue where the script may sometimes crash the whole Danmakufu engine with no error. I have examined the script many times and realised that it could be that I am spawning too many enemies. Does Danmakufu automatically delete enemies after they have left the screen? I could provide the code again if anyone wishes. Sorry, I am not that experienced with stages however
« Last Edit: December 08, 2016, 02:32:27 AM by lolpudding »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #427 on: December 08, 2016, 02:00:24 PM »
Short answer: No, by default objects are NOT autodeleted when they leave the screen.

Longer answer: Do you have the console log window open while testing? The log window can be activated through the config.exe by ticking the box for it. It will show info about number of bullets, objects, tasks running etc.


Edit
Got a question of my own for implementing Continue System. I can vaguely remember I might have asked this before (unsure) though here I go (again perhaps):  How did you do it mechanical wise? (if you have a continue system)

The problem I am having is that STATE_END is kicked in for your player when you have zero lives left and go Pichuun. Meaning your player won't respawn, even if you added lives. So I am guessing the trick is to prevent the player from going into that state.

Handling STATE_DOWN at zero lives is not working as intended. Example:
Code: [Select]
if(GetPlayerState == STATE_DOWN && GetPlayerLife == 0 && GetCommonData("remainingContinue", 0) > 0) {
SetPlayerLife(3);
}
Because technically you're on your last life. Validating it at -1 is non existent, because STATE_END will kick in.

So what do I do? Add +1 life, adjust the HUD so if you're at 1 life, it shows 0 hearts?
« Last Edit: December 08, 2016, 08:42:00 PM by Helepolis »

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #428 on: December 08, 2016, 11:14:03 PM »
So what do I do? Add +1 life, adjust the HUD so if you're at 1 life, it shows 0 hearts?
Yes, actually. That is the only way I managed to make it work. In my experiments, once STATE_END was triggered there was no stopping it.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #429 on: December 09, 2016, 06:32:20 AM »
Yes, actually. That is the only way I managed to make it work. In my experiments, once STATE_END was triggered there was no stopping it.
Check. If that is the case, then we have no choice.

It also somewhat surprised me that the creators of Star Mythology aren't using a continue system at all.

Edit
Progress update: HUD shows no filled hearts. Now I just need to re-map the triggering of the menu and not use CloseStgScene. Thanks Porygon
[attach=1]


Edit2:
Almost there. Managed to now make STATE_END kick in when the player is on the last life. I added a check in my stage heart beat loop. When the player had no continues, plus was hit and about to enter his last life, it would quickly call SetPlayerLife(0); to sync the game. Therefore, the next hit will sure trigger STATE_END for the stage script and also trigger STAGE_RESULT_PLAYER_DOWN in the package script.

Now I need to make sure the Continue choice is not available at the final ending screen and also prevent replays from being saved once a continue is used.  (The original games also prevent this)

* Helepolis wipes sweat, blood and tears.

That was some ride for me after being away from my game quite a while.
« Last Edit: December 09, 2016, 09:28:19 PM by Helepolis »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #430 on: December 10, 2016, 12:37:42 AM »
Short answer: No, by default objects are NOT autodeleted when they leave the screen.

Longer answer: Do you have the console log window open while testing? The log window can be activated through the config.exe by ticking the box for it. It will show info about number of bullets, objects, tasks running etc.

Ah, I dont use the log window, but it seems really useful. It turns out the stage constantly crashed because I spammed "if(ObjEnemy_GetInfo(obj, INFO_LIFE) <= 0){break;}" too many times and found a way to let the enemies delete themselves.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #431 on: December 10, 2016, 08:38:48 AM »
Probably you've done similar, but the most common method is to delete an enemy once it crosses a certain boundary of your play field.

For example I use:
Code: [Select]
// leave field == delete
if(ObjMove_GetX(obj) < GetClipMinX-17 || ObjMove_GetX(obj) > GetClipMaxX+17 || ObjMove_GetY(obj) < GetClipMinY-17 || ObjMove_GetY(obj) > GetClipMaxY+17) {
Obj_Delete(obj);
}

GetClipMinX and such are self written functions which quickly get the minimum X coordinate for my play field.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #432 on: December 10, 2016, 10:05:14 AM »
Semi-relevant reminder that if you have a package script and start a stage (, etc) from it, script IDs are reset and the ID of the original package script is dropped, so you can't target events to package scripts directly, nor to miscellaneous scripts started from the package before the stage begins. NotifyEventAll will still work.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #433 on: December 29, 2016, 12:02:33 PM »
Okay, so I'm having a problem that was reported in one of these threads before but never had an answer posted...however, the project that was having the problem appears to have progressed past it, so I figure it's worth asking if a solution was found at some point. (For reference, that report was here --- https://www.shrinemaiden.org/forum/index.php?topic=16584.540 --- by a user by the name of Eredom)

Basically I'm attempting to insert BGM into a script, but it skips ahead a few seconds the first time one of a few specific conditions are met. These are:
- Whenever a spell card is declared
-- Whether the default spell card sound effect was changed, but NOT if it was removed
- Whenever a "bad" sound effect is used
-- Does not happen if the place where the "bad" sound effect was used is changed to a "good" sound effect
-- Whether a sound effect is "bad" or not seems to be random (my shot sound effect is fine, but another one for shots moving around without being "fired" isn't)

It doesn't skip again after the first time. I've tried different BGMs and they also skip. I followed the instructions Helepolis gave when this came up before. Code is as follows:

For setting up the BGM (NOTE: Has been tried without passing loop arguments, and with the loop starting at 0) :

Code: [Select]
function SetUpBGM(bgmpath, loopStart, loopEnd) {
let obj = ObjSound_Create();
ObjSound_Load(obj, bgmpath);
ObjSound_SetSoundDivision(obj, SOUND_BGM);
ObjSound_SetLoopEnable(obj, true);
ObjSound_SetLoopTime(obj, loopStart, loopEnd);
return obj;
}

For running the BGM (placed in the @Initialize section of the Plural) :

Code: [Select]
let bgmpath = GetCurrentScriptDirectory() ~ "/sound/bgm.ogg";
let bgmObj = SetUpBGM(bgmpath, 13.6, 177.2);
ObjSound_Play(bgmObj);

For setting up a sound effect:

Code: [Select]
function SetUpSoundEffect(soundpath, volume) {
let obj = ObjSound_Create();
ObjSound_Load(obj, soundpath);
ObjSound_SetSoundDivision(obj, SOUND_SE);
if (volume > 0) {
ObjSound_SetVolumeRate(obj, volume);
}
return obj;
}

For playing a "bad" sound effect:

Code: [Select]
let moveStarSoundPath = "script/experimentation/Sanae/sound/bulletmove.wav";
let moveSoundObj = SetUpSoundEffect(moveStarSoundPath, 35);
ObjSound_Play(moveSoundObj);

For declaring a spell (nothing fancy) :

Code: [Select]
ObjEnemyBossScene_StartSpell(objScene);
If anyone knows how/if Eredom ultimately solved this problem, I'd greatly appreciate it.

(P.S. I am currently going through Sparen's tutorial set and will probably just move on from the sound section in the meantime, but having it almost-but-not-quite-working is kind of maddening)

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #434 on: December 29, 2016, 04:33:47 PM »
From reading the older posts you linked to, it seems that Eredom tried using a different BGM track (from White Name Spoiled Past) and it worked. That doesn't make much sense to me, but it's possible that it's a problem with the specific track being used. It wouldn't be the first time Danmakufu behaved strangely with specific audio files.

I use a very similar setup to what you do for BGM and sound effects and I've never run into such a skipping problem. Perhaps share with us the specific music track you're using and we can test if that somehow causes problems.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #435 on: December 30, 2016, 01:59:01 AM »
Sure thing...except, as far as I can see, there's no way to attach files to a forum post here? I'm not familiar with any sound or general file uploading services, either, though I probably should be :/. So how should I provide it?

As a side note, Eredom got back to me on Facebook and let me know that you need a .ogg file (check)...with a specific bitrate, preloaded before it needs to be used (not check >_>). So the issue is probably that all my attempts were MP3s converted using Audacity, which produces some kind of variable bitrate. That said, I'll tool around with the export quality setting (which affects the bitrate) and pre-loading all my sound effects and maybe using a .wav file for the BGM (even though this isn't practical for any sort of publicly released script) just to see what works.

EDIT: Well I'll be damned...an export quality of exactly 6 doesn't have any problems (5, 7, and 10 all did!). I guess that solves my issue, hopefully the same export quality works for any other MP3s I screw around with.

EDIT2: Ah, spoke to soon. It just reduces the skipping to the point where if you're at certain points in the BGM you don't notice it.

EDIT3: Okay, so more testing results...6 had minimal skipping, 5, 7, 8, and 10 all had a noticeable skip on the first spell card declare, 9 skips the first time you run the script but doesn't if you restart the script and run it again?? That's bizarre. Maybe I'll find some permutation of things that works.

EDIT4: More testing...6 and 9 skip less but still noticeably, but restarting the script using Danmakufu's default restart function in the menu completely stops the skipping on ANY quality level. (also I might have been imagining the skipping differences for the quality levels >_>)

So...I guess what I want to know now is, how does restarting a Plural script in Danmakufu work? I might be able to pull a solution out of that (simply waiting before playing the BGM didn't work, so I guess I need some way to have the asset "already loaded" in some specific meaningful way)

Anyway this pretty conclusively shows that it's the BGM that's the problem (since modifying it modified the issue), so I'm guessing the lesson is "don't use BGM converted from MP3 using Audacity". If I ever get around to releasing things publicly, I'll have to keep that in mind.

While I'm here, though, how does render priority on bullets work? I tried Obj_SetRenderPriorityI(bullet, <priority>) and setting it to 80+ caused them to render out of place as expected (i.e. treating the top left of the window as 0,0 rather than the top left of the playing area) but bullets with an ostensibly lower render priority were appearing on top of bullets with a higher one. Is there some trick I need to be aware of?

And actually, come to think of it, I have another question...whenever I try to use GetCurrentScriptDirectory() for a #include, Danmakufu crashes. This is irritating because it means all my includes are full filepaths rather than being flexible based on where the script folder is (and I'm trying to separate out things like essential functions and animation data into a separate code file that I can just include in each script). Is there any remedy for this?
« Last Edit: December 30, 2016, 04:55:47 AM by DichotomousCreator »

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #436 on: December 30, 2016, 12:21:38 PM »
You can't directly upload files below a certain number of posts, probably. Keeps malicious users from uploading harmful files.

While I'm here, though, how does render priority on bullets work? I tried Obj_SetRenderPriorityI(bullet, <priority>) and setting it to 80+ caused them to render out of place as expected (i.e. treating the top left of the window as 0,0 rather than the top left of the playing area) but bullets with an ostensibly lower render priority were appearing on top of bullets with a higher one. Is there some trick I need to be aware of?
Higher priority -> drawn on top. Meanwhile stuff under 20 and over 80 uses the window for the origin, while stuff in 20~80 uses the STG frame. Within the same priority, whatever starts drawing later is drawn on top. I'm not sure of the circumstances you're talking about but any object will behave the same way.

And actually, come to think of it, I have another question...whenever I try to use GetCurrentScriptDirectory() for a #include, Danmakufu crashes. This is irritating because it means all my includes are full filepaths rather than being flexible based on where the script folder is (and I'm trying to separate out things like essential functions and animation data into a separate code file that I can just include in each script). Is there any remedy for this?
You need to be aware that there's a difference between the script's main interpretation stage and the pre-processing stage(s). Most of the #Stuff headers are read way in advance for use in the script select menu, but when you open the script there's a pre-processing stage that glues all the #includes together and checks for errors and whatnot. This isn't a place where you can put code, it just reads the path you provide and pastes that script into the current one at that line. To get relative paths you use . to reference current directory and .. for the parent directory, so if in the same folder you have bla.dnh you use #include "./bla.dnh", and if there's a lib folder above the script's folder with a lib_anim.dnh file you'd use #include "../lib/lib_anim.dnh".

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #437 on: December 30, 2016, 04:28:08 PM »
Ah alright, thanks. That should make organizing a bit easier

The issue I'm having with bullet render priorities is that I'm doing this:

Code: [Select]
ascent(j in 0..20) {
    //Fill up shots array here
    Obj_SetRenderPriorityI(shots[j], 50);
}

ascent(j in 0..20) {
    //Fill up shots array here
    Obj_SetRenderPriorityI(shots2[j], 55);
}

and shots in the first array are still appearing over the top of shots in the second array if they were spawned earlier, as though their priorities were identical. The shot arrays are generated in a task which takes a render priority value as an argument (the code above shows the numbers for the sake of clarity) and passes it directly on to each shot generated using the function above.

I wanted to see if there were some weird special rules for making various shots outprioritize each other, since if I set the priority value too high (i.e. 81 and above) it treats the origin differently as I expect it to...but the shots with priority 55 aren't being drawn on top of the shots with priority 50.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #438 on: December 30, 2016, 08:25:18 PM »
Question about arrays:  Was there a function to quickly check whether an Object or value is within the array or do I have to check that manually myself with a loop through the Array?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #439 on: December 31, 2016, 02:51:52 AM »
shots in the first array are still appearing over the top of shots in the second array if they were spawned earlier, as though their priorities were identical. The shot arrays are generated in a task which takes a render priority value as an argument (the code above shows the numbers for the sake of clarity) and passes it directly on to each shot generated using the function above.
Yeah I'm not too sure why that would be the case. I would suspect that the function isn't actually being applied to the objects, but if you can use your method to make them 80+ then that's not the case.

I can do this:

Code: [Select]
task bla(g,p){
  let shots = [-1,-1,-1,-1,-1];
  ascent(i in 0..5){
    shots[i] = CreateShotA1(192, 100, 2, 90, g, 0);
    Obj_SetRenderPriorityI(shots[i], p);
  }
}
bla(SHOT_AMULET_RED, 50);
yield;
bla(SHOT_AMULET_BLUE, 55);

And the priorities work as they should. So I dunno, I'm just going to ask for your actual code so I can look more concretely.


Question about arrays:  Was there a function to quickly check whether an Object or value is within the array or do I have to check that manually myself with a loop through the Array?
Without any other data structures that are more appropriate for contains checks, or other special properties to the data that would make it easier (e.g. the array is already sorted, in which case you can binary search) you're going to have to go through it all.

You can create a dummy Primitive object and use Obj_Set/GetValue with strings of the object IDs as keys, then use Obj_IsValueExists to scrub it together; this is essentially the interface to a hash table, but even now I still haven't bothered to see whether it actually has the properties of a hash table and whether it has too much overhead to be useful. It's probably ok though.
« Last Edit: December 31, 2016, 02:57:36 AM by Drake »

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #440 on: December 31, 2016, 09:33:08 AM »
Bah, guess I'll have to handle it after all. Also good point you make: I was thinking of using 2D arrays for the key value pair behaviour, Obj_Set/Get is far more effective and useful here.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #441 on: December 31, 2016, 11:06:07 AM »
Okay never mind figured it out, I'm constantly applying the priority to the first side of the star rather than applying it to all five sides. I changed the iteration and it's working fine now (I realized that it wasn't in fact the whole star that was being displaced when I set the priority to 81, but rather just the first side). Apologies!

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #442 on: January 04, 2017, 02:17:02 PM »
I've always seen these "%" in scripts. Can anybody say me please, what are they doing? And an example to that (or examples?)   :wat:

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #443 on: January 04, 2017, 03:21:44 PM »
That's the modulo operator. Computing a % b gets the remainder when dividing a by b. For example, 11 % 4 = 3, because when dividing 11 by 4 you get 2, with 3 remaining: 11 = 4*2 + 3. For some other examples,
7 % 2 = 1  (because 7 = 2*3 + 1)
10 % 5 = 0  (because 10 = 5*2 + 0)
2 % 3 = 2  (because 2 = 3*0 + 2)

The most relevant uses you'll see of it are checking to see if (a % b == 0), which is true if a is cleanly divisible by b, and to check (a % 2), which is 0 if a is even and 1 if a is odd.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #444 on: January 04, 2017, 04:01:02 PM »
I begin to remember the nightmares of the higher arithmetic with this "mod" signs  :D
Anyway, it's a nice function. Thank you, Drake, for the clarifying.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #445 on: January 08, 2017, 02:25:22 AM »
'lo everyone. Newcomer here. I've been toying with the creation of some basic patterns, but I'm finding myself stuck on two problems that I can't seem to figure out.

The first is the creation of prefight chatter. While I've managed to display text with ObjText, managed to create image overlays of those speaking, and even creating semi-transparent pictures, I'm still not sure how to put all of this together into one single smooth system for talking. If anyone could tell me how to do this, I'd be grateful.

The second question is related to creating my own bullets. I've created some cuttlefish shaped bullets on a .png file. However, when I try to use them in a pattern, the bullets don't fire at all. If I change the bullet ID to one of the default shots, it fires just fine, so the problem isn't with firing the bullet in the first place.

The pastebin for my shots are here.
http://pastebin.com/fEc2xZgE

Shot constant sheet is here.
http://pastebin.com/cg7QQKzq

And the shot single file is here.
http://pastebin.com/xP3XJyKX

The code that I think is relevant, but I've stared myself blind at it and still can't see the fault if so, is here.
Code: [Select]
#TouhouDanmakufu[Single]
#ScriptVersion[3] //This is required for ph3 scripts
#Title["Border of cliche and beginner"]
#Text["SampleA01:Shooting Bullets Straight Down"]
#BGM ["./LLS - Alice Maestra.mp3"]

//Danmakufu basic has dimensions 384 x 448
//Load the default shotsheet
#include"script/default_system/Default_ShotConst.txt"
#incluce"script/default_system/Extra_ShotConst.txt"

task MainTask{
BoWaP
}

task BoWaP{
    let angleT = rand(0, 360);
    let objcount = 0;
    while (ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
CreateShotA1(102, 134, 3, angleT, 1, 5);
CreateShotA1(282, 134, 3, angleT, 601, 5);
angleT += sin(objcount) * 12; //BOWAP
objcount += 1;
yield;
        }
    }

Thanks in advance.

Junky

  • Just Another Scripter
  • *external screams*
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #446 on: January 08, 2017, 10:19:21 PM »
The next Len'en character on my list is Tenkai. The biggest issue is I have no clue how their borders work and how bullets hitting the edges of the spinning square border spawns on a the edge of another corresponding square border that's spinning in the opposite direction. Conarnar did it within one of his scripts. Sorry if that sounded confusing.
Anyone can be amazing at danmakufu. I believe in you! Push yourself to become the greatest!

(One day I'll become the greatest danmakufu scripter that there ever was.
...
...Got a LOOOOOOOOOOOOOOOOOONG way to go.)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #447 on: January 09, 2017, 01:16:57 AM »
'lo everyone. Newcomer here. I've been toying with the creation of some basic patterns, but I'm finding myself stuck on two problems that I can't seem to figure out.

The first is the creation of prefight chatter. While I've managed to display text with ObjText, managed to create image overlays of those speaking, and even creating semi-transparent pictures, I'm still not sure how to put all of this together into one single smooth system for talking. If anyone could tell me how to do this, I'd be grateful.

Dialogue events require waiting for player input in a blocking manner, as well as other things. Usually, it is implemented as part of a Plural or Stage script. Usually, you must create or use an existing library for the purpose.

The second question is related to creating my own bullets. I've created some cuttlefish shaped bullets on a .png file. However, when I try to use them in a pattern, the bullets don't fire at all. If I change the bullet ID to one of the default shots, it fires just fine, so the problem isn't with firing the bullet in the first place.

The pastebin for my shots are here.
http://pastebin.com/fEc2xZgE

Shot constant sheet is here.
http://pastebin.com/cg7QQKzq

And the shot single file is here.
http://pastebin.com/xP3XJyKX

Firstly, is the file path to the image correct? Secondly, I suggest using LoadEnemyShotData(path/to/shot/definition/sheet). If you never load the shot sheet, Danmakufu will not know that it exists. Simply including the constants doesn't mean anything if they don't refer to anything.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #448 on: January 09, 2017, 05:00:35 AM »
Nah, all that's fine. The load function is just called in the constants file (calling it in the script scope happens to be acceptable). The problem is just

#incluce"script/default_system/Extra_ShotConst.txt"
« Last Edit: January 09, 2017, 05:07:33 AM by Drake »

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #449 on: January 09, 2017, 03:03:54 PM »
Nah, all that's fine. The load function is just called in the constants file (calling it in the script scope happens to be acceptable). The problem is just

#incluce"script/default_system/Extra_ShotConst.txt"

*facepalms*