Author Topic: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (locked)  (Read 269019 times)

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #360 on: May 29, 2012, 06:45:37 PM »
Does anyone know how to upload textures and images onto danmakufu? I've watched Hele's vidyas but no luck for me...


Oh ya BTW, does anyone know how to make a function of how to retrieve a bullet's graphic? I would like to use it to create ZUN-style delays.
« Last Edit: May 29, 2012, 07:53:28 PM by fonduemaster »

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #361 on: May 29, 2012, 11:42:45 PM »
I don't know what you mean for the first part. Please elaborate.

You can get a shot's image ID with ObjShot_GetImageID(obj); though.

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

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #362 on: May 30, 2012, 04:40:52 PM »
What i mean is I want to make danmakufu show an image. The image is 'lol.png' (for an example :V). So what I done is I defined the vertexes and used the triangle strip method etc etc (basically similar to what Helepolis did). But all I got was a white square in the upper right corner which was unable to move at all.
*i!Noob alert!i*

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #363 on: May 30, 2012, 08:08:52 PM »
Triangle strips? You just need OBJ_SPRITE_2D to show pictures, like this:

Code: [Select]
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(obj, path);
ObjSprite2D_SetSourceRect(obj, left, top, right, bottom);
ObjSprite2D_SetDestRect(obj, x1, y1, x2, y2);

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #364 on: May 30, 2012, 10:30:43 PM »
You can still use primitive triangles to draw, but you sort of need to post what you have in order for anyone to see what you're doing wrong.

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

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #365 on: June 04, 2012, 08:13:42 PM »
You can still use primitive triangles to draw, but you sort of need to post what you have in order for anyone to see what you're doing wrong.
Hang on, me thinks I've read somewhere on RaNGE that if the path of the image is incorrect it will show the white square in the upper left corner. So I guess i've written the image location wrong.
I would post the image and the script up but I've renovated my danmakufu folder and DELETED EVERYTHING by accident
« Last Edit: June 04, 2012, 08:16:47 PM by fonduemaster »

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #366 on: June 04, 2012, 08:59:25 PM »
Apologies for double post, but I need to know how to create the actual shotsheet script. Not like creating the rectangle co-ordinates and the id and alpha etc for the individual bullets. But like delay_rect, LoadEnemyShotData(), and stuff. Basically I need to learn how to script the script which defines the bullets and how to give them a name.

Less complex version: I need to learn on how to create scripts for shotsheets, like the danmakufu default ones (Default_ShotData and Default_ShotConst). Especially delay_rect, because i dont know what that does.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #367 on: June 05, 2012, 01:33:01 AM »
Code: [Select]
#UserShotData
shot_image = "./img/blablabla.png" //image path
delay_rect = (209, 472, 243, 507) //the graphic rect for the "bullet delay" image that shows up before a shot is actually fired

ShotData{
id = 1 //this is the ID you reference when shooting a bullet
rect = (0,0,16,16) //the graphic rect of the shot, ignored if using animation
collision = 4 //collision radius
render = ALPHA //either ALPHA or ADD, defaults to alpha
delay_color = (255,128,255) //the color mask applied to the delay image, (255,255,255) means image is drawn full brightness, defaults to (128,128,128)
angular_velocity = 3 //speed at which the shot image spins, can be negative, defaults to 0 (NOT YET IMPLEMENTED)
AnimationData{ //only declare if bullet is animated
//declares rects to use for the animation, first parameter is the # frames the image lasts
animation_data = (16,0,0,12,12)
animation_data = (8,12,0,24,12)
animation_data = (24,12,12,24,24)
}
}

ShotData{
//etc
}

Assigning constant names to bullet IDs just requires you to define them somewhere (not in the shot script).
redstarbullet = 1;
and stuff like that. Pretty straightforward.

Load with LoadEnemyShotData(pathtoshotscript).

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

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #368 on: June 05, 2012, 08:09:14 AM »
liu drake
im trying it now


~~~later~~~
Fuck you danmakufu I hope you die in a hole.
Y U NO WORK, I WAS SO CLOSE.
[attach=1]
Hardly anything has changed on line ten and it's counting it as an error: [size=78%]http://pastebin.com/qSLb6mBK[/size]
Shotsheet data:[size=78%]http://pastebin.com/ufVPxUmM[/size]
Image:[attach=2]
Script I use to fire the bullets in:[size=78%]http://pastebin.com/1bsuSJh6[/size]


