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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #660 on: June 27, 2017, 11:59:41 AM »
So because im using a mix of tutorials so it won't might work. So instead i did only 1 point, but here's the real problem : After I created this script https://pastebin.com/TF8xTbik it says GetCenterX is not defined.   ??? Why
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #661 on: June 27, 2017, 01:44:24 PM »
Why does this code make the amulets go out from the boss and then ... straight down?
Code: [Select]
task TAmuletChain(dir)
{
loop(20)
{
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let shotObj = CreateShotA1(ex, ey, 1, 270 + (85 * dir), 156, 10);
ObjMove_AddPatternA1(shotObj, 60, 2, GetAngleToPlayer(shotObj));
wait(5);
}
}

In case you're wondering, my intention is to have them go toward the player.

The player is directly below the boss, most likely. GetAngleToPlayer(shotObj) will execute IMMEDIATELY, so the bullet will, at 60 frames, face whatever angle the player was at relative to the boss 60 frames prior. So if the player remains below the boss, the bullet will go straight down at the player. If the player moves 60 pixels to the side after the bullet has been fired but before the 60 frames are up, the old angle (270 degrees) will have already been calculated, and the bullet will go straight down.

A fix would be to have an Object task, say BulletCommands(shotObj), and in this task, wait(60); ObjMove_SetSpeed(shotObj, 2); ObjMove_SetAngle(shotObj, GetAngleToPlayer(shotObj));

I assume that you want the bullets to move in their given speed and angle for 60 frames, then aim at the player.

So because im using a mix of tutorials so it won't might work. So instead i did only 1 point, but here's the real problem : After I created this script https://pastebin.com/TF8xTbik it says GetCenterX is not defined.   ??? Why

You have a few syntax errors in your script. See Line 42.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #662 on: June 27, 2017, 03:21:47 PM »
It solved, but I can't solve this problem https://pastebin.com/0MWfFa3v (It's the same problem and it says its at the 30th line) . I think there's no problem for it but it still failed... and I'm not sure about the laser part, am i right ? or not ?  ??? ??? ???
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #663 on: June 27, 2017, 05:12:20 PM »
It solved, but I can't solve this problem https://pastebin.com/0MWfFa3v (It's the same problem and it says its at the 30th line) . I think there's no problem for it but it still failed... and I'm not sure about the laser part, am i right ? or not ?  ??? ??? ???

You can use Ctrl-F to 'find' certain words and phrases. Before posting to this thread, ensure that all of your braces, brackets and parentheses line up.

If you are unsure how to use Ctrl-F to determine this:

Ctrl-F {
Ctrl-F }

The above numbers (for number of times each character was present in your script) should be the same. For your script, your braces do not match, therefore causing the 'is not defined' error. This syntax error can be easily mitigated by using a Text Editor such as Notepad ++ or Sublime that comes with the ability to collapse and expand blocks of code (blocks referring to code contained within { } in this case).

I also highly suggest using tabs and/or spaces to properly indent your code blocks. This makes it easier to find missing { and }, and will save you a great deal of time in the future.

NOTE: Take a very good look at lines 44-45. It's very obvious that there's something wrong with your code there.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #664 on: June 27, 2017, 07:33:27 PM »
Why is this script making a LOT of noise but spawning no bullets?

https://pastebin.com/ac9vCS09

EDIT: WOW I'm retarded. Yeah, including the actual bullet file would help, wouldn't it...

OK, new problem. WTF does it mean when my console log is spammed with token messages and my stage script doesn't show up?

EDIT: Also solved. I missed a quotation mark. x.x

Problem number 3...  Why is my bomb image not showing up? It's functioning perfectly except for that.
https://pastebin.com/S2Qi3xhh

Aaaaaand, problem number four, perhaps more significant. My bgm is skipping around right when the midboss is called and several times shortly after. I'm fairly sure the problem lies in the stage script (https://pastebin.com/6CUBCupS).
« Last Edit: June 29, 2017, 03:00:39 AM by JayRS »

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #665 on: June 29, 2017, 11:56:34 AM »
I'm trying to create a spell card where the boss shoots 3 randomly aimed bullets that stop when they hit the walls. Then I wait 90 frames and I want to move the three bullets to the circuncenter of the triangle formed by the three of them, but I have no idea how to calculate that... Help?

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #666 on: June 29, 2017, 08:54:12 PM »
OK this music skipping problem is driving me crazy... It happens every time around the midboss. See above post for text files.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #667 on: June 30, 2017, 04:01:33 AM »
Problem number 3...  Why is my bomb image not showing up? It's functioning perfectly except for that.
https://pastebin.com/S2Qi3xhh


