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

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1530 on: October 11, 2018, 07:00:32 PM »
I'm thinking about drawing a boss sprite sheet.
What is a good number of animation frames for idle/movement poses, and what rate is it good for these frames to be cycled?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1531 on: October 11, 2018, 10:05:43 PM »
That really just art. The framerate is going to depend on how many frames you draw in order for it to look as intended. The number of frames you draw are going to depend on how smooth or varied you want the animation to be versus the amount of effort. Look for examples of animations you like and just try things.



Reminder there's an unanswered question from the previous page:
Hello, everyone. I'm trying to implement a replay system, but this error on the picture always pops up when i finish writing the name. I use default replay script as the base. It resulted in the same error even before I reworked it. What could be the issue?
Here's replay scirpt and part of the package I call it in. Hope, that's enought

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

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1532 on: October 20, 2018, 07:21:54 AM »
How do you create beams of the type that are seen in the Extra of Great Fairy Wars?
So far, I have tried using lasers, but they are very bright, and are bullet-shaped. I would ideally prefer something in a cone or triangular shape.

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1533 on: October 20, 2018, 10:36:48 PM »
Is there any simple background scripts I can look at? I'm trying to make one to reference later, but I keep running into problems that turn into another problem once I fix it.  (One moment the brightness increases every non-spell, and next the effect won't even show up, etc. etc. )

The default isn't really helping me, and I'm starting to get a bit of a headache from it  :ohdear:.

if you actually want to look at the mess, here you go https://pastebin.com/sAHLmt8J
Quick edit: yes, Textures is spelled wrong. I was lazy and kept it for now
Edit: I can't specify to save my life, the current issue is an effect won't appear. The moon is on it's own, so there's no way it's covering it up.
« Last Edit: October 21, 2018, 03:58:24 AM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1534 on: October 21, 2018, 01:15:30 AM »
How do you create beams of the type that are seen in the Extra of Great Fairy Wars?
So far, I have tried using lasers, but they are very bright, and are bullet-shaped. I would ideally prefer something in a cone or triangular shape.

You could probably make it work with lasers if you turned their alpha down and made cones or triangles out of a bunch of small lasers. Probably not the most efficient method though.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1535 on: October 21, 2018, 03:27:55 AM »
if you actually want to look at the mess, here you go https://pastebin.com/sAHLmt8J
This seems more or less fine for something simple. What is the current problem? Are you only running the script once at the start of a stage, or are you starting it on every pattern? That would be my guess as to why things are getting brighter.

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

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1536 on: October 21, 2018, 03:56:23 AM »
This seems more or less fine for something simple. What is the current problem? Are you only running the script once at the start of a stage, or are you starting it on every pattern? That would be my guess as to why things are getting brighter.
I forgot to specify (will I ever learn  :V) that this scripts problem is the effect not showing up (in this case, the fog.)for the basic(nonspell?) background. That's on my end, sorry.

Glad to know it isn't an obvious issue, though (not yet at least, I have a weird feeling it is though). It's just the moon (which is small) and the fog, so it can't be covering it up.
« Last Edit: October 21, 2018, 03:59:29 AM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1537 on: October 21, 2018, 06:14:45 AM »
Surprise, it is ;P
In the nonspell part you imply that if a spell is active, make those objects visible, rather than invisible. The moon is showing up because you never wrote a line for Obj_SetVisible(obj2, alpha > 0) so it isn't being set to invisible to begin with.

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

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1538 on: October 21, 2018, 03:07:01 PM »
Surprise, it is ;P
In the nonspell part you imply that if a spell is active, make those objects visible, rather than invisible. The moon is showing up because you never wrote a line for Obj_SetVisible(obj2, alpha > 0) so it isn't being set to invisible to begin with.
hahahaha  :V