~~~EDIT~~~
I just had to put "include_function" instead of just "include". But It then says the shot types are not defined, so I put their respective numbers in the script instead of the bullet's constant name. Now I have no errors, but there are no bullets on the screen and there's no delayed shots as well.
I request halp.
« Last Edit: June 05, 2012, 11:13:13 AM by fonduemaster »

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #369 on: June 06, 2012, 11:02:57 PM »
Your shot_image is "./script/default_system/img/FondueShotSheet.png" instead of "./img/FondueShotSheet.png" or something. "./" references the current directory.

Though, it really wasn't a good idea to write out everything and then try to get it to work properly, rather than test one bullet and get that to work first before continuing. EDIT: And in the future, could you test the advice people give before thanking them and then editing your post? I saw "ty ilu" and didn't realize you still needed help because edited posts don't send notifications.
« Last Edit: June 06, 2012, 11:04:38 PM by Drake »

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

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #370 on: June 07, 2012, 08:44:05 AM »
Your shot_image is "./script/default_system/img/FondueShotSheet.png" instead of "./img/FondueShotSheet.png" or something. "./" references the current directory.

Though, it really wasn't a good idea to write out everything and then try to get it to work properly, rather than test one bullet and get that to work first before continuing. EDIT: And in the future, could you test the advice people give before thanking them and then editing your post? I saw "ty ilu" and didn't realize you still needed help because edited posts don't send notifications.
Okay, thanks. Sorry for that ty liu thing btw

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #371 on: June 07, 2012, 05:26:06 PM »
Man it's been so long since I've worked on danmakufu!
I can't remember that one function that sets the boundaries for where bullets automatically delete. Tried going through the function list on the wiki but still can't find it. Any help?

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #372 on: June 07, 2012, 07:55:42 PM »
SetShotAutoDeleteClip(l,t,r,b);

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

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #373 on: June 07, 2012, 09:38:17 PM »
Perfect, thanks.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #374 on: June 08, 2012, 01:05:50 PM »
SetShotAutoDeleteClip(l,t,r,b);

What are those arguments mean?  ???

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #375 on: June 08, 2012, 07:23:16 PM »
What are those arguments mean?  ???

They define how far out of the screen that the bullets are deleted. Left, Top, Right, Bottom.

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #376 on: June 10, 2012, 07:24:27 PM »
Yay, my shotsheet is AMAZING and It works on Danmakufu.
One problem though.
Danmakufu makes my shotsheet look PUTRID. I don't know what Dnh has done but I think it has crappy rendering/drawing. What's happening? It's turning a work of art into a piece of sh*t.


Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #377 on: June 10, 2012, 10:21:54 PM »
I should probably take it upon myself to go look up the differences ph3 has with 0.12m in terms of blurry aids since Pony dude clearly isn't getting back to me. Your case is obvious once you look at the shotsheet, though. For shot rect declarations the top and left are inclusive, while the bottom and right are exclusive. You aren't defining your bullet properly, so not only did you end up with an incorrect graphic, you changed the size of the bullet from 11 pixels to 10 pixels, which means that the center of the bullet is a half-pixel and is drawn inaccurately. Here's a picture:



First is your scenario. The bullet defined is 10x10 (missing a pixel right and bottom), its center is a half-pixel and is drawn on a whole pixel.
Second is the same 10x10 bullet; its center is a half-pixel but I draw it on a half-pixel (enemy position+0.5 both directions). Notice how it tries to fix it.
Third is the bullet redefined to be what it should, 11x11. Its center is a whole pixel and is drawn on a whole pixel. Drawn perfectly.
Fourth is the original bullet image for comparison.

EDIT: aaaaaa nooooo