Spell objects are not 2D Sprite objects, nor are they Move objects. You will have to use alternatives for the functions you're trying to call.

Aaaaaand, problem number four, perhaps more significant. My bgm is skipping around right when the midboss is called and several times shortly after. I'm fairly sure the problem lies in the stage script (https://pastebin.com/6CUBCupS).
Is the skipping consistent at exactly the same times? If you delay the midboss does the skipping delay in time, or does it still skip at the same points in the music? Have you tried other music to see if that also skips? It could just not like the file you're using.

As far as I'm aware loading issues should mostly affect the running script, not cause music to skip. It also seems unlikely a small script should cause a significant issue, but there are ways to distribute the loading if necessary.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #668 on: June 30, 2017, 03:48:23 PM »
So i finished the delay laser, but when i made the MainTask like this in the script https://pastebin.com/aK8Dcfq0 , the shot data is this :
  ShotData{
   id = 157
   rect = ( 105, 431, 129, 459 )
   delay_color = ( 63, 255, 255 )

It worked, but after like 10 seconds, a very big (coverment 70%) shot flew, not was i expected.
Why ?
Or my MainTask is wrong ???  ??? ??? ???
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #669 on: June 30, 2017, 03:57:19 PM »
So i finished the delay laser, but when i made the MainTask like this in the script https://pastebin.com/aK8Dcfq0 , the shot data is this :
  ShotData{
   id = 157
   rect = ( 105, 431, 129, 459 )
   delay_color = ( 63, 255, 255 )

It worked, but after like 10 seconds, a very big (coverment 70%) shot flew, not was i expected.
Why ?
Or my MainTask is wrong ???  ??? ??? ???

Since you defined your laser to be 398 pixels wide, of course it's going to cover most of the screen :|

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #670 on: June 30, 2017, 04:02:16 PM »
But i wanted only loose lasers from it, im not sure about the shot data though ...
I wanted this DS_BEAM_SKY as loose laser (? im not sure it works?)
It's annoying to read the shot sheets due im really poor at japanese......
SO which is the most suitable for it  ??? ???
Just keep it neutral :3

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #671 on: June 30, 2017, 10:45:24 PM »
Again, that is a loose laser. It just looks like a bullet because you swapped the length and width parameters.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #672 on: July 03, 2017, 05:37:03 PM »
Hello again, I would like to ask for advice about how to avoid creating broken replays? I haven't tested the replay function for my small project yet, but I would like to try and decrease the chances of creating a ruined replay.
« Last Edit: July 03, 2017, 05:38:49 PM by lolpudding »

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #673 on: July 03, 2017, 06:08:49 PM »
This may be a dumb question, but I'm trying to find a way to prevent spawning in (0,0) when a single finishes and another one starts, my plan is to create a function in my library that ends the task where it is called. Is there any kind of command to "end" a task before it finishes?

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #674 on: July 03, 2017, 06:38:10 PM »
So I'm trying to use 2D arrays to hold references to several rings of "orreries" (think PC-98 Marisa) - o[0][0..4] holds the "planets", and o[1..5][0..4] hold the "moons". This is modified from a single with a single ring of orreries, with references held in 1D arrays, which works.

When I try to assign to the 2D array, however, I get the error ""=" is nessasary. (sic)"

The error points to line 4 of the following:

Code: [Select]
//Task for each orrery to update its position and angle
task TOrrery(let arr, let id, let offset, let color, let center) {
let orrery = CreateOrrery(color);
o[arr][id] = orrery; //add the orrery to the global array of orreries         //<----- Error points here
while(true) {
let cx = ObjMove_GetX(center); let cy = ObjMove_GetY(center);
let pos = rot[arr]+offset;
ox[arr][id] = cx+r[arr]*cos(pos); oy[arr][id] = cy+r[arr]*sin(pos);
ObjMove_SetPosition(orrery, ox[arr][id], oy[arr][id]);
let angle = atan2(oy[arr][id] - cy, ox[arr][id] - cx) + angoffset;
ObjMove_SetAngle(orrery,angle+0); //point orrery at center
oa[arr][id] = angle;

yield;
}
}

One instance of this task is run per orrery - another task is responsible for controlling the values in the arrays, which are declared globally (in the header). In this modified version, one version of the "controller" task is run for each ring of orreries, one with the boss given as the center and one with each "planet" as the center. Other tasks are responsible for firing bullets from orreries (not currently called in this single) and making harmless lasers between orreries (because I can't get magic circles to work except when they randomly decide to appear). These tasks are run one per ring, same as the controller task.

The arrays are also initialized in the header as 2D arrays of 0s or references to a dummy bullet as appropriate, as previously I had been getting complaints about "using a variable that has not been set yet". CreateOrrery is a function that simply creates a bullet, sets its blend mode and such, and returns the bullet.

Since as far as I can tell there is in fact an "=" there, I assume the problem is something to do with the syntax of multidimensional arrays.

Edit: My next best guess is that it has to do with the arrays being global, but I didn't have any problems using them globally when they were one-dimensional.
« Last Edit: July 03, 2017, 07:53:57 PM by gameboy17 »
Literally everything in this script will crash and burn.
1CC tracker

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #675 on: July 04, 2017, 07:19:02 AM »
This may be a dumb question, but I'm trying to find a way to prevent spawning in (0,0) when a single finishes and another one starts, my plan is to create a function in my library that ends the task where it is called. Is there any kind of command to "end" a task before it finishes?
You can return from a task and that ends it just as it would a function, but you shouldn't be relying on this because you will start breaking things even more severely due to the timing-based nature of tasks, and it is harder to find those issues and solve them. Spawning at (0,0) is basically always the same easy problem where the tasks keep trying to do things at the enemy position after the enemy is deleted (or in general, anything that keeps referring to an object that's been deleted). All you have to do is properly wrap your relevant tasks in life checks or enemy deletion checks; whichever is more appropriate.


So I'm trying to use 2D arrays to hold references to several rings of "orreries" (think PC-98 Marisa) - o[0][0..4] holds the "planets", and o[1..5][0..4] hold the "moons". This is modified from a single with a single ring of orreries, with references held in 1D arrays, which works.
You can't fully index into multidimensional arrays to set values, unfortunately. You can only set values of the first dimension, so e.g.
Code: [Select]
a = [[0,1,2],[3,4,5],[6,7,8]]
a[1][2]         #=> 5
a[1][2] = 9     #=> error
a[1] = [3,4,9]  #=> ok

If you really want to be able to do this you have to temporarily make a copy of the first index in, set the value on that copy, then put it back in the full array, like
Code: [Select]
temp = a[1]
temp[2] = 9
a[1] = temp
If you want to go deeper than two dimensions you then have to do this recursively.

I've already made a solution for this previously, which you can find here:
https://gist.github.com/drakeirving/0456b9437b4f8a995e8f714b1b131800

All that being said, I still don't think this is the best way to approach your problem. Having 2D arrays of object IDs is generally fine if you aren't changing those values all the time, since to manipulate the objects you only need to get the object IDs from the arrays, which is fine. But the global 2d array of positions and angles don't seem to make sense when you only immediately use them to then set the object properties; presumably you also refer to those arrays elsewhere but you shouldn't need to do that when you can already get each object and then use GetX/Y/Angle. You also seem to have radius and a rotation array but I'm not convinced that can't easily be avoided.

This rearrangement might help, since many people don't seem to know you can do this:

Code: [Select]
function CreateOrrery(let arr, let id, let offset, let color, let center) {
let orrery = // insert all the stuff you'd put in the original CreateOrrery function

task TOrrery(){
while(!Obj_IsDeleted(orrery)) {
let cx = ObjMove_GetX(center); let cy = ObjMove_GetY(center);
let pos = rot[arr]+offset;
ox[arr][id] = cx+r[arr]*cos(pos); oy[arr][id] = cy+r[arr]*sin(pos);
ObjMove_SetPosition(orrery, ox[arr][id], oy[arr][id]);
let angle = atan2(oy[arr][id] - cy, ox[arr][id] - cx) + angoffset;
ObjMove_SetAngle(orrery,angle+0); //point orrery at center
oa[arr][id] = angle;

yield;
}
}
TOrrery();
return orrery;
}

This way you can say let bla = CreateOrrery(...) to be able to keep the object ID and the task will already be started. I'm guessing that the main reason you're saving a bunch of global arrays and using various tasks to control those arrays and cross-reference everywhere is because you didn't know you could do this.
« Last Edit: July 04, 2017, 07:24:41 AM by Drake »

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #676 on: July 04, 2017, 01:29:40 PM »
Right, so i was in the middle of following a tutorial to learn the basics and i was thinking i might as well test if it shows up. I save the script, launch danmakufu and... Nothing. I don't see my script, only the basic samples and EX-Rumia that come with the download. I have checked, double checked and triple checked that my header is written right and there doesen't seem to be any problem. The code obviously isn't complete yet and lacks any sort of bullets but i don't see why i shouldnt be able to even see it?

https://pastebin.com/VrZbi5ma


Moved code to pastebin. Please put large blocks of code in pastebin links to avoid unnecessary scrolling.  --Hele
« Last Edit: July 04, 2017, 05:47:42 PM by Helepolis »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #677 on: July 04, 2017, 06:34:59 PM »
I've recently finished some tutorials and decided to try some things out for myself, but, of course, I've run into a few things I don't understand and a few things that shouldn't be happening.  Here's my code: https://pastebin.com/CFqhiiKt At the bottom of the script is a link to some screenshots. I think the problems are from line 171 onward.  What I wanted this to do was for the blue stream of bullets to circle around the boss, then, after a second, the other colors would join in. The other colored bullets, task shoot, should start firing once count reaches 60, so one second. Instead, it takes about 26 seconds for them to fire. As shown in the fourth screenshot, once the boss dies, the bullets continue to fire from the top left corner of the screen for a second before the script closes. I don't get why the blue bullets speed up after the 26 seconds, either (though that is what I wanted it to do), or why any of the bullets end up on top of each other so often. There are also some gaps in the pattern, but that might be due to a wait.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #678 on: July 04, 2017, 09:06:55 PM »
Right, so i was in the middle of following a tutorial to learn the basics and i was thinking i might as well test if it shows up. I save the script, launch danmakufu and... Nothing. I don't see my script, only the basic samples and EX-Rumia that come with the download. I have checked, double checked and triple checked that my header is written right and there doesen't seem to be any problem. The code obviously isn't complete yet and lacks any sort of bullets but i don't see why i shouldnt be able to even see it?
#BGM header needs quotes to show it's a string #BGM["./rss_4boss"]. When a header fails the parser gives up, so nothing will show up.

I've recently finished some tutorials and decided to try some things out for myself, but, of course, I've run into a few things I don't understand and a few things that shouldn't be happening.  Here's my code: https://pastebin.com/CFqhiiKt At the bottom of the script is a link to some screenshots. I think the problems are from line 171 onward.  What I wanted this to do was for the blue stream of bullets to circle around the boss, then, after a second, the other colors would join in. The other colored bullets, task shoot, should start firing once count reaches 60, so one second. Instead, it takes about 26 seconds for them to fire. As shown in the fourth screenshot, once the boss dies, the bullets continue to fire from the top left corner of the screen for a second before the script closes. I don't get why the blue bullets speed up after the 26 seconds, either (though that is what I wanted it to do), or why any of the bullets end up on top of each other so often. There are also some gaps in the pattern, but that might be due to a wait.
First of all, the reason the bullets keep spawning in the corner is what I just mentioned to GenoCraft. The boss is dead, and soon deleted, but you haven't set it up to stop firing. If the boss dies after you call fire() but before shoot(), shoot will still run, and additionally if that instance of fire hasn't ended it will keep shooting bullets as well. So you have to  be more careful with your zero-life checks.

As for the rest, you're mainly being confused by the asynchronous nature of running tasks, and also probably by your usage of global variables. The other bullets take so long to fire because while you do count from 0 up to 60, you have a yield and a wait(25) between each time, so 26 frames between each increment, which overall will take 1560 frames to reach 60, i.e. 26 seconds.

The blue bullets also speed up at that point because their spin is determined by the global variable count2, which you also start increasing in shoot. Other weird side effects of the global variables is that eventually count would get reset back to 0 which would cause shoot to stop being run and you'd just have the blue bullets again.

Basically you should keep working on getting familiar with how tasks work. Keep experimenting, but maybe try something with fewer moving parts so it's easier to keep track of.
« Last Edit: July 04, 2017, 09:08:29 PM by Drake »

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

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #679 on: July 04, 2017, 10:08:35 PM »
This way you can say let bla = CreateOrrery(...) to be able to keep the object ID and the task will already be started. I'm guessing that the main reason you're saving a bunch of global arrays and using various tasks to control those arrays and cross-reference everywhere is because you didn't know you could do this.

Oh thank god, I can code in ways that make sense again. No more trying to juggle things in global arrays just to pass back a reference!
Literally everything in this script will crash and burn.
1CC tracker

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #680 on: July 05, 2017, 10:44:11 AM »
I don't know if I can ask this here, but it's somehow related to Danmakufu and I'm desperate...
Apparently ever since yesterday I can't open Danmakufu wiki anymore because of this error:
[attach=1]
I tried to search how to install whatever component this requires yesterday, but I really couldn't. Help, I won't be able to finish my RaNGE 17 entry without the wiki  :ohdear:

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #681 on: July 05, 2017, 11:56:13 AM »
The wiki is down. Nothing you can do about it. Try using the archived version until it's fixed: https://web.archive.org/web/20170625051804/http://dmf.shrinemaiden.org/wiki/Main_Page

R. P. Genocraft

  • Craftsman of absolute unpredictability
  • Boundary of productive and lazy
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #682 on: July 05, 2017, 12:24:14 PM »
The wiki is down. Nothing you can do about it. Try using the archived version until it's fixed: https://web.archive.org/web/20170625051804/http://dmf.shrinemaiden.org/wiki/Main_Page
Oh, I see, Thank you.

CrestedPeak9

  • Fangame Advocate
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #683 on: July 05, 2017, 12:29:09 PM »
I've reported the bug to forum, now just wait.
Lunatic 1cc: EoSD, PCB, IN, MoF, TD, DDC, LoLK, HSiFS, WBaWC

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #684 on: July 05, 2017, 01:00:15 PM »
Keep in mind that the Japanese documentation is still available at http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_help_v3.html

Additionally, there are a number of external resources (such as tutorials) that may contain information on some of the various functions.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #685 on: July 05, 2017, 01:19:06 PM »
Right so the script is showing up in danmakufu now, thanks. However, i'm getting a strange error when i open it up. it says i need a } at line 26 but i don't see why i should.

Here's the script: https://pastebin.com/j4b6UnGh
And the error message: https://pastebin.com/CYPzceR1

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #686 on: July 05, 2017, 01:25:12 PM »
Right so the script is showing up in danmakufu now, thanks. However, i'm getting a strange error when i open it up. it says i need a } at line 26 but i don't see why i should.

Here's the script: https://pastebin.com/j4b6UnGh
And the error message: https://pastebin.com/CYPzceR1

You're missing a ; on line 25

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #687 on: July 05, 2017, 04:38:16 PM »
So out of nowhere I started getting error messages that I was trying to use a variable that hasn't been set yet every time anything referenced my boss object. No clue what I did to cause it, so I ended up making several improvements to how I handle spawning the boss that, while they made my code much cleaner, did not (fully?) resolve the problem. (Now instead of manually creating a boss, I have a function in another file that checks if there's a boss stored in common data, if so returns that, and if not creates a new one, stores it in common data, and returns it.)

Anyway, I currently get no problems if I try to load only a few singles, but adding more results in an error saying only "_NextChar:すでに文字列終端です", which Google translates as "It is already a string termination".

That message is very unhelpful, but I have been able to gather some information from the log. First, the error occurs at the very end of the plural registering scenes. Second, it doesn't seem to come from the plural itself, as the plural is able to keep going long enough to write to the log that it's done registering scenes. Third, the function to create/fetch and return the boss goes on to execute, meaning the first single got far enough to call it.

While I'm posting, I'll go ahead and mention my other outstanding bugs in case anyone has any ideas.

*Spell circles not displaying properly/at all
   -Task definitely being run but not getting drawn
   -Static spell circles that stay there for the rest of the fight
*Spellcard bonuses displaying as 0 or 1 instead of actual bonus
   -Bonuses set in EV_REQUEST_SPELL_SCORE and score added in system script
*Game sometimes freezes (not responding) upon starting plural until I comment out all spellcards and re-add them one by one
   -May simply be taking a long time to load scenes; has not yet occurred since enabling the log window
*Player can bomb during Wait singles (my lazy way of adding delays between singles and spawning items)
   -ForbidPlayerSpell is being set but gets ignored?
*No timer noises until the last three
   -The obvious answer is that I've got the wrong name for the first tick SE but I've checked that several times
Literally everything in this script will crash and burn.
1CC tracker

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #688 on: July 05, 2017, 06:41:29 PM »

You have a lot of stuff here, and it seems you have systematic problems. I'll go one by one.

I started getting error messages that I was trying to use a variable that hasn't been set yet every time anything referenced my boss object.

Ensure that the variable holding your boss object has been declared e.g. let objBoss;, and is in each and every single containing a boss.

Now instead of manually creating a boss, I have a function in another file that checks if there's a boss stored in common data, if so returns that, and if not creates a new one, stores it in common data, and returns it.

This is what Boss Scenes are for. Each Single should create its own boss, and should delete the boss at the end of the Single.

You should be doing the following in each Single:
Code: [Select]
    let objBoss;
    let objScene=GetEnemyBossSceneObjectID(); //For spell cards

...

@Initialize {
    ...
    objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist(objBoss);
        ObjEnemyBossScene_StartSpell(objScene); //For spell cards
    ...
}

And in each Plural:
Code: [Select]
task TPluralR{
    let dir = GetCurrentScriptDirectory();
    let obj = ObjEnemyBossScene_Create();
    //Add your singles here, e.g. ObjEnemyBossScene_Add(obj, 0, dir ~ "./S6BNS1.txt");
    ObjEnemyBossScene_LoadInThread(obj);
    ObjEnemyBossScene_Regist(obj);
    while(!Obj_IsDeleted(obj)){
        yield;
    }
    CloseScript(GetOwnScriptID());
}

I don't know what you're doing, but it's definitely not what Danmakufu expects.

adding more results in an error saying only "_NextChar:すでに文字列終端です"

Ensure you have no weird symbols, i.e. no ?????? stuff in your scripts.

*Spell circles not displaying properly/at all
   -Task definitely being run but not getting drawn
   -Static spell circles that stay there for the rest of the fight

Depends on you you handle these. Remember that objects are not deleted at the end of a script unless you use object auto deletion or manually delete. Remember to yield; your main loop as well.

*Game sometimes freezes (not responding) upon starting plural until I comment out all spellcards and re-add them one by one
   -May simply be taking a long time to load scenes; has not yet occurred since enabling the log window

Expect some delay before a plural is loaded.

Player can bomb during Wait singles (my lazy way of adding delays between singles and spawning items)
   -ForbidPlayerSpell is being set but gets ignored?

Ensure that you are calling everything in the proper block. You'll have to provide some code for this one.

I hope this helps somewhat. If you have further problems, please post your code. Additionally, I recommend looking at the sample ExRumia boss. Get a feel for Danmakufu's script structure and how it expects you to work with Singles, Plurals, and Stages.
« Last Edit: July 05, 2017, 06:44:59 PM by Sparen »

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #689 on: July 05, 2017, 08:34:30 PM »
You have a lot of stuff here, and it seems you have systematic problems.

Yep, I'm sort of in the middle of reworking a lot of things that I hacked together before learning the "right" way to do them, so there are plenty of issues.

Ensure that the variable holding your boss object has been declared e.g. let objBoss;, and is in each and every single containing a boss.

Yep, every single has it declared in the header and initialized in @Initialize (using the value returned by the function I mentioned).

You should be doing the following in each Single:
And in each Plural:

That's pretty much what the function does, and I haven't actually removed the code to delete the boss at the end of each single, so I don't think it's causing additional problems. I'll strip out the common data stuff, though, since it sounds like that doesn't work.

Ensure you have no weird symbols, i.e. no ?????? stuff in your scripts.

No mojibake that I've found, although there were kanji in a few places. Removing the kanji didn't fix it.

Depends on you you handle these. Remember that objects are not deleted at the end of a script unless you use object auto deletion or manually delete. Remember to yield; your main loop as well.

I actually went through every single while loop in my code (with Notepad++'s Find All in All Opened Documents) and checked to make sure every single one had a yield (or terminated). I don't think there are currently any tasks getting another copy called every frame due to extra yields - although that has happened at least once, it's definitely not the cause of the current issues.

I'm trying to use the default magic circle script, so I assumed it would clean up after itself, but I'll look through it again to make sure.

Ensure that you are calling everything in the proper block. You'll have to provide some code for this one.

Went ahead and zipped up the folder. Spells and nonspells are named with fruits and numbers (I've mostly been working with the Peaches and Kiwi series), everything else is named something that makes sense. Plural is called Plural.dnh, functions are in Resources.txt.

Sorry to make you sift through this mess - if I had any idea where the problem was I'd narrow it down.

Get a feel for Danmakufu's script structure and how it expects you to work with Singles, Plurals, and Stages.

I'll admit, I basically have no idea what the difference between a plural and a stage is. I'll get to that when I get to it, though. Wait, that's exactly the sort of thing that led to me hacking things together not knowing that you're supposed to use a thing I hadn't read about yet...
« Last Edit: July 05, 2017, 08:37:01 PM by gameboy17 »
Literally everything in this script will crash and burn.
1CC tracker