While you got it the other way around (I wanted both to show, the fog was being invisible (I hope I'm making sense)), that was the source.  I didn't know what it did so I didn't touch it...

One more thing though:

It's taking a long time to load the stage. 5-10 seconds too long. Is this normal? Is there things in a background that affect loading time? How can I avoid that?
« Last Edit: October 21, 2018, 10:17:51 PM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1539 on: October 21, 2018, 09:14:41 PM »
I know the fog was invisible, I'm saying that the moon being visible is actually accidental because you forgot a line of code. What you wanted to do is add the other Obj_SetVisible and then swap where you say alpha=255 and alpha=0.

alpha > 0 is an expression like you'd put in an if statement that resolves to either true or false. So you can use it directly like that instead of doing if(alpha > 0){ Obj_SetVisible(obj, true); }else{ Obj_SetVisible(obj, false); }

Or really you could just make everything more clear in the code by removing all the `alpha` stuff and have it be like

Code: [Select]
let frame = 0;
   
loop {
    Obj_SetVisible(obj1, !bSpell); // Visible only when spell not active
    Obj_SetVisible(obj2, !bSpell); // Visible only when spell not active
    ObjSprite2D_SetSourceRect(obj1, 0, 0 + (frame*2) % -512, -512, -512 + (frame*2) % -512);
    frame++;
    yield;
}
« Last Edit: October 21, 2018, 09:16:35 PM by Drake »

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

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1540 on: October 21, 2018, 10:15:48 PM »
stuff
Ah, I see. I was just confusing myself then. Thank you!
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1541 on: October 22, 2018, 06:53:17 AM »
You could probably make it work with lasers if you turned their alpha down and made cones or triangles out of a bunch of small lasers. Probably not the most efficient method though.

This method is okay, but the beam's colour then fades as it gets further away from the source, since the lasers are spreading apart. Is there some way to vary their alpha along the length of each laser to counterbalance this effect?

Keegster2

  • Green shroom
  • The guy that was dead for like 5 years
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1542 on: October 25, 2018, 08:05:03 AM »
I use Windows 10, and Danmakfu's window is really weird. When the window is expanded, the actual game covers only a portion of the window; the rest is just gray space. When not expanded, only part of the game is visible, meaning I can only really play with the former. The config program doesn't work, either. I can't close the program in any way but shutting it down with Task Manager. Is this a problem with Windows 10 in general, or is it specific to how I'm using Danmakufu? (For the record, I do not have AppLocale. I have no idea if these problems are all connected to me not having it.)
"I'll give you old-timey, you mountebank!"

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1543 on: October 25, 2018, 05:16:45 PM »
I use Windows 10, and Danmakfu's window is really weird. When the window is expanded, the actual game covers only a portion of the window; the rest is just gray space. When not expanded, only part of the game is visible, meaning I can only really play with the former. The config program doesn't work, either. I can't close the program in any way but shutting it down with Task Manager. Is this a problem with Windows 10 in general, or is it specific to how I'm using Danmakufu? (For the record, I do not have AppLocale. I have no idea if these problems are all connected to me not having it.)

Danmakufu 0.12m or ph3?

If it's ph3, the window size is fixed, but it should run regardless of locale.

If it's 0.12m, you MUST use Japanese Locale to avoid a crash.

Are you attempting to fullscreen the window or something? It may also help to provide a screenshot so that we can better understand your problem.

Keegster2

  • Green shroom
  • The guy that was dead for like 5 years
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1544 on: October 25, 2018, 07:27:10 PM »
Danmakufu 0.12m or ph3?

If it's ph3, the window size is fixed, but it should run regardless of locale.

If it's 0.12m, you MUST use Japanese Locale to avoid a crash.

Are you attempting to fullscreen the window or something? It may also help to provide a screenshot so that we can better understand your problem.
Dang it, I forgot to mention my version. It's ph3. Here's some photos of what the window looks like in both sizes.

[attach=1] [attach=2]
"I'll give you old-timey, you mountebank!"

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1545 on: October 25, 2018, 10:30:49 PM »
This seems like some sort of odd graphics card issue. The window not expanding to fit fullscreen is not uncommon, and usually there's an option in one's graphics card settings to change how fullscreen behaves. The game size seems to be 800x600 in both cases, but your window size is the default 640x480 (hence the clipping), so that's uh quite strange.

I've attached a config file with default settings, can you plop this in your folder and see if this changes anything? Also, can you describe what you mean by the config.exe not working?

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

Keegster2

  • Green shroom
  • The guy that was dead for like 5 years
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1546 on: October 26, 2018, 12:15:03 AM »
I've attached a config file with default settings, can you plop this in your folder and see if this changes anything? Also, can you describe what you mean by the config.exe not working?
I can change the window style settings in config.exe just fine, but I can't change the screen refresh rate to 1/2 or back to 1/1, if I change it to 1/3 or Flexible. The close, Start Game, OK, and Cancel buttons don't do anything when I click on them. The Exit command located in the File(F) button in the taskbar does nothing, either, even when I press Alt + F4. In addition, despite the window style being set to a window, the window size section is completely blank.
The Danmakufu Wiki says to set my compatibility mode to Windows 2000 in order to get it working, but Windows 10 doesn't have that as an option. I've tried setting it to the earliest version available, Windows 95, but that didn't work.
"I'll give you old-timey, you mountebank!"

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1547 on: October 26, 2018, 01:39:47 AM »
That is very wrong, there aren't the tabs for Device/Key/Option either. Have you tried using the config.dat file I provided? Is this a fresh download? If not, can you try redownloading from the main site?

To be clear, this should not strictly have anything to do with W10; people use DNH fine with it without any compatibility settings, including myself. If you're asking because this is a new computer, it could be any number of things, but I see this is a laptop so my suspicion is immediately with the graphics.
« Last Edit: October 26, 2018, 01:43:12 AM by Drake »

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

Keegster2

  • Green shroom
  • The guy that was dead for like 5 years
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1548 on: October 26, 2018, 01:45:41 AM »
I have no idea how to use the .dat. Do you just place it in the same folder as config.exe?
I'm 100% sure I'm using the latest version from the original site. I tried uninstalling it previously, but it didn't fix any of my problems. (And for the record, this is not a new laptop. I've had it since last year.)
"I'll give you old-timey, you mountebank!"

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1549 on: October 26, 2018, 02:00:41 AM »
Yes, just place it in the folder and overwrite the old one, that's where the settings are saved that you'd modify with config.exe, so I'm just getting around the program not working for you.

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

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1550 on: October 26, 2018, 12:36:52 PM »
How does one pass a value to a task by reference?

Specifically, I'd like to pass an array containing shot object ids, which can be managed by three separate shot-generating tasks at once.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1551 on: October 26, 2018, 02:10:05 PM »
There are two methods I can think of to achieve what you are trying to do:

One is to make the array global. There will be no race conditions due to the single threaded execution, but you will need to maintain the array properly.

The other is to forcefully 'pass by reference' (not really passing by reference) using Obj_SetValue. In this case, you have an object whose ID is passed to the tasks, and the Object has a value set to the array. Any changes to the array within a task will be consistent across the tasks.

In both cases, be aware that the order of execution for the tasks is not predictable, so you cannot expect the array to be updated by certain tasks in a certain order.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1552 on: October 26, 2018, 05:07:32 PM »
Forgive me, but I've never used this function before, and I'm not completely clear on what it's doing from the documentation alone.
Is it creating a pointer with a character ID?

It also seems to be suggested that I may have to clean up after finishing with the 'key' by using Obj_DeleteValue(), is this correct?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1553 on: October 26, 2018, 05:14:15 PM »
Forgive me, but I've never used this function before, and I'm not completely clear on what it's doing from the documentation alone.
Is it creating a pointer with a character ID?

It also seems to be suggested that I may have to clean up after finishing with the 'key' by using Obj_DeleteValue(), is this correct?

Object Values are like extra attributes.

Obj_SetValue(obj, "New_Field", <value>) uses the integer Object ID to locate the object instance, then adds the attribute "New_Field" to the instance. The type of "New_Field" is defined to be the type of the value.

Note that the attribute is local to the instance of the object. When the object is deleted, all its attributes are deleted as well.

I would not use the term pointer in this case since Danmakufu doesn't have Pass By Reference at all.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1554 on: October 26, 2018, 05:37:55 PM »
Object Values are like extra attributes.

Obj_SetValue(obj, "New_Field", <value>) uses the integer Object ID to locate the object instance, then adds the attribute "New_Field" to the instance. The type of "New_Field" is defined to be the type of the value.

Note that the attribute is local to the instance of the object. When the object is deleted, all its attributes are deleted as well.

I would not use the term pointer in this case since Danmakufu doesn't have Pass By Reference at all.

Um... So it's defining a type?
How exactly is this used to reference obj from a task?
And is this different from the what would be returned by making a variable '= obj' ?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1555 on: October 26, 2018, 06:55:13 PM »
Um... So it's defining a type?
How exactly is this used to reference obj from a task?
And is this different from the what would be returned by making a variable '= obj' ?

Danmakufu doesn't require explicit type declarations.

As long as you have an object ID, you can access the object from any location as long as it has not been deleted.
Object IDs can be passed as parameters to a task or function.

I don't quite understand what you mean by '= obj'.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1556 on: October 26, 2018, 07:27:33 PM »
Danmakufu doesn't require explicit type declarations.

As long as you have an object ID, you can access the object from any location as long as it has not been deleted.
Object IDs can be passed as parameters to a task or function.

I don't quite understand what you mean by '= obj'.

My last question was querying if there would be a difference between using:

let objID = obj;
Task(objID)

...as opposed to:

Obj_SetValue(obj,"New_Field",<value>);
let objID = "New_Field";
Task(objID)

Incidentally, is this the right way to use this function for the purpose I'm intending?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1557 on: October 26, 2018, 08:42:59 PM »
No, that isn't correct.

Object value tables are essentially dictionaries mapping strings to arbitrary values, and the table is attached to an object. Common Data are exactly the same thing, but are program-global instead of object-local.

Code: [Select]
let obj = Obj*_Create();
Obj_SetValue(obj, "field", value);
let x = Obj_GetValue(obj, "field"); //-> x = value

Sparen is suggesting that something like this is possible:

Code: [Select]
let obj = Obj*_Create();
Obj_SetValue(obj, "shots", shot_array);
Task1(obj);
Task2(obj);
task Task1(){
  let local_shot_array = Obj_GetValue(obj, "shots");
  // modify local_shot_array
  Obj_SetValue(obj, "shots", local_shot_array);
}
task Task2(){
  let local_shot_array = Obj_GetValue(obj, "shots");
  // modify local_shot_array
  Obj_SetValue(obj, "shots", local_shot_array);
}

Personally I don't think there's much reason in this case not to just use the function scope here unless we're given more info:

Code: [Select]
let shot_array = bla;
Task1();
Task2();
task Task1(){
  // access shot_array directly
}
task Task2(){
  // access shot_array directly
}

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

HumanReploidJP

  • The Scripter with Something of Common Sense
  • "Start the life of an idol! Let's get STAR~ted!"
    • HumanReploidJP's Youtube Channel
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1558 on: October 28, 2018, 02:24:11 PM »
So as I put an opening bracket in the save replay, this error pops up.

[attach=1]

Is there anything than can help? Let me know if there's one.

Please Respond! :wat: Thank you.
MiraikeiBudoukan (Futuristic Vineyard) Game Concepts (WIP)
(Non-Touhou, yet bullet-hell-Inspirable (Like JynX). Don't get serious.)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1559 on: October 29, 2018, 02:09:34 PM »
So as I put an opening bracket in the save replay, this error pops up.
Is there anything than can help? Let me know if there's one.

Please Respond! :wat: Thank you.

What do you mean by 'I put an opening bracket in the save replay'? Please walk us through your code and the steps taken to generate the error. It may be a case where you need to use osb/csb or disable Syntactic Analysis on a Text Object, since [ and ] have historically been fickle in regards to replays.