For even-sized graphics like this, it seems like dnh tries to fix it automatically, but blurry aids happens? Trying to fix the location doesn't seem to work.
« Last Edit: June 10, 2012, 10:48:01 PM by Drake »

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

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #378 on: June 11, 2012, 06:15:02 AM »
stuff
Oh, I get it. So when I get home from school today I'll have to edit the shotsheet and make the sizes/radius of all the shots an odd number. But why is Danmakufu reducing the quality of each shot then? Do I just have to edit the bullets to give them more contrast?

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #379 on: June 11, 2012, 06:35:48 AM »
The even-sized bullets aren't actually a huge deal, it's just me being OCD about it being drawn perfectly and not being able to find a solution immediately. The odd-sized ones do seem to draw perfectly, just make sure to fix your outer bounds to be exclusive (i.e. add 1 to bottom and right).

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #380 on: June 12, 2012, 04:30:05 PM »
I'm not sure if I'm reading this correctly, but if I have an 11x11 pixel bullet where the top left pixel of that 11x11 box is at the very top left corner of the shotsheet, should I be defining the graphic rectangle as (0, 0, 11, 11)? That's what I've been doing all this time for all my graphics and I'm not so sure if that's correct anymore.
<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.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #381 on: June 12, 2012, 10:44:24 PM »
You're right, you're probably just confused because fondue is using 1,1 as his topleft. For (0,0,11,11), you don't have the (11,11) pixel drawn; the last pixel drawn is (10,10). The first drawn is (0,0). I know you understand this lol.

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #382 on: June 12, 2012, 11:08:10 PM »
Oh, okay, thanks. I thought I was going crazy for a second, lol.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #383 on: June 13, 2012, 02:52:48 AM »
I should probably take it upon myself to go look up the differences ph3 has with 0.12m in terms of blurry aids since Pony dude clearly isn't getting back to me.

Sorry D:

It was late at night when I tried the things you gave me, but I couldn't get any of it working and basically gave up on the grounds that I must be dumb.

I got around it by doubling image size and keeping the DestRect to where I want it.  Excessive, but (somewhat) functional!
« Last Edit: June 13, 2012, 02:56:20 AM by Frenticpony »

fondue

  • excuse me
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #384 on: June 18, 2012, 04:10:12 PM »
I'm probably not the only one who has this problem, but whenever something moves across the stage, a few times every second the object seems to jump a few pixels. It always happens with bullets. I can't stop it, even if the object moves at slow speeds. Why's that?

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #385 on: June 18, 2012, 09:58:13 PM »
Is Danmakufu running at a proper 60fps? Is it consistent? Does it happen with all moving objects? Does it not happen with some objects?

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

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #386 on: June 18, 2012, 11:09:01 PM »
I'm probably not the only one who has this problem, but whenever something moves across the stage, a few times every second the object seems to jump a few pixels. It always happens with bullets. I can't stop it, even if the object moves at slow speeds. Why's that?

Sound like the issue I was having.  Turned out it had to do with Danmakufu running at 63 fps, which I had to force-limit in order for it to stop. 

If that is the issue, Dxtory is free and able to lock the FPS at 60, thus stopping the little skipping about.


Also, I've been messing with using odd numbers on images to fix the "blurry aids", but to no avail.  Using an image(for a spellcard background) with dimensions 413x407 set at those numbers both with Source and Dest Rect still results with a blurry image.  I've tried a whole bunch of combinations with SourceRect, DestRect and DestCenter, but this thing's still looking pretty bad.

The end result of all experiments: https://dl.dropbox.com/u/38923366/ph3blur.png

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #387 on: June 19, 2012, 01:02:42 AM »
LoadTexture(GetCurrentScriptDirectory~"eff04.png");
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"eff04.png");
ObjRender_SetPosition(obj,128,128,0);
ObjSprite2D_SetSourceRect(obj, 0, 0, 413, 407);
ObjSprite2D_SetDestRect(obj, -206, -203, 207, 204);

I fiddled around with this and changing the size and render position didn't work. Looks like you do have to resize the image to dimensions a power of two. Just extend the sides of the image to 512x512 and see what happens.
http://i.imgur.com/3yWJU.png

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

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #388 on: June 19, 2012, 02:26:55 AM »
Just extend the sides of the image to 512x512 and see what happens.

Aha!  Works!  So, to avoid the blurryness... (Correct me if I'm wrong)

Source images should be a power of two.
SourceRect should have odd dimensions.

Hopefully, I'll be able to go through all my 2X images soon and resize them back to normal.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #389 on: June 19, 2012, 03:42:22 AM »
I'm actually confused now since when testing bullet definition scripts, odd and even-sized rects seem to be important but the overall image doesn't have to be 2n, but with render objects (or maybe just sprite objects) 2n dimensions are important but oddness and evenness isn't.

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