Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Topic started by: Helepolis on July 11, 2011, 03:48:45 PM

Title: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (locked)
Post by: Helepolis on July 11, 2011, 03:48:45 PM
This is the Q&A thread for the newest Danmakufu engine, currently ph3 beta.

The wiki for 0.12m has been moved to different page here: http://dmf.shrinemaiden.org/wiki/index.php?title=Danmakufu_v0.12m

The wiki itself will from now on update for ph3 beta: http://dmf.shrinemaiden.org/wiki/index.php?title=Main_Page


Before you ask questions about "can I port my scripts from 0.12m to ph3?" Answer is No. You can't.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheMasterSpark on July 13, 2011, 05:48:21 PM
There doesn't seem to be any built-in function for using Cut-ins in enemy scripts. Am I right in that we need to handle them ourselves like image objects, or is it still in there, hidden somewhere?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 13, 2011, 06:20:33 PM
The sample has the lines for Concentration01 and CutIn commented out, so I think it's safe to say they aren't implemented in the current version, but may be added later. For now, you'll have to make a custom CutIn object.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheMasterSpark on July 13, 2011, 06:39:26 PM
Ah, you're right. I knew I had seen those familiar words somewhere when mulling over the scripts earlier, but I guess my mind automatically filtered it away due to the double slashes. Thanks.  :)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: BardzoSkomplikowanyNick on July 15, 2011, 08:40:58 AM
Could somebody help?

My Danmakufu ph3 doesn't see any script, although it's correctly written. Have somebody the same problem?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheMasterSpark on July 15, 2011, 09:10:52 AM
Yeah, I had that as well at first. I needed to run it through Applocale in order for it to show scripts. Running it without Applocale didn't crash the game like it did with the earlier version of Danmakufu, but with this new one I couldn't see anything other than folders.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: J.O.B on July 15, 2011, 09:24:27 AM
Would it actually be possible to make it able to run without japanese characters? As in change all the japanese characters to something english?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 15, 2011, 10:39:33 AM
What Masterspark said, you NEED APPLOCAL in order to see the example scripts.

Would it actually be possible to make it able to run without japanese characters? As in change all the japanese characters to something english?
Any script not containing Japanese characters will be recognized without AppLocal. So yes, if you eliminate all JP text inside the example scripts, they will all showup.

This is what you need at the top of any script (like in old dnh, except this time the type of script is located inside the headers and not through enemy_script_xxxx anymore.

Code: [Select]
#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["lolTitle"]
#Text["lolText"]

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Stuffman on July 15, 2011, 11:00:19 PM
There doesn't seem to be any built-in function for using Cut-ins in enemy scripts. Am I right in that we need to handle them ourselves like image objects, or is it still in there, hidden somewhere?

I suspect the Boss Scene Objects (http://dmf.shrinemaiden.org/wiki/index.php?title=Boss_Scene_Object_Functions) are used for this, but I have no idea how they work yet.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on July 16, 2011, 12:00:13 AM
I suspect the Boss Scene Objects (http://dmf.shrinemaiden.org/wiki/index.php?title=Boss_Scene_Object_Functions) are used for this, but I have no idea how they work yet.

It is used for plural boss fights actually.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 16, 2011, 02:41:22 AM
Yeah, no built in spell card name code or cutin code. You can use this in the meantime.

Code: [Select]
//Draws the spell card name as an text object.
task SetSpellText01(string)
{
loop(60){yield;}

let txt = ObjText_Create;
ObjText_SetText(txt,string);
ObjText_SetFontSize(txt,12);
ObjText_SetFontColorTop(txt,255,255,255);
ObjText_SetFontColorBottom(txt,128,128,255);

ObjText_SetFontBorderType(txt,BORDER_FULL);
ObjText_SetFontBorderColor(txt,0,0,64);
ObjText_SetFontBorderWidth(txt,1);

ObjText_SetHorizontalAlignment(txt, ALIGNMENT_RIGHT);
ObjText_SetMaxWidth(txt, 300);
ObjRender_SetX(txt, 368 - 300);

ascent(i in 0..60)
{
ObjRender_SetAlpha(txt,i*255/60);
ObjRender_SetY(txt,80-i);
yield;
}


while(!Obj_IsDeleted(objEnemy)){yield;}
Obj_Delete(txt);
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on July 17, 2011, 11:52:57 PM
Does anyone know if ph3 has a new shot data function to spin shots? Previously, we used angular_velocity, but it seems that's no longer a valid option. I'd look on the wiki, but there's nothing there about shot data at all... Also, I checked the Default_ShotData file and found THEY use angular_velocity, but when I put it on my player shots, they don't spin at all...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on July 18, 2011, 12:16:06 AM
angular_velocity does not work at all for the moment - ph3 is still in beta, so it's possible they took it out temporarily to make things work.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 18, 2011, 01:13:04 AM
Can anyone figure out how to get ObjText_SetFontType to work? It crashes Danmakufu without fail, even when the corresponding InstallFont runs successfully (returns true).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on July 18, 2011, 09:43:04 AM
Can anyone tell is there a function to find square root?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on July 18, 2011, 08:24:34 PM
Can anyone tell is there a function to find square root?

Square root is also known as taking the half power. Therefore blah^0.5 is the square root of blah.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on July 19, 2011, 11:07:01 AM
Square root is also known as taking the half power. Therefore blah^0.5 is the square root of blah.
Thanks.

And is there a function to check if two specified objects are colliding? ObjCol_IsIntersected doesn't seem useful for this.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Something XutaWoo-y on July 22, 2011, 08:44:35 AM
A question more on design than actual programming, but for players with power level, should debug keys that increase and decrease power level be kept? Since I doubt it'll be common for single boss scripts to drop power items, this'll keep players from being stuck at base power level for the entirety of the fight.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on July 22, 2011, 09:32:58 PM
Just default it to a fairly neutral power level, use a DPS script to balance it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on July 23, 2011, 12:17:34 AM
Whoops, misunderstood question.

Since we're used to 0.12m, most people will probably ignore power items so you should probably have it default to a specific power level at all times. However, if you want, you can make your player read a common data to turn on power levels and tell people to use that if they want power items to be compatible with your player.

In fact, why don't we establish a certain common data that anyone can use to turn on compatibility with power items? Any name suggestions?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: J.O.B on July 23, 2011, 01:25:44 AM
I trying to make a pattern where bullets are shot in a circle and then after 1 second, spin around however many degrees and eventually get to me. But I'm having trouble making the angle increase properly so it isn't working properly. So how exactly do I increase the angle? I've tried using angle++ but it doesn't seem to do the trick.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 23, 2011, 01:31:36 AM
I'm assuming you're having trouble with making the bullets turn? The problem is that angle++ just adds to a variable named angle, which won't have any connection to the bullet angle unless you code it that way. What you need to do is use a function that changes the angular velocity of a shot, such as ObjMove_AddPatternA2, or change the angle manually each frame using ObjMove_SetAngle. (Link a pastebin next time, it's easier to figure out what the issue is that way)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: J.O.B on July 23, 2011, 01:36:02 AM
Does it work when I have one of the arguments with the angle variable? Since that's currently what I have.
Also I think I've tried ObjMove_AddPatternA2 before.
And the problem is the bullets turn at the same angle. I want to change that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 23, 2011, 03:00:55 AM
Does it work when I have one of the arguments with the angle variable? Since that's currently what I have.
Also I think I've tried ObjMove_AddPatternA2 before.
And the problem is the bullets turn at the same angle. I want to change that.
Seriously, pastebin your code. It's still really unclear to me what you're trying to do.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: J.O.B on July 23, 2011, 03:14:22 AM
I actually deleted that part of the script because it started crashing when I put something else in the script (as in another pattern).
I just want to know how to make the bullets turn in increasing angles, not in the same angles.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on July 23, 2011, 12:53:39 PM
Oh, then use a variable (such as angle) in AddPattern, just as you said. You can change either the frame of the angle velocity change, or the amount of the angle velocity.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: J.O.B on July 23, 2011, 01:59:23 PM
I still isn't working how I want it to :( Oh well, at least I'm having fun :3
Try dodging this ( hint there's a safespot on the spawning line).

http://pastebin.com/1htgkEX5    Large code in Pastebin... -Hele

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: AVeryConcernedSheep on July 24, 2011, 05:34:15 AM
Just a couple things:
1) GetAngleToPlayer is listed as a function in the wiki, however I haven't been able to get it to work.  Not that it is a lot of trouble to create your own variable, it just makes me wonder if there are other functions listed that simply don't do anything.  The best I've gotten out of GetAngleToPlayer is to fire bullets at an angle of 0.

2) I've been looking for how to set the Boss Timer, but in scanning the Default_System script, the arguments for the "Case{}" script don't exist.  Which means I'd have to make educated guesses as to how to set it up.  That is, of course, unless I'm not being very intelligent (a definite possibility).

Edit: Should probably ask the question then:  Anyone figure this stuff out?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 24, 2011, 08:14:58 AM
Just a couple things:
1) GetAngleToPlayer is listed as a function in the wiki, however I haven't been able to get it to work.  Not that it is a lot of trouble to create your own variable, it just makes me wonder if there are other functions listed that simply don't do anything.  The best I've gotten out of GetAngleToPlayer is to fire bullets at an angle of 0.

2) I've been looking for how to set the Boss Timer, but in scanning the Default_System script, the arguments for the "Case{}" script don't exist.  Which means I'd have to make educated guesses as to how to set it up.  That is, of course, unless I'm not being very intelligent (a definite possibility).

Edit: Should probably ask the question then:  Anyone figure this stuff out?

1) GetAngleToPlayer is an Obj based function. It is asking for an Obj parameter. Since the enemies/bosses are obj as well, you need to use that. For example for the Rumia script:

Code: [Select]
objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist([b]objEnemy[/b]);

Meaning you need  GetAngleToPlayer(objEnemy); Except, just like in the 0.12m, it only angles it proper if it is spawned at the boss 0,0 location. Otherwise you still need atan2.


2)    ObjEnemyBossScene_SetSpellTimer (as listed on the wiki and manual)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Mеа on August 12, 2011, 12:26:17 AM
So I've been tinkering around with the Mesh Objects and stuff, and .mqo files load properly, but I whenever I try to use .elem files, nothing shows up on the screen? (Using ObjMesh_Load)
Also, how do the materials work? The color stays, but the texture dissapears. Also, it appears that everything aside from the color disapears (alpha, specularity, etc. Although in alpha's case, it kind of works if I use ObjRender_SetAlpha, but then it's still wierd.) Assuming that only the color stays, is there any way to attach a texture from Danmakufu? ObjPim_SetTexture doesn't seem to work, and neither does RendertoTextureB1.
Am I doing something wrong, perhaps?
(I make the model in MetaSequoia and import it into Elfreina(freeware version) to animate. MetaSequoia exports as .mqo and Elfreina as .elem)

EDIT:
I think I might know why the .elem files don't work. For some reason, trying to open the .elem files outside of the program doesn't work. If you try and double click it, you get a message saying that loading the file failed. However, you can use Elfreina to import the data of the model in the .elem file into the program. That's just stupid. Someone just please help.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on August 12, 2011, 03:38:40 AM
ObjSound_SetVolumeRate doesn't seem to work.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 12, 2011, 07:07:04 AM
ObjSound_SetVolumeRate doesn't seem to work.
It seems that most functions do not seem to work yet in ph3. This was confirmed for few other functions before. We can't do much about it than just continue with what we have and watch warmly for the next update.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Schezo on August 13, 2011, 02:05:47 AM
Are there any other player scripts besides the default Rumia out there?  If so could someone direct me towards them?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 14, 2011, 05:17:46 PM
Are there any other player scripts besides the default Rumia out there?  If so could someone direct me towards them?
None at this moment as far as I am aware.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 14, 2011, 09:52:42 PM
sorry i'm being lazy with that
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on August 19, 2011, 08:31:42 PM
EDIT: ...nevermind, I solved it. I wasn't supposed to use the x and y positions in SetVertexPositions, and I forgot to put yield; in the Spiral task...


I'm having trouble making a bomb. What I'm trying to do is make stars (the bomb's graphic) spawn at a point that spirals out from the center of the screen (there's no GetCenterX/GetCenterY function as far as I know, so I'm having to fudge it by halving the results of GetStgFrameWidth and GetStgFrameHeight for center X and center Y, respectively...is this correct?), then after some time, they increase in size and vanish. (This last part hasn't been started yet; ignore that for now.) Problem: The stars are supposed to spawn every 5 frames, but instead, they all spawn at once in odd places on the screen and have no interaction.

http://pastebin.com/TsVrn2zf   Large blocks of code go in pastebin... -Hele

It's unfinished, I just wanted to test if it worked first. It doesn't. I put some graphics on the Spiral task, and they didn't show up. So, I'm assuming that is bugged...somehow... Help?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on August 22, 2011, 02:18:23 AM
Couple questions
- Does ph3 have built-in vsync ?
- SampleE01.txt (the motion blur script) drops my fps to 20. Is it a bug or a feature ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on August 23, 2011, 01:40:33 AM
It seems that either I'm incorrectly looping some of these BGMs or...

http://pastebin.com/muWBrysv

BGM #00 is not used.
In all present files, there is 1~2 seconds of silence after the end loop point.
BGMs #1, 6, 7, 8, 9, and 11 are missing and therefore the loop points are not set.

BGMs #2, 5, 12: these ones work correctly.
BGMs #3, 4, 10, 13: do not loop correctly and produce infinite static after the end of the loop.

Do I have to provide the large folder of bgms I'm using?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on August 23, 2011, 02:23:35 PM
It seems that ph3 uses only integer part of the loop point number. This may cause the incorrect loop.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on August 23, 2011, 03:38:59 PM
Upon trying different file extensions, music looping ALWAYS WORKS on .ogg files.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on August 24, 2011, 04:01:58 PM
Has anyone figured out how plural stages work yet?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Cabble on August 25, 2011, 11:03:21 PM
Just downloaded it

Scripts aren't even appearing for me.

Edit: Also, will there ever be a general help thread? Are all the regular commands the same, or are some different?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Schezo on August 26, 2011, 01:50:26 AM
For the scripts not appearing, are you using applocate?

And yes things are a bit different. I would suggest reading the wiki (http://dmf.shrinemaiden.org/wiki/index.php?title=Main_Page) as it tells new functions and the new way to script since there are revisions from the old version.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Cabble on August 26, 2011, 09:11:28 PM
The wiki doesnt have some of the more basic commands such as CreateShot01, so i was wondering if they were the same.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on August 26, 2011, 09:43:13 PM
The wiki doesnt have some of the more basic commands such as CreateShot01, so i was wondering if they were the same.
CreateShot01 became CreateShotA1 and now returns an object ID like Obj_Create(OBJ_SHOT) does, for example. A lot of this actually makes things a lot easier.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 26, 2011, 09:52:19 PM
basic shots returning objects is the best thing
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gammaraptor on August 26, 2011, 11:04:37 PM
Anybody know some good tutorials for ph3? I've looked through the wiki but there doesn't seem to be much.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 26, 2011, 11:08:46 PM
that's because it just came out in beta and pretty much everyone is trying to become accustomed to how it works and some functions don't even work anyways because it's still in beta
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gammaraptor on August 26, 2011, 11:21:24 PM
that's because it just came out in beta and pretty much everyone is trying to become accustomed to how it works and some functions don't even work anyways because it's still in beta

=D I'll figure it out then. Horray for trial and error.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 27, 2011, 09:01:41 AM
That is kind of the whole point of this contest #9 as well you know? To make people perform trial and error for once instead of sit and raise hands to receive.

Even I am right now figuring like the most basic functions and mechanisms such as sprite animation and scaling. That is just how we have to deal with it for now.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on August 27, 2011, 05:51:30 PM
I'm having trouble with bouncing bullets. They spawn and move normally, but nothing happens when the cross the sides.
Code: [Select]
task Shot(angle){
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let minx = 32;
let maxx = 416;
let obj = CreateShotA1(ex, ey, 4, angle, DS_BALL_M_RED, 20);
let bounce = 0;

if(ObjMove_GetX(obj)<minx || ObjMove_GetX(obj)>maxx){
if(bounce==0){
ObjMove_SetAngle(obj, 180-angle );
bounce++;
}
}
}
Man, this new script style will take a bit of getting used to.

EDIT : Fixed! I forgot the loop.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 28, 2011, 12:39:39 PM
Diving in the wiki and official documentation, I cannot find any MaxX MinX -like functions for the play field. Or am I being really blind here?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on August 28, 2011, 02:22:35 PM
Diving in the wiki and official documentation, I cannot find any MaxX MinX -like functions for the play field. Or am I being really blind here?
Yeah. Apparently they've been replaced by some two functions called GetStgFrameWidth/Height (for X or Y respectively), which may prove to be a lot more versatile somehow.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on August 28, 2011, 02:24:47 PM
(0,0) is always the top left, and (GetStgFrameWidth,GetStgFrameHeight) is always the bottom right of the playing area. Divide by two to get the center.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 28, 2011, 02:43:26 PM
That is indeed odd, however good enough to carry on.

What I am really starting to miss in ph3 is CreateShotA =[. It was so easy to make flashy stuff with it, now instead of 4 lines of code, I need to script an entire object bullet for this joke =.=
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on August 28, 2011, 02:58:54 PM
But creating object bullets is about 10 times easier now :V

0.12m
Code: [Select]
CreateShotA(0,GetX,GetY,10);
SetShotDataA(0,0,4,angle,0,-0.05,1,RED01);
SetShotDirectionType(PLAYER);
SetShotDataA(0,90,4,0,0,-0.05,1,NULL);
SetShotDirectionType(ABSOLUTE);

ph3
Code: [Select]
let obj = CreateShotA2(GetX,GetY,4,angle,-0.05,1,RED01,10);
ObjMove_AddPatternA4(obj,90,4,0,-0.05,0,1,GetPlayerObjectID,NO_CHANGE);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gammaraptor on August 28, 2011, 09:38:12 PM
But creating object bullets is about 10 times easier now :V

0.12m
Code: [Select]
CreateShotA(0,GetX,GetY,10);
SetShotDataA(0,0,4,angle,0,-0.05,1,RED01);
SetShotDirectionType(PLAYER);
SetShotDataA(0,90,4,0,0,-0.05,1,NULL);
SetShotDirectionType(ABSOLUTE);

ph3
Code: [Select]
let obj = CreateShotA2(GetX,GetY,4,angle,-0.05,1,RED01,10);
ObjMove_AddPatternA4(obj,90,4,0,-0.05,0,1,GetPlayerObjectID,NO_CHANGE);

Object Oriented Programming xD
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on August 29, 2011, 04:11:24 AM
Is there a way to display the bullet count in ph3 ... ? GetEnemyShotCount wasn't there.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Schezo on August 29, 2011, 10:03:55 PM
Is there something similar to
SetDamageRateEx(x, y, k, d);
That will allow familiars when shot at to damage the main boss?  A method or something?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 29, 2011, 10:57:04 PM
task DamageMainBoss(ratio){
  let lastframelife = ObjEnemy_GetInfo(this, INFO_LIFE);
  loop{
    yield;
    if(lastframelife > ObjEnemy_GetInfo(this, INFO_LIFE)){
      ObjEnemy_AddLife(boss, (lastframelife - ObjEnemy_GetInfo(this, INFO_LIFE)) * (-ratio));
      lastframelife = ObjEnemy_GetInfo(this, INFO_LIFE);
    }
  }
}


Something like that might work. Obviously if you plan to heal the boss you should add an extra conditional in there, and whatever.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on August 30, 2011, 11:41:54 PM
Is ObjRender_SetBlendType a non-working function right now? It doesn't seem to work, sadly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on August 30, 2011, 11:50:13 PM
Is ObjRender_SetBlendType a non-working function right now? It doesn't seem to work, sadly.
Are you using BLEND_ADD_RGB, etc?

edit:typo
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on August 31, 2011, 12:26:26 AM
BLEND_ADD_RGB, yeah.
There's no error window or anything. It's just that there's no effect.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on August 31, 2011, 03:18:38 AM
ObjRender_SetBlendType works well.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on August 31, 2011, 04:05:27 AM
Hmm... Are the ObjRender functions not supposed to apply to bullets? Because that would solve a lot.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on August 31, 2011, 04:18:18 AM
Blend types for shot objects are defined in shot data.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Thaws on September 09, 2011, 10:19:37 AM
Finally have time to play around ph3 like 2 weeks ago, took some time to get used to the new scripting style, but I am really liking how much more convenient it is to use object bullets XD.

Anyways,  this is probably a stupid question due to me having never been interested in scripting players and so have no knowledge about them.  :V
I've noticed when the default Rumia player dies, bullets don't disappear. So do I have to do something like if(Player dies){Delete bullets} in all my attack scripts or is that the player script's responsibility to do so?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on September 09, 2011, 12:22:40 PM
Finally have time to play around ph3 like 2 weeks ago, took some time to get used to the new scripting style, but I am really liking how much more convenient it is to use object bullets XD.

Anyways,  this is probably a stupid question due to me having never been interested in scripting players and so have no knowledge about them.  :V
I've noticed when the default Rumia player dies, bullets don't disappear. So do I have to do something like if(Player dies){Delete bullets} in all my attack scripts or is that the player script's responsibility to do so?
The player does it. Run a check for (GetPlayerState == STATE_DOWN) when removing bullets; don't simply put the code in the EV_HIT event section, or they'll be deleted before you die. (EV_HIT runs exactly when it says it does: when you get hit. Deathbombing is counted as a "hit" because a bullet still hit you. STATE_DOWN is death, but I don't know if there's an associated event type.)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on September 11, 2011, 09:59:06 AM
Is there any way to #include scripts from the upper directories?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on September 11, 2011, 12:04:16 PM
Is there any way to #include scripts from the upper directories?

Not at my knowledge.
Except if you translate what you did in 0.12 into ph3!

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 11, 2011, 07:59:09 PM
First of all I'm not quite sure why you would #include a script from a higher directory, considering in most cases an #include should just be in the same or below. If you're making a huge file structure you should be using absolute paths instead of GCSD.

If it's the sort where you usually put ./ for the script directory (i.e. when you aren't giving a string), use ../ for the one above.
If it's the sort where you use GCSD, the whole thing is just a string. You can eliminate characters in the pathname until you get to your desired directory.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on September 12, 2011, 02:48:00 AM
Yeah, i'm using absolute paths already.

GCSD, GMSSD does not work in #include. It shows an error... something about types.

../ doesn't work too.

Thanks for the reply.

UPD:
Is there something like CreateEnemyFromFile in ph3?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on September 16, 2011, 12:18:04 PM
As far as I'm aware, there is none. However, you can use this for the same effect:
Code: [Select]
function CreateEnemyA1(scriptpath, x, y, enmspd, enmang, life, argument){
let enemyscript  = LoadScript(scriptpath);
SetScriptArgument(enemyscript, 1, x);
SetScriptArgument(enemyscript, 2, y);
SetScriptArgument(enemyscript, 3, enmspd);
SetScriptArgument(enemyscript, 4, enmang);
SetScriptArgument(enemyscript, 5, life);
SetScriptArgument(enemyscript, 6, argument);
StartScript(enemyscript);
return enemyscript;
}
And in the initialize of the enemy script, put the respective script arguments to their respective values.
Code: [Select]
ObjMove_SetPosition(objEnemy, GetScriptArgument(1), GetScriptArgument(2));
ObjMove_SetSpeed(objEnemy, GetScriptArgument(3));
ObjMove_SetAngle(objEnemy, GetScriptArgument(4));
ObjEnemy_SetLife(objEnemy, GetScriptArgument(5));
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on September 30, 2011, 05:34:14 PM
http://pastebin.com/2jSBE8u5 (http://pastebin.com/2jSBE8u5)

I'm trying to make Reimu's homing orbs for a bomb (reeeeeeeeeeal original), but right now, just to get the graphics right, I have a basic spell object that simply moves up 5 pixels every frame. But for some reason, whenever the first orb spawns, the game stops for about 2 seconds. After that, the rest spawn just fine! (they spawn every 60 frames just as a test of this) I can't figure out what's wrong. If you check my Marisa A player from the Player Script thread, it doesn't stop the game when the bomb is used, and I copied the code for the explosion object for this bomb! I can't figure out WHAT is different that causes this freeze. All I can tell is, it only freezes when the very first orb is spawned; doesn't matter when, just that it does at all.

Help!

EDIT: I just realized, it might be more helpful if the entire player script was posted...
EDIT2: ...nevermind, it was setting the texture that did it...but why did THIS freeze when I spawned SIX objects at once with my Marisa A player without loading the graphic any other way? Heck, that bomb loads NONE of the graphics before spawning the objects...there should've been at least three freeze spots...
EDIT3: Default Rumia does one even better- NO graphics are preloaded in it. Not bomb, not player. NOTHING. It doesn't freeze. SO WHY IS THIS ONE BOMB LITERALLY THE ONLY ONE THAT DOES!?
EDIT4: and finally, the issue: Apparently, the bomb's graphic was DOUBLE the size of those used in my Marisa player, plus 1. Minus 1, halve the size, no freeze. ...but when I switched to the player graphic file, Reimu.png...no freeze. Said file is bigger. Odd. Then again, it has a lot of transparent space...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on October 02, 2011, 01:12:35 AM
EDIT: if (ObjEnemy_GetInfo(obj, INFO_LIFE) <= 0). Never mind, I need to go kill myself.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on October 08, 2011, 02:04:02 PM
Well now I have a problem on my script.
 I want to create explosion effects when my boss shooting bullets ... I tried with this code (I have not yet made the paramettrage below):

Code: [Select]
task ExplodeBUllet(X,Y,sx,sy,alpha)
{
let A= 28;
let B= 31;
let objE = ObjPrim_Create(OBJ_PRIMITIVE_2D);
ObjPrim_SetPrimitiveType(objE,PRIMITIVE_TRIANGLELIST);
ObjPrim_SetVertexCount(objE,4);
ObjPrim_SetTexture(objE,GetCurrentScriptDirectory ~

"img/explodeyellow.png");
ObjPrim_SetVertexUV(objE,0, -1/2*A,-1/2*B);
ObjPrim_SetVertexUV(objE,1,1/2*A,-1/2*B);
ObjPrim_SetVertexUV(objE,2,1/2*A,1/2*B);
ObjPrim_SetVertexUV(objE,3,-1/2*A,1/2*B);
ObjRender_SetX(objE,X);
ObjRender_SetY(objE,Y);
ObjRender_SetScaleX(objE,sx);
ObjRender_SetScaleY(objE,sy);
ObjRender_SetAlpha(objE,alpha);
}


But nothing appears >.<!
Help me >o<
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 08, 2011, 09:33:22 PM
Five bucks says you forgot to load the texture.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Supreme Gamesmaster on October 08, 2011, 11:20:26 PM
ObjPrim_SetTexture loads the texture, so it's not that.

I think you've got the wrong primitive type; you want PRIMITIVE_TRIANGLEFAN. (Personally, I'd just use ObjSprite2D functions for rectangles.)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 09, 2011, 03:12:24 AM
Trianglefan vs Trianglestrip likely has nothing to do with this, the only difference with square objects is that the third and fourth vertices are swapped.

Although, now that you mention it, the coordinates for the whole image is currently (-14, -15.5, 14, 15.5). Apparently Prim_SetVertexUV uses percentages (0 to 1) relative to the texture size for
its coordinates, so you'd want Prim_SetVertexUVT for the pixel coordinates. But even then, the coordinates shouldn't go into the negatives since there's nothing past (0,0).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on October 09, 2011, 06:40:44 PM
Is there any way to check if a bullet collides with another bullet or laser? I tried ObjCol_IsIntersected but that only seemed to apply to the player.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on October 10, 2011, 03:08:29 AM
I think you can use some trigonometry to check if the point is on the segment.

This doesn't work in beta2. It seems that it is bugged.
Code: [Select]
bgm_Obj = ObjSound_Create;
ObjSound_SetSoundDivision(bgm_Obj, SOUND_BGM);
ObjSound_Load(bgm_Obj, BGM_TABLE[0]);
ObjSound_SetVolumeRate(bgm_Obj, 100);
ObjSound_SetLoopEnable(bgm_Obj, true);
ObjSound_SetLoopTime(bgm_Obj, BGM_LOOP_TABLE[0], BGM_LOOP_TABLE[1]);
ObjSound_Play(bgm_Obj);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on October 18, 2011, 04:06:28 AM
BGM doesn't seem to work at all in beta 2 for some reason?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TraceTheKriken on October 19, 2011, 04:17:12 AM
I was following a tutorial that helps people to do their own spell cards in danmakufu. At the end of the first part the maker of the tutorial tested his script, it worked but mine didn't. I always get this message, and since I can't read japanese I don't know where the problem is.

here is image of the error message (http://imageshack.us/photo/my-images/441/scripterror.png/)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on October 19, 2011, 04:25:55 AM
I'm pretty sure that isn't Japanese...!
Welp, I think your AppLocale is set to the wrong locale on Danmakufu.

Also, I think you're supposed to be having script_enemy_main in your script somewhere. It might not exist, in Danmakufu's eyes. If you get what I mean...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 19, 2011, 06:28:03 AM
Your locale isn't parsing the Japanese correctly. Either AppLocale isn't on the proper setting or you don't have the proper languages installed.
Regardless, it's either saying script_enemy_main doesn't exist or that your brackets are mismatched. Can you pastebin your script?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on October 19, 2011, 11:45:55 AM
Quote
・oggのBGM再生時、2秒以内のファイルしか再生できなくなっていたのを修正
Fixed *.ogg bgm playback
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DgBarca on October 24, 2011, 12:45:21 PM
Well hi.
I wanted to do a image that is only rendered on another image to do something like the transition between the normal and spirit world in TD (http://img803.imageshack.us/img803/5421/th009.png). But in fact I have no idea how to do this. I managed to do something with a white zone and the pic in multiply blending but only if the background is completely black.

Well, I might not be clear, but something like this : http://img3.imageshack.us/img3/3896/testcbp.png
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on October 24, 2011, 01:52:53 PM
The first one and the second one are completely different. What exactly do you want to do?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DgBarca on October 24, 2011, 02:03:35 PM
Well, I have a surface, and on this surface is drawn a picture. And the picture is not drawn out of the surface.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 25, 2011, 03:51:44 AM
What you want is an alpha mask. Unfortunately it doesn't seem like there's an easy way to do even a simple one in Danmakufu, but if you're content with a mask that simply turns pixels on/off rather than turning some pixels semi-transparent as well (unless you're masking an add-blend image in which case it's much much simpler), you can do it. If you want to do anything besides extraordinarily basic stuff it's going to be extremely process-heavy.

Firstly you make a completely black-white (as in binary) image where the white is what shape you want to turn pixels invisible (to reveal the image underneath) and the black is the stuff you want untouched. Then in-script you create a render target with the affected image as the first image, then the white image where you want to remove, and set the render mode to subtract. This will obviously turn all overlapped pixels black, and thus transparent. You then use this target as the foreground image you use.

If you want a mask shape that moves about the image (necessary for a moving foreground/background), you're going to need to recreate the render target every frame. If you want a shape that changes over time, you're going to need to either apply a mask image multiple times or add onto the target you already have (such as you would with trance mode). Obviously this gets expensive very quickly. If you do want an image that does have semi-transparent pixels as well, it just becomes exponentially expensive since it's basically fusing a lower-transparency image onto a higher-transparency image over and over.

There's really no easy way I can think of.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on October 25, 2011, 12:44:13 PM
Well, I have a surface, and on this surface is drawn a picture. And the picture is not drawn out of the surface.


Download Link here (http://www.mediafire.com/?k7k9gaq4giwafh6)

This is a short text file that contains the two functions I just made:
ImageOverImageA1(obj, path, InX, InY, radset)
 - You must create a primitive object in your own script, then put that into the obj parameter
    + (Example: let ImgMove = ObjPrim_Create(OBJ_PRIMITIVE_2D); )
 - path is the path to the image you want in a circle
 - InX is the middle  X coordinate of the radius that will be drawn in the circle
 - InY is the middle  Y coordinate of the radius that will be drawn in the circle
 - radset is the radius of the image that will be drawn

SetNewImageRender(obj, InX, InY, radset)
 - Parameters are the same as above, except these will only update the image to render on the already existing object, so only call this once you have called ImageOverImageA1 first

This is just the base for the effect you want, you must manually set the Object Position on your own, #Include this script in your own script, and other such things for effects such as setting the scale or alpha.

Also I'm not entirely sure if this is what you wanted, but I made it match that example image you showed (except for the fade effect, you will have to create a triangle strip and put it around the circle or something similar).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Angelic Pride on November 02, 2011, 01:18:57 AM
Having problems with Danmakufu ph3

I am able to start the game perfectly, and no errors pop up.

I am able to see the scripts in the Directory

However, I am unable to play them no matter what keys I press on the keyboard. What do I do, and what is my problem?

Note:
I have Applocale, if you ask.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheMasterSpark on November 13, 2011, 09:18:14 PM
Having problems with Danmakufu ph3

I am able to start the game perfectly, and no errors pop up.

I am able to see the scripts in the Directory

However, I am unable to play them no matter what keys I press on the keyboard. What do I do, and what is my problem?

Note:
I have Applocale, if you ask.

Can you describe the situation a bit more? Have you pressed the Z key to select a script?

Anyway, I've got a question of my own. I'm being a bit lazy now, but is there any feasible way to get two sets of player controls running at the same time? I've been thinking about the potentials of co-op play, but can it actually be done? Are there enough input keys to go around? There'd only be a single player script running, but perhaps the second player could be created like an option object to the first player and then controlled independently?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shockman on November 19, 2011, 04:33:51 AM
Anyway, I've got a question of my own. I'm being a bit lazy now, but is there any feasible way to get two sets of player controls running at the same time? I've been thinking about the potentials of co-op play, but can it actually be done? Are there enough input keys to go around? There'd only be a single player script running, but perhaps the second player could be created like an option object to the first player and then controlled independently?

If you go into the config.exe and set the main player's controls to different keys, and then create a separate script for the second player and use GetVirtualKeyState (http://dmf.shrinemaiden.org/wiki/index.php?title=Input_Functions#GetVirtualKeyState) to control the second player, then it might be possible. But I'm not sure that GetVirtualKeyState would end up following the original keys, I don't think they will.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on November 19, 2011, 05:40:13 AM
If you go into the config.exe and set the main player's controls to different keys, and then create a separate script for the second player and use GetVirtualKeyState (http://dmf.shrinemaiden.org/wiki/index.php?title=Input_Functions#GetVirtualKeyState) to control the second player, then it might be possible. But I'm not sure that GetVirtualKeyState would end up following the original keys, I don't think they will.
I think it won't work. Virtual key values are predefined constants.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 19, 2011, 06:58:17 AM
Yes, but the very definition of a virtual keyboard implies it's controlled by the program, not your keyboard itself. If you change the keymap around it'll reflect those changes.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shockman on November 19, 2011, 07:02:38 AM
Yes, but the very definition of a virtual keyboard implies it's controlled by the program, not your keyboard itself. If you change the keymap around it'll reflect those changes.

That's what I thought.  :wat:

In that case, I don't know any other way for it to work.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Angele on November 24, 2011, 11:54:54 PM
It's already been a few month but there seems to be rather little love for ph3. I'd like to know if it would be better to continue using 0.12m, or to use ph3, for a beginner. I've played with 0.12m a little, and can do some basics, but if ph3 is the inevitable future I might as well just learn it. I'm just troubled by how few scripts and tutorials there are for ph3.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on November 25, 2011, 12:44:28 AM
Use ph3 because as you said, it's the inevitable future. The basic stuff are similar to 0.12m for the most part so the old tuts would still work.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 25, 2011, 02:06:55 AM
It's already been a few month but there seems to be rather little love for ph3. I'd like to know if it would be better to continue using 0.12m, or to use ph3, for a beginner. I've played with 0.12m a little, and can do some basics, but if ph3 is the inevitable future I might as well just learn it. I'm just troubled by how few scripts and tutorials there are for ph3.
1. It's still in beta. At the pace mkm seems to be working, we might have a full release by January.
2. Most tutorials learned from 0.12 can easily be applied to ph3, even if they aren't literally the same thing. If you understand the tutorials in 0.12 and understand the differences in ph3, then it should be simple to apply the standard tutorials.
3. Just continue using ph3 if you've barely even scraped the surface of 0.12 anyways.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: claudius90 on November 25, 2011, 03:54:25 AM
Glad I'm not the only one, I'm also a beginner here, and I really want to make a game project like Touhou. But when I frst came here, ph3 also released, so I thought I should wait till there's some tuts about it. Since I'm pretty clueless how to start this.

But I decide I should start to research it now, I hope I can get some help from you guys ^w^.

Anyway, I'm trying to learn about user defined bullet (shotdata). I have some questions to make

Quote
ShotData{
   id = 1 //ID - Default Green Shots
   rect = (49,197,69,233)
   render = ALPHA
   alpha=164
   collision = 16
}

As I learned
id: to be recalled later in main code
rect: left, top, right, bottom of the bullet in the image

I have no ideas of the rest, but I guess alpha is opacity of the bullets

And about "rect", how do you know the exact region of the bullet you need, or you have to measure in the image by yourself?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on November 25, 2011, 04:28:03 AM
Something like that
Code: [Select]
ShotData{
id=1 // Unique ID
rect=(1,358,32,387) //x1, y1, x2, y2
render=ADD // Render type - ADD or ALPHA
angular_velocity = 0 // Makes bullet spin (doesn't seem to work yet
delay_color= (128,128,128) // The color of the delay texture (r,g,b)
alpha=164 // Alpha
collision = 16 // Collision radius, i.e. bubble shots have smaller collision than their texture.
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 25, 2011, 05:52:50 AM
You can figure out the bounding rectangle of the bullet in most image editing programs by moving the cursor to the desired point. If the image loads properly, MS Paint tells you each point very easily. Photoshop you have to go Window -> Info to get the position of your cursor.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on November 25, 2011, 05:07:29 PM
How do you make the FW/TD lifebar?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on November 28, 2011, 07:35:22 AM
I've been viewing a number of tutorials relating to microthreading using v0.12.
However, I'm having modifying shot angle/velocity (after firing) in ph3 (Beta 3).
(Let me clarify:
In my script, I have a small task to fire bullets using CreateShotA1.
I tried a While (!Obj_IsDeleted) loop with a delay ( loop (30) { yield; } ) and to use (ObjMove_SetAngle) with the output of CreateShotA1. No change is observed however.)

Could you help me with this?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on November 28, 2011, 09:10:19 AM
You should use
ObjMove_AddPatternA1 ,ObjMove_AddPatternA2, ObjMove_AddPatternA3 or ObjMove_AddPatternA4
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on November 28, 2011, 08:14:27 PM
For some reason, this crashes danmakufu when it comes to the portion of the stage where I have added it:

Code: [Select]
scene = ObjEnemyBossScene_Create();
ObjEnemyBossScene_Add(scene, 0, "./boss/RanN1.dnh");
if(GetDif>2){
//ObjEnemyBossScene_Add(scene, 0, "./boss/RanS1.dnh");
}
ObjEnemyBossScene_LoadInThread(scene);
while(!Obj_IsDeleted(scene)){yield;}

If I remove it then it doesn't crash. Any idea what the problem might be?

Here's the link to the entire script if that helps (it's quite long though): http://pastebin.com/mZSusVPs
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on November 29, 2011, 04:56:12 AM
For some reason, this crashes danmakufu when it comes to the portion of the stage where I have added it:
./ only works in headers, use GetCurrentScriptDirectory instead
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on November 30, 2011, 06:52:10 PM
Does anyone know why the "ITEM_POINT" and "ITEM_POINT_S" arguments of "EV_GET_ITEM" doesn't work?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on November 30, 2011, 09:50:35 PM
How do you make the FW/TD lifebar?
Whatever the equivalent of effect objects is... You'll need to use a triangle fan with the first point in the center of your circle image. Alternatively, you can use a triangle strip and bend a straight line into a circle and slowly shrink it.

Does anyone know why the "ITEM_POINT" and "ITEM_POINT_S" arguments of "EV_GET_ITEM" doesn't work?
Scoured the wiki but I have no idea what EV_GET_ITEM is. It doesn't sound like a function so you might be mixed up about something.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on December 01, 2011, 03:21:41 PM
Scoured the wiki but I have no idea what EV_GET_ITEM is. It doesn't sound like a function so you might be mixed up about something.

EV_GET_ITEM is an @Event argument used in player script to get when a certain item is picked up by the player. But only the ITEM_POINT and ITEM_POINT_S doesn't work.

On a side note, is there any other way to get when a point item is picked up?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on December 01, 2011, 03:48:50 PM
EV_GET_ITEM is an @Event argument used in player script to get when a certain item is picked up by the player. But only the ITEM_POINT and ITEM_POINT_S doesn't work.
Ehhh, I dunno then. Maybe it's a bug, but I don't use ph3 at all.

Quote
On a side note, is there any other way to get when a point item is picked up?
You can try doing something like this instead:
Code: [Select]
task Something {
    let points = GetPoint();
    loop {
        while(points == GetPoint()){
            yield;
        }

        // Anything run here will only happen when the total number
        // of points picked up changes (which will usually be when a
        // point is picked up)

        // Set the points variable to equal GetPoint() so it'll enter the
        // while loop again
        points = GetPoint();
    }
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on December 01, 2011, 03:56:52 PM
You can try doing something like this instead:
Code: [Select]
task Something {
    let points = GetPoint();
    loop {
        while(points == GetPoint()){
            yield;
        }

        // Anything run here will only happen when the total number
        // of points picked up changes (which will usually be when a
        // point is picked up)

        // Set the points variable to equal GetPoint() so it'll enter the
        // while loop again
        points = GetPoint();
    }
}

The problem is that the point counter isn't increased when a point item is collected, so you have to do it manually, which i cannot because i cannot get when they are picked up...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on December 01, 2011, 05:04:19 PM
I'm all out of ideas then. I'd have to actually experiment with ph3 to be of any help and I don't really feel like doing that... Anyone else wanna take a stab at this?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on December 03, 2011, 01:45:58 PM
You should use
ObjMove_AddPatternA1 ,ObjMove_AddPatternA2, ObjMove_AddPatternA3 or ObjMove_AddPatternA4
Since these functions only allow you to change speed/direction/other crap after a certain period, how could you make bullets change their properties once a certain condition is fulfilled, (barring doing some calculations, of course) such as bullets bouncing off walls?
~TH
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 04, 2011, 02:03:30 AM
The new engine seems much more cooler ( Infact I changed the default screen to Undefined Fantastic Object  ). Finally something new I can do without fucking include functions for the CTC shot sheet. YES!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 04, 2011, 02:36:13 AM
Since these functions only allow you to change speed/direction/other crap after a certain period, how could you make bullets change their properties once a certain condition is fulfilled, (barring doing some calculations, of course) such as bullets bouncing off walls?
Object bullets, or math to calculate the frames needed for the effect to happen :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 09, 2011, 11:08:05 AM
Well if you're just interested in bouncing off walls one, you can also just shoot the symmetric image of your bullet.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 09, 2011, 12:35:38 PM
Does anyone know all the functions of ph3? I'm making a function replace for 0.12m so can someone provide with the most functions or a link to all the functions?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on December 09, 2011, 12:58:40 PM
Does anyone know all the functions of ph3? I'm making a function replace for 0.12m so can someone provide with the most functions or a link to all the functions?

The wiki has most of them described: http://dmf.shrinemaiden.org/wiki/index.php?title=Functions_(ph3)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on December 11, 2011, 12:57:26 PM
I would like to learn about tasks and familiars...
Because the truth is that i NEVER use tasks and I'd like to start now...
I know there's already a tutorial about this,but it don't seem to work in ph3... :ohdear:

So,please,can someone show me a very simple task of familiar spawning  around the boss and shooting bullets in a code?
Pwease?

(I don't really know if it's in here or in the danmaku request thread that I should post,but since it's about ph3.. might as well get it in here.)
Thanks!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 11, 2011, 05:59:26 PM
Hi. Just to say I'm new-ish to Dnh and I would like to know how to script certain things (mostly about bullet patterns).

1. I've been trying to script to make a spiral of bullets, like the beginning of Hina Kagiyama's last spell card on MoF. I suppose it has something to do wit 'ascent'? Or 'descent'?  I'm such a ⑨. I mean, something like the enemy fires 1 bullet down, the next one right after (at about 10 degrees to the right/left, and over and over).

2. For me, it's impossible to to make something fire at say like 30 frames, and have something else fire at 45 frames. I've been doing something like this:
Code: [Select]
@MainLoop
{
let px = GetPlayerX();
let py = GetPlayerY();
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angleToPlayer = atan2(py - ey, px - ex);

if(frame == 30){
let obj = CreateLooseLaserA1(ex, ey, 2, angleToPlayer, 20, 10, DS_ICE_PURPLE, 10);
}
        if(frame == 45){
        let obj2 = CreateLooseLaserA1(ex, ey, 5, angleToPlayer, 200, 50, DS_ICE_RED, 10);

}
frame = 0;
}

If I do something like that, it just comes up with errors and all that stuff.

3. How the hell do you create tasks? Or external scripts? I've always been confused by them. What I'm interested in more is external scripts where you can load bullet patterns and spellcards and all that stuff, right?

4. Could someone please provide me with greater explanation for mathematical and syntax functions. They are very WTH. Never fully understandable.

Thanks in advance.
fonduemaster
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 11, 2011, 08:02:30 PM
Hi. Just to say I'm new-ish to Dnh and I would like to know how to script certain things (mostly about bullet patterns).

1. I've been trying to script to make a spiral of bullets, like the beginning of Hina Kagiyama's last spell card on MoF. I suppose it has something to do wit 'ascent'? Or 'descent'?  I'm such a ⑨. I mean, something like the enemy fires 1 bullet down, the next one right after (at about 10 degrees to the right/left, and over and over).

2. For me, it's impossible to to make something fire at say like 30 frames, and have something else fire at 45 frames. I've been doing something like this:
Code: [Select]
@MainLoop
{
let px = GetPlayerX();
let py = GetPlayerY();
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angleToPlayer = atan2(py - ey, px - ex);

if(frame == 30){
let obj = CreateLooseLaserA1(ex, ey, 2, angleToPlayer, 20, 10, DS_ICE_PURPLE, 10);
}
        if(frame == 45){
        let obj2 = CreateLooseLaserA1(ex, ey, 5, angleToPlayer, 200, 50, DS_ICE_RED, 10);

}
frame = 0;
}

If I do something like that, it just comes up with errors and all that stuff.

3. How the hell do you create tasks? Or external scripts? I've always been confused by them. What I'm interested in more is external scripts where you can load bullet patterns and spellcards and all that stuff, right?

4. Could someone please provide me with greater explanation for mathematical and syntax functions. They are very WTH. Never fully understandable.

Thanks in advance.
fonduemaster

I think you need to start with th_dnh0.12m~. Tasking is easier there and most us already understand all of 0.12m~. To answer your question, since there is no page on the new wiki about functions, I'll explain what I know. You can make bullets, customize angle, and some stuff at CreateShot(A\B)1.  Tasking, I think it is done at finalize like 0.12m~. Mathematically, It depends on the angles, velocity, direction, and delay. Other mathematical functions are Obj_(Whatever you call it) and (maybe) SetMovePosition(I don't know the number).  Oh yeah, next time Pastebin you codes.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 11, 2011, 10:29:48 PM
Quote
I think you need to start with th_dnh0.12m~. Tasking is easier there and most us already understand all of 0.12m~. To answer your question, since there is no page on the new wiki about functions, I'll explain what I know. You can make bullets, customize angle, and some stuff at CreateShot(A\B)1.  Tasking, I think it is done at finalize like 0.12m~. Mathematically, It depends on the angles, velocity, direction, and delay. Other mathematical functions are Obj_(Whatever you call it) and (maybe) SetMovePosition(I don't know the number).
What. There is no possible way he could have understood that, I barely did myself.


Anyways fonduemaster, you'd be much better off having people explain things to you in real time rather than, from the looks of it, explaining nearly everything about danmakufu. When you have the time, please head over to the #danmakufu IRC channel (http://webchat.ppirc.net/?channels=danmakufu).

1. Would be easier to do using tasks unless you want MainLoop to get a bit complicated. You can do it with MainLoop, it's just much easier if you learn tasks first.

2. You should be linking a screenshot of the error, or copying the contents of the error. From the looks of it, frame might not be predefined, and even if it was there isn't anything increasing frame in your code so it won't go anywhere. Really it just looks like you don't yet understand program flow at all.

3. Tasks you should read tutorials for and ask questions in the IRC chat for. External scripts you shouldn't be thinking about whatsoever at this point.

4. Again, ask those kinds of questions in the IRC chat. That's less of being confusing than you just not understanding how anything works.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 12, 2011, 01:02:28 AM
What. There is no possible way he could have understood that, I barely did myself.


Anyways fonduemaster, you'd be much better off having people explain things to you in real time rather than, from the looks of it, explaining nearly everything about danmakufu. When you have the time, please head over to the #danmakufu IRC channel (http://webchat.ppirc.net/?channels=danmakufu).

1. Would be easier to do using tasks unless you want MainLoop to get a bit complicated. You can do it with MainLoop, it's just much easier if you learn tasks first.

2. You should be linking a screenshot of the error, or copying the contents of the error. From the looks of it, frame might not be predefined, and even if it was there isn't anything increasing frame in your code so it won't go anywhere. Really it just looks like you don't yet understand program flow at all.

3. Tasks you should read tutorials for and ask questions in the IRC chat for. External scripts you shouldn't be thinking about whatsoever at this point.

4. Again, ask those kinds of questions in the IRC chat. That's less of being confusing than you just not understanding how anything works.

I'm a bad at explaining stuff. Well I'll let you explain stuff more clear.

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 12, 2011, 04:36:25 PM
Thank you lots Drake and marisa x reimu, this will come in handy.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on December 15, 2011, 04:40:26 AM
I'm a newbie and I have some questions  :D

1. I know how to make a straight laser, but how can I make it permanently?
2. How can I "move" the laser angularly (like Tewi from Touhou 8, but keep on moving...)
3. So I make "a round of bullet" like:

Code: [Select]
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angle=o;
while(angle<360)
{
                  let obj = CreateShotA1(ex, ey, 2, 90, DS_BALL_BS_RED, 10);
                  ObjMove_AddPatternA4(obj,  60,  3,  0,  0,  0,  3, objPlayer, NO_CHANGE);
                  angle+=15;
}

How can I keep the round of bullet aiming at the player without "dis-round" it? (like Aya non-spell form Touhou 10)

That's all, sorry for my English because i'm Asian ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on December 15, 2011, 10:18:08 AM
If you want something like that, i can help you.
http://www.youtube.com/watch?v=r3_EDoE4kWg
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on December 15, 2011, 02:58:52 PM
That's great! Can you give me the script? :D
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on December 16, 2011, 05:31:51 AM
No, i won't give it to you, but i can help you in making one. You must learn scripting, not  just Ctrl+C/Ctrl+V-ing.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 16, 2011, 06:11:09 AM
3. So I make "a round of bullet" like:
Code: [Select]
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angle=o;
while(angle<360)
{
                  let obj = CreateShotA1(ex, ey, 2, 90, DS_BALL_BS_RED, 10);
                  ObjMove_AddPatternA4(obj,  60,  3,  0,  0,  0,  3, objPlayer, NO_CHANGE);
                  angle+=15;
}

How can I keep the round of bullet aiming at the player without "dis-round" it? (like Aya non-spell form Touhou 10)
I think what you might be looking for is this.
Please tell me if it something's wrong.
Code: [Select]
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angle=0;
while(angle<360){
                let obj = CreateShotA1(ex, ey, 2, angle, DS_BALL_BS_RED, 10);
ObjMove_AddPatternA1(obj, 60, 3, GetAngleToPlayer(objEnemy));
                angle+=15;
}

You want all of the bullets to go in the same direction, right?
For this, you want to know the function GetAngleToPlayer(). This will be the new angle for the bullets.
When you put "objEnemy" in the "()", you are saying that this new angle will be the direction from the boss to the player.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on December 17, 2011, 06:29:08 PM
Hum hum hi every one.

I bought an Asus PC for Christmas with windows 7 system.
I want to know if danmakufu can be run on windows 7....
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 17, 2011, 07:46:53 PM
Hum hum hi every one.

I bought an Asus PC for Christmas with windows 7 system.
I want to know if danmakufu can be run on windows 7....

Of Course it Can Duh!

Here are the steps TO FREEDOM!:

1. Download Touhou Danmakufu ( 0.12m~ or ph3. Whichever one you prefer )

2. Download AppLocale and install.

3. As you see, Applocale isn't running. Configure CMD ( Type in CMD or Command Prompt ). Then, run it in admin

4. It gives you a file location. Place Applocale ( apploc ) into that location, folder, file, etc.

5. type in CMD "apploc.msi"

6. YOU HAVE APPLOCALE! SELECT JAPANESE AND RUN TH_DNH!

Video

Applocale Install (http://www.youtube.com/watch?v=THbWXMHYNrs)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on December 17, 2011, 10:03:30 PM
I know what is Applocal (I'm not a danmakufu begginer ?_? ) but it can't run on window 7. And I want to know if ph3 can be run on windows 7 without applocal? I think, there are stuffs to do with unicode...

(Sorry if my english is frenchly bad :P)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 17, 2011, 10:56:19 PM
AppLocale runs fine on Windows 7 if you can get it to install properly, but the installation does have problems. If you just download the msi file and try to install, it will fail. This is because of a bug with the UAC prompt.

1. Put the apploc.msi into the C:\Windows\system32 folder, (unless you know how to navigate using the command prompt).
2. In the search/run bar in the start menu, type cmd, then press Ctrl, Shift and Enter. The UAC box will pop up and the command line will start in admin mode.
3. Type apploc.msi and hit enter to start installation, (or if can navigate, just CD to the installer).

Alternatively, you can temporarily disable the UAC by going to Start -> Control Panel -> Action Center -> Change User Account Control settings, then set it to "Never notify". Install AppLocale, then turn the UAC setting back to default.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 17, 2011, 11:01:33 PM
I know what is Applocal (I'm not a danmakufu begginer ?_? ) but it can't run on window 7. And I want to know if ph3 can be run on windows 7 without applocal? I think, there are stuffs to do with unicode...

(Sorry if my english is frenchly bad :P)

Unicode? I have ph3 and it runs perfectly fine of Windows 7. Just run it with applocale ( it works in windows 7...)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MMX on December 18, 2011, 02:05:14 AM
AppLocale runs fine on Windows 7 if you can get it to install properly, but the installation does have problems. If you just download the msi file and try to install, it will fail. This is because of a bug with the UAC prompt.

1. Put the apploc.msi into the C:\Windows\system32 folder, (unless you know how to navigate using the command prompt).
2. In the search/run bar in the start menu, type cmd, then press Ctrl, Shift and Enter. The UAC box will pop up and the command line will start in admin mode.
3. Type apploc.msi and hit enter to start installation, (or if can navigate, just CD to the installer).

Alternatively, you can temporarily disable the UAC by going to Start -> Control Panel -> Action Center -> Change User Account Control settings, then set it to "Never notify". Install AppLocale, then turn the UAC setting back to default.
Hmm i've never experienced such an issues installing applocale on Win 7 :wat: And what is UAC prompt?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 18, 2011, 02:26:09 AM
User Account Control is that thing that pops up every time you run a program in admin mode or go install a program, asking you if you really want to run the program. It basically hinders things from installing unwanted programs. If you have it turned off then obviously you would have never had problems installing AppLocale, because the UAC is what screws it up.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MMX on December 18, 2011, 02:51:19 AM
User Account Control is that thing that pops up every time you run a program in admin mode or go install a program, asking you if you really want to run the program. It basically hinders things from installing unwanted programs. If you have it turned off then obviously you would have never had problems installing AppLocale, because the UAC is what screws it up.
Ah right than. That's one of the first thing i'm turning off after windows install.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on December 19, 2011, 02:22:57 PM
No, i won't give it to you, but i can help you in making one. You must learn scripting, not  just Ctrl+C/Ctrl+V-ing.

Then, how can I make the lazers moving? ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 19, 2011, 06:54:22 PM
Then, how can I make the lazers moving? ???

Lol, I don't know

Joking aside, just set the speed with Obj_SOMETHING and it moves.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 19, 2011, 11:38:29 PM
Then, how can I make the lazers moving? ???
You might be able to try ObjStLaser_SetAngle.


Besides that, is there a ph3 alternative to CreateShot12? I want bullets that have "gravity."
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 19, 2011, 11:47:39 PM
That would be the CreateShotB series.
CreateShotB1(x, y, xspeed, yspeed, graphic, delay);
CreateShotB2(x, y, xspeed, yspeed, xaccel, yaccel, xmaxspd, ymaxspd, graphic, delay);
CreateShotOB1(obj, xspeed, yspeed, graphic, delay);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 20, 2011, 12:34:45 AM
Are those functions still in development? CreateShotB1 and B2 don't seem to be registering with Danmakufu.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 20, 2011, 03:25:17 AM
Do you have beta 3? They're only available in the latest beta.
(Although I must admit I haven't actually tested them myself so I can't really help you after that lol)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 20, 2011, 05:36:28 AM
Oh, I thought I had beta 3, but I was actually working with b2+. Thanks.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Skyler on December 21, 2011, 12:46:55 AM
I can't seem to be able to play any scripts.
I have no idea how to work Danmakufu and the wiki isn't really helping; it doesn't give me enough information.
The ExRumia script isn't showing up in directory and neither are the other two I've downloaded.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on December 21, 2011, 01:10:08 AM
I can't seem to be able to play any scripts.
I have no idea how to work Danmakufu and the wiki isn't really helping; it doesn't give me enough information.
The ExRumia script isn't showing up in directory and neither are the other two I've downloaded.

Hope you read the information thread (http://www.shrinemaiden.org/forum/index.php/topic,6181.0.html) which has a link to the AppLocale tutorial (http://www.shrinemaiden.org/forum/index.php/topic,4138.0.html). If you still need help after that, we're going to need more information. Since you're posting in this thread, I'm guessing you're using ph3 instead of 0.12m so I'm not going to be much more help than this. I still haven't touched ph3.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 23, 2011, 02:02:55 PM
You might be able to try ObjStLaser_SetAngle.


Besides that, is there a ph3 alternative to CreateShot12? I want bullets that have "gravity."
The Dnh Wiki has no information on that...
nor with some of the other stuff.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on December 23, 2011, 02:41:18 PM
Even when I try to create object bullets (By defining all the properties) I still don't manage to change their properties when a certain condition is met (in this case, home on the player when it hits a wall):
(EDIT: Minor spelling mistake corrected)
Code: [Select]
task curvedhomingcrap(x,y,angle,angvel){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,2);
ObjMove_SetAngle(obj,angle);
ObjMove_SetAngularVelocity(obj,angvel);
ObjShot_SetGraphic(obj,DS_KNIFE_KOUMA_BLUE);
ObjShot_Regist(obj);
let n=1;
while (!Obj_IsDeleted(obj)){
let sx=ObjMove_GetX(obj);
let sy=ObjMove_GetY(obj);
if (((sx<=0)||(sy<=0)||(sx>=GetStgFrameWidth())||(sy>=GetStgFrameHeight()))&&(n==1)) {
n=0;
ObjMove_SetAngle(obj,GetAngleToPlayer(obj));
ObjMove_SetSpeed(obj,3);
ObjShot_SetGraphic(obj,DS_KNIFE_KOUMA_RED);
}
yield;
}
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 23, 2011, 05:59:09 PM
That would be the CreateShotB series.
CreateShotB1(x, y, xspeed, yspeed, graphic, delay);
CreateShotB2(x, y, xspeed, yspeed, xaccel, yaccel, xmaxspd, ymaxspd, graphic, delay);
CreateShotOB1(obj, xspeed, yspeed, graphic, delay);

Aren't there any more createshotB functions? the y-speed and the x-speed parameters for them dont work, even though Dnh recognises them. Also, i dont really understand the last function you put down...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 23, 2011, 08:26:36 PM
The Dnh Wiki has no information on that...
nor with some of the other stuff.
It's there, it just doesn't have a description for it right now.
http://dmf.shrinemaiden.org/wiki/index.php?title=Shot_Object_Functions#ObjStLaser_SetAngle
Check towards the bottom.

Even when I try to create object bullets (By defining all the properties) I still don't manage to change their properties when a certain condition is met (in this case, home on the player when it hits a wall):
(EDIT: Minor spelling mistake corrected)
Code: [Select]
stuff
I don't see what's wrong. I tried it out and it works fine.

Aren't there any more createshotB functions? the y-speed and the x-speed parameters for them dont work, even though Dnh recognises them. Also, i dont really understand the last function you put down...
What are you filling in for the xspeed and yspeed?
If you want the bullet to move at, say, a 35-degree angle, I think the speeds should be
xspeed= speed*cos(35)
yspeed= speed*sin(35)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on December 23, 2011, 08:26:45 PM
I don't get ph3 beta. What are the functions to script? And how to task?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 24, 2011, 12:03:55 AM
Anyone have an example for a scrolling, tiled background? Or even a static background, for that matter.

Also, how do I display quotation marks in text?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Schezo on December 24, 2011, 03:26:00 AM
Cloud:
This is what I used to make my background during the spellcards in Schezo4U
Code: [Select]
task DrawBGspell(drawbg){
let bgs = 0;

if(drawbg){
ObjPrim_SetTexture(objBG1, BG1);
Obj_SetRenderPriorityI(objBG1,25);
ObjPrim_SetTexture(objBG2, BG2);
Obj_SetRenderPriorityI(objBG2,26);
}

while(!Obj_IsDeleted(objEnemy))
{

if(drawbg){
        ObjSprite2D_SetSourceRect(objBG1,0,bgs,700,500+bgs);
ObjSprite2D_SetDestRect(objBG1,0,0,700,512);
ObjSprite2D_SetSourceRect(objBG2,-bgs/3,bgs/2,700-bgs/3,500+bgs/2);
ObjSprite2D_SetDestRect(objBG2,0,0,512,512);
bgs++;
}
yield;
}
}
With objBG1 and 2 being predefined call the task in initialize and it should give a decent background.
objBG1 was a 480x640
objBG2 was a 256x256

I don't know about the quotation marks though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on December 24, 2011, 05:27:23 AM
I don't see what's wrong. I tried it out and it works fine.
Well, then there must be something wrong with my machine.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on December 24, 2011, 05:47:24 AM
Well, then there must be something wrong with my machine.
Try using ObjMove_AddPattern instead.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on December 24, 2011, 06:02:14 AM
Try using ObjMove_AddPattern instead.
Ah, but I want to make it change directions once a certain condition is met; barring more math, how could I do it with that?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Rosen on December 24, 2011, 06:13:08 AM
Ah, but I want to make it change directions once a certain condition is met; barring more math, how could I do it with that?
Your conditions are right, and it also works fine when i run your task.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 24, 2011, 06:15:53 AM
At this rate it might be better if you could pastebin the whole script for us.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 24, 2011, 07:34:59 AM
Quotation marks can probably maybe be used with an escape character like "blabla"blablabla" or something.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on December 24, 2011, 07:47:02 PM
It works! Thanks.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on December 26, 2011, 12:04:28 PM
I'll repeat my question...

Can anyone (that uses Ph3) can tell me how to make a shot task?
Because I want to know how to do cool things!:3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 26, 2011, 02:17:06 PM
Code: [Select]
task Taskname(your parameters){

//define whatever you need (often, a time counter) and put any code you need here

let obj=ObjShot_Create(OBJ_SHOT);
 ObjMove_SetPosition(obj,some x, some y);
ObjShot_SetGraphic(obj, bullet id);
ObjMove_SetAngle(obj, some angle);
ObjMove_SetSpeed(obj, some speed);
 //etc. (delay, fade, bomb resist ...)
ObjShot_Regist(obj);

while(GetLife>0 && !Obj_IsDeleted(obj)){ //you'll usually want the bullet to disappear when the current nonspell/spell ends, and the task to end when the bullet is deleted (eg by a bomb)
yield; //don't forget that little one : it pauses this task in order to let the other tasks advance too
//put what the bullet does every frame here.
}
Obj_Delete(obj); // if you got out of the loop because life was under 0, delete the bullet.
//put other aftereffects here if any.
}

Try to understand the following task, as an example.

Code: [Select]
task EDivShot(x,y,a,g,d,k){

let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjShot_SetGraphic(obj,g);
ObjMove_SetAngle(obj,a);
ObjMove_SetSpeed(obj,0);
ObjShot_Regist(obj);

let t=0;

while(GetLife>0 && !Obj_IsDeleted(obj)){

t++;
yield;

if(t==d){CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a-60,0.05,1.5,g+1,0);
CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a+60,0.05,1.5,g+1,0);}

if(t==d+60){ObjMove_SetAngle(obj,a+k);}
if(t>=d+60){ObjMove_SetSpeed(obj,(t-(d+60))*0.01);}

}
Obj_Delete(obj);
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on December 26, 2011, 03:08:15 PM
I have:

http://pastebin.com/9D7JzeZ6

And even with your task,there is still a problem!(thanks for explaining to me btw)
Is there something missing?^^"
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 26, 2011, 04:26:58 PM
Is it possible to make an enemy shot from a player script ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on December 26, 2011, 06:46:59 PM
And even with your task,there is still a problem!(thanks for explaining to me btw)
Is there something missing?^^"

The task is never called, so it never runs.
You also have an extra } right after the yield in @MainLoop.

Is it possible to make an enemy shot from a player script ?

I've tried to do so in the past with no success. I don't think it's possible.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on December 26, 2011, 07:35:34 PM
I've a problem with applocal herrrrr.
I put apploc.msi in my system32 folder and I ran cdm, and I wrote "apploc.msi" (without "" of course). But it's finally a fail ! >.< help me please I want to have ph3 on my computer >.<
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 26, 2011, 08:48:51 PM
And, err, how should I do if i want to kill the player in the player script ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on December 26, 2011, 09:54:51 PM
And, err, how should I do if i want to kill the player in the player script ?
You could probably use SetShotIntersectionCircle for one frame with a radius large enough to cover the entire screen. Haven't tested if it works in player scripts though.

Here's a link to the wiki documentation: http://dmf.shrinemaiden.org/wiki/index.php?title=Shot_Functions#SetShotIntersectionCircle
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 26, 2011, 09:57:11 PM
I have:
[code]
And even with your task,there is still a problem!(thanks for explaining to me btw)
Is there something missing?^^"
Mismatching brackets. I would tell you to go figure out where but gtbot decided to be overly helpful instead lol

I've a problem with applocal herrrrr.
I put apploc.msi in my system32 folder and I ran cdm, and I wrote "apploc.msi" (without "" of course). But it's finally a fail ! >.< help me please I want to have ph3 on my computer >.<
Did you run the command line in administrator mode? Gotta right-click and select it.

And, err, how should I do if i want to kill the player in the player script ?
It isn't implemented yet, but you could always recreate the death sequence by forbidding shot and bomb, disappearing, setting lives down, waiting, repositioning, etc. Why would you want to do that anyways?

You could probably use SetShotIntersectionCircle for one frame with a radius large enough to cover the entire screen.
...They just went over that enemy shots don't work in player scripts. That was the first idea.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 26, 2011, 11:17:51 PM
Quote
It isn't implemented yet, but you could always recreate the death sequence by forbidding shot and bomb, disappearing, setting lives down, waiting, repositioning, etc. Why would you want to do that anyways?

I wanted to make a "Perfect Freeze" (of pofv, not gfw) bomb. For that I needed to create new bullets in the player script (just changing speed and angle of the bullets wouldn't work well). But in ph3, all bullets created in the player scripts are considered as shot by the player and therefore do not kill the player. And you can't start enemy scripts from the player script. So I just decided that freezing the bullet would transform its shape into a unique shape, and i'd just have to manually check for collisions with the player. Except that even if I detected the collision, I had no mean to kill the player.

Since this is for a peculiar game script, i just make the game script spawn and delete an invisible bullet when notified of a certain Event, and I make the player script notify other scripts about that Event when a collision is detected.

But this is not a solution for just any script, of course.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on December 27, 2011, 03:04:57 PM
Sorry but I found the solution to run danmakufu on my computer ^^'

But I have a new problem hurrrrrr, I want to create an explosion when my boss is defeated but nothing happen -_-' just a picture...

Code: [Select]


task Explode01(x,y,scalex,scaley,alpha)
{
                let frame = 1;
                let int = false;
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
Obj_SetRenderPriority(obj, 1);
ObjPrim_SetTexture(obj, Explode1);
ObjSprite2D_SetSourceRect(obj, 0, 0, 63, 64);
ObjSprite2D_SetDestRect(obj, 0, 0, 63, 64);
ObjRender_SetPosition(obj, x, y, 0);
                ObjRender_SetScaleX(obj,scalex);
                ObjRender_SetScaleY(obj,scaley);
                ObjRender_SetAlpha(obj,alpha);
  while(Obj_IsDeleted(obj)==false)
{
if(frame == 5){int = true;}
frame++;
wait(1);

if (int==true)
{

loop(255)
{
alpha--;
ObjRender_SetAlpha(obj,alpha);
wait(0.5);
}

int = false;

}
}
yield;
}

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 27, 2011, 03:11:17 PM
Code: [Select]
wait(0.5);
 :ohdear: :ohdear: :ohdear:

Can you remind us what is the function "wait" ?


On a side note, did you notice your task will be going on forever ?
I kinda understand what you wanted to do, but here's what your task does :
It does nothing during the first four frames, and then your int==true stuff on the fifth, and then nothing, forever.( You won't get out of the loop since nothing will delete your "obj" object.)
And ... what is that "yield;" right before the task ends ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on December 27, 2011, 03:49:21 PM
function wait is wrote don't worry hurrrr.

But the yield.....I don't know why it's here u_u'.

I try with scale but the picture appear directly big --_--:

Code: [Select]


function wait(w){loop(w){yield;}}

task Explode01(x,y,scalex,scaley,alpha)
{
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjRender_SetBlendType(obj, BLEND_ALPHA);
Obj_SetRenderPriority(obj, 1);
ObjPrim_SetTexture(obj, Explode1);
ObjSprite2D_SetSourceRect(obj, 0, 0, 32, 28);
ObjSprite2D_SetDestRect(obj, 0, 0, 32, 28);
ObjRender_SetPosition(obj, x, y, 0);
                ObjRender_SetScaleX(obj,scalex);
                ObjRender_SetScaley(obj,scaley);
                ObjRender_SetAlpha(obj,alpha);
wait(1);
loop(20)
{
scalex+=0.2;
ObjRender_SetScaleX(obj,scalex);
scaley+=0.2;
ObjRender_SetScaleY(obj,scaley);
}
}
I don't know what logic takes to program an explode like this ... help meee >.<
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 27, 2011, 04:03:14 PM
Code: [Select]
loop(20)
{
scalex+=0.2;
ObjRender_SetScaleX(obj,scalex);
scaley+=0.2;
ObjRender_SetScaleY(obj,scaley);
}
Well, looping 20 times through this is just equivalent to

Code: [Select]
scalex+=4;
ObjRender_SetScaleX(obj,scalex);
scaley+=4;
ObjRender_SetScaleY(obj,scaley);

It's not because you make loops that things become fluid ...
I think it's time for you to understand what our little yield; means, as it's explained well enough in the tutorials, I'd suggest you read them once more.

Now,

Code: [Select]
function wait(w){loop(w){yield;}}So, what happens when you're doing this : 
Code: [Select]
wait(0.5);
Code: [Select]
loop(0.5){yield;}Is that really what you want to be done !?

So, in your first bit of code, replace that nonsensical wait(0.5) by a proper wait(1), and in your second bit of code, place the yield; where it fits.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 27, 2011, 07:08:48 PM
And another question :

How would you make an auto-counterbomb ? More precisely, how can you detect a hit, and do you prevent it from killing the player ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on December 27, 2011, 07:37:09 PM
And another question :

How would you make an auto-counterbomb ? More precisely, how can you detect a hit, and do you prevent it from killing the player ?

The EV_HIT and EV_PLAYER_SHOOTDOWN both detects the hit, i guess one of them is before the actual death and the other the hit itself. I'm unsure, but maybe making the player invincible in one of those events prevents the death.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 27, 2011, 07:47:08 PM
I tried with both the events and the GetPlayerState function, but HIT fails and SHOOTDOWN is too late anyway.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on December 27, 2011, 10:06:54 PM
How would you make an auto-counterbomb ? More precisely, how can you detect a hit, and do you prevent it from killing the player ?

EV_HIT detects when a player is hit by an enemy object. To prevent death, or in other words counterbomb automatically, simply put in CallSpell; in the event. CallSpell will then run EV_REQUEST_SPELL.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on December 27, 2011, 10:29:55 PM
Yeah thanks ! At first i was trying to manually notify the events. Just a quick note : I tried just to do nothing when the event was called but it caused the spell to go on forever, you actually need to make sure to GetSpellManageObject(); and then delete the object, even if you do nothing else.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on December 31, 2011, 04:13:07 AM
At this rate it might be better if you could pastebin the whole script for us.
http://pastebin.com/vhPHfUvq
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 31, 2011, 06:50:49 AM
you have no yield in your mainloop aaaaaaaaaaaaaaaaaaaaaaaaaa
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on December 31, 2011, 04:11:38 PM
Recollection[Hana's scipt In my boss battle ohohoho.wav]

Well,i finally find (thanks to Hana) a script with them bouncing bullets!:D
it's gonna be so much fun!:D
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 31, 2011, 07:53:21 PM
But bouncing bullets in 0.12 and ph3 are exactly the same and is like the first thing you learn from object bullet tutorials, I don't see what you're getting at.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Miplouf Saigyouki on December 31, 2011, 08:31:43 PM
Well,I never really used tasks or object bullets before~
Btw i run the bouncing bullet script,but...is it normal that sometimes,there are let's say five bullets and then a hole of 2~3 bullets before getting back to normal?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on January 02, 2012, 08:06:48 AM
Well, how can I make bouncing bullets?  :ohdear:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 02, 2012, 09:57:20 PM
At the most basic level, bouncing bullets is knowing two things: how to manipulate object bullets (which is pretty simple and fundamental), and just knowing the procedure of how to bounce the bullets, which is just split into detecting when a bullet should bounce, and then just manipulating its angle. That's it, there's nothing special, which is why it's commonplace in tutorials. That being said, if you don't know how to bounce bullets in 0.12, then go read the Intermediate tutorial (http://www.shrinemaiden.org/forum/index.php/topic,865.0.html) and maybe watch Hele's videos (http://www.youtube.com/watch?v=8Yr3UxcJi5I) on object bullets (http://www.youtube.com/watch?v=fMBudAKGSlE). There is literally nothing different in ph3 besides the renaming of functions (which you can easily look up and/or should know already) and having to use ObjShot_Regist() to let dnh acknowledge and fire the bullet.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on January 03, 2012, 08:31:29 PM
Hi everyone!
So, I make a thread for my first ph3 experimentations (a total flop herrr)
So to complete my boss:

-How can I animate my boss (like touhou: animation movement ---> animation return to idle etc...)

-How can I do a circle life like Ten desires/Great Fairy War?

-How I can do background for my spell cards (what functions I must use)?

Thanks if you help me

-
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on January 03, 2012, 09:58:02 PM
-How can I animate my boss (like touhou: animation movement ---> animation return to idle etc...)
The same way it is done in 0.12m in general. Please check the tutorials for this. Except you replace the functions with the ph3 ones. (and sprite has become an object, but the mechanics is roughly the same)
Code: [Select]
ObjSprite2D_SetSourceRect(objEnemy, Left,  Top, Bottom, Right);
-How can I do a circle life like Ten desires/Great Fairy War?
Guessing it is done with effect objects. You need to understand Effect Objects or Objects in general. In ph3 they are using different functions but the base can be found in 0.12m tutorials as well for object style scripting.

-How I can do background for my spell cards (what functions I must use)?
Have you checked the wiki for Ph3? It is like written there.
Code: [Select]
let objScene = GetEnemyBossSceneObjectID();
ObjEnemyBossScene_StartSpell(objScene);

This activates spell card mode. For the BG function, again check the wiki =|


Almost all questions can be found in the wikis/tutorials with some imagination, excluding the life circle as 12.8 and 13 (as that is something most of us never attempted yet I think).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on January 05, 2012, 05:33:15 PM
-How can I animate my boss (like touhou: animation movement ---> animation return to idle etc...)
Try this animation library for ph3 (http://dl.dropbox.com/u/15870353/LucasAnimation.zip). Be sure to look at the examples and comments in the code.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: testingwalker on January 05, 2012, 06:58:45 PM
does anyone know where I can find a good detailed ph3 tutorial?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on January 05, 2012, 08:07:59 PM
does anyone know where I can find a good detailed ph3 tutorial?
No such thing. Yet.
In English anyway. Maybe Japanese ones exist.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 05, 2012, 10:04:03 PM
I was supposed to get around to that but I guess I sort of have to script things first.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on January 05, 2012, 11:49:16 PM
No such thing. Yet.
In English anyway. Maybe Japanese ones exist.
I thought there was a Japanese Manual or something for functions.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 06, 2012, 01:17:12 AM
If you could answer all your own questions about the fundamentals of ph3 using a functionlist and syntaxlist, I would be delighted. Unfortunately, this doesn't seem to be the case.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MMX on January 06, 2012, 02:09:10 AM
If you could answer all your own questions about the fundamentals of ph3 using a functionlist and syntaxlist, I would be delighted. Unfortunately, this doesn't seem to be the case.
Hmm.. Never touched ph3, but all i need for scripting in 0.12m is functions description on wiki. There are some fundamental questions coming from time to time, but nothing that could stop me. What's kind of case are you talking about? Lack of explanation of how those functions could be used to do things, or some gaps in understanding the basic workflow? :wat:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on January 06, 2012, 06:26:50 PM
Okay Lucas, Ihad somes problems with your lib (I don't understand anything).
So, I worked myself Ichirin animation, but I have problems:

Code: [Select]
task AnimateBoss
{
     let int = false;
     let count = 0;
     let count2 = 0;
let count3 = 0;
while(Obj_IsDeleted(objichirin) == false)
{
if(CheckDirection(objichirin, "right") == true){ObjRender_SetScaleXYZ(objichirin, 1, 1, 1)}
if(CheckDirection(objichirin, "left") == true){ObjRender_SetScaleXYZ(objichirin, -1, 1, 1)}
if(ObjMove_GetSpeed(objichirin) == 0 && int == true)
{
if(count3==5){ObjSprite2D_SetSourceRect(objichirin, 192, 96, 256, 192);}
if(count3==10){ObjSprite2D_SetSourceRect(objichirin, 128, 96, 192, 192);}
if(count3==15){ObjSprite2D_SetSourceRect(objichirin, 64, 96, 128, 192);}
if(count3==20){ObjSprite2D_SetSourceRect(objichirin, 0, 96, 64, 192);}
count3++;
int = false;
}
if(ObjMove_GetSpeed(objichirin) == 0)
{
if(count2==10){ObjSprite2D_SetSourceRect(objichirin, 0, 0, 64, 96);}
if(count2==20){ObjSprite2D_SetSourceRect(objichirin, 64, 0, 128, 96);}
if(count2==30){ObjSprite2D_SetSourceRect(objichirin, 128, 0, 192, 96);}
if(count2==40){ObjSprite2D_SetSourceRect(objichirin, 192, 0, 256, 96);}
count=0;
count3 = 0;
}

if(ObjMove_GetSpeed(objichirin) > 0)
{
if(count==5){ObjSprite2D_SetSourceRect(objichirin, 0, 96, 64, 192);}
if(count==10){ObjSprite2D_SetSourceRect(objichirin, 64, 96, 128, 192);}
if(count==15){ObjSprite2D_SetSourceRect(objichirin, 128, 96, 192, 192);}
if(count==20){ObjSprite2D_SetSourceRect(objichirin, 192, 96, 256, 192);}
count++;
int = true;
}
if(count2>40)
{
count2=0;
}
count2++;

yield;
}
}

"if(ObjMove_GetSpeed(objichirin) == 0 && int == true)" is the condition for the reverse move of ichirin but nothing hapened ichirin go to idle directly next the normal move.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on January 07, 2012, 12:58:03 AM
Code: [Select]
if(ObjMove_GetSpeed(objichirin) == 0 && int == true)
{
if(count3==5){ObjSprite2D_SetSourceRect(objichirin, 192, 96, 256, 192);}
if(count3==10){ObjSprite2D_SetSourceRect(objichirin, 128, 96, 192, 192);}
if(count3==15){ObjSprite2D_SetSourceRect(objichirin, 64, 96, 128, 192);}
if(count3==20){ObjSprite2D_SetSourceRect(objichirin, 0, 96, 64, 192);}
count3++;
int = false;
}
Variable int immediately becomes false the moment it becomes true, so it'll only run this if statement for 1 frame. A way around this would be to use this if(count3==25){int = false;} instead, or whichever value of count3 you'd like for the animation to go on for.

Quote
Code: [Select]
if(ObjMove_GetSpeed(objichirin) == 0)
{
if(count2==10){ObjSprite2D_SetSourceRect(objichirin, 0, 0, 64, 96);}
if(count2==20){ObjSprite2D_SetSourceRect(objichirin, 64, 0, 128, 96);}
if(count2==30){ObjSprite2D_SetSourceRect(objichirin, 128, 0, 192, 96);}
if(count2==40){ObjSprite2D_SetSourceRect(objichirin, 192, 0, 256, 96);}
count=0;
count3 = 0;
}
In this part of the code, count3 is always changed to be value 0, resulting in the above code to not be run, even if int was true.  A way around this would be to add && int == false in the if statement.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on January 07, 2012, 05:11:31 PM
Okay thanks for help, Gtbot, it's better now! But I want to make an attack animation and I have no idea how I must script this, can you help me again please >.<?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on January 07, 2012, 06:19:42 PM
Okay thanks for help, Gtbot, it's better now! But I want to make an attack animation and I have no idea how I must script this, can you help me again please >.<?

Define a new variable to the script (not the task) named whatever you want with value false.  Check if this variable is false, if so then perform the other three animation stance if statements (if(variable == false){other three animation if statements}). If true, make it perform the attack animation using the set up you have. Simply change the variable to true/false whenever you want the attack to play. Exact details depends on how you want to execute it. The easiest way using the setup you have right now would be to just add count4 and add a count4 = 0; below where count3 = 0; is at, just make sure you make the other three existing animations  don't run if the variable is true.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 11, 2012, 06:10:26 PM
 ???Can someone give me advice on how to make bullets reflect off walls and/or make a spiral of them ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 11, 2012, 06:50:11 PM
???Can someone give me advice on how to make bullets reflect off walls and/or make a spiral of them ???
Question, have you read the v0.12 Intermediate tutorial? The very first thing it does is explain how to fire a spiral of bullets, and later it explains how to bounce bullets. The methods used in ph3 are nearly exactly the same besides a few function name changes.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 11, 2012, 07:15:01 PM
Question, have you read the v0.12 Intermediate tutorial? The very first thing it does is explain how to fire a spiral of bullets, and later it explains how to bounce bullets. The methods used in ph3 are nearly exactly the same besides a few function name changes.
Ugh, I forgot. i usually skip the instructions, and just copy and paste the main loop parts (how nooby of me). ill read more and hopefully pay attention this time. sry
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DarkOverord on January 11, 2012, 08:54:20 PM
At risk of sounding stupid, but decided to start learning ph3 instead of lazily learning v0.12m. This isn't an issue but more of a question really.

Is there a list of Danmakufu's default bullets anywhere? Besides "DS_BALL_S_RED" for example in the first sample script on the wiki. I'm more learning by recreating those scripts with my own touches to them for now. (Or is there a handy shot script that explains each bullet like the old Super Shot I was so fond of?)

If not, I'm sure I can try and make some custom shots. Can't be too hard (And surely worth trying I guess to LEARN)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on January 11, 2012, 09:17:54 PM
At risk of sounding stupid, but decided to start learning ph3 instead of lazily learning v0.12m. This isn't an issue but more of a question really.

Is there a list of Danmakufu's default bullets anywhere? Besides "DS_BALL_S_RED" for example in the first sample script on the wiki. I'm more learning by recreating those scripts with my own touches to them for now. (Or is there a handy shot script that explains each bullet like the old Super Shot I was so fond of?)

If not, I'm sure I can try and make some custom shots. Can't be too hard (And surely worth trying I guess to LEARN)

Default_ShotConst.txt in the default_system folder has every single default bullet listed.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DarkOverord on January 11, 2012, 09:33:27 PM
Default_ShotConst.txt in the default_system folder has every single default bullet listed.
Oh fffffs how they hell did I miss that one. Thank you very much though!

EDIT: okay here's an on odd one. ph3 is running at 62.5 fps... why? o.??

Also, is animation handled differently? I've been trying to do it similar to how I did it in 12m, using ObjSprite2D_SetSourceRect instead of SetGraphicRect, but it doesn't seem to want to play, even with the animation looping as a task elsewhere. I think I'm derping somewhere
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on January 12, 2012, 01:36:06 AM
EDIT: okay here's an on odd one. ph3 is running at 62.5 fps... why? o.??

Also, is animation handled differently? I've been trying to do it similar to how I did it in 12m, using ObjSprite2D_SetSourceRect instead of SetGraphicRect, but it doesn't seem to want to play, even with the animation looping as a task elsewhere. I think I'm derping somewhere
62.5 is the new default fps for whatever reason they wanted

This second question is probably no. The only guess I can make without seeing your script is you're missing a yield; in MainLoop, or you forgot to ObjPrim_SetTexture(obj, imgpath);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DarkOverord on January 12, 2012, 01:47:31 PM
you're missing a yield; in MainLoop
...OH FFFFFFS

I was going off the sample script which actually doesn't have a yield; in MainLoop. But I'm equally as stupid for forgetting all loops have yields!  :V

EDIT: In fact, looking at it, none of the translated sample scripts on the wiki have a yield. That's. What? :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on January 12, 2012, 03:04:57 PM
EDIT: In fact, looking at it, none of the sample scripts have a yield. That's. What? :V

SampleE01, SampleRB01, SampleRB02 and SampleRB03 all have yields in their MainLoops actually.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DarkOverord on January 12, 2012, 04:04:55 PM
SampleE01, SampleRB01, SampleRB02 and SampleRB03 all have yields in their MainLoops actually.
Which aren't on the wiki. Will edit my post to say translated scripts :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 12, 2012, 06:21:20 PM
I was going off the sample script which actually doesn't have a yield; in MainLoop. But I'm equally as stupid for forgetting all loops have yields!  :V
In fact, looking at it, none of the translated sample scripts on the wiki have a yield. That's. What? :V
The samples on the wiki don't have yields because they don't have any tasks to yield from. Not all loops have yields; only when you want to pause task behaviour until the next frame do you use yields. At a lower level view, a yield just halts the behaviour and jumps you to the next task in line, and the last in line should be MainLoop, whereupon it finishes the current frame processing. If you have no last yield in MainLoop, there's nothing to tell the program to jump back to the tasks' yields.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: DarkOverord on January 12, 2012, 07:58:34 PM
The samples on the wiki don't have yields because they don't have any tasks to yield from. Not all loops have yields; only when you want to pause task behaviour until the next frame do you use yields. At a lower level view, a yield just halts the behaviour and jumps you to the next task in line, and the last in line should be MainLoop, whereupon it finishes the current frame processing. If you have no last yield in MainLoop, there's nothing to tell the program to jump back to the tasks' yields.
aha. Lesson learned :V Thanks, I'll bare that in mind when going through the samples.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on January 14, 2012, 10:44:15 AM
you have no yield in your mainloop aaaaaaaaaaaaaaaaaaaaaaaaaa
No wonder. Fixed.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 15, 2012, 11:58:50 AM
Oh look, another help request from me.
Anyways, I need help with making a task, which will make curved lasers spawn around the stage edges, then curve inwards to the middle of the stage with angular velocity of '0.5', then curve/move outwards again.
I've learned now how to do tasks(but not functions), and make object bullets. Anyone got any ideas? ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on January 17, 2012, 09:25:31 AM
I don't understand what you can't do there, if you know how to make a task, just make a curved laser at the edge and modify its angle ...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on January 18, 2012, 12:10:32 PM
Oh look, another help request from me.
Anyways, I need help with making a task, which will make curved lasers spawn around the stage edges, then curve inwards to the middle of the stage with angular velocity of '0.5', then curve/move outwards again.
I've learned now how to do tasks(but not functions), and make object bullets. Anyone got any ideas? ???
There seems to be a function in Danmakufu for curved lasers:
CreateCurveLaserA1(引数:8、返り値:[オブジェクトID])
 1) real:x座標
 2) real:y座標
 3) real:速度
 4) real:角度
 5) real:レーザーの長さ
 6) real:レーザーの幅
 7) real:弾画像ID
 8 ) real:遅延時間
指定した位置に曲がるレーザーを出現させます。
出現させたレーザーにさらに操作を加える場合は、ObjMove_XXX,ObjLaser_XXXを使用してください。

Using my horrible translation skills (Please correct me and add on to the translation):
CreateCurveLaserA1(8 Variables, Returns object ID)
 1) real:x position
 2) real:y position
 3) real:speed
 4) real:angle
 5) real:length
 6) real:レーザーの幅 (Width?)
 7) real:Graphics
 8 ) real:Delay
指定した位置に曲がるレーザーを出現させます。
出現させたレーザーにさらに操作を加える場合は、ObjMove_XXX,ObjLaser_XXXを使用してください。
(Something about it being able to be manipulated via Move and Laser object commands.)

You could probably change the angular velocity via ObjMove_SetAngularVelocity(objectID,angularVelocity).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on January 19, 2012, 05:07:55 PM
I'm trying to run danmakufu on one computer. It starts up perfectly, but when I go into any of the categories it crashes with a Microsoft Visual C++ Runtime Error. Is there any way to fix this?

EDIT: The DnhViewer works fine though...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Mеа on January 21, 2012, 01:37:28 AM
指定した位置に曲がるレーザーを出現させます。
出現させたレーザーにさらに操作を加える場合は、ObjMove_XXX,ObjLaser_XXXを使用してください。
(Something about it being able to be manipulated via Move and Laser object commands.)

Yeah, it says:
"Creates a curving laser at the designated coordinates.
For additional controls for the created laser, use the ObjMove_XXX or ObjLaser_XXX commands."

Heres a bonus since I'm kind of free and bored at the moment:
Code: [Select]
ObjLaser_SetLength(Arguments: 2)
 1) real:Object ID
 2) real:Laser Length
Sets the Laser's length.

ObjLaser_SetRenderWidth(Arguments: 2)
 1) real:ObjectID
 2) real:Laser Width
Sets the Laser's width.
If the hitbox width is not designated, the hitbox width will be set to 1/2 this width by default.

ObjLaser_SetIntersectionWidth(Arguments: 2)
 1) real:Object ID
 2) real:Laser Hitbox Width
Sets the hitbox width of the laser.

ObjLaser_SetInvalidLength(Arguments: 3)
 1) real:ObjectID
 2) real: Laser hitbox length, tip
 3) real: Laser hitbox length, end
Sets the non-hitbox areas of the tip and ends of the lasers.
By default, the non-hitbox area is set to 10% of the laser length for both tip and end.

ObjLaser_GetLength(Arguments: 1、Returns:real)
 1) real:ObjectID
Returns the designated laser object's length

ObjStLaser_SetAngle(Arguments: 2)
 1) real:ObjectID
 2) real:Laser Angle
Sets the [setting type(?)]laser's angle. (Different from the angular velocity of the laser)

ObjStLaser_GetAngle(Arguments: 1、Returns:real)
 1) real:ObjectID
Returns the [setting type(?)]laser's  angle. (Different from the angular velocity of the laser)

ObjStLaser_SetSource(Arguments: 1)
 1) real:ObjectID
 2) bool:Light Source
Enables or Disables the [setting type(?)]laser's light source.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 21, 2012, 07:45:34 PM
Yeah, it says:
"Creates a curving laser at the designated coordinates.
For additional controls for the created laser, use the ObjMove_XXX or ObjLaser_XXX commands."

Heres a bonus since I'm kind of free and bored at the moment:
Code: [Select]
ObjLaser_SetLength(Arguments: 2)
 1) real:Object ID
 2) real:Laser Length
Sets the Laser's length.

ObjLaser_SetRenderWidth(Arguments: 2)
 1) real:ObjectID
 2) real:Laser Width
Sets the Laser's width.
If the hitbox width is not designated, the hitbox width will be set to 1/2 this width by default.

ObjLaser_SetIntersectionWidth(Arguments: 2)
 1) real:Object ID
 2) real:Laser Hitbox Width
Sets the hitbox width of the laser.

ObjLaser_SetInvalidLength(Arguments: 3)
 1) real:ObjectID
 2) real: Laser hitbox length, tip
 3) real: Laser hitbox length, end
Sets the non-hitbox areas of the tip and ends of the lasers.
By default, the non-hitbox area is set to 10% of the laser length for both tip and end.

ObjLaser_GetLength(Arguments: 1、Returns:real)
 1) real:ObjectID
Returns the designated laser object's length

ObjStLaser_SetAngle(Arguments: 2)
 1) real:ObjectID
 2) real:Laser Angle
Sets the [setting type(?)]laser's angle. (Different from the angular velocity of the laser)

ObjStLaser_GetAngle(Arguments: 1、Returns:real)
 1) real:ObjectID
Returns the [setting type(?)]laser's  angle. (Different from the angular velocity of the laser)

ObjStLaser_SetSource(Arguments: 1)
 1) real:ObjectID
 2) bool:Light Source
Enables or Disables the [setting type(?)]laser's light source.
Thanks.  :3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: NonexistentFlower on January 26, 2012, 11:58:02 AM
A question: How do you slow/stop time? (As in Youmu/Sakuya respectively.)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on January 26, 2012, 01:15:40 PM
A question: How do you slow/stop time? (As in Youmu/Sakuya respectively.)

You can use the StartSlow and StopSlow functions. Stop time is not yet implemented.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 28, 2012, 05:34:04 PM
Oh god.
Theres no 'wait' function or anything related in ph3  :ohdear: .
 :o FFFFFFFFFFUUUUUUUUUUU-
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on January 28, 2012, 06:41:38 PM
What kind of wait, you mean the regular waiting function to delay tasks/
function wait(n) { loop(n) { yield; } }
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 28, 2012, 06:51:07 PM
What kind of wait, you mean the regular waiting function to delay tasks/
function wait(n) { loop(n) { yield; } }
Well, any 'wait' really. There is one in 12.0m where its like: "wait(number);". It's more like that wait I would like help with. thanks.

EDIT: Wait, what do you mean by 'function'? Well, go on. i'd like to learn more. heh heh.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on January 28, 2012, 07:09:17 PM
Well, any 'wait' really. There is one in 12.0m where its like: "wait(number);". It's more like that wait I would like help with. thanks.

EDIT: Wait, what do you mean by 'function'? Well, go on. i'd like to learn more. heh heh.

It summons the function of wait. Then you give the variable of "n" and then loop it. Well just do this:
Code: [Select]
function wait(n){
loop(n){yield;}

I think this way works the same way in ph3 beta. If you are really curious, try it at a test script or your "script-in-the-making"
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 28, 2012, 07:39:40 PM
It summons the function of wait. Then you give the variable of "n" and then loop it. Well just do this:
Code: [Select]
function wait(n){
loop(n){yield;}

I think this way works the same way in ph3 beta. If you are really curious, try it at a test script or your "script-in-the-making"
Thankies
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 28, 2012, 08:43:52 PM
If you don't know what wait() is to begin with and don't even know what a function is, what are you even doing using it. I don't even.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on January 28, 2012, 09:02:40 PM
Well, his script will, let's just say, end in pure rage of messing up on functions. If he doesn't know what a function is or wait, he could just stick to MainLoop style.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chronojet ⚙ Dragon on January 29, 2012, 02:57:28 AM
wait a sec,
wait isn't even a function except in Event scripts of v0.12m
Even then it's Wait with a capital W.

so how are you getting this information from, that "wait function of v0.12m" bull.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 29, 2012, 06:16:26 AM
Because basically every script and tutorial ever have the wait function defined. It's so extremely common that people don't actually know what it does. This is also why you get stuff like wait(200);yield; all over.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 29, 2012, 09:39:34 AM
If you don't know what wait() is to begin with and don't even know what a function is, what are you even doing using it. I don't even.
I do know what 'wait()' means and how it works, it just dosen't work for me in ph3.

wait a sec,
wait isn't even a function except in Event scripts of v0.12m
Even then it's Wait with a capital W.

so how are you getting this information from, that "wait function of v0.12m" bull.
Video tutorials :3.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 29, 2012, 09:59:39 AM
I do know what 'wait()' means and how it works, it just dosen't work for me in ph3.
How are you attempting to use it, then? More details (or a script) would be nice.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 29, 2012, 11:20:22 AM
How are you attempting to use it, then? More details (or a script) would be nice.
Here: http://pastebin.com/fLqVL7xK
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on January 29, 2012, 01:29:55 PM
wait(n) is being used in @MainLoop.

There is your problem.

Edit:
- This doesn't seem to be the entire script. Since 'wait' is nowhere defined.
- Script seems a huge mess also. I cannot trace where the MainLoop ends.
- Since you seem to be confused about 'functions' I suggest you to dive into the tutorials first.

How you use 'wait'
Code: [Select]
@MainLoop {
// w/e
yield;
}

function wait(w) { loop(w) { yield; } }

task something {
// something
wait(30);
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Yukari-Chan on January 29, 2012, 05:16:24 PM
Here: http://pastebin.com/fLqVL7xK

What the... Just...Well guess I can help you out
What you did wrong:
- The script seems messy.
- Did you even end it?
- You didn't even use wait
- Where the hell does the script end?
- I think you forgot a few "{}"
- Did you even summon wait?

What are you doing...

Anyway, I think there is a Finalize at ph3 so summon wait there and do

Code: [Select]
function wait(n)
loop(n){yield;}}

task sample {
sampleshot;
wait(120);
}

You might want to summon sample or any other name for task at Initialize.

If you have any further mistakes, do what Helepolis says and dive in the wiki. They might have some information. Yes, I had to do that too get tasking...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on January 29, 2012, 05:27:33 PM
Here: http://pastebin.com/fLqVL7xK

On top of what has been said earlier, you have a return in the MainLoop and both curvelaser and bulletshot tasks are defined inside MainLoop.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on January 29, 2012, 08:39:10 PM
Quote
- You didn't even use wait
- Did you even summon wait?

What the hell.  You should be supporting people who don't use wait. If people knew what they were doing with their yields we wouldn't have that many problems.

Stick to loop(n){yield} ! It's just so much easier.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on January 30, 2012, 07:24:50 AM
What the hell.  You should be supporting people who don't use wait. If people knew what they were doing with their yields we wouldn't have that many problems.

Stick to loop(n){yield} ! It's just so much easier.
You realize he's been asking this whole time on how to use the wait function right?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on January 30, 2012, 09:38:02 AM
 :derp: I just forgot to put a line after the "wth", the two things were unrelated.  :derp:

The "what the hell" part was the answer to the quote, related to the fact that the script does contain some instances of wait(*).

The other part was just adressing the fact that some people, probably partly because of the tutorials, do not make the link between wait(*) and yield, and they become unable to use yield properly. I'm just in favor of advertising loop(*){yield} because if forces comprehension of the yield and make people switch to tasks more easily.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Mеа on February 04, 2012, 08:18:57 PM
How do 3d objects work? I made an octahedron in blender, put it into metasequoia, and then into danmakufu, but it only appears as a dull colored thing. Well let me elaborate. I made a semitransparent octahedron, but it doesn't show it's transparency in danmakufu. I made the mesh in blender, and attached materials that made it semitransparent with a texture in metasequoia. In danmakufu, it loses the semitransparency, luminosity, specularity, etc., but only retains the texture.
Is there any way to add a source of light in danmakufu? Kinda stuck here.
Also do materials stay attached to an imported 3d object?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on February 06, 2012, 09:00:02 PM
You're expecting way too much from Danmakufu. As far as I know, all it can do is draw textures at arbitrary angles in 3D space. Anything else, including lighting and transparency is out of the question for now, and honestly I wouldn't expect it to be implemented any time soon.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Mеа on February 07, 2012, 10:54:14 AM
Hm..... [attach=1]
In that case, does anyone know of this (http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html)?
Is there any where to get the files for the last tutorial RD02? Or does it not exist?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 08, 2012, 04:25:35 PM
Is a function a bit like defining a variable, but instead it's a bit like a task? Am I rite?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on February 08, 2012, 09:32:09 PM
Mmmmmmno. If you really want to learn the differences between all the terms past the "you know just enough to script properly" barrier, I suggest you pick up the books. It would be difficult to define everything without misleading you in some way.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 09, 2012, 07:16:03 PM
Mmmmmmno. If you really want to learn the differences between all the terms past the "you know just enough to script properly" barrier, I suggest you pick up the books. It would be difficult to define everything without misleading you in some way.
To be honest, i agree. Maybe i should just stick to the basics.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on February 09, 2012, 10:05:25 PM
Well no you shouldn't. You should try to understand what is a function and what is a task.

You can see a function as a way to put a name on a sequence of instructions.

let's say you have this function

Code: [Select]
function yieldo{while(IsPlayerSpellActive){yield;}}
Then the following code :

Code: [Select]
loop(5){yieldo;}
Is equivalent to
Code: [Select]
loop(5){while(IsPlayerSpellActive){yield;}}
function can also accept parameters and return values

For example
Code: [Select]
function rand_int(a,b){yield; return floor(rand(a,b+1))} means your function will also return a value you can recuperate naturally, for example :
Code: [Select]
let a=100+rand_int(-50,150);This will execute the yield; and return an integer for your operation.


On the otherhand, a task is code that is executed in a parallel way, it is not replaced in the task that called it.

Code: [Select]
Task Yieldo{while(IsPlayerSpellActive){yield;}}
Then the following
Code: [Select]
loop(5){Yieldo} will be equivalent to
Code: [Select]
loop(5){} and five instances of our Yieldo task will start doing their own stuff at the same time as our task.

Because of this, it would absurd to return a value from a task, since the task that called the second task kept on executing since calling it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 11, 2012, 09:52:18 AM
Thanks lots. slightly confusing though. *sweat drop*
Anyway, I sorted out it I guess, and i've finally learnt about 'wait(number);' and everything is going great.
Gold star to all of you.  :3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 11:52:03 AM
Is it possible for the shotsheet to be integrated into PH3? Should we create a new topic about custom shotsheets for PH3?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 14, 2012, 01:15:55 PM
Is it possible for the shotsheet to be integrated into PH3? Should we create a new topic about custom shotsheets for PH3?

Shotsheets work the same in ph3 as far as i know, some things such as angular velocity isn't implemented yet though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 01:23:26 PM
Shotsheets work the same in ph3 as far as i know, some things such as angular velocity isn't implemented yet though.
Thanks, but how should we know the names for each graphic bullet, does it stay the same as, for instance "DS_BALL_M_RED" ? I guess I will have to use the "RED01" way. I'll try it .  :)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 14, 2012, 02:40:43 PM
Thanks, but how should we know the names for each graphic bullet, does it stay the same as, for instance "DS_BALL_M_RED" ? I guess I will have to use the "RED01" way. I'll try it .  :)

The DS_BALL_M_RED is just a variable with a numeric value, in this case 25 which is the id of a normal sized red bullet. So writing DS_BALL_M_RED is the same as writing 25.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 03:04:47 PM
The DS_BALL_M_RED is just a variable with a numeric value, in this case 25 which is the id of a normal sized red bullet. So writing DS_BALL_M_RED is the same as writing 25.
Oh, right. But when I configured the files for compatibility use with PH3, and replaced them with the default ones, I get no bullets when I fired them.  ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 05:15:43 PM
Can anyone help me with a custom shotsheet problem? I've used the Expanded shotdata ZUN style from the Custom user shotsheets thread, but when I use it in danmakufu I get errors, even though I followed the instructions. I even used Onthenet's sheet. But when I configure it, the sheet does work, but there are no bullets when I fire them.

EDIT: I realised those scripts are v12.0m.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on February 14, 2012, 05:23:57 PM
> Download a script that has it and copypaste.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 14, 2012, 05:41:18 PM
Oh, right. But when I configured the files for compatibility use with PH3, and replaced them with the default ones, I get no bullets when I fired them.  ???
Have you loaded the shotsheet with LoadEnemyShotData? Or did you replace the default shot sheet?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 10:11:13 PM
Have you loaded the shotsheet with LoadEnemyShotData? Or did you replace the default shot sheet?
Both. Why it no work? ;_;
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 14, 2012, 10:24:09 PM
Both. Why it no work? ;_;
When creating bullets, do you write a number or do you write DS_BALL_M_RED etc? Try the numbers and see if it works.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 14, 2012, 11:10:16 PM
When creating bullets, do you write a number or do you write DS_BALL_M_RED etc? Try the numbers and see if it works.
I did the numbers, and *drum roll* no result.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 15, 2012, 12:09:56 AM
I did the numbers, and *drum roll* no result.
That's strange. Could you pastebin your shotsheet script and your script you shoot bullets from?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on February 15, 2012, 12:27:37 AM
Can anyone help me with a custom shotsheet problem? I've used the Expanded shotdata ZUN style from the Custom user shotsheets thread, but when I use it in danmakufu I get errors, even though I followed the instructions. I even used Onthenet's sheet. But when I configure it, the sheet does work, but there are no bullets when I fire them.

EDIT: I realised those scripts are v12.0m.
In any case, shot sheets in 0.12 are basically the same in ph3 but they now have additional optional parameters, so as far as I know they should work nearly the same. Five bucks says you didn't Load the shot sheet into memory?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 15, 2012, 09:50:44 AM
In any case, shot sheets in 0.12 are basically the same in ph3 but they now have additional optional parameters, so as far as I know they should work nearly the same. Five bucks says you didn't Load the shot sheet into memory?
I loaded the shotsheet withLoadEnemyShotData() with and without the #Include one.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on February 16, 2012, 11:21:39 AM
Split the discussion from shotsheet thread and merged it with Ph3 thread because it turned into Q&A-ish discussion instead of shotsheet in general.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 16, 2012, 07:05:03 PM
That's strange. Could you pastebin your shotsheet script and your script you shoot bullets from?
Code:
http://pastebin.com/hbfdQQQu

Shotsheet script:
http://pastebin.com/YNBxUfpy

Shotsheet image:[attach=1]

(What the ras-clat. I didn't know the image would be so blurry. Just click on the image thanks.)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 16, 2012, 10:54:19 PM
Try removing the #include at the top of the script and put a LoadEnemyShotData(path) in @Initialize, where path is the path to the shot replace script.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 17, 2012, 09:01:48 AM
Try removing the #include at the top of the script and put a LoadEnemyShotData(path) in @Initialize, where path is the path to the shot replace script.
It works  :D thanks!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on February 17, 2012, 09:18:18 AM
wait what isn't that exactly what i said
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 17, 2012, 11:00:09 AM
wait what isn't that exactly what i said
Really? *Looks up the page*  :ohdear: Oops. Sorry, credit to you as well, Drake.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 18, 2012, 02:17:48 PM
I'm having a slight problem with danmakufu (both of them actually). It runs fine, but whenever the same sound effect is supposed to play when the same sound is already playing, instead of ending the old one and playing the new one like it should, the first one keeps playing and the second one isn't played at all.

I haven't experienced this problem with any other program.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 18, 2012, 02:59:40 PM
I'm having a slight problem with danmakufu (both of them actually). It runs fine, but whenever the same sound effect is supposed to play when the same sound is already playing, instead of ending the old one and playing the new one like it should, the first one keeps playing and the second one isn't played at all.

I haven't experienced this problem with any other program.
When the sound effect has played, and then the time comes when you want to play it again, before that try stopping the previous sound effect.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 18, 2012, 04:30:17 PM
When the sound effect has played, and then the time comes when you want to play it again, before that try stopping the previous sound effect.

That would be very annoying. It did work before i reinstalled windows...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 18, 2012, 07:27:04 PM
That would be very annoying. It did work before i reinstalled windows...
Well, imma out of ideas :/.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 24, 2012, 03:39:06 PM
Still having the same problem as six days ago:
I'm having a slight problem with danmakufu (both of them actually). It runs fine, but whenever the same sound effect is supposed to play when the same sound is already playing, instead of ending the old one and playing the new one like it should, the first one keeps playing and the second one isn't played at all.

I haven't experienced this problem with any other program.

The sound effects worked perfectly fine before reinstalling windows XP on my computer. I have tried both with and without applocale, tried looking for newer drivers and redownloading danmakufu, but nothing works.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 24, 2012, 05:07:51 PM
It sounds like a problem with Danmakufu itself, Try downloading the ph3 b4++ version...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on February 24, 2012, 05:28:27 PM
I don't think that's a problem with Danmakufu if it happens with both versions of Danmakufu. I know for sure that 0.12m should be working and JmLyan says it was working before. Maybe there are some driver issues after the reinstall? I'm honestly not too sure myself, but I'm at least sure that newer versions of ph3 are not likely to solve the problem.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on February 25, 2012, 10:11:38 AM
I have looked for driver updates but it still doesn't work. If the reason is driver issues, how do you solve those issues?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 26, 2012, 06:50:20 PM
Can someone give me the X/Y coordinates for the stage frame? What I mean: For example I need the X locations for the top of the stage frame from the furthest left side of the upper stage frame as well as the right side, and also the Y location of it. I also need the positions of the other stage frames (the right one, the bottom one and the left one).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on February 29, 2012, 04:00:20 PM
I've some problems with my ichirin script: http://www.mediafire.com/?dyds8y8p6x4dwpt

Run the plural and you will see what is the hell  :P
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on March 01, 2012, 11:22:31 PM
I've some problems with my ichirin script: http://www.mediafire.com/?dyds8y8p6x4dwpt

Run the plural and you will see what is the hell  :P
The designated script could not be found.
Your #include uses absolute pathing, and you most likely moved or renamed the folder that you're trying to get the file from. You could simply update the location to the new location of the file, but I advise against that. To get the current script directory in header paths, use "./"

So to fix this problem, replace all your #includes with this one (assuming you will keep the scripts in their current locations):

#include"./kumoi_lib.txt"
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Chester-low on March 04, 2012, 11:00:31 AM
Thank you very much Gtbot >u<
Hu....Can you explain to me how to make a 3D scroll background please ? >+<
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 04, 2012, 11:24:15 AM
Thank you very much Gtbot >u<
Hu....Can you explain to me how to make a 3D scroll background please ? >+<
I'm not really sure if you can. PH3 Is still B4++ though. Try something else, like a wavy background?
Okay, im really no help here  :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on March 04, 2012, 04:30:29 PM
Thank you very much Gtbot >u<
Hu....Can you explain to me how to make a 3D scroll background please ? >+<

There's different ways  of doing this, although I believe the easiest would be to put a 3D texture where you desire and update the source rect each frame to give the illusion that it's moving; for instance:
Code: [Select]
let ypos = 0;
while(true){
    ObjSprite3D_SetSourceRect(3DObjectID, 0, ypos, 256, ypos+256);
    ypos+=4;
    if(ypos > 255){ypos = 0}
    yield;
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on March 10, 2012, 04:07:19 AM
I know there's some dumb mistake I'm making here, but I don't know what.
Quote
#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["SampleA01"]
#Text["SampleA01 - Firing Bullets"]


#include"script/default_system/Default_ShotConst.txt"

let objEnemy;
let frame = 0;
let waitFrames = 0;
let bouncy;
let speed = 3;
let fallSpeed = 1;

@Event
{
   alternative(GetEventType())
   case(EV_REQUEST_LIFE)
   {
      SetScriptResult(500);
   }
}

@Initialize
{
   objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
   ObjEnemy_Regist(objEnemy);

   let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png";
   ObjPrim_SetTexture(objEnemy, imgExRumia);
   ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64);
   ObjSprite2D_SetDestCenter(objEnemy);

   let cx = GetStgFrameWidth() / 2;
   ObjMove_SetDestAtFrame(objEnemy, cx, 60, 60);
}

@MainLoop
{
   let ex = ObjMove_GetX(objEnemy);
   let ey = ObjMove_GetY(objEnemy);

   if(frame == 60)
   {
      bouncy = CreateShotA1(ex, ey, speed, rand(0,360), DS_BALL_S_RED, 30);
      while(waitFrames<=180){
         let sinSpeed = sin(ObjMove_GetAngle(bouncy))*fallSpeed;
         let cosSpeed = cos(ObjMove_GetAngle(bouncy))*speed;
         let nextAngle = atan2(ObjMove_GetY(bouncy)+sinSpeed,ObjMove_GetX(bouncy)+cosSpeed);
         fallSpeed++;
         waitFrames+=5;
         ObjMove_AddPatternA1(bouncy, waitFrames, speed, nextAngle);
      }
      frame = 0;
      waitFrames = 0;
      fallSpeed = 1;
   }

   ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);
   ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);

   frame++;

   if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0)
   {
      Obj_Delete(objEnemy);
      CloseScript(GetOwnScriptID());
      return;
   }
}
This is my dumb attempt at trying to make a bullet that acts like it's under the effects of gravity.
With the code as-is, every projectile just flies in a random direction for a split second, as intended, then, out of nowhere, flies to about 30 degrees.
Am I just trying to reinvent the wheel, here? I'm just about certain somebody's already done it, at least better than I would.
Also, would there be any easy way to be able to do this with multiple instances of this bullet?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 11, 2012, 07:36:30 AM
I see what you're trying to do, but even if it worked, changing the angle every 5 frames seems a bit choppy. You also don't need to pile on 36 patterns every 60 frames (actually it's 37 because of the <= condition), especially since you'll have tons and tons of overlap between every 60-frame segment from 25 of those patterns running at the same times as the new patterns. The angle code doesn't seem like it'll create a gravity effect either, but I can't be sure.

As for multiple instances though, you would make a task that runs in a similar way, then just call the task repeatedly; it wouldn't be hard once you got the one bullet going.

So, you have a static x-speed that relies on the angle the bullet is shot at. Rather, every frame you have ObjMove_SetX(obj, ObjMove_GetX(obj) + cos(angle)*xspeed);. Then you have an initial y-speed that again relies on the angle shot at. But, you also have have a negative y-acceleration that increases by some amount every frame. Or, ObjMove_SetY(obj, ObjMove_GetY(obj) + sin(angle)*(yspeed-yaccel)); and yaccel += 0.1;. This should be the basic outline of "gravity" arcing bullets.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 12, 2012, 04:25:05 PM
On 19:55 of http://www.youtube.com/watch?v=85bE4NlzrLE does anyone know how to do a copy of Eirin's spellcard? The part when the bullets get smaller then get bigger.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 13, 2012, 12:04:12 AM
By manually manipulating a graphic (ObjRender_SetScaleXYZ) and hitbox size (SetShotIntersectionCircle) and the movement every frame rather than actually firing a bullet. That game wasn't made using Danmakufu either, if that needs to be said.

In any case though, I don't suggest doing that because shrinking and growing bullets like that in most cases is just bad pattern design :I
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 13, 2012, 08:00:35 PM
In any case though, I don't suggest doing that because shrinking and growing bullets like that in most cases is just bad pattern design :I
Yea, i agree. I was just thinking of when the bullet is fired I could make it shrink when it's moving.
With your knowledge, you must've been studying danamkufu for at least 2 years.  :V Either that or i'm a mega newbie.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 14, 2012, 01:33:11 AM
actually i've been on/off for probably four years lol
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 14, 2012, 06:49:48 PM
Oh dear god. The confusing question is coming. AAAAAAAAAAAAA-

I't trying to make a function that will make the desired object pulsate at a speed per frame. But i'm getting spammed with errors. Can someone help me correct this? The function also needs the 'wait' function or else it  will fail even more than me at homework.
Code: [Select]
function pulsate(obj,xsize,ysize,minx,maxx,miny,maxy,xspeed,yspeed){
let signalx=1;
let signaly=1;
ObjRender_SetScaleXYZ(obj,xsize,ysize,0);
loop{ while(signalx==1){
xsize-xspeed;
if(xsize<=minx&&signalx==1){
signalx=0;
break;
}
wait(1);
}
}
loop{ while(signalx==0){
xsize+xspeed;
if(xsize>=maxx&&signalx==0){
signalx=1;
break;
}
wait(1);
}
}
loop{ while(signaly==1){
xsize-yspeed;
if(xsize<=minx&&signaly==1){
signaly=0;
break;
}
wait(1);
}
}
loop{ while(signaly==0){
ysize+yspeed;
if(xsize>=maxx&&signaly==0){
signaly=1;
break;
}
wait(1);
}
}
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ParallelNebulae on March 14, 2012, 11:42:08 PM
So, I know there's probably a tutorial for it somewhere, but I'm not sure where, but I'm wanting to know how to make a scrolling background.

Also, in some Danmakufu videos, there were people mentioning sine and cosine functions. How do you apply those?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on March 15, 2012, 12:03:03 AM
Oh dear god. The confusing question is coming. AAAAAAAAAAAAA-

I't trying to make a function that will make the desired object pulsate at a speed per frame. But i'm getting spammed with errors. Can someone help me correct this? The function also needs the 'wait' function or else it  will fail even more than me at homework.
http://pastebin.com/NK5gme3w

Fixed the tabbing to something people are more used to seeing. Off the top of my head, just from what I saw while retabbing it, xsize-xspeed; will not actually change the value of xsize. You probably mean xsize -= xspeed;. Also you are using a wait function, which I assume is the one that yields a given amount of times. However you're using a function instead of a task. That may or may not be correct depending on how you're using the function, but chances are you mean for it to be a task.

You shouldn't get any errors from the snippet after those changes, but I'm pretty sure it won't be working as you expected still.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 15, 2012, 12:07:05 AM
(Blargel: I thought it was meant to be a task as well, but he's likely applying it inside the passed object's microthread in which case this could be correct)

Ok. First of all you need to realize the wait function is just this:

function wait(n){
   loop(n){
      yield;
   }
}


If you call wait(1); you are doing loop(1){ yield; } which as should be incredibly obvious, is just yield;. Unless you're yielding more than once, please just stick to yield;. It doesn't actually matter (well there is memory allocated for the parameter and herp so i guess it does but w/e), but it just looks uh less incompetent.


Second of all, this is what you are doing:

loop{
   while(signalx==1){
      xsize-xspeed;
      if(xsize<=minx&&signalx==1){
         signalx=0;
         break;
      }
      wait(1);
   }
}


1. You are encasing a while loop inside of an infinitely running loop. Even though you have a break call in there, it should only break out of the while loop, so you're stuck.
2. xsize-xspeed; is invalid syntax, you mean xsize = xsize - xspeed; or xsize -= xspeed;
3. The if condition having signalx==1 in it is redundant since that's the while condition.
4. You don't even need the signals:
while(xsize>minx){
   xsize -= xspeed;
   yield;
}

5. Even if your stuff all worked, it wouldn't visibly change anything because there are no SetScales in there besides the beginning.
6. You probably mean to use ysize instead of xsize in the last two loops.
7. Even if you changed the above, they would not scale at the same time; all it would do is scale the x-dimension down to the minimum then to the maximum, and then scaling the y-dimension down to the min and then to the max.
8. In relation to the above, you'd end up with a max-scaled object since you aren't going back to the original size.
9. Even if everything worked completely as you intended to code it, I doubt it would look as you would want it to since you're just linearly scaling which will look choppy.

IN ANY CASE, there is a much much easier less contrived way to do a pulse scaling (I'm assuming a bunch of things about your objects but this will probably apply):
task pulse(obj, minscale, maxscale, speed){
   let mid = (maxscale-minscale)/2;
   let t=asin(((1-minscale)/mid) - 1);
   loop{
      ObjRender_SetScaleXYZ(obj, minscale + (sin(t)+1)*mid, minscale + (sin(t)+1)*mid, 0);
      t = (t+speed)%360;
      yield;
   }
}


(okay that took too long to figure out and calculate for a general case, whoops)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ParallelNebulae on March 15, 2012, 01:26:37 AM
http://pastebin.com/ZEJBtABV
http://pastebin.com/gbkCQgey
http://pastebin.com/kb0DncPL

Okay, I fixed that error, but now it crashes lags (0.6 fps! O_O) every time I run it.



Just realized the problem: TOO MUCH DAKKA.

But in all seriousness, I would like to learn how to make more intricate patterns.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 15, 2012, 02:36:59 AM
just to make it clear, you're firing (12)+(12*12)+(12*12*12)+(12*12*12*12)+(12*12*12*12*12) = 271452 bullets

maybe that has something to do with it


Also, you keep reassigning objx to a new bullet so your AddShots (if they worked) will end up adding one bullet to one bullet to one bullet to one bullet to one bullet, rather than all of them like you had probably intended. But even then, AddShot doesn't work with the CreateShot series; you have to build the shots using the object functions.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ParallelNebulae on March 15, 2012, 03:10:12 AM
What. In any case, I managed to get that spellcard to do something I liked, so I started making another one. And things are going swimmingly.

However, how would you do something like in Philosophy of a Hated Person where the bullets seem to come from offscreen and change what type they are?
Or in Genetics of the Subconscious... Just, the whole orbiting trailing thing...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 25, 2012, 11:44:00 AM
Stupidest, Questions. EVAR!!!111!!!1
Okay, sorry, but here it is.
1. How can you do a smooth motion (slowly increasing, the decreasing, then increasing etc), a bit like a spiral pattern of bullets (firing per 3 frames, of course), with the angle slowly decreasing, then the angle is going the other way, but at an increasing rate.
2. How to upload textures onto Dnh.
3. Bullets with gravity.
4. ALSO (cruise control), can someone give me the functions for GetClipMinX, GetClipMaxX, GetClipMinY and GetClipMaxY. (I know what those functions are and know what they do).

EDIT: I fixed question 4.

EDIT 2: I've posted the PH3 functions I made for the stage edges. Hope it helps other people asking for the locations of the stage frames. Blah blah. Here:
Code: [Select]
function GetClipMinX{
return 0;
}

function GetClipMaxX{
return 385;
}

function GetClipMinY{
return 0;
}

function GetClipMaxY{
return 444;
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony on April 12, 2012, 09:35:26 PM
I'm noticing that ph3 seems to "stutter" a couple of times a second.  I want to say it has something to do with the game running at 63 FPS, since .12m ran at a consistent 60 and I never noticed any of what I'm seeing now.  I tried forcing Vsync on and off (monitor refresh is 63Hz) to no avail.  It's quite annoying having everything appear like it's skipping around, and I was wondering if anyone else has worked around this.

Thanks.

EDIT: Since I have FRAPS set to record at 60FPS, I started it up and recorded a video.  As expected, the game was forced to 60FPS and I noticed none of the "stuttering" while recording.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 12, 2012, 10:30:57 PM
Dumb question, but can you set your monitor to a 60Hz refresh rate? That's likely the entire problem, since with the extra 3Hz you will have some skipping when the game is trying to play at the same rate unless you force it down somehow. (hurr durr obvious)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony on April 12, 2012, 11:56:44 PM
Dumb question, but can you set your monitor to a 60Hz refresh rate? That's likely the entire problem, since with the extra 3Hz you will have some skipping when the game is trying to play at the same rate unless you force it down somehow. (hurr durr obvious)

I tried doing that through Windows 7, but it didn't have any effect, and I can't find a way to change it within the monitor itself.  Even setting it to other Hz values didn't change Danmakufu's framerate.  I've found a temporary workaround for the time being (trial version of Dxtory forcing FPS to 60,) but it's not a long-term solution.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 14, 2012, 10:00:31 AM
Anyone know how to make something happen to a task while the declared stuff is outside the task? A bit like you have some 'IF' and 'WHILE' statements outside the said task, and those statements will edit the entire task?

If no-one can help me ill just create a function the returns 'OBJ'.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 14, 2012, 09:36:23 PM
The solution isn't necessarily that application. The short answer is that you can't (unless a global variable applies), but if you modify the structure so that you aren't trying to "change a running task from the outside" then you can probably make your end goal. You have basically no details aside from "this is a piece of my code structure and I want to do this to it" though, so some more information would be helpful.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on April 22, 2012, 09:16:50 AM
I got some question:

1. What are the uses of CreateShotB1, CreateShotB2, CreateShotOA1 and CreateShotOB1?
2. How can I insert the Sound Effect in my script?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 22, 2012, 04:27:14 PM
I got some question:

1. Bullets with X-Velocity and Y-Velocity.
2. Lol I dunno. ask the guy who's comment is above yours.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 22, 2012, 09:18:57 PM
The B series are shortcuts for shot objects that use x-velocity and y-velocity, while the A series are shortcuts for bullets with an angle and a velocity.
CreateShotOA1(object, vel, angle, graphic, delay);
    Returns a shot object with specified angle and velocity at object's position.
CreateShotB1(xpos, ypos, xvel, yvel, graphic, delay);
    Returns a shot object at specified xy-position with specified x-velocity and y-velocity.
CreateShotB2(xpos, ypos, xvel, yvel, xacc, yacc, xmaxvel, ymaxvel, graphic, delay);
    Returns a shot object with xy-velocities that increase by specified accelerations until they hit the specified minimum or maximum speed limits.
CreateShotOB1(object, xvel, yvel, graphic, delay);
    Returns a shot object with specified xy-velocities at object's position.

Sounds should be the same as in 0.12; LoadSound(pathtosound); PlaySE(pathtosound);
Generally you load the sound early on, like in @Init, but you don't need to.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: eternal on April 24, 2012, 01:19:58 AM
Hey everyone. I'm not a programmer but I have a basic question about danmakufu that I hope someone can answer. You know the "gravity" effect that the last boss of Subterranean Animism uses for her final spellcard? It feels like you're constantly being pulled upwards or towards her. Anyway, I'm not asking how to code that because I'm not working on a project atm; I just want to know how difficult it is. Is it possible to create a similar "gravity" effect that attracts the player to, say, a moving enemy? Or is that more complex than it sounds and the SA spellcard accomplishes the same effect in a different way?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 24, 2012, 01:33:37 AM
Incredibly easy. Like, one line of code easy.
ObjMove_SetPosition(GetPlayerObjectID(), GetPlayerX() + cos(GetAngleToPlayer(object)-180) * speed, GetPlayerY() + sin(GetAngleToPlayer(object)-180) * speed);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: eternal on April 24, 2012, 01:51:14 AM
Whoa. Cool. For some reason I thought it would be difficult. Thanks!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 25, 2012, 08:01:23 PM
The solution isn't necessarily that application. The short answer is that you can't (unless a global variable applies), but if you modify the structure so that you aren't trying to "change a running task from the outside" then you can probably make your end goal. You have basically no details aside from "this is a piece of my code structure and I want to do this to it" though, so some more information would be helpful.
Yo, finally got up the code~
Code: [Select]
task maintask{
yield;
fire;
}

task fire{
wait(60);
loop{
shot(EnemyX,EnemyY,2,90,DS_BALL_M_RED,30);
wait(15);
ObjMove_SetAngle(shot,0);
wait(30);
}
yield;
}

task shot(x,y,speed,angle,graphic,delay){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj);
while(!Obj_IsDeleted(obj)){
yield;
}
}
I getz errors! D:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 26, 2012, 04:12:39 AM
Yeah, it's even more basic than I had imagined. You need to recognize that when you call shot(); and have that while-not-deleted loop, you would put your "after the bullet is fired" stuff in there.

Code: [Select]
task maintask{
yield;
fire;
}

task fire{
wait(60);
loop{
shot(EnemyX,EnemyY,2,90,DS_BALL_M_RED,30);
wait(45); //combined the two waits
}
//you currently don't need the yield here, the code never gets this far
}

task shot(x,y,speed,angle,graphic,delay){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj); //fires the shot!
wait(15); //after the shot is fired, wait 15 frames
ObjMove_SetAngle(shot,0); //and then modify the angle
//you don't actually need the while-not-deleted loop if you don't have any continually looping behaviour
}

Note that this is what you'd have done in 0.12. This is procedural code and works fine for this application. However, ph3 includes the capacity for OO code as well.

Code: [Select]
task maintask{
yield;
fire;
}

task fire{
wait(60);
let shot1;
loop{
shot1 = shot(EnemyX,EnemyY,2,90,DS_BALL_M_RED,30);
//note that in the shot() function, the shot is fired
wait(15);
ObjMove_SetAngle(shot1,0);
//this modifies the angle of the object referenced by the shot1 variable.
//shot1 was given the ID of the shot object you had created and returned in the function.
}
}

function shot(x,y,speed,angle,graphic,delay){ //note: this is now a function so you can return a value
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj); //fires the bullet and registers the ID to be used outside of the local scope
return obj; //returns the object ID
}
This is the OO method, and it can create flexibility in other areas. You weren't able to do this in 0.12 because object IDs were not able to be accessed outside of the scope of the microthread.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on April 26, 2012, 04:26:24 AM
I'm pretty sure the second method is possible in 0.12m as well, but I don't see a reason why you would do that. It's less confusing for me if the bullet's logic is in its own task instead of being given to some other task to process.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 26, 2012, 09:13:26 AM
While I agree that in simple cases like this it's pretty silly, but I guess I'm talking to the more experienced people rather than fondue, and on a very general level rather than "here bullat". It probably seemed as if I'm advocating people using OO methods for simple applications like this, and that's my mistake. The way he worded his original question, I was anticipating it being something that could be solved by rearranging his code and using OO methods, so I just threw it out there anyways.
Passing around objects is extremely helpful when you're going for a game or anything with structures that communicate with each other. Plus I'm not limiting it to bullets either: this is for passing items, enemies, visual effects, etc. In 0.12 a large part of orchestrating effects and pretty much anything not-basic fell down to the gross overuse of commondata and setting global flags that affect the objects from within their threads when set, and then you have to manage the flags and stuff. Although there are some problems, ph3 gives birth to quite many possibilities, mainly in the scope of full games and other heavy management.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on April 26, 2012, 12:35:04 PM
Aaaaaaaaa.

I'm going nuts over this.

Whenever I try to run a script with this shotdata, I get an error stating "shot_image is undefined."
Here's the header for the script.
Code: [Select]
#UserShotData

shot_image = GetCurrentScriptDirectory -"img/danmaku.png"
delay_rect = (480, 480, 512, 512)

I've also tried
Code: [Select]
shot_image = "./img/danmaku.png";
That obviously didn't work either.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 26, 2012, 02:58:09 PM
Yeah, it's even more basic than I had imagined. You need to recognize that when you call shot(); and have that while-not-deleted loop, you would put your "after the bullet is fired" stuff in there.

Code: [Select]
task maintask{
yield;
fire;
}

task fire{
wait(60);
loop{
shot(EnemyX,EnemyY,2,90,DS_BALL_M_RED,30);
wait(45); //combined the two waits
}
//you currently don't need the yield here, the code never gets this far
}

task shot(x,y,speed,angle,graphic,delay){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj); //fires the shot!
wait(15); //after the shot is fired, wait 15 frames
ObjMove_SetAngle(shot,0); //and then modify the angle
//you don't actually need the while-not-deleted loop if you don't have any continually looping behaviour
}

Note that this is what you'd have done in 0.12. This is procedural code and works fine for this application. However, ph3 includes the capacity for OO code as well.

Code: [Select]
task maintask{
yield;
fire;
}

task fire{
wait(60);
let shot1;
loop{
shot1 = shot(EnemyX,EnemyY,2,90,DS_BALL_M_RED,30);
//note that in the shot() function, the shot is fired
wait(15);
ObjMove_SetAngle(shot1,0);
//this modifies the angle of the object referenced by the shot1 variable.
//shot1 was given the ID of the shot object you had created and returned in the function.
}
}

function shot(x,y,speed,angle,graphic,delay){ //note: this is now a function so you can return a value
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj); //fires the bullet and registers the ID to be used outside of the local scope
return obj; //returns the object ID
}
This is the OO method, and it can create flexibility in other areas. You weren't able to do this in 0.12 because object IDs were not able to be accessed outside of the scope of the microthread.
Drake your awesomeness has gone up by 76%
Now i have to help you out sometime :D
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 26, 2012, 03:09:32 PM
Aaaaaaaaa.

I'm going nuts over this.

Whenever I try to run a script with this shotdata, I get an error stating "shot_image is undefined."
Here's the header for the script.
Code: [Select]
#UserShotData

shot_image = GetCurrentScriptDirectory -"img/danmaku.png"
delay_rect = (480, 480, 512, 512)

I've also tried
Code: [Select]
shot_image = "./img/danmaku.png";
That obviously didn't work either.
Had that problem before. I think the solution was making shot_image into Shot_Image.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on April 26, 2012, 08:20:30 PM
Had that problem before. I think the solution was making shot_image into Shot_Image.
No go. Returns the very same error, with both of the words capitalized.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 26, 2012, 09:39:30 PM
1. GetCurrentScriptDirectory() is not defined for shot scripts.
2. Even if it was, you're using a minus symbol ( - ) and not a tilde ( ~ ) for concatenation there.
3. It is shot_image. Fondue probably means ShotData which is capitalized.
4. When you say "script", is this a new file you're using? How are you loading the shot script? Danmakufu saying shot_image is undefined makes me think that you're putting this in an include_script or something.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on April 27, 2012, 03:51:23 AM
I tried to a pattern like: enemy shot a bullet with a minus acceleration, when the bullet stops, other bullets will shot from that bullet. I tried using if command but it won't work. So what should I do?  :ohdear:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony on April 27, 2012, 02:41:26 PM
With ph3, I'm noticing that all the 2D Sprite objects appear to be a little blurry, even when the rects are set properly.  A notable example is the STG frame which I replaced directly from the default.  I took a screenshot to compare the raw image to the game itself, and the results are obvious.

http://dl.dropbox.com/u/38923366/ph3notcrisp.png

This may be a minor issue, but it wasn't present in .12m, and is making my OCD systems overload.
It seems that bullet graphics and text objects are the only things not suffering from this blur.

I even tried to draw it with Primitive 2D by setting the vertexs, but it looked no better.

Is there anything I can do, or is every non-text thing going to stand out like this forever?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 27, 2012, 02:44:19 PM
ShotData
lol yes I do.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 27, 2012, 03:16:15 PM
I tried to a pattern like: enemy shot a bullet with a minus acceleration, when the bullet stops, other bullets will shot from that bullet. I tried using if command but it won't work. So what should I do?  :ohdear:
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj);
if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
yield;
}
}
Make maxspeed zero to slow down and stop.
Make "accel" into any value you want. a negative (-) value will make obj decelerate.
Remember: A while statement is a loop while a condition is happening and an if statement will play only once when a condition happens.
Also, if you don't know how to task, i'm no help here :I

Gonna explain it.
The enemy will fire a bullet with the desired parameters. It will slow down, and as long it's not deleted and it's speed equals zero, a bullet will be fired from obj's position.
Edit the task for moar flexibility.
See Helepolis' danmakufu tutorials for more help.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on April 27, 2012, 07:44:36 PM
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjMove_SetSpeed(obj,speed);
ObjMove_SetAngle(obj,angle);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_Regist(obj);
if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
yield;
}
}

Just a short tip: in ph3, CreateShot functions returns the object ID. So you could write that task as this:

Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
yield;
}
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 27, 2012, 08:02:30 PM
Just a short tip: in ph3, CreateShot functions returns the object ID. So you could write that task as this:

Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
yield;
}
}
BOB SAGIT!
:V thanks anyway.
blaaaaa i always do wrong stuff  :(
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on April 28, 2012, 01:44:38 AM
It won't work! Both bullet were shot at the same frame!  ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 28, 2012, 02:31:01 AM
blah

It creates the bullet and then immediately after, checks if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)). Note that as it's written, it's checking if (obj&&ObjMove_GetSpeed(obj)==0) is deleted. Oops typo. Obviously there's some screwup in there somewhere and Obj_IsDeleted returns false and the decision goes through. Oops shot bullat.
Even if it was written properly, obviously the bullet isn't deleted right after it's shot so it skips straight to the next condition, and unless you started it at 0 speed, it would return false and not shoot the bullet. There is nothing after that since there are no loops. Putting an if statement in a task does not inherently loop the if statement per frame. What you want is
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(!Obj_IsDeleted(obj)){
if(ObjMove_GetSpeed(obj)==0){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
yield;
}
}
Or better yet
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(ObjMove_GetSpeed(obj) != 0){
yield;
}
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
Since the former will keep firing extra bullets as long as the bullet speed is 0, if it somehow ends up that the bullet speed stays 0.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on April 28, 2012, 02:57:14 AM
blah

It creates the bullet and then immediately after, checks if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)). Note that as it's written, it's checking if (obj&&ObjMove_GetSpeed(obj)==0) is deleted. Oops typo. Obviously there's some screwup in there somewhere and Obj_IsDeleted returns false and the decision goes through. Oops shot bullat.
Even if it was written properly, obviously the bullet isn't deleted right after it's shot so it skips straight to the next condition, and unless you started it at 0 speed, it would return false and not shoot the bullet. There is nothing after that since there are no loops. Putting an if statement in a task does not inherently loop the if statement per frame. What you want is
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(!Obj_IsDeleted(obj)){
if(ObjMove_GetSpeed(obj)==0){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
yield;
}
}
Or better yet
Code: [Select]
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(ObjMove_GetSpeed(obj) != 0){
yield;
}
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
Since the former will keep firing extra bullets as long as the bullet speed is 0, if it somehow ends up that the bullet speed stays 0.

Whoa! It works! Thanks so much!  :D
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 28, 2012, 08:18:00 AM
With ph3, I'm noticing that all the 2D Sprite objects appear to be a little blurry, even when the rects are set properly.  A notable example is the STG frame which I replaced directly from the default.  I took a screenshot to compare the raw image to the game itself, and the results are obvious.

http://dl.dropbox.com/u/38923366/ph3notcrisp.png

This may be a minor issue, but it wasn't present in .12m, and is making my OCD systems overload.
It seems that bullet graphics and text objects are the only things not suffering from this blur.

I even tried to draw it with Primitive 2D by setting the vertexs, but it looked no better.
It does also happen in 0.12. Not many people even notice this, so uh good job
I haven't tested to see what causes what I've dubbed "blurry aids" in ph3, so if you want you can be the guinea pig or something lol
-Try keeping all images restricted to width and height of a power of two. 64, 128, 256, 512, etc. Whole images obviously; odd UV coordinates are fine, I think. In other words, always buffer the image size up to one of those.
-Try keeping a displayed image's center on a single pixel. If the render/sprite image width/height is odd you're fine, but if the image width/height is even, try moving the position a half-pixel over. Of course, both of these can cause issues with centering (like if the image spins etc) so usually I have to play around until something works.
-Try angling the image a bunch. The cardinals haven't ever caused this, 45 degree offsets sometimes does and sometimes not, and usually anything outside that blurs up the image so I never suggest keeping an image rotated at an odd angle for very long.

There were probably a few more causes but I can't recall any. Anything that might screw up normal rendering like stretching XY vertices or using SetScale and such will probably do this for obvious reasons, but those aren't nearly as problematic.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on April 29, 2012, 04:50:38 AM
1. GetCurrentScriptDirectory() is not defined for shot scripts.
Tried both writing it as "script/blah/blah/blah" and GetCurrentScriptDirectory.

4. When you say "script", is this a new file you're using? How are you loading the shot script? Danmakufu saying shot_image is undefined makes me think that you're putting this in an include_script or something.
I used the function for loading shot data.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 29, 2012, 06:35:25 AM
Tried both writing it as "script/blah/blah/blah" and GetCurrentScriptDirectory.
Yes, you said that, I was just affirming that "script/folder/shotimage.png" is the correct method.

Quote
I used the function for loading shot data.
Alright, but how exactly are you loading it? Telling me you're using LoadEnemyShotData() doesn't help much. Can you paste the shot script on pastebin? The code section that you're using LoadBla() in?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 29, 2012, 09:38:40 AM
Excuse me for abusing this thread alot, and also not being sure I'm posting this in the right place, but is there any reccomendations on creating a custom shotsheet? Like any programs for making it and the shotsheet size?
Well I guess i'm expecting way too much from danmakufu already lol
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on April 29, 2012, 01:58:10 PM
Excuse me for abusing this thread alot, and also not being sure I'm posting this in the right place, but is there any reccomendations on creating a custom shotsheet? Like any programs for making it and the shotsheet size?
Well I guess i'm expecting way too much from danmakufu already lol

You realize this was on the first page of threads right?
http://www.shrinemaiden.org/forum/index.php/topic,12412.0.html
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on April 29, 2012, 02:01:48 PM
You realize this was on the first page of threads right?
http://www.shrinemaiden.org/forum/index.php/topic,12412.0.html (http://www.shrinemaiden.org/forum/index.php/topic,12412.0.html)
I know, that's to make scripts for shotsheets. I was talking about the actual image files and asking for good ideas for making them.
Like, the actual shot types (bubble, star, arrowhead etc).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on April 29, 2012, 03:14:26 PM
I know, that's to make scripts for shotsheets. I was talking about the actual image files and asking for good ideas for making them.
Like, the actual shot types (bubble, star, arrowhead etc).

If you have photoshop, you can use the grid function to make it easier to line up the bullets. Just make sure the distance is the same between all bullets of the same type and in a neat row and it should be fine.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on April 30, 2012, 07:33:57 AM
Well, I'm getting ready for more complicated things to learn

1. How can I make the CutIn like those in MoF/SA/UFO/TD?
2. How can I make dialogs - conversation between characters? Can I do it in Plural script or just Stage script?
3. How can I make familiars?  :ohdear:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 01, 2012, 03:19:30 AM
Well, I'm getting ready for more complicated things to learn

1. How can I make the CutIn like those in MoF/SA/UFO/TD?
2. How can I make dialogs - conversation between characters? Can I do it in Plural script or just Stage script?
3. How can I make familiars?  :ohdear:

1. http://www.mediafire.com/?dbtdzfbnuturnib (http://www.mediafire.com/?dbtdzfbnuturnib); Put #include"./Cutin.txt" in the header for the file you want the cutins to be added for. Keep in mind that depending on your file structure, you may have to edit the image paths in Cutin.txt. This is true when only white squares appear instead of the proper image. When editing the image paths, keep in mind that it is relative to the script calling Cutin.txt, not relative to Cutin.txt itself. Instructions on how to use the cutins are in Cutin.txt

2. You can do it in any script you desire, the key to getting it down is "display image and text; when shot button is pressed, move on". In the download for the cutins, I added a file that i was messing around with some time ago. This file contains a crude version of a Ten Desires conversation. Add #include"./EventTest.h" into the Sample.txt file to see how it works.

3.
Code: [Select]
let objFamiliar = CreateOption;

function CreateOption{
let obj = ObjEnemy_Create(OBJ_ENEMY);
ObjEnemy_Regist(obj);
ObjPrim_SetTexture(obj, familiarimage);
ObjSprite2D_SetSourceRect(obj, rec1, rec2, rec3, rec4);
ObjSprite2D_SetDestCenter(obj);
ObjEnemy_SetLife(obj, familiarlife);
return obj;
}
With the object id you get from this task, you may use it as you desire. Alternatively, you may edit this task to suit your needs for your familiar.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on May 01, 2012, 05:21:20 AM
1. http://www.mediafire.com/?dbtdzfbnuturnib (http://www.mediafire.com/?dbtdzfbnuturnib); Put #include"./Cutin.txt" in the header for the file you want the cutins to be added for. Keep in mind that depending on your file structure, you may have to edit the image paths in Cutin.txt. This is true when only white squares appear instead of the proper image. When editing the image paths, keep in mind that it is relative to the script calling Cutin.txt, not relative to Cutin.txt itself. Instructions on how to use the cutins are in Cutin.txt

2. You can do it in any script you desire, the key to getting it down is "display image and text; when shot button is pressed, move on". In the download for the cutins, I added a file that i was messing around with some time ago. This file contains a crude version of a Ten Desires conversation. Add #include"./EventTest.h" into the Sample.txt file to see how it works.

I tried the sample and get an error:

(http://i238.photobucket.com/albums/ff80/kuroemon1995/error.jpg)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 01, 2012, 07:10:22 AM
It says CreateSpeechImageA1 is undefined, which means you're calling something that your script currently can't find, basically. If you try to call on a variable or function named XYZ, but you haven't actually made XYZ, this error will happen. Assuming that you can't read japanese, please attempt to familiarize yourself with how the message looks, at least, because over time you will probably see it often enough.

Next, what are the steps to fix this, or at least the steps to figure out what is wrong?

If you don't know, then you probably should not be attempting to work this at the moment.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on May 02, 2012, 12:46:16 PM
Yes, you said that, I was just affirming that "script/folder/shotimage.png" is the correct method.
Alright, but how exactly are you loading it? Telling me you're using LoadEnemyShotData() doesn't help much. Can you paste the shot script on pastebin? The code section that you're using LoadBla() in?
I have the code on a separate computer at the moment.

But I managed to load it without the script returning an error. However, bullets won't spawn at all.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on May 11, 2012, 02:47:13 AM
Not really a question, but I finally figured out how to get fonts working.

1) You have to use a Shift-JIS font. Sorry, no Comic Sans.

2) Use the path to the font for InstallFont, and use the name of the font (open the ttf file and check the top) for ObjText_SetFontType.

Here's a usable serif font if anyone wants it. (http://dl.dropbox.com/u/15870353/ipamp-mona.ttf)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on May 12, 2012, 03:37:45 AM
Another question:

1) I tried making a plural script of Momiji so I get the images rip from Drake's Project and have this

(http://i238.photobucket.com/albums/ff80/kuroemon1995/stg4benm.png)

So how can I make enemy (or any other objects) animate?  :ohdear:

2) I also want to create some background just like the original game, but I don't know how to make background script  :ohdear:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 12, 2012, 06:30:40 AM
http://www.youtube.com/watch?v=JUj6xG79-TY

but use 2d sprite objects instead
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: silent hill on May 15, 2012, 08:08:29 PM
hi all , can i ask how to make the img i use with "#Image" on the start of the script to fit ?     my pic is  850x803   the default of danmakufu is 192x224 and that only take a corner of my pic , tried minimizing it with paint but it wont do the trick (quality drop) .  thx for the helpers .

the point (in the end) is that i will have the whole img in the menu right by the description
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on May 15, 2012, 08:39:34 PM
hi all , can i ask how to make the img i use with "#Image" on the start of the script to fit ?     my pic is  850x803   the default of danmakufu is 192x224 and that only take a corner of my pic , tried minimizing it with paint but it wont do the trick (quality drop) .  thx for the helpers .

the point (in the end) is that i will have the whole img in the menu right by the description

If you use photoshop or any other advanced image editing program to shrink the image the quality drop will be much lower. Doing it with no quality drop is impossible though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: silent hill on May 16, 2012, 04:00:48 PM
thx , but i think i wasnt straight with my question , so sorry for the confusion and i will rise some points -

1 im a beginner at danmakufu

2 i have tried to use photoshop but the function of chaining keeps the pixels under collective change so not all of the pic can go in there .
   (as so http://www.youtube.com/watch?v=b8yo7KMhuXM )

3 in the end im looking for some way to declare the X & Y  of the "#Image"  function just like "#background" have  (my hopes are that the 192 x 224 pixels limit is a default)

again cos im new i feel like the answer is right under my nose , salutation or not im just glad there is an active community for danmakufu .
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 16, 2012, 10:32:24 PM
- Chaining? Collective change? I'm not sure what you mean here.
- You cannot declare the rect to use in #Image.
- The image can be up to 640x480. It can fill up the whole screen, if you want, so where you get 192x224 I have no idea.
- Honestly I'm not sure why you're even bothering with it in the first place. It's just an image that pops up in the danmakufu select menu, just like #Text.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: silent hill on May 17, 2012, 05:14:24 PM
well , the vid i posted explain the chaining thingy (0:30) .

got the idea of the default pixels there   http://tornworld.forumotion.com/t172-danmakufu       ->   "Image is the image displayed to the right of the description. 192 by 224 seems to be a good resolution for these. "  and the fact that thats the  pixel size danmakufu takes from the top left if i use a bigger pic .

so bottom line , i set a goal to get good with danmakufu , and yes as you are saying this is not something to be bothered with , i should start with patterns .

ok , working on my first boss a more suitable question - can only supershots/objects be modified with the affect of "SetBombResist"  ?
- and how to correctly use "SetForbidPlayerSpell"  ? (thx for helpers)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on May 20, 2012, 08:52:39 PM
All shot functions returns the id of the shot, so SetBombResist works for any shot as long as you store it's ID in a variable.

As for SetForbidPlayerSpell, you can turn player bomb usage off any time with SetForbidPlayerSpell(false) or turn it on with SetForbidPlayerSpell(true).

EDIT: SetBombResist is incorrect by the way, it should be ObjShot_SetSpellResist.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 22, 2012, 05:21:17 AM
Well, I finally got to experimenting with Ph3. So I was wondering, is it possible to check for the collision between 2 specific objects like Collision_Obj_Obj in 0.12m? ObjCol_IsIntersected only checks whether the specified object intersects with any other object.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 22, 2012, 05:50:22 AM
Now that you can mush around with objects more freely it's quite simple to do it yourself (except I don't think you can get intersection radii for bullets yet).
Anyways, you want GetObjectDistance(obj1, obj2).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 22, 2012, 06:37:00 AM
Is that function on the wiki? I can't find it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 22, 2012, 08:19:18 AM
No, but it's on the official documentation that likely gets updated more consistently than the wiki currently does ;U
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 25, 2012, 01:42:01 AM
My friend wants to know how many key inputs Ph3 can detect. He's trying to get it so the player can choose an ability to use without going to some kind of ability select wheel in the middle of gameplay. Also, how exactly to the "user keys" work?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 25, 2012, 02:03:36 AM
All of the keys are defined in config.exe and can be freely changed. As for how many keys, why don't you just try hammering a bunch/all of them? If there's a limit (and not a limit of the keyboard) it should become obvious, no?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 25, 2012, 02:56:40 AM
All of the keys are defined in config.exe and can be freely changed. As for how many keys, why don't you just try hammering a bunch/all of them? If there's a limit (and not a limit of the keyboard) it should become obvious, no?
I probably phrased that question badly. I meant, how many different inputs can Ph3 detect? Apparently by looking at the config screen (which I forgot existed) there are 11 inputs that danmakufu detects, which can be customized to any key. Thanks for your help, since it pointed me in the right direction.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 26, 2012, 12:50:37 AM
Sorry for the double post, but I have yet another question. Is it possible to keep the player from dying and respawning when hit? I tried putting SetPlayerInvincibilityFrame in EV_HIT but it didn't work. I was trying to make a player that has a health system rather than extra lives.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Naut on May 26, 2012, 08:25:34 PM
Sorry for the double post, but I have yet another question. Is it possible to keep the player from dying and respawning when hit? I tried putting SetPlayerInvincibilityFrame in EV_HIT but it didn't work. I was trying to make a player that has a health system rather than extra lives.

You could have the player script automatically call a bomb script under EV_HIT so that it sort of autobombs, but the bomb script doesn't actually do anything other than decrease the health variable and only lasts one frame (as well as keeps bomb stock the same).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 26, 2012, 10:13:11 PM
You could have the player script automatically call a bomb script under EV_HIT so that it sort of autobombs, but the bomb script doesn't actually do anything other than decrease the health variable and only lasts one frame (as well as keeps bomb stock the same).

Funny you should suggest that because I actually tried and got it to work. However, for some very strange reason, after the first 5 hits, CallSpell fails to work. In fact, it then becomes impossible to bomb normally by pressing the bomb button.  I can bomb normally however many times I want. However, after CallSpell is called 5 times, bombs cease to work. This is really bizarre.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 26, 2012, 11:55:28 PM
Funny you should suggest that because I actually tried and got it to work. However, for some very strange reason, after the first 5 hits, CallSpell fails to work. In fact, it then becomes impossible to bomb normally by pressing the bomb button.  I can bomb normally however many times I want. However, after CallSpell is called 5 times, bombs cease to work. This is really bizarre.

Sounds as if GetSpellManageObject isn't deleted after you run the spell, perhaps an if-statement that doesn't run >5 times. If this is not the case try posting the script.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 27, 2012, 06:10:58 AM
Sounds as if GetSpellManageObject isn't deleted after you run the spell, perhaps an if-statement that doesn't run >5 times. If this is not the case try posting the script.

Here's the entire @Event segment that I have:

http://pastebin.com/hdmhkxmP

I truly have no idea why it only works 5 times.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 27, 2012, 10:15:13 AM
Here's the entire @Event segment that I have:

http://pastebin.com/hdmhkxmP

I truly have no idea why it only works 5 times.

I found the problem, it's the Rebirth Frame. The default value to counter bomb is 15, and with each counterbomb it decreases by 3, effectively disabling counterbombing after 5 times. To fix this simply add something like
      SetPlayerRebirthFrame(10);
      SetPlayerRebirthLossFrame(1);   
to EV_REQUEST_SPELL and it should work. For some reason, setting it in Initialize with a loss of 0 doesn't work, as it still goes down. This would also work as a failsafe should a script modify your player's rebirth frame.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 27, 2012, 02:21:13 PM
I found the problem, it's the Rebirth Frame. The default value to counter bomb is 15, and with each counterbomb it decreases by 3, effectively disabling counterbombing after 5 times. To fix this simply add something like
      SetPlayerRebirthFrame(10);
      SetPlayerRebirthLossFrame(1);   
to EV_REQUEST_SPELL and it should work. For some reason, setting it in Initialize with a loss of 0 doesn't work, as it still goes down. This would also work as a failsafe should a script modify your player's rebirth frame.
Alright that did it! Thanks a lot, I completely forgot about the rebirth frame decay. It works perfectly now.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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*
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan 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);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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 (http://pastebin.com/qSLb6mBK)[/size]
Shotsheet data:[size=78%]http://pastebin.com/ufVPxUmM (http://pastebin.com/ufVPxUmM)[/size]
Image:[attach=2]
Script I use to fire the bullets in:[size=78%]http://pastebin.com/1bsuSJh6 (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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud 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?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 07, 2012, 07:55:42 PM
SetShotAutoDeleteClip(l,t,r,b);
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KrackoCloud on June 07, 2012, 09:38:17 PM
Perfect, thanks.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: numbuh1 on June 08, 2012, 01:05:50 PM
SetShotAutoDeleteClip(l,t,r,b);

What are those arguments mean?  ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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.

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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:

(http://i.imgur.com/oWJrg.png)

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

(http://i.imgur.com/BgL9F.png)

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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on June 12, 2012, 11:08:10 PM
Oh, okay, thanks. I thought I was going crazy for a second, lol.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony 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!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue 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?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony 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
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake 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.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on June 19, 2012, 07:01:54 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?
Disregard some of the last post. Just tested Dnh a few times more and I realised the problem only happens with bullets, sorry. I don't think it has something to do with the framerate because if it did all other objects would have the same problem. It could be just that Danmakufu is still in beta and it's compatibility with shotsheets is slightly shitty.
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.
Are you saying that with all our images we should resize them by double (or make images with double the initial size), then when we upload the images/textures onto Dnh we scale them to half, or something?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on June 19, 2012, 09:22:04 PM
Are you saying that with all our images we should resize them by double (or make images with double the initial size), then when we upload the images/textures onto Dnh we scale them to half, or something?

He's saying that the length and width of the images should be a power of two (2, 4, 8, 16, 32, 64, 128, 256, 512, etc). The "2X images" in his last sentence means "twenty-something images".
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony on June 20, 2012, 04:07:44 PM
He's saying that the length and width of the images should be a power of two (2, 4, 8, 16, 32, 64, 128, 256, 512, etc). The "2X images" in his last sentence means "twenty-something images".

Actually... In order to get around the blurryness before, I re-sized all of my images to twice their size, so the 2x was meant as "2 times normal size".  But, there are twenty something images that need the re-size so I guess it works too.

For an "unrelated to blurry" question, I'm working on making a Subterranean Animism Reimu A player script, and the very last thing that the script doesn't have faithful to the original is invincible grazing.  Is there a way outside of "ObjPlayer_AddIntersectionCircleA1" that I can use to check for grazing?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 20, 2012, 09:55:18 PM
Does ObjPlayer_ClearIntersection and Add not work?

This might work:
-Use GetShotIdInCircleA2(x, y, r, TARGET_ENEMY) to return an array of object IDs
-Check these IDs against the last frame's stored array and eliminate the ones "you've already grazed", then store this array as the main one
-Use length() on it to find how many bullets are within the circle

And then you'll probably have to do some combing to make sure dead bullets are removed from the array and stuff like that but this should be appropriate.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on June 21, 2012, 04:47:36 PM
Oh yes, forgot to ask. In addition to the question about retrieving a shot's ID, is there a function to retrieve how long a shot's delay is?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 21, 2012, 08:57:41 PM
Not that I can tell. I'm going to ask the more expansive question of "why would you need it".
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on June 21, 2012, 09:39:02 PM
'why would you need it'
As stated before, I was going to be working on making a function or something that changes a shot's delay type.   Instead of the normal blur Dnh gives you when a bullet's delay is active, the default delay is invisible and during the time of how long the delay is active, the bullet's graphic is larger than the original bullet and at a lower alpha too. The graphic will gradually get smaller until the original size is acheived, and the graphic's alpha will get higher too. Until the bullet is at full alpha and normal size, the bullet will fire.
Sorry if I confuse you I'm not that good at explaining. :blush:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on June 21, 2012, 09:53:37 PM
The easier way to do that is to make a function that takes the CreateShot parameters, does the custom delay effect, and when it finishes, creates the bullet with a delay of 0.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 21, 2012, 10:17:16 PM
I asked why you needed it because chances are you wouldn't need it. Explaining what you want to do rather than "is there a function for this" makes it much more probable that you'll get a proper answer, especially since we may come up with a solution completely different than what you were expecting.

In this case, you just implement CreateShotwhatever into a new function, precisely how Lucas described. It'll just look like
Code: [Select]
function CreateShot01N(x, y, s, a, g, d){
let shot = CreateShot01(x, y, 0, a, g, 0);
//shot doesn't kill player, is invincible, etc
delayeffect;
return shot;

task delayeffect{
//do the effect
//shot "fires"
}
}
or something along those lines.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Frenticpony on June 22, 2012, 12:11:17 PM
Does ObjPlayer_ClearIntersection and Add not work?

This might work:
-Use GetShotIdInCircleA2(x, y, r, TARGET_ENEMY) to return an array of object IDs
-Check these IDs against the last frame's stored array and eliminate the ones "you've already grazed", then store this array as the main one
-Use length() on it to find how many bullets are within the circle

And then you'll probably have to do some combing to make sure dead bullets are removed from the array and stuff like that but this should be appropriate.

They work, but when using SetInvincibilityFrame, is seems to get rid of both hit and graze collision checking.

I'll mess around, but I've played with arrays very minimally so I expect catastrophic failure.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Arcorann on June 23, 2012, 12:12:04 PM
Could someone translate the changelogs for the most recent version of ph3?

For that matter, has anyone here actually tried any of the beta 6 previews yet? I've just started getting my head around the archiver and this new "package script" business.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: saturnascends on June 24, 2012, 12:44:43 AM
It's my first time tasking and I want to be competent, but I just have no clue what's going on here.

EDIT: Nevermind, figured it out. I'm just dumb.

It says my task "dumb" is undefined or something... Absolutely no idea how to fix that without taking that task out altogether.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on July 01, 2012, 04:11:13 PM
Is it possible as a temporary replacement for "angular_velocity", we could have some thing like this?:
Code: [Select]
task spinimage{
let imagespin=0;
let shot1=CreateShotA1(ex,ey,speed,angle,graphic,delay);
//Other Stuff
while(shot1==!Obj_IsDeleted(shot1)){
ObjRender_SetAngleY(shot1,imagespin);
imagespin+=number;
//Other Stuff
yield;
}
}
Or something?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on July 01, 2012, 07:05:12 PM
The latest ph3 version should have that implemented. Either that, or I read something wrong.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on July 01, 2012, 07:13:26 PM
The latest ph3 version should have that implemented. Either that, or I read something wrong.
I don't think you did read something wrong; just checked here http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_ph3.html (http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_ph3.html)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on July 01, 2012, 10:31:08 PM
Well it's sometimes hard to make out what it says when you only have google translate.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on July 02, 2012, 11:29:18 AM
Does anyone know how to construct these waveforms?:  http://upload.wikimedia.org/wikipedia/commons/7/77/Waveforms.svg (http://upload.wikimedia.org/wikipedia/commons/7/77/Waveforms.svg)
I don't really know how to explain it...but the Sine wave is definitely a yes-yes
Basically, I want to create a spiral of Kunais but I want the initial angle variable to slowly speed up, slowly speed down, reverse, slowly speed up every frame etc. That's one of the things I want to create.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Thaws on July 02, 2012, 11:41:37 AM
Does anyone know how to construct these waveforms?:  http://upload.wikimedia.org/wikipedia/commons/7/77/Waveforms.svg (http://upload.wikimedia.org/wikipedia/commons/7/77/Waveforms.svg)
I don't really know how to explain it...but the Sine wave is definitely a yes-yes
Basically, I want to create a spiral of Kunais but I want the initial angle variable to slowly speed up, slowly speed down, reverse, slowly speed up every frame etc. That's one of the things I want to create.
Sine wave:
Simply use the sine function.
set the speed = sin(angle)*displacement
angle should be increased by a certain number every frame. Somewhere around 3 would probably give a nice result.
displacement is your maximum speed. e.g. displacement = 1 would give a speed of -1 to 1.
If you want it to be positive all the time use somehing like speed = sin(angle)*displacement+3, then the speed will vary from 1 to 4 and back to 1.

Square wave:
Change the variable from positive to negative every set number of frames.
e.g.
if(frame%30 == 0){ speed = -speed;}
frame++;

Triangle wave:
speed += acceleration;
where acceleration is a square wave. (So speed will increase for some time, then decrease and repeat.)

Sawtooth wave:
Simply keep increasing speed until you reach a certain point then reset it
speed += acceleration;
if(speed > max_speed){ speed = original_speed;}
something like this.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Angele on July 16, 2012, 06:57:19 AM
Interest in danmakufu seems to be dwindling~ ._.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 16, 2012, 03:09:41 PM
Interest in danmakufu seems to be dwindling~ ._.
Perhaps or perhaps not, either way please keep in mind that this isn't the thread to discuss that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Ginko on July 24, 2012, 01:22:37 PM
I can't seem to have my lasers rendered with alpha; instead, it seems to be automatically changed to add lasers.

Is it just me ? Am I doing something wrong ?

The bullet I use for the laser is defined is the shotsheet with a "render=ALPHA", plus after creating the laser, I do a "ObjRender_SetBlendType(obj,BLEND_ALPHA);", but it looks like it's just ignored.

Is there a simple way to work around that, or will I have to manually make the hitbox and graphics ?  It seems kinda odd, though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on July 24, 2012, 02:12:47 PM
Well well a certain program is being as ass  :getdown:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on July 24, 2012, 02:30:09 PM
For what it's worth, 0.12m does the same thing from what I remember.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 04, 2012, 07:43:34 PM
How to custom player script?
'why would you need it'
Because I can make graphics and I haven't Danmakufu'd for a while and I wanted to try something different.



>Looks inside default player script


Nope, fuck that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 05, 2012, 04:37:31 AM
Creating a player script is essentially the same as in 0.12. You now can just also take advantage of events and ph3's new functionalities in general. The most important thing is knowing how to construct the logic and structure of a player, not really learning how to use any specific functions. Most stuff in the 0.12 tutorial besides effect objects (which you can now replace with sprites which are easier) still applies.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 22, 2012, 08:06:25 PM
Lonely Thread is lonely ;_;
How to I make a spell cutin? Like with the proper "spellname" text and the boss image, and when it finishes it gives you a point bonus?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on August 29, 2012, 08:54:24 PM
What's the default font for Danmakufu? On some computers, the text is extremely small, and for others, it's normal-sized.
I am considering using a different font, but knowing the default would be nice.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 29, 2012, 10:42:33 PM
Okay I'm working on a boss project (for once!) and I'm trying to load a part of a graphic sheet but there is no graphic rendered on the stage. What's going on here I'm 100% sure I scripted everything right...
[attach=1]




fake e: Thanks Drake for Touhou graphics :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on August 29, 2012, 11:18:53 PM
Okay I'm working on a boss project (for once!) and I'm trying to load a part of a graphic sheet but there is no graphic rendered on the stage. What's going on here I'm 100% sure I scripted everything right...
[attach=1]

fake e: Thanks Drake for Touhou graphics :V

Code: [Select]
LoadTexture(GCSD~"img/stage05e01.png");
let objEnemy = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(objEnemy,GCSD~"img/stage05e01.png");
ObjRender_SetPosition(objEnemy,100,100,0);
ObjSprite2D_SetSourceRect(objEnemy,0,0,256,512);
ObjSprite2D_SetDestRect(objEnemy,-120,-253,-73,-154);
Mkay, let's break down what you did wrong here.

Code: [Select]
ObjRender_SetPosition(objEnemy,100,100,0);This sets the sprite exactly 100 pixels away from the top left corner. Nothing really wrong with that.

Code: [Select]
ObjSprite2D_SetSourceRect(objEnemy,0,0,256,512);Here's a problem. You set the primitive to use the whole image at once. So, it will show all of Shou's sprites.

Code: [Select]
ObjSprite2D_SetDestRect(objEnemy,-120,-253,-73,-154);Another problem. I don't know if you're sure what you were doing here.
This makes the sprite go offscreen. Any coordinates less than 0 will always end off of the screen. It's actually located at the coordinates 27, -54. It is displayed way too high up to show up on the player's screen. In addition, this resizes it really, really weirdly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 29, 2012, 11:27:33 PM
Mega derp
Okay but is it okai if I omit ObjSprite2D_SetDestRect? Originally I thought that used used to draw a certain section of the whole graphics sheet...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 30, 2012, 12:18:34 AM
SourceRect and DestRect are like the UVs and XYs, respectively, that you would use for effect objects in 0.12. It is used to draw a defined section of the texture, you just didn't do it correctly (or at least, how you wanted it to).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 30, 2012, 09:50:04 AM
Ah, thanks got that sorted out, but I used ObjSprite2D_SetDestCenter instead; it's a lot easier. But since in my script attacks will be executed in succession, how do I make a plural script?

e: Yeah I said the boss graphic is on screen perfectly, but why isn't she moving? I wrote down ObjMove_SetDestAtWeight(); but nothing's happening...
http://pastebin.com/6sswr5aK (http://pastebin.com/6sswr5aK)

e2: Screw the problem I got it sorted out but it would be great if someone explained why the graphic wouldn't be drawn with that code. It would make great use in the future...


e3: OH LOOK ANOTHER QUESTION. Okay so I've set the intersection circles for the boss but she is taking to damage from the shots and the player wont die when I run into her. What's happening? http://pastebin.com/eduh9uiF (http://pastebin.com/eduh9uiF)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 31, 2012, 12:50:46 AM
1. Can't draw things during @Initialize (or rather, on the very first frame of a script) actually the example scripts do this so uh hooray you can draw things on the first frame! \o/
2. MainLoop
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 31, 2012, 07:56:14 AM
great now i feel like a complete idiot  :persona:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on September 23, 2012, 05:34:10 PM
How do I make a custom cut-in? I will be making the graphics and all but what are the requirements, functions, tasks etc for making one?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on September 23, 2012, 06:53:44 PM
How do I make a custom cut-in? I will be making the graphics and all but what are the requirements, functions, tasks etc for making one?
Funny that you should ask this since I just finished making my own for Ph3.

There are no "requirements" per say. What you'll probably want is a render object of the cut in image displayed with a priority that's below the bullets, player, etc. Then it's just as simple as manipulating the object to appear for a couple seconds, move where you want, then disappear.

Code: [Select]
task Cutin(CutImage,left,top,right,bottom) {
let obj = ObjPrim_Create(OBJ_SPRITE_2D);

ObjPrim_SetTexture(obj, CutImage);
Obj_SetRenderPriority(obj, 0.28); //This is the priority I used. Feel free to experiment with others
ObjSprite2D_SetSourceRect(obj, left, top, right, bottom);
ObjSprite2D_SetDestCenter(obj);
ObjRender_SetPosition(obj, x, y, 0); //Places the image wherever you want it to start

while(!Obj_IsDeleted(obj)) {
//Do stuff (like move the image where you want it to go)
yield;
}
}

Something like this should be a good start. For the spellcard name text you have a couple of options. You could make it a text object and use danamkufu's default text functions to display it (this is what I did and I find it the easiest). You could also make the spell name another render object like the cut in if you desire something other than danmakufu's text. However, this requires each spell name to have a different image as you will need to edit them separately in an image editor.

Anyway that should cover the basic requirements of a spellcard cut in. Any extra fluff (like the scrolling "Spell Card Attack!!") will usually just be more render objects.


Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on September 23, 2012, 07:07:25 PM
Thanks, I will try this later. What does Obj_SetRenderPriority do?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on September 23, 2012, 08:28:11 PM
Thanks, I will try this later. What does Obj_SetRenderPriority do?
It's basically Ph3's version of Obj_SetLayer in 0.12m. The higher the number, the higher up it is drawn. Note that ph3 has several different versions of this function, some of which require a number from 1-100 or 0-1. I'm not familiar with all of them so be sure to check the wiki for more info on that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 23, 2012, 11:00:48 PM
Making things like explosions and spell circles and cutins are all things that require no specific rules. It's all just a matter of knowing what you want the function to accomplish and knowing how to manipulate your images to do so.

Obj_SetRenderPriorityI(obj, n) is the function you usually want. Priorities range from 0 to 100, lower value means drawn higher (less priority).
20: Frame; anything lower is drawn over the frame
30: Player
40: Enemies
50: Bullets
60: Items
69: 2D Camera Focus; anything lower is ignored by the camera, i.e. moving the camera around won't move the image
80: Maximum priority for the scene; I haven't tested this value so I dunno what it does

Personally I figure the float version (Obj_SetRenderPriority) is only useful when you're actually using calculations to assign priorities rather than just numbers, since this is essentially the same thing using 20/100, 30/100, 69/100, etc.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on September 24, 2012, 07:37:24 PM
The fucking fuck?
[attach=1]
[attach=2]
What happened here? All I wanted to do is to spin the border on a sine and it fucks up the whole thing...


e: Download both and place in the same folder.


And why is the thread so empty ;_;
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 24, 2012, 09:58:15 PM
Obj_SetRenderPriority(border, 100) does not work. This is the function that just accepts values from 0 to 1. Even if you used Obj_SetRenderPriorityI(border, 100) which is the 0 to 100 function, you might not even see it as you're using the maximum priority.

ObjRender_SetPosition(border, 150, 150, 0) is going to throw it in 3D space. It's a simple object; just use ObjMove_SetPosition.

You don't need mainTask at all; ph3 lets you draw stuff on the first frame and it's just transparently tossing to spinborder, so why have it?

ObjRender_SetAngleXYZ(0,45,border,sin(angle2)*3) is probably the main issue. What is this even. ObjRender_SetAngleXYZ's parameters are object ID, X-angle, Y-angle and Z-angle, so you're throwing a 45-degree X-angle, a Y-angle rotated at whatever your border object's ID is, and actually affecting the object of ID 0. Use ObjRender_SetAngleZ. There is also no looping in your task, which you need in order to have your stuff run for more than one frame. Even if you had a loop your angle2 is just going to keep increasing (it currently doesn't), but using sin(angle2)*3 means it'll wiggle around from 0 to 1 to 0 to -1 to 0 degrees.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on September 29, 2012, 01:11:19 PM
I keep getting this error message. This happened when I tried to make some parts impossible to select.
"Line 356 ")" is required."
It happens right before I start the "Character Select" task. I checked the task above that, and nothing looks wrong with it. wat do?

http://pastebin.com/rJGev356
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on September 30, 2012, 09:39:48 AM
I keep getting this error message. This happened when I tried to make some parts impossible to select.
"Line 356 ")" is required."
It happens right before I start the "Character Select" task. I checked the task above that, and nothing looks wrong with it. wat do?

http://pastebin.com/rJGev356

Line 366:                 TMenuItem(iText, mx, my, texts[iText], (iText == 4 && !GetCommonData("unlockYUYUKO", false));

You are missing a closing parentheses. A syntax highlighter that bolds matching parentheses, braces, and brackets (NotePad++ is good) may be helpful in catching these mistakes more quickly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on September 30, 2012, 11:34:31 AM
Line 366:                 TMenuItem(iText, mx, my, texts[iText], (iText == 4 && !GetCommonData("unlockYUYUKO", false));

You are missing a closing parentheses. A syntax highlighter that bolds matching parentheses, braces, and brackets (NotePad++ is good) may be helpful in catching these mistakes more quickly.

Oh. Looks like you're right.

I am using Notepad++, but it didn't seem to catch that for me.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 06, 2012, 03:53:59 PM
can ph3 do things like slow time, speed up time and stop time?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: JmLyan on October 06, 2012, 04:24:39 PM
The StartSlow command can slow down time, speed up and stop time must be faked by changing player and bullet speed etc.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 06, 2012, 04:32:42 PM
The StartSlow command can slow down time, speed up and stop time must be faked by changing player and bullet speed etc.
Thanks I'll try that later. Also I was just about to edit my previous question to ask something in addition but oh well I'll ask another one :V

I can't explain it much, but I read this thread (http://www.shrinemaiden.org/forum/index.php/topic,875.0.html) and is there any more orbital rotating around orbitals? Like the complex ones, they look pwetty :3c If there are more, what are the maths needed to generate the orbitals?

e: Also not a question but apparently Danmakufu is now being updated to be able to have 12.0m functions...


e2: AND what does DnhViewer.exe and FileArchiver.exe do and how do they work?

e3:OH LOOK ANOTHER QUESTION HOW SURPRISING. When the boss moves left for example, how can I make the boss look like as if it's moving left? Like when it's not moving it has a normal graphic but when it moves left the boss will change graphic to look like she's moving left and when she stops moving her graphic changes back to normal. Or when the boss makes a pose to unleash a powerful attack.
And how do arrays work? How do you make/use them?
Thought of asking all my current questianos now instead of asking all of the later.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 06, 2012, 05:55:00 PM
I ran out of script examples. So, i want to know how to do:
 - the wall of bullets like the one in the Seiga's midboss spell, but just straight wall.
 - the bullet with the wavy trajectory (functions?)

I'm actually learning it, so i need the ways.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 07, 2012, 08:23:47 AM
I can't explain it much, but I read this thread (http://www.shrinemaiden.org/forum/index.php/topic,875.0.html) and is there any more orbital rotating around orbitals? Like the complex ones, they look pwetty :3c If there are more, what are the maths needed to generate the orbitals?

e: Also not a question but apparently Danmakufu is now being updated to be able to have 12.0m functions...

e2: AND what does DnhViewer.exe and FileArchiver.exe do and how do they work?

e3:OH LOOK ANOTHER QUESTION HOW SURPRISING. When the boss moves left for example, how can I make the boss look like as if it's moving left? Like when it's not moving it has a normal graphic but when it moves left the boss will change graphic to look like she's moving left and when she stops moving her graphic changes back to normal. Or when the boss makes a pose to unleash a powerful attack.
And how do arrays work? How do you make/use them?
Thought of asking all my current questianos now instead of asking all of the later.
1. http://en.wikipedia.org/wiki/Category:Curves
Go nuts, if you can understand what all the math and stuff means and how to turn that into code when you find something you want.

2. It's being updated regularly, getting some 0.12 functions back is just a part of its current growth.

3. haven't bothered with them yet tbh, filearchiver likely takes a project/script folder and packs it into one file to read from

4. http://www.youtube.com/watch?v=JUj6xG79-TY is probably enough to understand how the animation and selection concept works.
But to put it to work, you'll have to deal with the changes from 0.12 to ph3, such as the removal of the DrawLoop, which can instead be replaced by tasks or per-frame subroutines, and the removal of the linear "draw this then set graphic to this and draw that then this and this" that DrawLoop had and instead use sprite/render objects. I should get around to doing tutorials sometime. Very few people seem to be interested in dnh right now though :c

5. http://www.shrinemaiden.org/forum/index.php/topic,30.msg171.html#msg171
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3_data/syntax.html#VariableArray



I ran out of script examples. So, i want to know how to do:
 - the wall of bullets like the one in the Seiga's midboss spell, but just straight wall.
 - the bullet with the wavy trajectory (functions?)
1. I assume you want the bullets to split off randomly like Seiga's do, otherwise it's just firing bullets. But actually, this is almost just as easy.

loop(n){
   local{ //since you won't need the bullet objects after you fire them, the local scope lets you reuse the variable x
      let x = CreateShotA1(fire at some angle);   //you should know this
      ObjMove_AddPatternA1(x, frame, speed, angle); //tells the bullet to move at defined speed and angle when "frame" frames pass
      //in other words set the above "angle" to some random angle so that the bullets fire off in a spray
   }
   //wait two or three frames before firing the next bullet
}


Or you can use a function to make the bullet and set the angle and loop that instead. Or whatever. ObjMove_AddPatternA1() is the important bit.

2. Wavy trajectories are a thing. Fire the bullet at some angle, and then change the angle every frame to the original angle + sin(t)*something, where t constantly increases by some frequency. Will look like:

task bullet{
   let obj = CreateShotA1(fire at some angle);
   let a = that angle;
   let t = 0;
   while(!Obj_IsDeleted(obj)){
      ObjMove_SetAngle(obj, a + sin(t)*something );
      t = (t + something) % 360;    //t increases by something per frame
      yield;
   }
}


I think this should work, if you give it proper values.
Look up your basic trigonometry if you don't understand what I'm doing with SetAngle, also the dnh intermediate tutorial could help.
(Note, the modulo (%360) is there so t will go back to 0 when it hits 360. Mostly useless for you, but good for full-game scripters since it prevents overflow.)

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 07, 2012, 10:25:47 AM
@Drake

It's look great, but can you send me the working scripts? I can't get how it works.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 07, 2012, 12:05:03 PM
TOO MANY CURVES AAAA-
Oh god I don't understand any of them... what's the mathematical formula for the rose curve? If it's too tiring and too long to figure out please don't bother because I don't get a bit of it.

Also how do I work out the maths for each curve? Like I've read the formula for most of the curves but how do I "translate" the formula so Danmakufu can use it without errors?


e: if i have to ask ANOTHER question after this i will cut myself
1. http://www.mediafire.com/?dbtdzfbnuturnib; Put #include"./Cutin.txt" in the header for the file you want the cutins to be added for. Keep in mind that depending on your file structure, you may have to edit the image paths in Cutin.txt. This is true when only white squares appear instead of the proper image. When editing the image paths, keep in mind that it is relative to the script calling Cutin.txt, not relative to Cutin.txt itself. Instructions on how to use the cutins are in Cutin.txt
When I tried to use BYAKUREN I got an error?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 08, 2012, 09:10:26 AM
It's look great, but can you send me the working scripts? I can't get how it works.
I'd much rather you figure it out, as giving you a finished script wouldn't solve anything. Providing a framework and getting you to understand should be enough~

1. To make a wall of bullets, you just have to continuously fire bullets in one direction. Easy enough? That's just looping CreateShots.
The next step is setting a variable (x in the example) to the bullet object returned by CreateShot. This lets you reference the object in later statements.
Next, you use ObjMove_AddPatternA1(x, frame, speed, angle) to give the bullet x a movement pattern. Specifically, this tells the bullet to move at the defined speed and angle after "frame" frames pass after you call the function (in this case, frames after the bullet is fired). For your purpose, you're going to want to set "angle" to something like rand(0,360) for a random angle.

Lastly, you can wrap the inside of the loop with a local scope. A local scope makes it so that all variables declared inside are only valid inside, and can be reused once you hit its end bracket. Putting this in the loop means you get to reuse the variable x for each bullet you fire. But on second thought, the local scope might not need to be used, since once the movement pattern is applied you reset the variable to the next bullet anyways. My bad, this is unnecessary.

2. cos(t) will go from 1 to 0 to -1 to 0 to 1, as t increases (as you should know, otherwise read the intermediate tutorial as I suggested). Therefore, some angle (say, 60) plus cos(t) will go from 61 to 60 to 59 to 60 and back to 61, as t increases.
Or, that angle plus (cos(t) times 5) will go from 65 to 60 to 55 to 60 to 65 as t increases. So just fire a bullet that follows this angle; I gave you a framework above (except I used sin instead of cos, use cos). At a constant speed, it should make a wavy shape. Although, you probably have to make a small adjustment somewhere; I think the wave will be a bit off-center from where you want. Get it working first, though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Delfigamer on October 08, 2012, 12:29:41 PM
2. cos(t) will go from 1 to 0 to -1 to 0 to 1, as t increases (as you should know, otherwise read the intermediate tutorial as I suggested). Therefore, some angle (say, 60) plus cos(t) will go from 61 to 60 to 59 to 60 and back to 61, as t increases.
Or, that angle plus (cos(t) times 5) will go from 65 to 60 to 55 to 60 to 65 as t increases. So just fire a bullet that follows this angle; I gave you a framework above (except I used sin instead of cos, use cos). At a constant speed, it should make a wavy shape. Although, you probably have to make a small adjustment somewhere; I think the wave will be a bit off-center from where you want. Get it working first, though.
Sin-cos replacement is an exercise, huh? :3
That is really nice pattern to follow. In the past, when my engine even didn't use DirectX, I used an Enhanced Multy-Wavy Bullet Pattern (http://www.youtube.com/watch?v=QTPBcKB6Va0). Bullets here behave just as Drake said, though they are re-aimed multiple times.
Ah, and calculated angle is added to "player's angle", so waves follow you (http://www.youtube.com/watch?v=huCWOI20v0A); but with other values that may become unnecessary.
So, trigonometry is actually a very wonderful discipline, you should learn it in order to make nice danmakus. :3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 10, 2012, 09:00:48 PM
When I tried to use BYAKUREN I got an error?
It still wont work. Any ideas why?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 10, 2012, 09:23:43 PM
What error? The only error I'm getting is completely unrelated to the cutin (CreateSpeechImageA1), and when I got rid of that error I could use BYAKUREN fine.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 12, 2012, 03:25:58 PM
I can't figure at last how to make more "independent" loops, where the pattern X is shoot, in example, at sixtieth frame, and then, at every fifth frame after the last shoot of pattern X, and the pattern Y is shoot at three hundredth frame and at every one hundred twentieth frame after the last shoot of pattern Y. Can somebody explain me how to do it?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 12, 2012, 11:18:29 PM
Threading. Use tasks. You've probably already done a bunch of it if you're posting in the ph3 thread.

task patternX{
   wait(60);
   loop{
      dosomething;
      wait(5);
   }
}
task patternY{
   wait(300);
   loop{
      dosomethingelse;
      wait(120);
   }
}

And just start both of them at the end of @Initialize. The tasks will start, and while running they will yield ("go do something else and put this on the yielding queue") over to the next task. Then on the next frame the program will go through the yielding queue, eventually get to the task and run it from where it yielded. That's the basic structure of threading.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 12, 2012, 11:59:04 PM
drake, you've done enough helping for this month :V but thanks for all of it
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Fujiwara no Mokou on October 13, 2012, 01:08:06 AM
Ah yes, the microthreading. Well, they're more like microfibers, really.
The yield; statement decrements the current thread index, so that the instruction pointer resumes executing codes from that of the callee. Or, well, the previous called thread if  the callee has been removed from queue.
Tasks are useful for things such as parallel processes, so you could have a shoobullets(); and movecharacter();, these tasks running a loop within each one, but both executing at the same time.
It's not really at the same time, though. The one called first gets a turn to go first and then gives up its timeslice for the next one, so keep that in mind when dealing with global variables within tasks.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 13, 2012, 12:50:25 PM
I don't get it...
http://pastebin.com/KUZ9pAFA
Can somebody stoppping explaining it to me and starting giving the full examples?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Fujiwara no Mokou on October 13, 2012, 03:21:15 PM
Here. It's just a crude template, but it should give you the general direction.
http://pastebin.com/8nfVgLeG
You use tasks for parallel processes, such as MotionTask() and ShootBulletPattern(patternid);

Mind the yield; at @MainLoop.
Since MainLoop runs every frame, you must tell Danmakufu to suspend the MainLoop routine to look for other tasks. In this case, the BulletTask and MotionTask, since they'll never stop running. Once they have their timeslice and yield back to MainLoop, execution for that frame will be finished, and it'll happen all over again next frame.

Multiple yields suspend the tasks multiple frames, etc etc.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 13, 2012, 05:15:07 PM
It seem to work...
But I can't force PatternX and PatternY to start at chooseable frame... if(frame==x) doesn't work...

http://pastebin.com/0QpHEA6S
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 13, 2012, 09:16:21 PM
You seem to have missed the part where I did this:
task patternX{
   wait(60);
   loop{
      dosomething;
      wait(5);
   }
}

If the loop(30){yield;} during your patternX task makes the task wait for 30 frames each time it loops, then you should be able to see that putting loop(60){yield;} before the task's core loop, when the task begins, will make the task wait for 60 frames before really starting up.

The @Initialize routine only runs once, when the script begins. After that it is never run again. This is why you can't put if(frame==60){patternX;} in @Initialize, because that code will only run once, be false since frame is still 0, and the task won't run.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 13, 2012, 09:36:30 PM
I'm still having trouble...
This doesn't seem to run:

task PatternX(){
   wait(60); //here is problem
   loop(){
      let ex = ObjMove_GetX(objEnemy);
      let ey = ObjMove_GetY(objEnemy);
      let moving = rand(-5, +5);
      let angle=0+moving;
      while(angle<=360+moving){
         let obj1 = CreateShotA1(ex, ey, 3, angle, DS_BALL_SS_WHITE, 15);
         angle+=10;
      }
      wait(10);
      yield;
   }
}

There is something wrong with the first wait command... Oh, I would appreciate any good ph3 tutorials (it's not so fresh software)...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 13, 2012, 10:45:43 PM
It has nothing to do with ph3, it's the exact same in 0.12.

wait() is not a hardcoded function, it's user-defined:
function wait(n){
   loop(n){ yield; }
}


You're getting an error because you don't have the wait() function in your script. You have to add it to your script in order to use it, otherwise you use loop(n){yield;}. They're the same thing, wait() just saves some typing. I'm sorry, I assumed you understood what wait(n) meant so I used wait(n) and loop(n){yield;} interchangeably.

I'm not exactly sure how I can explain this better. When you use a yield, it stops the code there and moves onto the next thing to do, until the next frame. This is how you get danmakufu to seemingly run multiple tasks at the same time. On the next frame, the task/whatever will start from that yield and continue until it yields again or finishes. So if you have a loop(20){ yield; }, danmakufu will yield, wait for the next frame, then yield again, and yield again, 20 times. In this way, it's "waiting" 20 frames. We use the wait() function defined above to save a bit of typing and make it clearer what we're doing.

I really want you to understand this. This is a fundamental part of danmakufu scripting. Just giving you code to copypaste for all of your problems might be nice, but if you get to understand how the scripts actually works then you can do so much more without having to ask for anyone's help. I have no problems helping you, but understanding what's you're actually doing is obviously important!

Also, most things you're currently doing in ph3 are the same or very similar to how you'd do it in 0.12. Most of the early differences in ph3 come with the increased focus on objects, and the new drawing rules. Most of the real heavy differences only show up when you're doing more advanced scripting. Because the people working on advanced scripting are going to be more knowledgeable, we don't really have a need to make tutorials for ph3 right away, especially when the program is still being updated. If people really want a tutorial on ph3 and we have some actual interest in a subject to cover in a tutorial, then tell me and I'll do it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on October 14, 2012, 02:52:40 AM
If people really want a tutorial on ph3 and we have some actual interest in a subject to cover in a tutorial, then tell me and I'll do it.
Most of the parts of Ph3 I think I can (probably) figure out on my own based on my experience with 0.12m. However, there is one aspect of it that sort of mystifies me. I know it's not really necessary to know for basic scripting, but I've always been curious as to what @Loading is and what it does.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 14, 2012, 12:20:57 PM
Thanks Drake, it's now working well.

EDIT: Now, the "script" is completed!
here (http://speedy.sh/AZBkW/x.rar)

I want to add one more thing to it before trying to make something more - I want enemy's hitbox to be inactive before the sixtieth frame, because the first bullets are shoot at this particular frame, and the enemy is just moving before. I can't do this in Initailize, MainLoop, and making the task just seem to not work (it's bypassed by script). What should I do?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on October 14, 2012, 10:53:00 PM
You can do this in a few different ways, but the one with the least amount of editing is by starting a new task from @Initialize (just like the others) that uses ObjEnemy_SetDamageRate so that no damage to the boss is done, waits 60 frames, then resets SetDamageRate back to normal.
http://dmf.shrinemaiden.org/wiki/index.php?title=Enemy_Object_Functions#ObjEnemy_SetDamageRate
This is the description for ObjEnemy_SetDamageRate(). You should be able to implement this yourself, now.

Ozzy: From the description on the documentation, @Loading is for loading graphics and sounds in a separate thread. This might be useful when you start, perhaps say, stages inside a full game and you don't want massive chugging or a loading screen while you load necessary files. However, you can't create objects or generate random numbers, and probably not anything that calls the game engine's functions, but this shouldn't matter because those aren't its purpose anyways. Functions that the main program uses like loading files and simple math and the like should be fine, though? You probably also have to make sure that you aren't referencing the loaded files immediately because that can cause possible errors and replay desyncs for whatever reason. This is just my take on it, though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 15, 2012, 04:05:11 PM
Thanks for all these things, Drake. You should really complete the lack of tutorials on the wiki.

(...)You probably also have to make sure that you aren't referencing the loaded files immediately(...)
-> let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png";?
Do you mean using the let command after the load? Because I don't know how to refer after.

And more one thing, becuase i can't see anything wrong in this code:
http://pastebin.com/YJ47bkeG
It runs without error, but the black bullets doesn't seem to appear.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 20, 2012, 06:22:55 PM
Sorry for doublepost, but I want the another advice.
http://pastebin.com/UC2se2Ee
I just wanted to make the in-code difficulty switches for testing purposes, but something gone wrong. How it should be built?

EDIT:Nonetheless, i get script working. Here:
http://pastebin.com/NQy7FKxQ
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on October 23, 2012, 12:36:32 AM
Sorry for doublepost, but I want the another advice.
http://pastebin.com/UC2se2Ee
I just wanted to make the in-code difficulty switches for testing purposes, but something gone wrong. How it should be built?

EDIT:Nonetheless, i get script working. Here:
http://pastebin.com/NQy7FKxQ

Do you know what "local scope" is? Imagine something like this.

Imagine you have three boxes. Box A, Box B, and Box C.
B and C are inside of Box A.

You put a music box inside of box B, and then a microphone in box C. Because they're in different boxes, they cannot interact. Therefore, the microphone ignores the music box.
Now, what if you removed the music box from Box B, and just put it inside Box A? It should then be able to interact with the microphone.

Your issue is that you define the variable "difficult" in @Initialize, and then try to refer to it inside @Mainloop. What you want to do is move "let difficult" below the header, in the space where objPlayer, frame, and objEnemy are defined.

So, if you wanted it to work correctly, it should be like this.

Code: [Select]
#?Ś?ű?e????[Single]
#ScriptVersion[3]
#Title["10"]
#Text["10"]
#Background["script/default_system/Default_Background_IceMountain.txt"]
 
#include"script/default_system/Default_ShotConst.txt"
 
let objEnemy;
let objPlayer;
let frame = 0;
let difficult = 2;

Then, you remove "let difficult = 2;" from @Initialize, because you already defined it on a higher "level".
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 23, 2012, 07:58:47 PM
How can I use polar coordinates in Danmakufu? Like the θ thingy? I'm using it to generate curves.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on October 23, 2012, 08:28:07 PM
How can I use polar coordinates in Danmakufu? Like the θ thingy? I'm using it to generate curves.
Just convert the polar coordinates to cartesian coordiates. Danmakufu does not have native support for polar coordinates.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 24, 2012, 06:51:04 AM
Well if that's the case, how can eye do that?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on October 24, 2012, 11:55:33 AM
Well if that's the case, how can eye do that?
sine and cosine, of course.
Polar coordinates are direction and magnitude. Cartesian coordinates are X and Y.
For polar coordinates, it's just as simple as making a circle.

For example, to calculate the position of the end of a vector at (0,0) that has a direction of 53 degrees, and its magnitude is 96 pixels, to convert it to cartesian, you would use cos(53)*96 for the X coordinate, and sin(53)*96 for the Y coordinates.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 24, 2012, 05:40:50 PM
@Anthropohpobia - thanks, but I used that way already before you posted.

I had another question - how to get a definied track placed between two ends of the laser, regardless any properties (in my cause, angle is changing in every loop)?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on October 24, 2012, 08:11:02 PM
I had another question - how to get a definied track placed between two ends of the laser, regardless any properties (in my cause, angle is changing in every loop)?
A defined track?  ???
I have no idea what that means. There's a function that checks if a circle intersects with a line, though, if that's what you want.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 26, 2012, 06:55:18 PM
Okay, in the file DrawFunctions.txt in the folder Functions, the task TEnd in Cutin won't work. Ideas why?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Jonath on October 26, 2012, 09:30:38 PM
Hello there. I'm a beginner to Danmakufu ph3 and I'm trying to remake some of my patterns from the 0.12m version with the ph3.
But while testing, I had a problem with this task that is launched in the @Initialize loop : http://pastebin.com/DMQe2Sqm

Nothing fires. In 0.12m I obtain this result : http://puu.sh/1j2Yk


Sorry, actually I forget to add yield; in the mainloop. Shame on me ><
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: toyosataomimiMasquerade on October 27, 2012, 08:35:02 AM
umm excuse me but where can i make scripts of characters and bullets and etc.... well my computer is japanese applocale but the danmakufu isn't japanese it is kind of strange marks(noticing that it is the latest version and my danmakufu is working properly)can anyone give me an guide?
 ???
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on October 27, 2012, 02:29:16 PM
Okay, in the file DrawFunctions.txt in the folder Functions, the task TEnd in Cutin won't work. Ideas why?

Your scripts are ended immediately after the boss health reaches 0, giving no time for any other processes to do anything.  Do a wait(128) (or more than 128, depending on how long you want your script to remain active) right before CloseScript in all your scripts. Additionally, if you add bullet shooting sounds, they won't be abruptly stopped either.  However, a problem surfaces when you do this: your script's attack will likely continue to go on.  To solve this, you can either break your loops by checking if the boss hp is 0, or have the loops in a while statement for boss hp > 0, and when the hp reaches 0 the while statement will end.  Also, I suggest adding your piece of code that closes the script below a single while/loop (whichever you choose to do) statement; this will simplify a lot of things.

umm excuse me but where can i make scripts of characters and bullets and etc.... well my computer is japanese applocale but the danmakufu isn't japanese it is kind of strange marks(noticing that it is the latest version and my danmakufu is working properly)can anyone give me an guide?

What exactly do you mean by scripts of characters and bullets? Boss scripts or player scripts or bullet shot data? You can find information in the wiki, located at http://dmf.shrinemaiden.org/wiki/Main_Page (http://dmf.shrinemaiden.org/wiki/Main_Page). Also I'm not sure about the applocale part, I've never used it before.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 27, 2012, 02:49:59 PM
Your scripts are ended immediately after the boss health reaches 0, giving no time for any other processes to do anything.  Do a wait(128) (or more than 128, depending on how long you want your script to remain active) right before CloseScript in all your scripts. Additionally, if you add bullet shooting sounds, they won't be abruptly stopped either.  However, a problem surfaces when you do this: your script's attack will likely continue to go on.  To solve this, you can either break your loops by checking if the boss hp is 0, or have the loops in a while statement for boss hp > 0, and when the hp reaches 0 the while statement will end.  Also, I suggest adding your piece of code that closes the script below a single while/loop (whichever you choose to do) statement; this will simplify a lot of things.
Okay I've done all that (except for the while(){} thing for the code that closes the script) but for some reason stray bullets are being left behind in the top-left corner of the stage. They're there when the script closes. Ideas why?
fixed yaaaaaaaaaaaaay ilu
no its not :<

fixed :derp:

e: How do I make a replica of the first part of Shikigami's Shot "Unilateral Contract"? The part where a massive amount of bullets were being shot out from Ran all at the same time?
And in this piece of code why is it that Rumia (the boss) sometimes goes off the stage?
Code: [Select]
task TMovement{
let result=rand(-1,1);
if((GetEnemyX-50)<=32||(GetEnemyX+50)>=(GetStgFrameWidth()-32)){
result=-result;
}
if(result>=0){
ObjMove_SetDestAtWeight(objBoss,GetEnemyX-50,GetStgFrameHeight()/4,10,5);
}else{
ObjMove_SetDestAtWeight(objBoss,GetEnemyX+50,GetStgFrameHeight()/4,10,5);
}
yield;
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on October 27, 2012, 04:49:43 PM
Okay I've done all that (except for the while(){} thing for the code that closes the script) but for some reason stray bullets are being left behind in the top-left corner of the stage. They're there when the script closes. Ideas why?
If you went with the break; route, put one yield before the DeleteShotAll.
e: How do I make a replica of the first part of Shikigami's Shot "Unilateral Contract"? The part where a massive amount of bullets were being shot out from Ran all at the same time?
Code: [Select]
loop(128){
let ranspd = rand(2.5, 8);
let obshot = CreateShotA2(ex, ey, ranspd, rand(0,360), -ranspd/90, 0, DS_RICE_S_BLUE, 10);
ObjMove_AddPatternA2(obshot, 105, NO_CHANGE, NO_CHANGE, 0.05, 2.85, 3);
ObjMove_AddPatternA2(obshot, 155, NO_CHANGE, NO_CHANGE, 0.1, 0, 3);
}
change as needed
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on October 27, 2012, 05:16:33 PM
If you went with the break; route, put one yield before the DeleteShotAll.
I went with the other one, I called DeleteShotAll twice, before the wait(); and after the wait(); just to make sure all bullets are deleted.
Code: [Select]
loop(128){
   let ranspd = rand(2.5, 8) ;
   let obshot = CreateShotA2(ex, ey, ranspd, rand(0,360), -ranspd/90, 0, DS_RICE_S_BLUE, 10);
   ObjMove_AddPatternA2(obshot, 105, NO_CHANGE, NO_CHANGE, 0.05, 2.85, 3);
   ObjMove_AddPatternA2(obshot, 155, NO_CHANGE, NO_CHANGE, 0.1, 0, 3);
}
change as needed
Thankyou~
now
And in this piece of code why is it that Rumia (the boss) sometimes goes off the stage?
Code: [Select]
task TMovement{
      let result=rand(-1,1);
      if((GetEnemyX-50)<=32||(GetEnemyX+50)>=(GetStgFrameWidth()-32)){
         result=-result;
      }
      if(result>=0){
         ObjMove_SetDestAtWeight(objBoss,GetEnemyX-50,GetStgFrameHeight()/4,10,5);
      }else{
         ObjMove_SetDestAtWeight(objBoss,GetEnemyX+50,GetStgFrameHeight()/4,10,5);
      }
      yield;
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on October 27, 2012, 05:41:00 PM
And in this piece of code why is it that Rumia (the boss) sometimes goes off the stage?
The result variable is not accounted for at all when checking if Rumia is going to fly off screen, it's merely made into the opposite of + or - without regard to your current if statements.
Code: [Select]
if(GetEnemyX-50<=32){
result=-1
}
if(GetEnemyX+50>=GetStgFrameWidth-32){
result=1
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 27, 2012, 09:55:06 PM
I'm coming with another trouble:

task PatternX(){
   loop(60){yield;}
   
   loop{
      let ex = ObjMove_GetX(objEnemy);
      let ey = ObjMove_GetY(objEnemy);
      let angle=0;
      while(angle<=360){
         tangensbullet(ex, ey, 2, angle, DS_ICE_RED, 15);
         angle+=5;
      }
      loop(60){yield;}
   }
}

task tangensbullet(x, y, spd, ang, graph, delay){
   let shot = CreateShotA1(x, y, spd, ang, graph, delay);
   let sx = ObjRender_GetX(shot);
   let sy = ObjRender_GetY(shot);
   let wallhit = false;
   while(!Obj_IsDeleted(shot)){
      sx = ObjRender_GetX(shot);
      sy = ObjRender_GetY(shot);
      if(sx<=1){Obj_Delete(shot); wallhit = true;}
      if(sx>=GetStgFrameWidth-1){Obj_Delete(shot); wallhit = true;}
      if(sy<=1){Obj_Delete(shot); wallhit = true;}
      yield;
   }
   if(wallhit == true){
      CreateShotA1(sx, sy, spd, tan(ang), graph, 0);
      yield;
   }
}


I just wanted bullets to act like in Flandre's final spell, but I can't figure how to implement tangens here.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on October 27, 2012, 11:03:02 PM
I just wanted bullets to act like in Flandre's final spell, but I can't figure how to implement tangens here.
You don't have to use tangent, http://pastebin.com/8ZLLGRjt (http://pastebin.com/8ZLLGRjt)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: toyosataomimiMasquerade on October 27, 2012, 11:53:05 PM
....well i need all (it is my first time....and i don't know anything at all or even how to put these files or where)i just downloaded it because i wanted to get CtC
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Danmakuer on October 28, 2012, 08:01:24 PM
You don't have to use tangent, http://pastebin.com/8ZLLGRjt (http://pastebin.com/8ZLLGRjt)
Thank you so much!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on October 29, 2012, 11:53:36 PM
never mind, fixed it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on November 10, 2012, 07:28:30 PM
Is there any way to add spaces to the window.title in definition files?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 11, 2012, 03:12:54 AM
Well, full-width spaces work as expected. Since the def files are parsed, you'd have to find a rule in the parser that lets you use certain characters, or else that's probably it. Whitespaces are all eliminated and using quotations as you would in a filename doesn't work, neither do escape characters.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on November 11, 2012, 11:25:33 AM
How do I put custom fonts into Dnh and make them look nice? The default font for Danmakufu is crappy, and I want the custom font to look nice, as  if you made some text in Photoshop and rendered it into Danmakufu. But if I did make a custom image for the text, as Ozzie said a while ago it would take a longer time. Any ideas?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Delfigamer on November 11, 2012, 11:41:58 AM
Any ideas?
[attach=1]
Is idea clear?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on November 11, 2012, 11:47:07 AM
[attach=1]
Is idea clear?
But then I would have to render every letter :<

e: AND (if it hasn't already been asked yet because I can't remember and I'm too lazy to look orz) how do I animate sprites, like the boss sprite?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Delfigamer on November 11, 2012, 12:10:55 PM
But then I would have to render every letter :<
TCharset.BuildStrTexture (http://pastebin.com/bWx0prSX), line 260. * Yukari-like :> *

AND (if it hasn't already been asked yet because I can't remember and I'm too lazy to look orz) how do I animate sprites, like the boss sprite?
Maybe start a task that would change a certain 4 vars that represent the rectangle?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on November 11, 2012, 02:30:28 PM
TCharset.BuildStrTexture, line 260. * Yukari-like :> *
I don't get it.
Maybe start a task that would change a certain 4 vars that represent the rectangle?
But what if the enemy is moving? How do I pause the animation?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 11, 2012, 11:14:37 PM
How do I put custom fonts into Dnh and make them look nice? The default font for Danmakufu is crappy, and I want the custom font to look nice, as  if you made some text in Photoshop and rendered it into Danmakufu. But if I did make a custom image for the text, as Ozzie said a while ago it would take a longer time. Any ideas?
Well there's a difference between the hardcoded font DNH uses, and the font used to render the score/timer/etc, and the font you use for text objects, and a "font" you render manually as sprites or other render objects. Which do you want?

As for animating,
http://www.youtube.com/watch?v=JUj6xG79-TY
Except using the appropriate ph3 functions instead.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on November 12, 2012, 01:45:40 PM
Well there's a difference between the hardcoded font DNH uses, and the font used to render the score/timer/etc, and the font you use for text objects, and a "font" you render manually as sprites or other render objects. Which do you want?

As for animating,
http://www.youtube.com/watch?v=JUj6xG79-TY (http://www.youtube.com/watch?v=JUj6xG79-TY)
Except using the appropriate ph3 functions instead.
The font used to render the score/timer/etc and the font you render manually as sprites or other ender objects.
 
And witht eh font sheet Delfigamer posted is it possible to change Dnamakufu's default font with that?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 12, 2012, 09:42:27 PM
The images used to render the scores and timer are located in script\default_system\img\Default_SystemDigit.png, and then it's drawn as a SpriteList in script\default_system\Default_System.txt. You can change it however the heck you want as long as you know how SpriteLists work, or even as long as you can properly manipulate some sort of render object. Rendering other images as pseudo-fonts use the exact same method, but just with more rules per character.

If you want to use that sheet, then go ahead. These aren't fonts, they're just images. How you want to draw letters on the screen is just a matter of "draw these pixels at these coordinates". In that regard, Danmakufu doesn't really have a real default, it just uses scripts like anyone else would.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on November 13, 2012, 05:21:48 PM
Speaking of which, how exactly does the InstallFont function work? What types of fonts can be installed? Is it possible to install standard computer fonts such as Arial or Times New Roman or the like?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on November 13, 2012, 11:57:55 PM
Not really a question, but I finally figured out how to get fonts working.

1) You have to use a Shift-JIS font. Sorry, no Comic Sans.

2) Use the path to the font for InstallFont, and use the name of the font (open the ttf file and check the top) for ObjText_SetFontType.

Here's a usable serif font if anyone wants it. (http://dl.dropbox.com/u/15870353/ipamp-mona.ttf)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on November 15, 2012, 03:06:16 AM

Funny, I got Comic Sans working just fine.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 15, 2012, 04:00:55 AM
I just checked the version log, and amusingly enough that bug was fixed a week and a half before Lucas posted that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on November 17, 2012, 04:23:18 PM
good thing I checked this thread, because now I can do sbahj stage as I initially intended

Vaguely related question:  Starting a new line in a text object string without weird trial-and-error spacing. How?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on November 17, 2012, 05:09:31 PM
good thing I checked this thread, because now I can do sbahj stage as I initially intended

Vaguely related question:  Starting a new line in a text object string without weird trial-and-error spacing. How?
Line break[r]
goes where?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on November 17, 2012, 11:05:04 PM
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3_data/other_spec.html#Text
read da documentation!!!!!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Jonath on November 18, 2012, 12:21:33 AM
Hello, I was wondering, is there a way to get good full screen settings for ph3 ? Because on 0.12m the quality was really nice but, even with a high res, the ph3 one is really pixelised =/ I don't think it has something to do with the sprite tall/res. Ah and these grey stripes at both the sides of the screen are really disturbing, is there a way to make them black as the 0.12m version ?

Look, even the basic stg frame is pexelised as hell :<
http://puu.sh/1rlYZ
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Qwertyzxcv on November 19, 2012, 11:16:09 PM
When I go to the directory and navigate to the right folder, the script doesn't show up!  :wat: Extra information: I'm using  Windows 7, and I got Applocale to work.  The EX Rumia scripts are the only ones that work.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on November 20, 2012, 09:20:27 AM
I can't run a script. When I go to the directory and navigate to the right folder, it doesn't show the script!  ???:wat::ohdear: Even if it's a downloaded script it doesn't show up.  :derp:
Extra information: I'm using  Windows 7, and I got Applocale to work, then created an icon so it automatically runs it when I click Danmakufu.  The EX Rumia scripts are the only ones that work.

I'm guessing you're using the wrong version of Danmakufu for the scripts.

If this script (http://www.bulletforge.org/u/shockman/p/mima-boss-battle/v/12/archive) shows up, you're using 0.12m and need to download ph3 (http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_ph3.html) to run the other scripts you're trying.
If this script (http://www.bulletforge.org/u/gtbot/p/mamizou-battle/v/10/archive) shows up, you're using ph3 and need to download 0.12m (http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh.html) to run the other scripts you're trying.

But I could be wrong because I've never tried running a 0.12m script on ph3 or vice versa.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on November 30, 2012, 09:35:28 PM
Ok, (just to make sure before I start making my own) there are no built-in functions for dialogue events in Ph3, correct?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on November 30, 2012, 10:57:39 PM
Ok, (just to make sure before I start making my own) there are no built-in functions for dialogue events in Ph3, correct?
None whatsoever. I have made my own, though. It's not perfect in any way. I haven't made it actually show character portraits, and I need to come up with a way to predict how much height is needed for the speech bubble.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 01, 2012, 12:20:20 AM
Note that you can use user events to trigger dialogue scripts and functions and the like, which might make it easier to handle depending on how you've organized your stage layout.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 01, 2012, 04:05:46 PM
How do I recreate Marisa's familiars in IN stage 4, and Meirin's fairies in EoSD stage 3?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on December 01, 2012, 10:47:32 PM
How do I recreate Marisa's familiars in IN stage 4, and Meirin's fairies in EoSD stage 3?
Could you be more specific about which familiars? Marisa's spell cards have a lot of those.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 01, 2012, 11:11:04 PM
Could you be more specific about which familiars? Marisa's spell cards have a lot of those.
The... don't know how to say it. The Yellow, small ones for example. They have a little pattern inside them.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 01, 2012, 11:32:38 PM
...The graphic, or the movement of them, or the patterns they fire?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 01, 2012, 11:37:55 PM
...The graphic, or the movement of them, or the patterns they fire?
The graphic. And movement.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on December 03, 2012, 12:26:10 AM
Ok, new question. I should have gotten this confirmed before I started but oh well:

Can you have more than 255 bullet ids in shotsheets in Ph3 or not? I could have sworn I heard it both ways at some point.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 03, 2012, 12:55:56 AM
Well, the docs say that you can use IDs up to 10000 without any real problems, so while I can't confirm anything it seems likely that you can use however many you want.

Really though why would you ever need more than 256 bullets.

The graphic. And movement.
Movement is just having the object move at a radius around a center, namely the boss. The process works like this:
let radius = 50;  //radius of the circle the familiar moves along
let speed = 4;  //speed the familiar spins around
//per frame
   ObjMove_SetX(centerx + cos(t) * radius);
   ObjMove_SetY(centery + sin(t) * radius);
   t = (t + speed) % 360;  //t increases by speed and remains between 0 and 360

and just plop it in the object's main task. If you want the radius to increase from the center like Marisa often does, you simply start the radius at 0 and increase it per frame until it reaches what you want.

The graphic of the familiars depend on whether you're focused or not. The focus familiar is just a graphic that spins around. The unfocus graphic is two overlapped on top of each other; one spinning slowly in one direction and the other spinning quickly in the other direction. If you want the focusing aspect of it you can get the player's focus status with GetVirtualKeyState(VK_SLOWMOVE), which will return KEY_FREE/KEY_PULL when unfocused or KEY_HOLD/KEY_PUSH when focused.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on December 03, 2012, 01:03:20 AM
Well, the docs say that you can use IDs up to 10000 without any real problems, so while I can't confirm anything it seems likely that you can use however many you want.

Really though why would you ever need more than 256 bullets.
You wouldn't, but I just wanted to make one comprehensive shotsheet so that I'll never have to hunt around for a particular bullet type again.

Edit: Hmm, it seems that IDs above 255 don't error, but no bullet is fired. Anyone know what the problem is?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on December 03, 2012, 12:31:21 PM
You wouldn't, but I just wanted to make one comprehensive shotsheet so that I'll never have to hunt around for a particular bullet type again.

Edit: Hmm, it seems that IDs above 255 don't error, but no bullet is fired. Anyone know what the problem is?

Ensure that you have proper rect boundaries/using the correct IDs, check the brackets, and also make sure you have the latest version of Danmakufu. I can assure that you can have up to 10000 different unique IDs.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 03, 2012, 04:26:57 PM
Ensure that you have proper rect boundaries/using the correct IDs, check the brackets, and also make sure you have the latest version of Danmakufu. I can assure that you can have up to 10000 different unique IDs.
But with my amazing shotsheet from a while ago, I had a bullet with the id of 255. It had perfect rects and all and it fired. When I changed the id to 256 there was no bullet fired and no error.
Really though why would you ever need more than 256 bullets.
Maybe because we either have to use lots of bullets with little colours or little bullets with many colours. no restriction = moar bullets + moar colours
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on December 03, 2012, 07:25:40 PM
Ensure that you have proper rect boundaries/using the correct IDs, check the brackets, and also make sure you have the latest version of Danmakufu. I can assure that you can have up to 10000 different unique IDs.
You were right, it was a mistake that I made, though it was a rather weird one. It works now.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 04, 2012, 02:16:54 AM
Maybe because we either have to use lots of bullets with little colours or little bullets with many colours. no restriction = moar bullets + moar colours
There are two differences here. I said "why would you ever need that many bullets". The point is, you probably don't. With what you said, that you have to use that many, I am here fundamentally disagreeing. If you're using that many colors, you are picking a large portion of colors that are redundant, that could easily be replaced just as well with other colors with arguably better results. If you're using that many bullets, you very likely are not making effective use of those bullets and are basically just including them willy-nilly, which negatively impacts a variety of gameplay and aesthetic issues.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on December 05, 2012, 04:34:04 AM
Funny, I got Comic Sans working just fine.
I just checked the version log, and amusingly enough that bug was fixed a week and a half before Lucas posted that.
Ok, then all fonts should be working in Ph3? Then I don't know why that when I install a font other than certain fonts it doesn't change anything.

Edit: I found the problem. Apparently running Ph3 in applocale causes the fonts to fail. Veeeerrrrry weird and somewhat annoying.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on December 07, 2012, 12:37:45 PM
Ok, then all fonts should be working in Ph3? Then I don't know why that when I install a font other than certain fonts it doesn't change anything.

Edit: I found the problem. Apparently running Ph3 in applocale causes the fonts to fail. Veeeerrrrry weird and somewhat annoying.
Well, I'm not even using applocale and I can run Japanese programs natively. So I wouldn't have known that.

On-topic: Anybody know how to do word wrapping? I tried it myself, but the code returns (VOID).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 08, 2012, 02:47:26 AM
ObjText_SetMaxWidth(obj, width) probably does the job, docs say it wraps the text. ObjText_SetLinePitch(obj, height) seems to let you set how large the line spacing is.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on December 08, 2012, 10:24:41 PM
ObjText_SetMaxWidth(obj, width) probably does the job, docs say it wraps the text. ObjText_SetLinePitch(obj, height) seems to let you set how large the line spacing is.
Not what I needed. I need code that actually wraps around the lines, so I don't get this.

Code: [Select]
Shit reimu what are y
ou doing
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on December 08, 2012, 11:32:37 PM
Not what I needed. I need code that actually wraps around the lines, so I don't get this.

Not current possible, at least, automatically. You'd to have to manually put whitespace characters.oops
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 09, 2012, 12:12:47 AM
Not what I needed. I need code that actually wraps around the lines, so I don't get [derp]
Ah, ok.  I probably should have guessed that was the case in the first place oops.
In that case you'll probably need a sort of pre-formatter, since generally you want to initialize the object and then just be able to set the text over and over, and there isn't any function that lets you get the text. Very generally, a function that would return formatted text might be something like
Code: [Select]
function WrapText(str, maxlen){
    let tmp = "";
    let p = 0;
    ascent(i in 0..length(str)){
        if(str[i] == " "){ tmp = tmp ~ str[p..i+1]; p = i+1; }
        if(i%(maxlen-1) == 0){ tmp = tmp ~ "[r]"; }
    }
    return tmp;
}

But in order to use something like that without it being annoying, you'd need your dialogue system to be able to use the function for every new block of text automatically. Else you're going SetText(WrapText("shit")) every time and that's just plain dumb.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on December 09, 2012, 12:17:53 AM
Ah, ok.  I probably should have guessed that was the case in the first place oops.
In that case you'll probably need a sort of pre-formatter, since generally you want to initialize the object and then just be able to set the text over and over, and there isn't any function that lets you get the text. Very generally, a function that would return formatted text might be something like
Code: [Select]
function WrapText(str, maxlen){
    let tmp = "";
    let p = 0;
    ascent(i in 0..length(str)){
        if(str[i] == " "){ tmp = tmp ~ str[p..i+1]; p = i+1; }
        if(i%(maxlen-1) == 0){ tmp = tmp ~ "[r]"; }
    }
    return tmp;
}

But in order to use something like that without it being annoying, you'd need your dialogue system to be able to use the function for every new block of text automatically. Else you're going SetText(WrapText("shit")) every time and that's just plain dumb.
but that is what i was gonna do  :V
thanks for that, anyway.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 09, 2012, 12:23:30 AM
Yeah I assumed you were already intending on doing all that or already had it set up; was just covering it just in case  :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 09, 2012, 05:00:34 PM
In Script7.txt, even though I have clearly used a variable to define a function it says that the variable hasn't been assigned once. Why???
The errors are on line 71 and 72. The function used to draw the magic circle is in functions/DrawFunctions.txt.

e: forgot link lol https://www.dropbox.com/s/57pnztd4x3853re/Rumia%20Boss.rar
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on December 10, 2012, 12:30:04 AM
In Script7.txt, even though I have clearly used a variable to define a function it says that the variable hasn't been assigned once. Why???
FDrawFamiliar does not return a value, so fam1 and fam2 do not get any variable assigned to them. Add the following at the end of your FDrawFamiliar function:
Code: [Select]
return obj;This will give fam1 and fam2 their object ids, which should remove the error.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 10, 2012, 12:44:48 AM
Additionally, your TDrawBoss is going to have no idea what objBoss is as it isn't defined anywhere. Even if you include the script, it still doesn't exist in the context of the task.
And even if it works, it's bad practice. Pass the object id as a parameter. Without asserting that the object already exists it's very bad to just assume it is and try to perform functions on it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 10, 2012, 10:41:09 AM
FDrawFamiliar does not return a value, so fam1 and fam2 do not get any variable assigned to them. Add the following at the end of your FDrawFamiliar function:
Code: [Select]
return obj;This will give fam1 and fam2 their object ids, which should remove the error.
Ah, obvious error. Thanks.
Additionally, your TDrawBoss is going to have no idea what objBoss is as it isn't defined anywhere. Even if you include the script, it still doesn't exist in the context of the task.
And even if it works, it's bad practice. Pass the object id as a parameter. Without asserting that the object already exists it's very bad to just assume it is and try to perform functions on it.
Man, never thought of that. Tasks don't return values, right? I guess I'll have to modify the task and turn it into a function.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 10, 2012, 10:58:56 AM
If you're planning on starting a task and using an object that already exists, just pass the object you want used in the task as a parameter. You want to use a function to return the object when you're actually creating the object in that function (i.e. your TDrawBoss and TDrawFamiliar).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 10, 2012, 08:29:47 PM
Updated the 7th spell. No errors but the magic seals won't move at all. http://pastebin.com/MPkrAd27 . Updated DrawFunctions.txt here http://pastebin.com/feEZRLk5
I also couldn't really do the one with TDrawBoss() so I changed it into a function and returned 'objBoss'. Sorry. I get errors otherwise.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on December 11, 2012, 02:00:53 AM
Code: [Select]
function WrapText(str, maxlen){
    let tmp = "";
    let p = 0;
    ascent(i in 0..length(str)){
        if(str[i] == " "){ tmp = tmp ~ str[p..i+1]; p = i+1; }
        if(i%(maxlen-1) == 0){ tmp = tmp ~ "[r]"; }
    }
    return tmp;
}
regarding this code, it doesn't work properly.

First error was that the arguments given for the first conditional branch didn't match. So I changed it to if(ToString(str) == " ").

And even after that, it only adds a line break if the character at maxlen is a space. For example, if maxlen is 10, and your string is "Magical Girl" it doesn't add a line break at the tenth character, since it's not a space.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Blargel on December 11, 2012, 03:56:53 AM
regarding this code, it doesn't work properly.

First error was that the arguments given for the first conditional branch didn't match. So I changed it to if(ToString(str) == " ").

And even after that, it only adds a line break if the character at maxlen is a space. For example, if maxlen is 10, and your string is "Magical Girl" it doesn't add a line break at the tenth character, since it's not a space.

Yo I heard someone needed logic in here so i logiced something up for you.

Code: [Select]
function WrapText(str, max_length){
    let last_space = 0;
    let current_line_start = 0;
    let current_line_length = 0;
    let res = "";
    ascent(i in 0..length(str)){
        current_line_length++;
        if(str[i]==' '){
            last_space = i;
        }
        if(current_line_length > max_length){
            res = res ~ str[current_line_start..last_space] ~ "[r]";
            current_line_start = last_space+1;
            current_line_length = i-last_space;
        }
    }
    res = res ~ str[current_line_start..length(str)];
    return res;
}

This assumes you will never have a word that is longer than the max length. Otherwise stupid stuff will happen.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 11, 2012, 05:23:33 AM
Peopleophobia firstly it should have been == ' ' instead since single-quotes denotes characters and double denotes arrays of them, but that wasn't why it didn't work. It didn't work as I intended because after the first line break it would still keep checking for modulus from the length since the beginning of the string and not where it last cut. Also it wouldn't append the last block. Oh well. The fix is easy and Blargel's code is almost exactly the same as my fixed one.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 12, 2012, 07:05:47 PM
Updated the 7th spell. No errors but the magic seals won't move at all. http://pastebin.com/MPkrAd27 (http://pastebin.com/MPkrAd27) . Updated DrawFunctions.txt here http://pastebin.com/feEZRLk5 (http://pastebin.com/feEZRLk5)
I also couldn't really do the one with TDrawBoss() so I changed it into a function and returned 'objBoss'. Sorry. I get errors otherwise.
Ah, I thought about this for a while. I can't do anything with the magic seals because when I define the functions in Spell7.txt, I'm not defining the object. How do I manipulate the magic seal outside of the function, and how do I exactly 'fix' TDrawBoss to make the function/task better?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on December 12, 2012, 11:45:43 PM
Ah, I thought about this for a while. I can't do anything with the magic seals because when I define the functions in Spell7.txt, I'm not defining the object. How do I manipulate the magic seal outside of the function, and how do I exactly 'fix' TDrawBoss to make the function/task better?
Define the seal object on a higher level, or make it accessible using GetCommonData.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on December 13, 2012, 12:33:33 AM
Boss:
You have defined a boss enemy object in the Spell7 script. In your maintask, you call TDrawBoss(). Your function might work in this context since objBoss is defined on the script level, but it is much more useful and practical to do this:
Code: [Select]
function TDrawBoss{
        let objBoss=ObjEnemy_Create(OBJ_ENEMY_BOSS);    //NOTE OBJBOSS IS DEFINED ON THE FUNCTION LEVEL AND SO IS NOT RELIANT ON OBJBOSS ALREADY BEING DEFINED
        ObjEnemy_Regist(objBoss);
        let imgRumia=GCSD~"img/rumia.png";
        ObjPrim_SetTexture(objBoss,imgRumia);
        ObjSprite2D_SetSourceRect(objBoss,2,1,63,62);
        ObjSprite2D_SetDestCenter(objBoss);
        ObjRender_SetPosition(objBoss,-25,0,0);
        return objBoss;
}
//and in Spell7,
task mainTask{
        objBoss = TDrawBoss;    //HERE YOU ARE SETTING THE SCRIPT GLOBAL VARIABLE OBJBOSS TO THE OBJECT RETURNED BY TDRAWBOSS
        TEnemyHitboxStart;
        Cutin("Fluttering Illusions\"Semi-Invisible Shadows -Night-\"",14);
        TShoot01;
        yield;
}

Magic seal familiar:
Code: [Select]
function FDrawFamiliar(x,y,z,xadd,yadd,zadd,alpha,r,g,b){
        let obj;
        let xspin=0;
        let yspin=0;
        let zspin=0;
        let imgFam=GCSD~"img/etama2.png";
        obj=ObjPrim_Create(OBJ_SPRITE_2D);
        ObjPrim_SetTexture(obj,imgFam);
        ObjSprite2D_SetSourceRect(obj,193,113,256,176);
        ObjSprite2D_SetDestCenter(obj);
        ObjRender_SetPosition(obj,x,y,z);
        ObjRender_SetAlpha(obj,alpha);
        ObjRender_SetColor(obj,r,g,b);
        TSpin;
        CheckBossExists;    //DO THIS INSTEAD, PREVIOUSLY IT JUST CHECKED THE BOSS ONCE
        return obj;
        task TSpin{
                while(!Obj_IsDeleted(obj)){
                        ObjRender_SetAngleXYZ(obj,xspin,yspin,zspin);
                        xspin+=xadd;
                        yspin+=yadd;
                        zspin+=zadd;
                        yield;
                }
        }
        task CheckBossExists{
                while(!Obj_IsDeleted(obj)){
                        if(ObjEnemy_GetInfo(objBoss,INFO_LIFE)<=0){    //BECAUSE OBJBOSS IS NOT EXPLICITLY DEFINED IN THIS FUNCTION, YOU SHOULD PROBABLY PASS OBJBOSS AS A PARAMETER OF FDRAWFAMILIAR
                                Obj_Delete(obj);
                        }
                }
        }
}
Yes, you are defining the familiar objects already. It's defined globally throughout the script so you should be able to manipulate it however you want.
Where is your TMove03 though?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 13, 2012, 05:41:15 PM
I made TMove03 to make the use of ObjMove_SetDestAtWeight. It's in MoveFunction.txt.
No errors (except I had to add a yield; in CheckBossExists). I still can't manipulate the seals.
In Spell7.txt I have:
Code: [Select]

task mainTask{
   objBoss=TDrawBoss;
   TEnemyHitboxStart;
   Cutin("Fluttering Illusions\"Semi-Invisible Shadows -Night-\"",14);
   TShoot01;
   yield;
}


task TShoot01{
   ObjMove_SetDestAtWeight(objBoss,stgx,GetStgFrameHeight()/4,10,5);
   wait(70);
   fam1=FDrawFamiliar(objBoss,GetEnemyX,GetEnemyY,0,0,0,2.5,255,255,255,255);
   fam2=FDrawFamiliar(objBoss,GetEnemyX,GetEnemyY,0,0,0,-2.5,255,255,255,255);
   yield;
   ObjMove_SetDestAtWeight(fam1,stgx*2/10,GetStgFrameHeight()/4,10,5);
   while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>=0){
      loop(50){
         
      yield;
   }
}
}
In DrawFunctions.txt I have:
Code: [Select]

function TDrawBoss{
        let objBoss=ObjEnemy_Create(OBJ_ENEMY_BOSS);
        ObjEnemy_Regist(objBoss);
        let imgRumia=GCSD~"img/rumia.png";
        ObjPrim_SetTexture(objBoss,imgRumia);
        ObjSprite2D_SetSourceRect(objBoss,2,1,63,62);
        ObjSprite2D_SetDestCenter(objBoss);
        ObjRender_SetPosition(objBoss,-25,0,0);
        return objBoss;
}


function FDrawFamiliar(BOSS,x,y,z,xadd,yadd,zadd,alpha,r,g,b){
        let xspin=0;
        let yspin=0;
        let zspin=0;
        let imgFam=GCSD~"img/etama2.png";
        let obj=ObjPrim_Create(OBJ_SPRITE_2D);
        ObjPrim_SetTexture(obj,imgFam);
        ObjSprite2D_SetSourceRect(obj,193,113,256,176);
        ObjSprite2D_SetDestCenter(obj);
        ObjRender_SetPosition(obj,x,y,z);
        ObjRender_SetAlpha(obj,alpha);
        ObjRender_SetColor(obj,r,g,b);
        TSpin;
        CheckBossExists;
        return obj;
        task TSpin{
                while(!Obj_IsDeleted(obj)){
                        ObjRender_SetAngleXYZ(obj,xspin,yspin,zspin);
                        xspin+=xadd;
                        yspin+=yadd;
                        zspin+=zadd;
                        yield;
                }
        }
        task CheckBossExists{
                while(!Obj_IsDeleted(obj)){
                        if(ObjEnemy_GetInfo(BOSS,INFO_LIFE)<=0){
                                Obj_Delete(obj);
                        }
               yield;
                }
        }
}
God Danmakufu all I want to do is move an image around :c
Thanks for all your time and help.


e: Fixed it all! \^o^/
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on December 21, 2012, 09:32:32 PM
Got a new question. What exactly is the difference between functions such as LoadTexture and LoadTextureInLoadThread? When should each be used? Also, how should these be used with @Loading if at all?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 23, 2012, 02:35:20 PM
Why is it that when I have two objects that look the same and both are on ADD render, when they intersect they don't become brighter at the intersection points?

e: nvm, it turns out that is partially depends on the objects' colours.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on December 30, 2012, 02:43:02 PM
(Double post or no notification!!!1!! Sorry :c)
Apparently with the latest version of Dnh you don't need applocal but it won't detect some scripts. Could there be any bugs with this? It doesn't detect the Japanese scripts but it detects the English ones. Still going to use applocal though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Gensokyo Dreadnought on January 01, 2013, 05:14:14 PM
Hey guys, I'm pretty new with Danmakufu and I have absolutely 0% experience with programming whatsoever.

I have a question: Are the codes used in the tutorials work for ph3 as well?  ???

Thanks in advance. :3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Alicirno on January 01, 2013, 08:40:50 PM
(Double post or no notification!!!1!! Sorry :c)
Apparently with the latest version of Dnh you don't need applocal but it won't detect some scripts. Could there be any bugs with this? It doesn't detect the Japanese scripts but it detects the English ones. Still going to use applocal though.
I haven't had any problems with running it without applocale, other than not detecting Japanese scripts.

Hey guys, I'm pretty new with Danmakufu and I have absolutely 0% experience with programming whatsoever.

I have a question: Are the codes used in the tutorials work for ph3 as well?  ???

Thanks in advance. :3

The tutorials are based on 0.12m, so no (though they are similar).  And there aren't any tutorials yet, so you have to use the wiki to create ph3 scripts.

http://dmf.shrinemaiden.org/wiki/How_to_Write_Scripts - Use this for script structures.
http://dmf.shrinemaiden.org/wiki/Functions_%28ph3%29 - Use this for functions.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Gensokyo Dreadnought on January 01, 2013, 08:48:01 PM
The tutorials are based on 0.12m, so no (though they are similar).  And there aren't any tutorials yet, so you have to use the wiki to create ph3 scripts.

http://dmf.shrinemaiden.org/wiki/How_to_Write_Scripts - Use this for script structures.
http://dmf.shrinemaiden.org/wiki/Functions_%28ph3%29 - Use this for functions.

Very much appreciated~! Thanks! :3
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 02, 2013, 06:34:47 AM
To clarify, while the functions for ph3 can be different, the methodologies for anything you do from the 0.12 tutorials is going to be essentially the same in ph3; at least to start out with. For the most part, you just have to know which function in ph3 corresponds to the similar function in 0.12, if the function is even named differently at all. It will probably be a bit confusing to deal with, still.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 14, 2013, 08:42:25 PM
Why can't 2d primitive, 2d sprite, 2d sprite list, 3d primitive or 3d sprites be used by functions like ObjMove_SetMovePosition01(); and ObjMove_SetPosition(); ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 15, 2013, 12:44:00 AM
There isn't a function called SetMovePosition, so I assume you mean AddPattern or DestAtFrame or something. Anyways, it's simply because they aren't Move objects. The functions are just undefined if they aren't Move objects, just as you can't use ObjShot_SetDamage on a Text object.
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3_data/other_spec.html#Object

You can still use ObjRender_SetPosition though.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 15, 2013, 01:52:38 PM
Ugh. Does that mean with every 2d sprite I have to be an enemy object? But that wont cause problems for things that get the enemy count or misdirect aimed player shots, right? Either that or I will have to make render move functions/tasks that functions like ObjMove_SetDestAtSpeed(); and all that...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 15, 2013, 07:06:01 PM
What are you even trying to do? I'm not seeing the problem here.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on January 16, 2013, 03:46:40 PM
Basically, I wanted to be able to make render objects be usable with move functions like ObjMove_SetDestAtFrame(); . But since I can't I will either have to make functions that function the same way as ones like  ObjMove_SetDestAtFrame(); , but will be able to move render objects instead, or I make render objects an enemy object but that could cause problems like getting the enemy count on the screen.
If I don't do either then I will have to move the render objects around by scripting a block of code or so.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on January 16, 2013, 07:10:36 PM
I meant more of the context of what you're doing; I got that you wanted to use DestAtFrame. It's easy enough to write a function that works the same way, but the question is why you need to in the first place, because using movement-trajectory functions to move around sprites that aren't enemies or items seems weird.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 02, 2013, 09:27:30 PM
How do you make 3D backgrounds?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on February 06, 2013, 02:46:13 AM
How do you make 3D backgrounds?
Depends on whether you want actual, modeled backgrounds, or just flat textures.

For the former, you need to get familiar with Metasequoia. I don't know of any programs that can convert to the mqo file format, which is a shame, as I much prefer using Milkshape. Use ObjPrim_Create(OBJ_SPRITE_3D) for the latter.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 06, 2013, 04:18:32 PM
Depends on whether you want actual, modeled backgrounds, or just flat textures.

For the former, you need to get familiar with Metasequoia. I don't know of any programs that can convert to the mqo file format, which is a shame, as I much prefer using Milkshape. Use ObjPrim_Create(OBJ_SPRITE_3D) for the latter.
I do the latter but it just gives me a white background. I have all the 3D functions included.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 06, 2013, 05:05:56 PM
I do the latter but it just gives me a white background. I have all the 3D functions included.
More than likely, the path to your image is wrong.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 07, 2013, 04:41:05 PM
More than likely, the path to your image is wrong.
Nope, path is correct
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 07, 2013, 05:41:22 PM
Nope, path is correct
I can only otherwise guess it's the fog, but beyond that I'm unsure without seeing the code.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 07, 2013, 06:33:42 PM
I can only otherwise guess it's the fog, but beyond that I'm unsure without the code. It it
Fog?
/me checks the Danamkufu wiki.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: PJ on February 11, 2013, 12:42:06 PM
Fog?
/me checks the Danamkufu wiki.
Post your code, along with the image you're using.

Fog is disabled by default, so that absolutely cannot be it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on February 15, 2013, 01:06:52 PM
I tried to make a multiple boss battle, but it looks like Danmakufu can only handle one ObjEnemy_Create(OBJ_ENEMY_BOSS) at a time.
Do I have to define one of the bosses as an ObjEnemy_Create(OBJ_ENEMY) (ordinary enemy) or is there a way to avoid it? Does it matter anyway that one of the "bosses" isn't defined as a boss?
Thanks in advance.
~Maths
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 15, 2013, 03:40:06 PM
I tried to make a multiple boss battle, but it looks like Danmakufu can only handle one ObjEnemy_Create(OBJ_ENEMY_BOSS) at a time.
Do I have to define one of the bosses as an ObjEnemy_Create(OBJ_ENEMY) (ordinary enemy) or is there a way to avoid it? Does it matter anyway that one of the "bosses" isn't defined as a boss?
Thanks in advance.
~Maths
Yeah, you'll have to define as a regular enemy. It doesn't matter that one of the bosses aren't defined as a boss, as you could just manipulate whatever you need to get the desired effect.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on February 15, 2013, 04:31:21 PM
Yeah, you'll have to define as a regular enemy. It doesn't matter that one of the bosses aren't defined as a boss, as you could just manipulate whatever you need to get the desired effect.
Isn't the fact that Danmakufu can't handle more than 1 boss strange? I mean, if there can only ever be one boss then why does GetEnemyBossObjectID return an array instead of a single ID?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 15, 2013, 07:05:46 PM
Isn't the fact that Danmakufu can't handle more than 1 boss strange? I mean, if there can only ever be one boss then why does GetEnemyBossObjectID return an array instead of a single ID?
I questioned that too, maybe its forward compatibility for a future update? (so that if they add more than just 1 boss, it won't break scripts by changing the data type from integer to array)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 15, 2013, 07:44:13 PM
Post your code, along with the image you're using.

Fog is disabled by default, so that absolutely cannot be it.
Ahhhh, found out that you have to set the fog beforehand. Thanks anyway.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheScriptwriter on February 19, 2013, 09:55:23 PM
Is it possible to alter the course of a bullet (AddPattren) if it has been created from a function (ex.: nWayToPlayer) on a #include script (ex.: customFunctions.txt)? If so then how?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 19, 2013, 11:06:21 PM
Is it possible to alter the course of a bullet (AddPattren) if it has been created from a function (ex.: nWayToPlayer) on a #include script (ex.: customFunctions.txt)? If so then how?

Yes it's possible. Just return the bullet ID at the end of the function with the return function. (ex.: return objShot;)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on February 23, 2013, 03:07:51 PM
I'm interested in creating my own TD/GFW style boss lifebar. Where do I start and what do I do? I've peeked inside the default lifebar but I don't understand any of it. And I want to make a custom one because I don't want my scripts to look too ZUN-like.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on February 23, 2013, 04:04:20 PM
I'm interested in creating my own TD/GFW style boss lifebar. Where do I start and what do I do? I've peeked inside the default lifebar but I don't understand any of it. And I want to make a custom one because I don't want my scripts to look too ZUN-like.
You can take and use/modify mine if you'd like (located in /ds_system/S_System.h and inside the BossLife task (http://www.bulletforge.org/u/gtbot/p/mamizou-battle/v/10), but if you want to make yours from scratch, making a circular lifebar is taking the flat lifebar information, tossing the actual flatbar graphic, and then making a primitive object which draws the points angularly.

I'm sure there may be multiple (and better ways) of doing this, but the way I did it was creating two separate primitive objects, one with the lifebar outline and of the actual life itself. They were made with ascents that added the vertices in a circular ribbon-like fashion (an example of this would be the default magic circle). After this, I multiplied the remaining lifebar (which is returned from danmakufu in a 1-0 value) by 360, and then with each primitive point on the lifebar, I did a min(point's original location in a 0-360 value, the remaining life multiplied by 360); which gives the lifebar effect.  The amount of vertices you use depends up to you, as more vertices gives more health precision and a smoother circle, but also has more lag. Another thing to consider would be removing vertices instead of doing a min() check.

After that, the stars, which represent the amount of steps remaining in the plural, are next, and are probably the easiest. Use a sprite list to display the amount of steps left (INFO_REMAIN_STEP_COUNT), and if you use the same variables from the previous flat lifebar, it should take care of the lifebar regain effect which is done after completing a step. The nubs that represent each attack within a step is also similarly easy. Danmakufu returns an array with all the attacks inside a step (INFO_ACTIVE_STEP_LIFE_RATE_LIST) in a very convenient 1-0 percentage value; by using this array you can do an ascent loop and create each nub on an angle within the lifebar by multiplying the proportion of each step with 360. (Also this information is not necessarily required to be presented the way I described, as this would make it ZUN-like, but this information is needed to display to the player so they won't be left confused)

Also, all of these values are obtained from ObjEnemyBossScene_GetInfo (http://dmf.shrinemaiden.org/wiki/Boss_Scene_Object_Functions#ObjEnemyBossScene_GetInfo), and I suggest getting used to the default life bar and how it works or it's going to be quite difficult trying to do the circular one. Plus, knowing how the regular life bar works would make things a lot easier for you when doing the circular one.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TheScriptwriter on March 01, 2013, 06:32:12 PM
If I wanted to make a bullet rotate around an object, no matter where the said object should be/move to, how would I go about this? Would I have to use Lasers, or could I use Bullets?

And how would I be able to separate them afterward, simply make them fly outward, away from the object?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 02, 2013, 04:13:30 AM
http://www.shrinemaiden.org/forum/index.php/topic,865.0.html

Covers what would be needed. Particularly the trigonometry part and the Great Whirlwind example. The orbiting bullet you could create in a task, and each frame you would increase an angle variable, and set the position of the bullet to be a certain radius around whatever other object you want.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: 8lue Wizard on March 08, 2013, 10:21:10 AM
So I've been out of the loop for a while, but I remember back when I was making my Nazrin player script for 0.12, someone had made up test scripts to measure DPS and bomb damage. Does something like that exist for ph3?

Also, I've noticed that most of the ph3 player scripts up on BulletForge have a bunch of CommonData junk at the top. What's the deal with that? If I ignore it, will my script have compatability issues?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on March 08, 2013, 01:24:04 PM
So I've been out of the loop for a while, but I remember back when I was making my Nazrin player script for 0.12, someone had made up test scripts to measure DPS and bomb damage. Does something like that exist for ph3?

Also, I've noticed that most of the ph3 player scripts up on BulletForge have a bunch of CommonData junk at the top. What's the deal with that? If I ignore it, will my script have compatability issues?
Luckily, I remembered that I had my old working dps tester (pastebin link) (http://pastebin.com/QS5DvwWg) on my mediafire (i broke the one on my computer by accident oops). Should work as long as you didn't alter or change the default_system folder.

The second question, that depends on the player itself, but I'm a culprit of common data in my players. Non of my players will have compatibility issues if you ignore the commondata.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: 8lue Wizard on March 08, 2013, 11:10:30 PM
Ah, perhaps I should have phrased my question a little better. I'm working on a player script, (hence my request for the dps tester) and fully realize that if an enemy script is designed with, say, Time Stop compatibility in mind, and my player script doesn't support that, that it'll break the intended functionality of the script, since I'm not playing by its rules. My question was less about the technical details of CommonData support, and more about user expectations: is this widely accepted enough that people are going to assume a given script will support it, and then ding points when something breaks, or are they going to assume nothing and then give bonus points when they find out it does?

The other part of this question is: if I want to support these tasks (which I'm probably going to, eventually, regardless of the answer to the above), what are the big points I have to make sure I hit? Is there an easy reference implementation available, or, better yet, a library of compatible helper functions? I don't wanna be reinventing the wheel here if someone's already done the heavy lifting. In short, "What's the deal with this thing?"

Many thanks for the dps script, though, it's exactly what I was looking for.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on March 09, 2013, 12:16:39 AM
I'm not really sure, since I've never seen another script that utilizes the common data I've put in place (except my own), since I was mostly keeping the common data so I can use later if I wanted to change/retreive something, and just mentioned it at the top of the file if anyone else wanted to use it. One thing that I've done in a script is that if time stop isn't supported, it immediately skips the time stop and simulates what would've happened in time stop, effectively removing that gameplay downtime and makes the bullets seemingly spawn from no where. I've never used the time slow common data except in SakuyaB, but it was just to speed everything up when using the Danmakufu built in StartSlow/StopSlow functions.

I have a few functions that are relating to time stop common data, such as bullets responding to the time stop common data, but that's for enemy scripts, which I'm not sure if that what you want or player script functions, which I don't have any of. In short, you can effectively ignore it if you'd like; there's also the possibility that TimeStop will make an official return in ph3 at some point, though that may take a while or never happen.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 09, 2013, 01:37:18 AM
Never. You should never expect that an enemy script is going to implement some forced interaction with a player script unless it was specifically designed for use with that player script alone, such as if it's a game or other reasonably complete work. Such a thing should have player type restrictions in the first place, and it would probably include the player script alongside it. Otherwise whoever made the enemy script is simply doing it wrong.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: 8lue Wizard on March 09, 2013, 04:14:34 AM
Duly noted. There was some chatter back on the first page or two of this topic about setting up some community-standard common data fields that I skimmed over, but I didn't know if anything had come of that; guess I was just making a mountain out of a molehill.  :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on March 09, 2013, 05:47:51 AM
Yeah I didn't mention it back then, but I'm pretty opposed to a "community-wide" standard, if only because imposing such a thing would probably cause a lot of people to make enemy scripts that create the problem you're talking about. More than that, it alienates all the other scripters that aren't on this forum or aren't aware of there being a standard, effectively making it useless. A player Power variable would work but I don't really consider a CommonData like that being any sort of standard, especially since some scripts may implement the variable in unintended ways. It sounds nice in theory but I don't think anything good would really come of it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Arcorann on March 09, 2013, 08:17:53 AM
We already have a standard now that power has been built into the engine (GetPlayerPower / SetPlayerPower). I don't think anything outside what is inbuilt can be standardised, since the cooperation of everyone who is coding for ph3 will be practically impossible.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on March 16, 2013, 12:06:29 PM
How to re-create Sakuya's timestop from EoSD?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on March 18, 2013, 10:00:49 PM
I would say use StartSlow with 0 frames, but that would freeze the game~

In truth, though, it really would be nothing more than darkening the screen and forcing the player to stop using common data...
The bullets can be stopped by using GetShotIdInCircleA2 and running the resulting array through an ascent loop...
So, to put it in coding terms...something like this, perhaps?
Freezing the player would be a chore though, because if I am correct (probably not, as I know very little about the engine) you have to force a freeze on the player itself through common data checks...ie SetCommonData("TimeFreeze", 1);

I decided to look into GtBot's time stop task, which is fairly simple, all it does is darken the screen by a set amount and set the common data "TimeStop" to 1...
Stopping bullets should be simple enough to do, because the functions ObjMove_GetSpeed and ObjMove_SetSpeed exist and are documented, which is nice.
I would check with GtBot before using any of his content, though, for he must have put in lots of time and effort getting his code to work just right.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on March 19, 2013, 03:43:37 PM
I would say use StartSlow with 0 frames, but that would freeze the game~

In truth, though, it really would be nothing more than darkening the screen and forcing the player to stop using common data...
The bullets can be stopped by using GetShotIdInCircleA2 and running the resulting array through an ascent loop...
So, to put it in coding terms...something like this, perhaps?
Freezing the player would be a chore though, because if I am correct (probably not, as I know very little about the engine) you have to force a freeze on the player itself through common data checks...ie SetCommonData("TimeFreeze", 1);

I decided to look into GtBot's time stop task, which is fairly simple, all it does is darken the screen by a set amount and set the common data "TimeStop" to 1...
Stopping bullets should be simple enough to do, because the functions ObjMove_GetSpeed and ObjMove_SetSpeed exist and are documented, which is nice.
I would check with GtBot before using any of his content, though, for he must have put in lots of time and effort getting his code to work just right.

I PMed him when I wanted to use his cutin function and he replied
Quote
Everything I make is free to be modified and redistributed.
I'd still give him credit for the function, obviously.
Also, feel free to ask him personally if you would prefer to.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on March 20, 2013, 04:46:58 AM
I PMed him when I wanted to use his cutin function and he replied
This is indeed true :)

How to re-create Sakuya's timestop from EoSD?
What LegoCS said is pretty much true, although I should add that the tedium amount of effort to do this can be a little too much for a relatively low reward (unless you're using the player for a specific game/script that will utilize this often),  and then there's always the possibility that TimeStop may be built into the ph3 version.

Another yet very cheap way of doing this would be to "freeze" the player by forcing the player on the same spot as when TimeStop was initiated, then saving an image of that same moment as well, while also disallowing bombs/shots. Then draw the image over the game so that the player's normal functions would appear as though they stopped. While this is happening, you can move your bullets and boss and any other effects temporarily above the priority of this fake image. Once TimeStop would have ended, you could then reset the priorities of the boss/bullets/effects and remove the fake game image. As I mentioned before, this is a very cheap way of doing it and it has its own problems, but as of now with no TimeStop equivalent, this is the only way I can envision a TimeStop that could work for any script without the need for commondata,
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Swerfawe on March 31, 2013, 04:03:35 AM
Could someone please explain what a "Package Script" is? The wiki doesn't list it as a script type, but I think it's the most noticeable addition to that list. Also, what is CommonData and how is it used?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on March 31, 2013, 05:38:02 AM
Could someone please explain what a "Package Script" is? The wiki doesn't list it as a script type, but I think it's the most noticeable addition to that list. Also, what is CommonData and how is it used?
Since I'm the one who added the package script functions to the wiki, I guess I should answer this. A package script is, to put it simply, a full game script. You can use them to link separately scripted stages together. Probably the best way to show how package scripts work is to take a look at how the sample package script works and how it uses the listed functions.

To answer your second question, I'm going to point you to this. (http://www.shrinemaiden.org/forum/index.php/topic,12397.msg960502.html#msg960502) It works the same way in Ph3, only there is no GetCommonDataDefault. Instead, GetCommonData is the same thing as the old GetCommonDataDefault. The SaveCommonData and LoadCommonData functions in ph3 also work in a similar way to their 0.12m counterparts only with slightly different names. Check the function list on the wiki for more details.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on April 18, 2013, 08:56:04 PM
I have tried to make a double battle with Minoriko and Shizuha by defining Shizuha as an ordinary enemy (not a boss). It works fine, except for one annoying detail: When I try to play the plural script, every time I defeat an attack, Shizuha reappears from the upper left corner in the beginning of the next. I guess this has something to do with Shizuha's enemy object being deleted at the end of scripts or something like that, but I don't know. It only happens to Shizuha, not Minoriko.
Please, do you have any ideas? As an amateur, I'd prefer a solution that isn't too complicated if that's possible. Thanks in advance.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on April 18, 2013, 09:52:58 PM
The easiest solution would be to record Shizuha's X and Y coordinates into a common data in each script, and then in the @Initialize for each script, set the Shizuha enemy object ID's coordinates to the common data. Example (variables interchangeable):
Code: [Select]
@Initialize{
ObjRender_SetPosition(Shizuha, GetCommonData("ShizuhaX", 96), GetCommonData("ShizuhaY", -128), 0);
[..]

@MainLoop{
SetCommonData("ShizuhaX", ObjRender_GetX(Shizuha));
SetCommonData("ShizuhaY", ObjRender_GetY(Shizuha));
[..]
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 19, 2013, 12:22:30 AM
That sounds like needless use of common data. Could I take a look at how you're implementing her as an enemy? It only becomes an issue if you're actually recreating the Shizuha enemy object every attack (and deleting it). As long as her object isn't being destroyed there should be little problem.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on April 19, 2013, 11:12:42 AM
The common data solution worked nicely. Thank you very much for your assistance, gtbot  :)

Drake: Is there a reason not to use common data? Using it seems to be pretty simple (at least for something like what I wanted to do). Anyway, I define Shizuha with this:
Code: [Select]
objFam = ObjEnemy_Create(OBJ_ENEMY);
ObjEnemy_Regist(objFam);
in Initialize and delete objFam at the end of "EnemyActions", a task that contains movement and bullet firing and a few other things. (objFam is short for objFamiliar which refers to the fact that Shizuha is defined as a familiar, not as a boss)
My problem has been solved, so I just wrote this in case you want to know and/or have an easier way to do the same thing.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on April 19, 2013, 11:42:11 PM
Common data in 0.12 was for most people a workaround for the lack of real global variables, i.e. variables that can be accessed across scripts when the hardcoded functions weren't enough. Thing is that it gives way to abusing how much common data is stored and manipulated, and makes a huge mess of scripts. It isn't clean, isn't very safe, is generally a pain, and is abusable enough that people just start shoving everything into common data just because. When you globalize everything it gets really gross very quickly, so needlessly using common data as an easy way out should be avoided. In 0.12, there was a lot that could only be accomplished by using common data, but in ph3 you have a lot more freedom and utility, so usually you don't need it.
also see http://c2.com/cgi/wiki?GlobalVariablesAreBad

The inclusion of common data areas and saving and loading makes it much more useful for other purposes though, such as saving scores, data for replays, unlocks, RNG seeds, etc.

Anyways, in ph3, by default, objects are not deleted across script transitions. If you don't delete and recreate Shizuha every new script, you can still just get her object ID back using GetAllEnemyID(). Depending on if there are other enemies existing, you should be able to just grab it if you know its index in the array of enemies. Note that the reason you don't need to do this with the boss object is that even though you delete the boss object at the end of a script, its position and stuff are still internally stored somewhere; likely in the boss scene object.

Speaking of which, you could also replace the use of common data by doing pretty much the same thing, only with the boss scene object, using Obj_SetValue(). With that, the values will only exist as long as the boss scene exists, and you'll only be able to access them within the scope of the boss scene, making it a bit nicer.

Actually, someone be the guinea pig for the above. If it works well enough then it might be an idea to create additional boss/boss scene functions to facilitate familiar creation and manipulation.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on April 20, 2013, 08:22:14 PM
The "don't delete and recreate Shizuha" sounds a little difficult because I want to allow the player to play individual attacks (what am I supposed to do, make separate scripts for "spell practice" or write something like "create Shizuha if she doesn't exist"?), but thanks for telling me about it anyway; it'll probably be useful later.
I tried the method with "Obj_SetValue()" and it works fine too, so I think I'll stick to that if it makes things nicer. Thank you for explaining it.  :)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TalosMistake on April 30, 2013, 01:59:55 AM
Can I ask a question ?

If I want to change BGM in plural file. How can I do it ?

Example: I have a plural script that contains 6 nonspells and 6 spells. During 1st nonspell - 3rd spell , I want to play BGM1, and during 4th nonspell - 6th spell, stop playing BGM 1 and play BGM2 instead.

I tried to use PlayBGM but it doesn't work  :V , or maybe I should do something with Sound Object Functions ?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Tao-Sensei on May 03, 2013, 01:07:45 AM
Is there any place where I can find a written tutorial not in Japanese?

Either one doesn't exist or I'm blind (probably the latter).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: TalosMistake on May 03, 2013, 01:33:50 AM
Is there any place where I can find a written tutorial not in Japanese?

Either one doesn't exist or I'm blind (probably the latter).

This ? (http://www.nightbugstudios.com/index.php?/topic/307-tutorial-introduction-to-danmakufu-ph3-a-simple-script/)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Tao-Sensei on May 04, 2013, 03:59:31 AM
This ? (http://www.nightbugstudios.com/index.php?/topic/307-tutorial-introduction-to-danmakufu-ph3-a-simple-script/)
What.

Like I said, probably I'm blind, but thank you.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on May 05, 2013, 02:26:22 PM
Player Script question!

In 0.12m, I could do this in the description:
Code: [Select]
#Text[Wonderful Shrine Maiden of Paradise

Normal Shot: Homing
Focus Shot: Aimed
Normal Speed: ********
Focus Speed: ***
Spell card: Fantasy Seal]

And the description on the player select screen would take up several lines of text. However, if I try the same in ph3, it doesn't work, and \n doesn't force a newline either. Is there any way to have a player script's Text block be multiple lines long?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on May 05, 2013, 02:34:06 PM
I usually spam the space bar until there is a new line whenever I test it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 05, 2013, 02:37:58 PM
For all strings, new lines in ph3 are defined with [r]
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: stillsatellite on May 06, 2013, 04:11:17 PM
Does length still work in ph3? Didn't see it in the function list so I'm wondering.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 06, 2013, 06:50:04 PM
You could just have seen if it worked for yourself, but yes.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on May 06, 2013, 07:16:13 PM
Does Danmakufu allow multiple shotsheets uploaded at once?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 06, 2013, 10:43:19 PM
If you mean multiple images being used at the same time, I don't believe so, but you could instead just reload different shotdata files (that use different images) as needed.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on May 07, 2013, 02:06:43 PM
I tried using two different shotsheets at once and got no ill effects at all. Apparently, the only thing you have to watch out for is the shot IDs. If you put something like this at the start of your script (like I did):
Code: [Select]
#include "script/default_system/ZUN_shotdata/ZUN_ShotConst.txt"
#include "script/default_system/Default_ShotConst.txt"
and some shot IDs are used in both shotsheets, the bullets from the latter sheets (in this case "Default_ShotConst.txt") override the bullets from the former. Of course, you can change the bullet IDs in the sheets if you want to prevent it. Note that ph3 does not have the 255 ID limit, so don't worry about that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: CK Crash on May 08, 2013, 11:36:07 PM
Is there a decent translation of the package script function descriptions (http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_help_v3_data/func_package.html) yet? There are a few features I'm interested in, like linking stage replays, and I feel like I'm stumbling along in the dark using Google Translate... An English package script to use as an example would be helpful as well.

EDIT: DUMB I mistyped "package" when searching the wiki, and assumed that it just wasn't written up yet because it's a new addition...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sparen on May 08, 2013, 11:38:47 PM
Is there a decent translation of the package script function descriptions (http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_help_v3_data/func_package.html) yet? There are a few features I'm interested in, like linking stage replays, and I feel like I'm stumbling along in the dark using Google Translate... An English package script to use as an example would be helpful as well.

http://dmf.shrinemaiden.org/wiki/Package_Functions

(Miransu told me to post this)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 09, 2013, 12:17:47 AM
EDIT: DUMB I mistyped "package" when searching the wiki, and assumed that it just wasn't written up yet because it's a new addition...
It was a relatively new addition to the wiki. Myself and a friend filled in the information somewhat recently, and since then I've experimented with the functions enough that I can (mostly) say that the translated descriptions are accurate.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on May 09, 2013, 10:53:43 AM
"ObjShot_SetSpellResist" doesn't seem to protect the bullets from deathwaves. I tried using the function on a bullet and playing as gtbot's Arbiter and Eientei Teams. When the player died, the bullet disappeared even though I had used ObjShot_SetSpellResist(obj,true). Do you know any way to fix this?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 09, 2013, 01:00:05 PM
That's a problem with my old deathwave code than with danmakufu. You may have older versions of my scripts since the updated ones have this fixed (although Eientei only has one version so it should still work, if not PM me)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on May 09, 2013, 05:13:18 PM
Whoops, looks like I forgot to update the Arbiter players. Sorry about that  :ohdear: The new version doesn't seem to have a deathwave at all. I tried re-downloading just in case I had messed with it and forgotten about it, but still, I didn't see any bullets being removed. I tested the Eientei team again, and now it worked perfectly. I don't know why I thought a deathwave removed spell resistant bullets, but I blame my faulty memory and my lack of programming skills  :V
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 09, 2013, 06:26:04 PM
Whoops, looks like I forgot to update the Arbiter players. Sorry about that  :ohdear: The new version doesn't seem to have a deathwave at all. I tried re-downloading just in case I had messed with it and forgotten about it, but still, I didn't see any bullets being removed. I tested the Eientei team again, and now it worked perfectly. I don't know why I thought a deathwave removed spell resistant bullets, but I blame my faulty memory and my lack of programming skills  :V
The reason is that the "death wave" is actually just a DeleteShotAll command, which does not have any restrictions when it comes to spell resistant bullets. There is no built in "death wave" that ignores spell resistant bullets like there is in 0.12m. The way to do it would be to make the death wave in the player script be something like this (I suspect that gtbot did something similar with his newer versions):

Code: [Select]
function DeleteEnemyBullets {
let Bullets = GetShotIdInCircleA1(GetPlayerX,GetPlayerY,10000);
ascent(i in 0..length(Bullets)) {
if(!ObjShot_IsSpellResist(Bullets[i])) {
ObjShot_FadeDelete(Bullets[i]);
}
}
}
This function gets the IDs of all bullets in play and checks if they are spell resistant. If they aren't, then it deletes them. Otherwise it ignores them.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 09, 2013, 07:42:35 PM
What.

DeleteShotInCircle(TYPE_SHOT, TYPE_FADE, x, y, r)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 09, 2013, 09:04:53 PM
DeleteShotInCircle also removes spell resistant bullets.


edit: @Maths ~Angelic Version~ I thought I may have just changed the deathwave for testing purposes but it turns out I actually never fixed it to work with the faster respawn, I'll fix that real quick
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 09, 2013, 09:54:57 PM
Nnnnot if you specify TYPE_SHOT.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on May 09, 2013, 10:33:22 PM
wow i'm really oblivious  :X
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 10, 2013, 12:53:44 AM
Nnnnot if you specify TYPE_SHOT.
But then it won't destroy lasers, right?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on May 10, 2013, 03:21:56 AM
I actually have a question, how do I attach a script to a user defined item?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 10, 2013, 04:29:35 AM
But then it won't destroy lasers, right?
Lasers are set by default to be spell-resistant. You can make them not so, but they aren't really ever supposed to be destroyed by deathwaves or whatever anyways. Why would they need to be?

How are you supposed to dictate how they disappear? Pretty much any method you're going to use to delete some long object is going to look awful unless you're shrinking it to nothing.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on May 13, 2013, 04:48:29 PM
Is there any ph3 tutorial or code snippet out there with an example of a non-boss enemy loaded into a stage script? I'm floundering hardcore tryinng to figure out the proper structure and syntax for the use case.

Edit: Never mind, I'm getting this figured out.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 14, 2013, 06:41:18 AM
Is there any ph3 tutorial or code snippet out there with an example of a non-boss enemy loaded into a stage script? I'm floundering hardcore tryinng to figure out the proper structure and syntax for the use case.

Edit: Never mind, I'm getting this figured out.
I know you already said you're getting it figured out, but I'm just going to say that the best way to make non boss enemies in a stage script would be in a task, very similar to how you would make an object bullet in 0.12m.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on May 14, 2013, 03:03:33 PM
Yup! Looked at a Japanese long-form ph3 script, and that was how they did it.

Incidentally, is there built-in logic for any of the following in ph3, or am I going to have to implement them myself:

-Fast-forward button (Space in 0.12)
-Invincibility toggle button ('I' in 0.12)
-Spell Card cutins
-Changing how close the player can get to the edges of the field (default behavior lets them poke halfway off)
-The standard Touhou point item collection logic, where the value depends on where you are on the screen when you capture it
-Fairy Wars/Ten Desires-style circular boss lifebars
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on May 14, 2013, 03:40:52 PM
This is what I know about:
-Ctrl is used for fast-forward.
-gtbot has made a cutin function and a GFW/TD lifebar. As far as I know, he's fine with his work being reused, but please give him credit for it. I think Fondue has made a TD-like lifebar too, but I don't know if he's okay with it being reused (of course, you can try asking for permission). I think gtbot's is closer to the original lifebar if that matters to you.
-I believe SetPlayerClip(MinX,MinY,MaxX,MaxY) changes how close the player can get to the edges of the field.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 14, 2013, 04:44:50 PM
-Invincibility toggle button ('I' in 0.12)
-Spell Card cutins

You'll have to implement these yourself. Fortunately, I've already coded the debug keys you're looking for. Feel free to use my code:
Code: [Select]
if(GetKeyState(KEY_I)==KEY_PUSH) { SetPlayerInvincibilityFrame(100000); }
if(GetKeyState(KEY_U)==KEY_PUSH) { SetPlayerInvincibilityFrame(0); }
Once I'm confident that my cut in function doesn't need improvement, I'll release it publicly. However, if you want it in its current state, which is 99% complete and functional, shoot me a PM.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on May 15, 2013, 12:41:10 AM
Thanks for the information! I'll look into gtbot's scripts, and can figure the rest out myself.

As I continue to dig relentlessly deeper into ph3, I'm running into trouble with detecting the collection of user-defined items. I've got this for a simple item script:

Code: [Select]
task CreateLeaf(x, y) {
let turnSpeed = 10;
let angle = 0;

let item = CreateItemU1(T_ITEM_LEAF, x, y, 0);
ObjItem_SetRenderScoreEnable(item, false);
ObjItem_SetDefinedMovePatternA1(item, ITEM_MOVE_TOPLAYER);

while(!Obj_IsDeleted(item)) {
angle += turnSpeed;
ObjRender_SetAngleZ(item, angle);
yield;
}
}

The item appears and behaves as expected, moves towards the player while spinning, and disappears upon contact with them. However, no event is generated. The player's @Event isn't called at all. I tried using a NotifyEvent(playerID, EV_USER, params) call, but still nothing. How do I make my item trigger an event when collected?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on May 15, 2013, 01:40:35 AM
I think Fondue has made a TD-like lifebar too, but I think gtbot's is closer to the original lifebar if that matters to you.

Well, Fondue reused Gt's health bar. I am also going to be using it for some of my scripts in a modified form...more of me nitpicking his work to try to make it more like the original than what was already there. (ie. the "notches" on the health bars are stretched across the bar and there is not supposed to be one at the top of the bar.)

Also I want to say right now that Gt is also a total bro about reuse of his work. I will definitely give credit for all of this.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on May 15, 2013, 09:17:50 AM
Well, Fondue reused Gt's health bar.
I thought I remembered it being slightly different. Well, maybe I remembered Miransu Uwabami's (from BulletForge) lifebar, which looks different from gtbot's. I don't know how Miransu feels about having his/her work reused though.
Edit: Fondue has made a cutin function too. While gtbot's is more or less a recreation of various post-MoF cutins, Fondue's cutin has a more original design.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on May 15, 2013, 03:53:35 PM
 Ohhh, all this talk about me is making me feel wanted C:
-gtbot has made a cutin function and a GFW/TD lifebar. As far as I know, he's fine with his work being reused, but please give him credit for it. I think Fondue has made a TD-like lifebar too, but I don't know if he's okay with it being reused (of course, you can try asking for permission). I think gtbot's is closer to the original lifebar if that matters to you.
Got his permission, used it and credited him.
I thought I remembered it being slightly different. Well, maybe I remembered Miransu Uwabami's (from BulletForge) lifebar, which looks different from gtbot's. I don't know how Miransu feels about having his/her work reused though.
Edit: Fondue has made a cutin function too. While gtbot's is more or less a recreation of various post-MoF cutins, Fondue's cutin has a more original design.
P sure Miransu made his own.
And yes I did make my own.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on May 15, 2013, 05:08:52 PM
Argh, working with custom item logic keeps getting more frustrating and confusing.

I still can't get custom item collection events to work. I try just putting the logic for the item at the end of the item's task, but then it triggers whether the player collects it or it falls off the bottom of the stage. I try to do any logic related to the item's position, but ObjMove_GetX/Y seem to always return 0, no matter where the item is. I try to use GetObjectDistance, but it crashes the game. I try to add dynamic score based on player location, but there's no way to change the Score value of an item after it's been created.

Am I missing something, or are Item objects so wonky that I'd be better off tossing out all the provided Item framework and using ObjRenders for all my items?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on May 19, 2013, 02:50:44 AM
Is there a way to take apart strings?
I'm referring to checking the character at a given position of a string. Like...if you were to check the second position of the word "word", it would return "o".
I know it's possible to do in other languages such as C++...I'm just not sure if it can be done here.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on May 19, 2013, 03:07:00 AM
Just the same. Strings work as arrays of characters.
let str = "word";
str[1] is 'o'
str[1..4] is "ord"
length(var) is 4
erase(str, 1) is "wrd"
str ~ "soup" is "wordsoup"

Moreover booleans are analogous to 0 and 1 so you can do something like
let num = 26;
str[num < 10]
is 'w'
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on May 19, 2013, 03:08:51 AM
That is...interesting. Thank you very much.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on May 19, 2013, 03:11:12 AM
Is there a way to take apart strings?
I'm referring to checking the character at a given position of a string. Like...if you were to check the second position of the word "word", it would return "o".
I know it's possible to do in other languages such as C++...I'm just not sure if it can be done here.
You would do it the same way you were to do it to an array, since strings are just arrays of characters. For example, if string = "word", then string[1] would equal "o".

Edit: Sorry, I somehow didn't see that Drake beat me to it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on June 02, 2013, 03:20:30 PM
Okay, can someone help me understand ph3's music looping functionality? The numbers you put in really don't seem to reflect its behavior. Like, I do PlayMusic(song, 19, 20) and I'd expect that to mean that the song loops back to 0:19 every time it reaches 0:20, but the looped segment is about 11 seconds long, which doesn't make an ounce of sense. Also, putting in certain pairs of numbers seems to crash the game.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 02, 2013, 04:12:23 PM
Are you using an .mp3 file? I've had trouble when working with mp3s, but .wavs work fine.

edit: oops, i didn't check that i was actually using .ogg instead of .wav; fondue is right, .ogg is the one with no problems
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on June 02, 2013, 04:43:39 PM
Use .ogg files. They're really small and sound just as good as .wav's. The only problem is that they can be only pretty much opened with Audacity.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 10, 2013, 06:18:18 AM
I'm working with 2d arrays right and can't find any examples of how to use them.
I've become very comfortable with doing something like this:
Code: [Select]
let b = [];
ascent (i in 0 .. 10) {
    b = [CreateShotA1(0, 0, 0, 0, DS_BALL_S_RED, 40)] ~ b;
    ObjShot_SetAutoDelete(b[0],false);
}
After this I expect to have an array of 10 bullets.

Now I'd like to do something similar with a 2D array but the logic doesn't extend like I expect it too. I tried something like this:
Code: [Select]
let b = [[]];
let c = [];
ascent (i in 0 .. 10) {
    c = [CreateShotA1(0, 0, 0, 0, DS_BALL_S_RED, 40)] ~ c;
    ObjShot_SetAutoDelete(c[0],false);
}
b = c ~ b;
After which I'd like to have an 1 by 10 array of bullets, but I got an error on the last line which said this: "型が一致しません".

Any ideas on this? I'll take example code too.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: LegoCS on June 10, 2013, 07:18:07 AM
I plugged it into Google Translate and it said type mismatch. Not entirely sure if I'm interpreting your post correctly, but I think you are unable to use multidimensional arrays in Danmakufu...I hope someone else can explain this in further detail, because while I would like to be more knowledgeable in the inner workings of Danmakufu, I am afraid I have been working with Doom for too long for that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 10, 2013, 07:44:24 AM
The problem is just that you're concatenating a 1d array with a 2d array. All that needs to be changed is b = [c] ~ b; since then it's concatenating [[bullet,bullet,...]] and [[]].
[[a,b,c],[d,e,f]] ~ [[1,2,3],[4,5,6]] -> [[a,b,c],[d,e,f],[1,2,3],[4,5,6]] and so on.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 10, 2013, 12:04:21 PM
I tried Drake's solution and it didn't work. I got the "type mismatch" error again.

Update:
I tried changing the first line to "let b = [[CreateShotA1(0, 0, 0, 0, DS_BALL_S_RED, 40)]];", thinking that if it was an array of bullets to begin with it would accept new bullets. This does fix the type mismatch but now I'm having problems in other parts of my code. So this won't do (nor should it).
How do people trace code in this program? Is there some kind of console output?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 10, 2013, 10:44:55 PM
Wow, that sucks. For whatever reason the empty array is a type mismatch. The above works fine when the other array dimension isn't empty (and is of the same type).
In order to work it deeper than one dimension, you have to reconstruct the 1d array instead with b[0] = c ~ b[0]. In that case you can eliminate the use of the c array entirely, but I assume you have a reason for constructing the array like this.

There is no real trace function, but generally with explicit errors it gives you the line number where something screwed up. 0.12 had a sort of console but it was cumbersome to use, and now I don't think there is one for ph3. For 0.12 I've recently been using the debug functions I wrote here  (http://www.shrinemaiden.org/forum/index.php/topic,5164.msg966255.html#msg966255) rather than the console, so I could probably whip up something similar for ph3. Really debugging here is just "write stuff all over the screen and remember what common errors are from experience".
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 11, 2013, 03:23:25 AM
So I got a great solution. After I declared+instantiated the 2d array with a junk bullet, I deleted the location in the array. At this point it was an empty array again but I figured it had already held a bullet so now it might hold more, and it did. Bullets can now be added without issues. Also, I placed the junk bullet at -100,-100 so I assume the auto-delete took care of it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on June 11, 2013, 05:10:04 AM
danmakufu is as crazy as ever
i don't particularly like that solution but at least it works
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on June 11, 2013, 06:36:15 AM
0.12 had a sort of console but it was cumbersome to use, and now I don't think there is one for ph3.
Actually there IS a log window for later versions of Ph3 which can be enabled from the config. It gives some debug information as well as takes a log of certain events as they happen. The value of common data within common data areas can be found as well as the number of script tasks that are running, the number of enemies existing, and the number of objects currently existing can be found there just to name a few. The function WriteLog can also be used in scripts to write certain text to the log. This can be helpful to figure out what part of a script is causing a crash.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 11, 2013, 12:13:21 PM
Actually there IS a log window for later versions of Ph3 which can be enabled from the config. It gives some debug information as well as takes a log of certain events as they happen. The value of common data within common data areas can be found as well as the number of script tasks that are running, the number of enemies existing, and the number of objects currently existing can be found there just to name a few. The function WriteLog can also be used in scripts to write certain text to the log. This can be helpful to figure out what part of a script is causing a crash.
Oh god, I found the write log function and I've been looking everywhere for a log to be written to. It doesn't seem to display the text that I write to it though. I only see Moon Runes.

The common data fields might work better.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on June 11, 2013, 04:32:48 PM
Oh god, I found the write log function and I've been looking everywhere for a log to be written to. It doesn't seem to display the text that I write to it though. I only see Moon Runes.

The common data fields might work better.
I can confirm that it does indeed write the exact text put into WriteLog, it just also writes a ton of other things that are in unintelligible in Japanese.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 11, 2013, 11:36:07 PM
I can confirm that it does indeed write the exact text put into WriteLog, it just also writes a ton of other things that are in unintelligible in Japanese.
Weird because I'm only getting unintelligible Japanese. Although, I'm also getting some stuff that isn't Japanese. It's making me think there's some kind of encoding error or something.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on June 15, 2013, 04:58:08 AM
All rigiht, back with a trickier question! I'm messing with the provided sample script (SampleE02.txt) that renders a circular distortion circle around the boss, in order to alter it for my own uses. However, when used with my own background, the visuals aren't working correctly.

Using the default "Ice Mountain" background:
(http://i.imgur.com/xd0JAiM.png)

Using my 2D background:
(http://i.imgur.com/63OegNM.png)

Plain as day, there's a square border visible around the distortion effect. Enabling or disabling different parts of the effect reveals that the border is being created by the part of the effect that renders the outside corner space between the circular edge of the distortion and the square border of the effect area. Has anyone messed with ph3's daunting render-to-texture functionality enough to have a clue what would cause that? Looking at the code for my background and Ice Mountain, the only thing that seems substantially different between them is that I'm using 2D rendering instead of 3D...

EDIT: A classic case of post-and-solve! Adjusting the coordinates of the outside part of the texture by 0.5 pixels removed the frame.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 15, 2013, 03:31:32 PM
I'm having a severe issue with one of my player scripts. Here. (https://dl.dropboxusercontent.com/u/26851686/beetlemania.zip) I'm trying to spawn Enemy objects (referred to as "Shell" from here on) into an array so I can make sure I can limit the amount of Shells on the screen at a single time, but it's not working correctly. When a Shell is spawned, the border turns black, and after some time, the player and its hitbox turns into a shell, moves like the Shells, and then eventually, even the boss does it, too! THEN the actual shells spawn later on. Yes, I'm sure just putting it into another task within the ShellManage task would work, lowering the Shells variable every time one is destroyed, but I'd like to know why my array setup is working in case in the future, I might need this for something else...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 15, 2013, 09:44:30 PM
Browser crashed and lost my reply  :X

Basically, in the ascent at line 278, you are manipulating objects with the value of i rather than the objects inside of the array. Because of this, everything else gets manipulated until the shells appear (since at some point it will eventually reach the ID that the shells are). To fix this, just change all the references that use i as an object to ShellCount[‎i], which I've done for you (http://pastebin.com/f0zrTCaM). Also, the Shells variable is kind of unnecessary, since you can just use length(ShellCount) in its place.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 15, 2013, 10:00:17 PM
Browser crashed and lost my reply  :X

Basically, in the ascent at line 278, you are manipulating objects with the value of i rather than the objects inside of the array. Because of this, everything else gets manipulated until the shells appear (since at some point it will eventually reach the ID that the shells are). To fix this, just change all the references that use i as an object to ShellCount[‎i], which I've done for you (http://pastebin.com/f0zrTCaM). Also, the Shells variable is kind of unnecessary, since you can just use length(ShellCount) in its place.
Oh, derp. Thanks! The reason I used the "Shells" variable was in case it was the use of length(ShellCount) that did it. (It wasn't.)

Well, I have a new issue now. I decided to go with a task-based approach to handling the shells (much simpler XD) and have gotten to the point of having the shells stun the player. It was working fine up until I added some code to stop the player from moving. Now, every time the player gets hit by a shell, the game freezes and an error box shortly appears, saying only "bad allocation". I don't know what's wrong. Updated stuff is here (https://dl.dropboxusercontent.com/u/26851686/beetlemania.zip)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 15, 2013, 10:50:28 PM
You are setting GetPlayerX and GetPlayerY to a value, which is what is causing the error (they shouldn't be modified except by Danmakufu). You should be setting StunX/Y = GetPlayerX/Y instead.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 15, 2013, 10:53:49 PM
You are setting GetPlayerX and GetPlayerY to a value, which is what is causing the error (they shouldn't be modified except by Danmakufu). You should be setting StunX/Y = GetPlayerX/Y instead.
rugh34ujg3h

this is what happens when i haven't used danmakufu for a while

thank you
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on June 19, 2013, 03:59:17 AM
Is there an animation-handling library of some sort for ph3? I am seriously inept when it comes to manually handling animations and graphics... ^^;
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 19, 2013, 10:30:36 AM
There is this one (http://dl.dropbox.com/u/15870353/LucasAnimation.zip) from Lucas (http://www.shrinemaiden.org/forum/index.php/topic,10181.msg770766.html#msg770766),
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on June 20, 2013, 12:17:09 AM
Ah, thank you. However, upon trying to use it, the second animation function gives me an error regarding arrays, and moreover, it has Danmakufu automatically crash when it transitions from one script to another in plurals. I might have to resort doing this manually...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on June 20, 2013, 02:51:17 PM
Are you using an .mp3 file? I've had trouble when working with mp3s, but .wavs work fine.

edit: oops, i didn't check that i was actually using .ogg instead of .wav; fondue is right, .ogg is the one with no problems

Got a .ogg file, and it still doesnt work right. I say "PlayBGM(music1A, 10, 20);", and instead of looping back to 0:10 at the 0:20 mark, it just plays and loops the entire song. The effect is the same, no matter what I set the last two parameters to.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 20, 2013, 03:18:16 PM
Ah, thank you. However, upon trying to use it, the second animation function gives me an error regarding arrays, and moreover, it has Danmakufu automatically crash when it transitions from one script to another in plurals. I might have to resort doing this manually...
Ah, I see. In this case, I'll make a basic animation library for you. It'll be done rather soon.

Got a .ogg file, and it still doesnt work right. I say "PlayBGM(music1A, 10, 20);", and instead of looping back to 0:10 at the 0:20 mark, it just plays and loops the entire song. The effect is the same, no matter what I set the last two parameters to.
It might be related to the file itself and the way Danmakufu processes the sounds. That happens to me too on some files I've used (except instead they repeatedly played 2 seconds and were disconnected from any sound objects), and I'm not entirely sure as to why it happens.  ???

Try making the audio a sound object  (http://dmf.shrinemaiden.org/wiki/Sound_Object_Functions)and see if it'll loop correctly then.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: professor_scissors on June 20, 2013, 03:56:53 PM
Try making the audio a sound object  (http://dmf.shrinemaiden.org/wiki/Sound_Object_Functions)and see if it'll loop correctly then.

Yes! Loading a Sound Object was the thing to do. It works perfectly now, thanks!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 21, 2013, 12:08:36 AM
Yes! Loading a Sound Object was the thing to do. It works perfectly now, thanks!
Oh, that's great :)
I'll make a basic animation library for you. It'll be done rather soon.
finished it (http://www.bulletforge.org/u/gtbot/p/basic-animation-library)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on June 21, 2013, 01:44:01 AM
finished it (http://www.bulletforge.org/u/gtbot/p/basic-animation-library)

I can't thank you enough--it works wonderfully~
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on June 24, 2013, 03:06:40 PM
Does anyone here know how user events work? I'm trying to read up on EV_USER on the official documentation but Google Translate makes it very unclear.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 28, 2013, 02:30:11 AM
Hi, another player script problem.

https://dl.dropboxusercontent.com/u/26851686/MarisaD3.txt (https://dl.dropboxusercontent.com/u/26851686/MarisaD3.txt)

In the section of the Option task that sets relativeX and relativeY,  relativeX & Y are supposed to point to the closest enemy (or the boss) if one exists, thus causing the options to home in on the boss. There's just one problem: they never do, and the check for if a boss exists causes an error if no boss exists. I suspect I might be using GetAllEnemyID incorrectly, but...the wiki is no help whatsoever. It only offers the most basic info that tells me absolutely nothing. "Gets the ID of every enemy present on the screen, and returns them in an array." Then how do I access them? What value corresponds to what? D: Please help!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on June 28, 2013, 05:01:03 AM
Hi, another player script problem.

https://dl.dropboxusercontent.com/u/26851686/MarisaD3.txt (https://dl.dropboxusercontent.com/u/26851686/MarisaD3.txt)

In the section of the Option task that sets relativeX and relativeY,  relativeX & Y are supposed to point to the closest enemy (or the boss) if one exists, thus causing the options to home in on the boss. There's just one problem: they never do, and the check for if a boss exists causes an error if no boss exists. I suspect I might be using GetAllEnemyID incorrectly, but...the wiki is no help whatsoever. It only offers the most basic info that tells me absolutely nothing. "Gets the ID of every enemy present on the screen, and returns them in an array." Then how do I access them? What value corresponds to what? D: Please help!
Well for starters, you don't have parenthesis behind GetAllEnemyID in your GetClosestEnemyID function to indicate it's a function. I guess, yeah, your using it incorrectly.

I notice you have a tree of if statements in that same function. Does ph3 not have early escape functionality, i.e. if I write
Code: [Select]
if(a == b && c==d) {
a = "blah"
}
and a==b evaluates to false, will c==d even been evaluated seeing as the entire if statement already has no hope of being true?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 28, 2013, 01:49:22 PM
There's no parentheses behind it because my experience is, functions work without them unless they have parameters, and GetAllEnemyID doesn't. GetPlayerX/Y are functions, but they don't need parentheses because they don't have parameters. (why would they? XD)

Also as for tree of ifs, it's because CK Crash told me to do that because "less resource intensive, and there's no reason to check enemy data until you verify the enemy exists". :/ He says that if a==b results to false, c==d will still be checked. My experience...I'd say that's true.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on June 28, 2013, 02:34:08 PM
In the section of the Option task that sets relativeX and relativeY,  relativeX & Y are supposed to point to the closest enemy (or the boss) if one exists, thus causing the options to home in on the boss. There's just one problem: they never do, and the check for if a boss exists causes an error if no boss exists. I suspect I might be using GetAllEnemyID incorrectly, but...the wiki is no help whatsoever. [...] Then how do I access them? What value corresponds to what? D: Please help!
GetAllEnemyID returns an array in the order that they were created in. If no enemy exists, the array returned is [].

Your options are not moving because every frame you are calling relativeX/Y = GetPlayerX/Y (line 401/402).

edit: (forgot about the boss part)
Instead of checking if GetEnemyBossObjectID is invalid, check if GetEnemyBossSceneObjectID is not invalid, and if it is not invalid, then set the boss object ID. (to be honest i'm not sure why this is done but this is the way i have it in my code and from the example code)
Code: [Select]
if(GetEnemyBossSceneObjectID != ID_INVALID){ID = GetEnemyBossObjectID[0];}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Nimono on June 28, 2013, 05:22:17 PM
GetAllEnemyID returns an array in the order that they were created in. If no enemy exists, the array returned is [].

Your options are not moving because every frame you are calling relativeX/Y = GetPlayerX/Y (line 401/402).
Oh my GOSH, how did I miss that!? You're a freaking life saver! Thanks so much! :D Now to speed up the movement...ehehe...
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Kingault on June 29, 2013, 03:39:53 AM
Nevermind, problem resolved.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Swerfawe on July 03, 2013, 02:43:29 AM
http://pastebin.com/CJYWnKM0
I only made a small edit to the default 5-way homing shot, but there is huge hitbox dissonance on the lasers. Is there anything wrong, or is it just that ph3 is still being developed?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on July 04, 2013, 03:21:27 PM
How does danmakufu decide on the size of a bullet's hit circle? Seems like that should be set in the shotData file. I tried using ObjShot_SetIntersectionCircleA1 but that just doesn't seem to work. Also, do you need a shotConst file?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on July 04, 2013, 04:03:59 PM
http://pastebin.com/CJYWnKM0
I only made a small edit to the default 5-way homing shot, but there is huge hitbox dissonance on the lasers. Is there anything wrong, or is it just that ph3 is still being developed?
This looks like a problem with ph3 itself.
How does danmakufu decide on the size of a bullet's hit circle? Seems like that should be set in the shotData file. I tried using ObjShot_SetIntersectionCircleA1 but that just doesn't seem to work. Also, do you need a shotConst file?
I'm not entirely sure, but I think the hitbox is 2/3 the size of the image. ObjShot_SetIntersectionCircleA1 needs to be set every frame to work. shotConst is completely up to your preference and not required, although it makes it easier to remember (261 vs SHOT_COOLSHOT_RED). Take note that the default shotConst file loads the shot data locally (LoadEnemyShotData), so you'll have to load that elsewhere if you choose to not use it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on July 04, 2013, 09:18:56 PM
I'm not entirely sure, but I think the hitbox is 2/3 the size of the image. ObjShot_SetIntersectionCircleA1 needs to be set every frame to work. shotConst is completely up to your preference and not required, although it makes it easier to remember (261 vs SHOT_COOLSHOT_RED). Take note that the default shotConst file loads the shot data locally (LoadEnemyShotData), so you'll have to load that elsewhere if you choose to not use it.
This may be the most I've ever dislike danmakufu. 2/3 seems to be right.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on July 04, 2013, 11:45:52 PM
It can be set in the ShotData using the key collision, it just gives it a certain radius by default if it isn't present.

SetIntersectionCircleA1() and SetShotIntersectionCircle() need to be called per-frame, yes.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 05:52:15 PM
I looked through this topic about fonts issue and still don't get some parts.
I did some experiments with script under Wine and any font I tried worked fine. When I loaded windows and checked the script, I was surprised to see different font to be used during playing. Some people told that it's AppLocale issue so you have to use Shift-JIS font for that. So, what fonts exactly are Shift-JIS ones? Before I thought that Shift-Jis fonts are those which support Japanese but, for example, Liberation Mono supports it but didn't work in danmakufu (even though I tried to use installfont function, it used some other one which was proportional).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sparen on July 14, 2013, 07:28:39 PM
Wine has always used different fonts for me. When I centered text in PDD, Windows users had half the text not on the screen because they were using a font.

As for Shift_JIS, it's a text encoding, not a font.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 07:36:07 PM
As for Shift_JIS, it's a text encoding, not a font.

I was talking about this post:

1) You have to use a Shift-JIS font. Sorry, no Comic Sans.

What exactly was meant there?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 14, 2013, 07:55:42 PM
He means you need to use a font that is compatible with Shift-JIS encoding. Some fonts do not support the Shift-JIS and those are not usable. The comic sans was a joke.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on July 14, 2013, 08:13:35 PM
He means you need to use a font that is compatible with Shift-JIS encoding. Some fonts do not support the Shift-JIS and those are not usable. The comic sans was a joke.
However, provided Danmakufu is not running with Applocale, ANY font should work, regardless of its encoding.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 08:29:47 PM
So how can I know if the specific font is suitable while using AppLocale? I tried several fonts which support Shift-JIS (if the font is capable to show Japanese characters, it supports Shift-JIS, right?) but only native MS Gothic worked, other fonts just were ignored. Sorry if the question looks dumb, I just don't get where I'm wrong.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on July 14, 2013, 08:38:35 PM
So how can I know if the specific font is suitable while using AppLocale? I tried several fonts which support Shift-JIS (if the font is capable to show Japanese characters, it supports Shift-JIS, right?) but only native MS Gothic worked, other fonts just were ignored. Sorry if the question looks dumb, I just don't get where I'm wrong.
Do you need to use applocale? If you remove the default scripts and player then it should run fine with or without it, so long as you don't try to make it read any scripts with Japanese characters in them.

If you must use it, from experience I know that a lot of unicode fonts work with or without applocale so you can try that. Honestly though, your options while using applocale are really limited.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 08:56:44 PM
Do you need to use applocale? If you remove the default scripts and player then it should run fine with or without it, so long as you don't try to make it read any scripts with Japanese characters in them.

If you must use it, from experience I know that a lot of unicode fonts work with or without applocale so you can try that. Honestly though, your options while using applocale are really limited.
Hm, so if I completely get rid of Japanese characters from the script, it will work without applocale and, of course, will use any font I'd like, right?
Do I need to remove even Japanese comments or only text input should not contain them?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 14, 2013, 09:00:28 PM
However, provided Danmakufu is not running with Applocale, ANY font should work, regardless of its encoding.
Perhaps, but according to Lucas it isn't. Assuming he has researched it. I myself haven't research any of the font area for ph3, so I wouldn't know. We'll have to take his word on it. Also MS Gothic has Shift-JIS compatibility, if we compare it to Lucas' post it should work.


Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 09:11:46 PM
Yes, MS Gothic works fine (it was originally used in that script), it just... doesn't look so good, that's why I thought it would be nice to use some other font.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sparen on July 14, 2013, 09:13:26 PM
[I contacted Onthenet about this. Don't know if I should have or not, but he may or may not respond.

Anyways, I'm pretty sure the issue relates to 0.12m as well, since I've had the same problem in 0.12m]
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on July 14, 2013, 09:14:13 PM
Hm, so if I completely get rid of Japanese characters from the script, it will work without applocale and, of course, will use any font I'd like, right?
Yes, that's correct. That's what I have been doing.

Do I need to remove even Japanese comments or only text input should not contain them?
I would remove the comments too, just to be safe.

Perhaps, but according to Lucas it isn't. Assuming he has researched it. I myself haven't research any of the font area for ph3, so I wouldn't know. We'll have to take his word on it. Also MS Gothic has Shift-JIS compatibility, if we compare it to Lucas' post it should work.
That post was made when ph3 was in a MUCH older version. Apparently support for non Shift-JIS fonts was added sometime after that. Or else it was a glitch to begin with, I cannot remember which. Regardless, I can confirm that nearly all fonts work now.

Anyways, I'm pretty sure the issue relates to 0.12m as well, since I've had the same problem in 0.12m]
What problem? As far as I remember, you could not install fonts in 0.12m. I don't see how that could be relevant.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 14, 2013, 09:17:23 PM
That post was made when ph3 was in a MUCH older version. Apparently support for non Shift-JIS fonts was added sometime after that. Or else it was a glitch to begin with, I cannot remember which. Regardless, I can confirm that nearly all fonts work now.
That is then great news regarding fonts. Thanks for the heads up. I almost forgot that within these last months, lots of releases has been there for ph3. I wonder if it will leave its beta status soon?

Also unrelated, but a valid question, I noticed the looping function isn't responding proper for BGM/SE. Is this correct?

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on July 14, 2013, 09:22:03 PM
Also unrelated, but a valid question, I noticed the looping function isn't responding proper for BGM/SE. Is this correct?
Which looping function? I have not experimented with PlayBGM myself but as was previously mentioned, sound objects loop just fine, though mp3 files may not work properly (if at all). Ogg files seem to be preferred. Also ObjSound_SetLoopTime does not usually result in flawless looping. ObjSound_SetLoopSampleCount is a far more precise alternative. Instead of using seconds, it uses samples. Using audacity or similar programs you can see the sample count at any point during the track, and use that for the information to provide in the function.

Funny how this comes up, as I just tried all of this for the first time today and it worked wonderfully.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 14, 2013, 09:24:45 PM
Those are indeed the functions I am mentioning. OGG is preferred huh? I remember how in 0.12m OGG was dangerous to use with incorrect formats (Mecha Kisume script...).

I assume the same goes for the Volume rate, it seems to be behaving odd when using mp3s. I tried volume rate 50, but it was like near quiet when 90 was quite soft already. (Parameter for it says between 1-100).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on July 14, 2013, 09:26:07 PM
I assume the same goes for the Volume rate, it seems to be behaving odd when using mp3s. I tried volume rate 50, but it was like near quiet when 90 was quite soft already. (Parameter for it says between 1-100).
I never quite understood what was up with the volume rate, as 50 was basically silent like you said. I wonder if that differs when using different file formats, ill have to experiment with that.

Edit: Oh I should also say that ogg files seem to be preferred when LOOPING. For ordinary use, mp3s are just as good.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on July 14, 2013, 09:36:53 PM
Yes, that's correct. That's what I have been doing.
I would remove the comments too, just to be safe.
I see, thank you. I'll check it when I will have enough data to replace. Meanwhile, I'll look for Japanese text which definitely should be translated.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sparen on July 14, 2013, 09:49:14 PM
0.12m fonts: Danmakufu run with Wine would have glitchy fonts; I'm not referring to the installation of fonts. It just had problems with fonts anyways.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on July 20, 2013, 07:39:08 PM
I was fooling around with the draw/view distances in ph3 and I noticed the distance for drawing sprite objects is logically low.

In 0.12m, this was manipulatable with SetPerspectiveClip(param1,param2); though I cannot seem to really detect/figure out it ph3. I think I'm missing it on the wiki, but couldn't locate it.

Edit:
Quote from: 0.12m documentation from official site
SetPerspectiveClip(引数:2)
 1) 近クリッピング距離 (初期値10)
 2) 遠クリッピング距離 (初期値1500)
パースペクティブ射影行列変換時のクリップ距離を指定します。
近クリップより近いものと遠クリップより遠くのものは描画されません。

    ph3にはありません。

Well *****. I sent the author an e-mail asking about this. It makes no sense at all to me.



Also unrelated to my question, the sphere-camera in ph3 is wrong in terms of logical. It is using azimuth, angular altitude and horizon radius for 3DCamera.
(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Azimuth-Altitude_schematic.svg/350px-Azimuth-Altitude_schematic.svg.png)

Except the observer point isn't you, but the star is. Star player da ze!

Edit2: Actually, regarding the sphere-camera thing. It would make sense if the stage is drawn at the "star" I guess? Or ----- I am so confused. Oh well, awaiting reply from author.

Edit 3:
Received E-mail from the author. He says it is indeed non-existent feature in ph3. It will be implemented in the next version.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sakkeru on July 22, 2013, 10:27:28 PM
Apologies, please ignore this post. I figured out the error, but I don't know how to delete this, so... Yes, please ignore this.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 01, 2013, 11:27:50 AM
I did some heavy digging in the ph3 structure to grasp the way it all is tied together. Mainly with the spell background and effects, it is required for my tutorial so I was wondering if these are correct.

I've noticed that if the #System header is void then default_system.txt will be called. This file contains the standard effects and drawing for boss lifebar, playerscore, timer, etc etc. First of all, compared to 0.12m, there is no @BackGround routine, however two separate tasks listening to a boolean inside Default_Background_IceMountain.txt.

If no Background header is provided, no spellcard background animation will be used at all. The magic circle shown around the boss is a default effect which can be always called.
Code: [Select]
let objScene = GetEnemyBossSceneObjectID();
ObjEnemyBossScene_StartSpell(objScene);
is a simple example in Rumia which gets the bossID and then start a scene on that ID. Default_System.txt listens with the Event case(EV_START_BOSS_SPELL) and kicks the Default_System_MagicCircle.txt spell card. It is important to keep the spellcard BG and magic circle strictly separated during our mind breaking process.

First of all, when the background txt is called, two tasks are called: NormalBG and SpellBG who listen to the boolean bSpell. This boolean is set inside the @MainLoop routine which constantly listens whether a spell card is called or not.
Code: [Select]
if(objScene != ID_INVALID && ObjEnemyBossScene_GetInfo(objScene, INFO_IS_SPELL))ObjEnemyBossScene_StartSpell(object); & INFO_IS_SPELL are tied together. So the value is true and based on this, the bSpell boolean is set to true or false. The two tasks being called are listening non-stop to this boolean and are looping infinitely until the script is closed. This is why you can for example during plurals have easier background swapping.

I hope I managed to explain it correctly and this will perhaps give insight for people who wish to alter the effects.

You could of course always draw your own background by simply leaving #system header out, providing no #background header and creating a simple 2D sprite on Layer 20. Anything is possible but understanding the game structure is never a bad thing.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Byronyello on August 07, 2013, 06:23:08 AM
Forgive me if I'm missing something simple, but as far as I can see there isn't a SetAlpha function for bullet objects, so I'd like to know two things:
1: Am I blind?
2: If not, how does one make one's bullets have transparency?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on August 07, 2013, 06:29:29 AM
Oh, you can. Just use ObjRender_SetAlpha with the bullet object's ID and you are set.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Byronyello on August 07, 2013, 06:36:20 AM
Oh, you can. Just use ObjRender_SetAlpha with the bullet object's ID and you are set.
Much appreciated. When I was looking through the wiki for such a function, I found that. I had no idea that bullet objects were also render objects though, so I thought nothing of it. Again, thank you.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 07, 2013, 07:02:48 AM
(http://nazr.in/6qe)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 07, 2013, 07:19:40 AM
In ph3, everything that is made as an object will listen to object funtions. So if you want to modify rendering -> Render Object Functions. If you want to influence movement -> Object Movement Functions. Etc etc. Do keep in mind that for some reason not all functions respond to the objects. I've just noticed that Primitive 2D sprites do not respond to ObjMove_SetSpeed while it did in 0.12. Even though some functions are implemented in ph3, they aren't always truly working. PlaySE for example won't play any sounds at all. You need to use Object Sounds.

Regarding Object Sounds, a small explanation:
If you think Object Sounds are independent unique sounds which will no longer be "overwritten" by the same sound (when repeated), you've got it wrong. While it almost looks as if the author intended this, it is either unfinished or he failed. Let me explain further.
Code: [Select]
let objSound = ObjSound_Create;
ObjSound_Load(objSound,<Marisa's Master Spark>);
ObjSound_SetDivision(objSound,SOUND_SE);
ObjSound_Play(objSound);
loop(120) { yield; }
Obj_Delete(objSound);
Let us say our sound sample is Marisa's master sparks sound. A quite lengthy sfx. So the above code is a simple object sound spawn, setting the path, division and playing it. After 120 frames (2s at 60fps) it will be deleted. So if we play this 2x with 0,5s interval, we will have 2 sounds technically. Sounds simple right? Wrong.

First of all, the previous master spark sound is instantly interrupted by the new one. You might think due to the object ID handling, it should have a unique ID and therefore not interfere. Second disappointment is that upon calling Obj_Delete, all master spark sounds will stop playing. Again this is baffling as we though the Object Style scripting would solve all this. My guess is that each sound file (wav/mp3) can be called once in the memory of ph3. Just like 0.12m, playing the similar sound will interrupt the previous.

I am guessing SoundDivision was intended, however, not responding or working at all. Not sure if the author is aware of this.

So there you have it folks, more knowledge for your work. Oh and if you want to mimic PlaySE use this handy function:
Code: [Select]
task PlaySFX(path)
let objSound = ObjSound_Create;
ObjSound_Load(objSound,path);
ObjSound_SetDivision(objSound,SOUND_SE);
ObjSound_Play(objSound);
loop(120) { yield; }
Obj_Delete(objSound);
}
Above can be expanded with more parameters for the delay to delete. It is though important you delete your object sounds eventually, otherwise it will possibly cause performance issues.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 07, 2013, 07:31:52 AM
PlaySE for example won't play any sounds at all. You need to use Object Sounds.
That is actually not correct. PlaySE fails to play sound effects if they are not loaded into memory first with LoadSound. It's very strange though that they now require loading while they did not in v0.12m, while the opposite is now true for images.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 07, 2013, 08:26:00 AM
That is actually not correct. PlaySE fails to play sound effects if they are not loaded into memory first with LoadSound. It's very strange though that they now require loading while they did not in v0.12m, while the opposite is now true for images.
In that case, the wiki mentions nothing about this. We might want to update that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 16, 2013, 10:26:17 PM
I wanna start using ph3. But I noticed there is no Cutin function. Is there is script I can use that does it?

Or will I have to steal it from Mystical Power Plant?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 16, 2013, 10:34:23 PM
Why do you need a cut-in effect if you're just starting to use ph3? It isn't a necessary element in any sort of beginner script. If you want a simple picture-and-text thing, then it's easy enough to whip up yourself if you're used to tossing graphics on the screen and moving them around.

But seriously please start using ph3, we need more ph3 up in here.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 16, 2013, 10:54:28 PM
When I do start learning ph3 I want to atleast be able to get a spell card working, complete with a cutin, name, score bonus.
Pretty much, I want it as close to Touhou as I can get. Especially since I started on a full game and I have been thinking about moving it to ph3. I guess I'll look at MPP.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 16, 2013, 11:46:50 PM
I'm saying that if you're "just starting" with ph3, you don't start by attempting to make a Touhou-like, and if you want to make a full game you definitely shouldn't just be yanking other code simply because you can't yet make it yourself.

1. Can you make a cutin image simply render on the screen?
2. Can you pop the image from one place to another?
2b. Can you gradually move the image from one place to another?
3. Can you modify the image's transparency?
3b. Can you make the image fade in and out?
4. Can you make text simply render on screen?
5. Can you pop the text from one place to another?
5b. Can you gradually move the text from one place to another?
6. Can you make the text correspond with some decreasing bonus variable?
7. Can you make the text disappear when you're done the card?
8. Can you award the bonus when you're done the card?

Then you have a simple cutin and score bonus.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 17, 2013, 12:42:59 AM
You make it look soo simple. I'll do it once I'm familiar with the different functions.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on August 17, 2013, 01:44:11 AM
the cool part is that it is that simple

you can take a look and also use my cutin code (download (http://www.mediafire.com/?egc1rcymacgg8vq)) if you'd like, however, it's quite messy since this was one of the earlier things i had made for ph3 and i haven't got around to cleaning it up
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 17, 2013, 03:10:46 AM
the cool part is that it is that simple

you can take a look and also use my cutin code (download (http://www.mediafire.com/?egc1rcymacgg8vq)) if you'd like, however, it's quite messy since this was one of the earlier things i had made for ph3 and i haven't got around to cleaning it up

Thank you. It works perfectly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 19, 2013, 03:35:04 PM
I noticed that even though I set the score of the spell card the bonus isn't given. But this doesn't seem to work either.

Code: [Select]
let score = ObjEnemyBossScene_GetInfo(objEnemy,INFO_SPELL_SCORE);

AddScore(score);

Can someone help me with this?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on August 19, 2013, 05:09:11 PM
Perhaps you didn't set the attack as a spellcard by using ObjEnemyBossScene_StartSpell?

As for the AddScore not working either, I noticed you are using objEnemy, which implies its the enemy object itself, as the object ID for the function, it should instead be the boss scene object rather than the boss itself. You can get the scene ID by using GetEnemyBossSceneObjectID. You must also use the scene object for ObjEnemyBossScene_StartSpell too, as this could also be another reason the score bonus isn't being given.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 19, 2013, 05:30:08 PM
Yup, I changed it to objscene. So now The player gets a spell bonus, but even if the player fails the bonus is still being given.

The "ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE)" should update the spell card score with 0 if the player dies right?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 19, 2013, 05:43:12 PM
Yup, I changed it to objscene. So now The player gets a spell bonus, but even if the player fails the bonus is still being given.

The "ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE)" should update the spell card score with 0 if the player dies right?
The spell card bonus will only be zero if the card is timed out. A death or bomb will not automatically make the bonus zero. You must manually check whether the player bombed or died and add the bonus accordingly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 19, 2013, 05:58:27 PM
I'm trying to use something like this.

Code: [Select]
       
 if(GetPlayerState(STATE_DOWN)==true){
        fail = 1;
       }
        if(fail==1){

        score = 0;
}

But Danmakufu tells me that I'm missing arguments. Even though the Wiki says GetPlayerState only needs 1.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 19, 2013, 07:26:29 PM
I'm trying to use something like this.

Code: [Select]
       
 if(GetPlayerState(STATE_DOWN)==true){
        fail = 1;
       }
        if(fail==1){

        score = 0;
}

But Danmakufu tells me that I'm missing arguments. Even though the Wiki says GetPlayerState only needs 1.
There is an easier way to do what you're trying to do. Use ObjEnemyBossScene_GetInfo. This function can return both the number of times the player bombed and died during the current attack with the parameters INFO_PLAYER_SPELL_COUNT and INFO_PLAYER_SHOOTDOWN_COUNT. Look here (http://dmf.shrinemaiden.org/wiki/Boss_Scene_Object_Functions#ObjEnemyBossScene_GetInfo) for more info on this function.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 19, 2013, 10:30:08 PM
I still can't get it. No matter what, Danmakufu won't force the "score" varible to = 0.

Code: [Select]

score = ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE);

            if(ObjEnemyBossScene_GetInfo(objScene,INFO_PLAYER_SPELL_COUNT)>=1){
            fail = 1;

            }
if(fail==1){
score = 0;
}

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 19, 2013, 11:25:19 PM
I still can't get it. No matter what, Danmakufu won't force the "score" varible to = 0.

Code: [Select]

score = ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE);

            if(ObjEnemyBossScene_GetInfo(objScene,INFO_PLAYER_SPELL_COUNT)>=1){
            fail = 1;

            }
if(fail==1){
score = 0;
}
There doesn't seem to be anything wrong with that logic. Perhaps you should post the rest of the script.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 19, 2013, 11:56:50 PM
Ok.
http://pastebin.com/EjVJx0A3


Also, is there a function that is like CreateShotA from 0.12m? I'm trying to see if I can recreate my latest boss battle that I made(check my thread if you want to see it) in 0.12m which uses that function.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 20, 2013, 03:44:19 AM
Better:

Code: [Select]
@Event{
alternative(GetEventType())
case(EV_START_BOSS_SPELL){
SPELL_SCORE = 9999; //or whatever other initial value
}case(EV_PLAYER_SHOOTDOWN){
SPELL_SCORE = 0;
}case(EV_PLAYER_SPELL){
SPELL_SCORE = 0;
}
//others
}

Personally I would ignore the default spell score system entirely since getting INFO_SPELL_SCORE depends on things like an active timer and less importantly being an active spell card. It also changes values with its own system so yeah. Well, in the above EV_START_BOSS_SPELL requires an active spell by default too, but you can always hijack the event by calling NotifyEventAll(EV_START_BOSS_SPELL, 0) wherever you want.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 20, 2013, 06:56:21 PM
Thanks.

One more question, how do I make enemy and familiar scripts? The wiki doesn't say how to build a enemy script.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 21, 2013, 12:22:03 AM
Thanks.

One more question, how do I make enemy and familiar scripts? The wiki doesn't say how to build a enemy script.
I looked at Tree of Life by professor_scissors to see how it was done there, and then boiled it down a bit. Essentially you have three things. A function to create a general fairy (helpful since you'll be making a lot of these), a task to maintain the fairy (so the fairy dies when it should and all that sort of stuff), and a task to control the specific type of fairy. This stuff can be collapsed together to an extent, and ToF expands on it. The things look like this:

Code: [Select]
//A task that controls the movements of the fairies.
//Since some fairies fly in formation , I find it useful to make tasks for formations instead of individual fairies
task mixerFormation(x, dir) {
//create a fairy
//while(something) {
//move to some location
//yield;
//}
}

function CreateFairy(img, hp) { //Creating the fairy and passing the image and the hp of the fairy
let e = ObjEnemy_Create(OBJ_ENEMY); //lets create the enemy!
ObjEnemy_SetLife(e,hp); //seting HP
ObjEnemy_Regist(e); //regestering the enemy, whatever that exactly means
ObjPrim_SetTexture(e, GetCurrentScriptDirectory() ~ img);  //adding a texture
ObjSprite2D_SetSourceRect(e, 0, 0, 32, 32); //selecting the right texture
ObjSprite2D_SetDestCenter(e); //positioning the texture
FairyMaintenance(e); //starting the maintaining function
return e; //returning the ID of the fairy
}

task FairyMaintenance(fairy) {
while(!Obj_IsDeleted(fairy) && ObjEnemy_GetInfo(fairy, INFO_LIFE) > 0) { // tests if the fairy is still alive
ObjEnemy_SetIntersectionCircleToShot(fairy, ObjMove_GetX(fairy), ObjMove_GetY(fairy), 16); // if not, give it a radius to be hit by stuff
yield; //... you know what this does, right?
}
if(ObjEnemy_GetInfo(fairy, INFO_LIFE) <= 0 && !Obj_IsDeleted(fairy)) { //tests if the fairy is dead
Obj_Delete(fairy); //makes the fairy dead
}
}
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 21, 2013, 01:20:09 AM
So do I include this in Stage scripts? Or make single scripts and include them there?

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 21, 2013, 03:57:22 AM
Building an enemy script and launching it to spawn an enemy is the same as spawning a boss enemy, the main difference is the lack of a need for a boss scene. At least, from a stage.

You can just keep creating enemy objects from a boss script if you want familiars that don't run from their own scripts. You can even look at ExRumia for an example.

In other words it's even easier.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 21, 2013, 05:57:03 AM
Your way seems to work the easiest(it's pretty much like 0.12m), but after some testing I noticed that if I start the same script twice it will only show up once.

So say I use your method to create a enemy that shoots a bullet at the player, and I want 5 of the those enemies, Danmakufu will only create one even though I put StartScript in five times.
IDK, i'll see if Imosa's method works.

Nope tasking it didn't work. Danmakufu tells me I can't use @Initialize in the script I include it in.(Single or even Stage)

Here's the task. http://pastebin.com/w3GWVQYv
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 21, 2013, 09:04:45 PM
So do I include this in Stage scripts? Or make single scripts and include them there?
I had that code in a stage script and called it from the stage script. A more sophisticated and complex stage would probably want to include  it from another file.

Nope tasking it didn't work. Danmakufu tells me I can't use @Initialize in the script I include it in.(Single or even Stage)
I'm a little confused. I've never seen an error tell me that I can't use @Initialize, but the code you posted didn't seem to do anything radical so I don't see why it should be the cause. Clarify, are you putting this code in a new file and including that file, or are you just putting this code in your stage file.
The code you posted is wrong in a few places. Line 26 for example just says, GetX and GetY, and I have no idea what those variables are.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 21, 2013, 10:01:28 PM
I had that code in a stage script and called it from the stage script. A more sophisticated and complex stage would probably want to include  it from another file.
Ok, so include it stages like any other task.

I'm a little confused. I've never seen an error tell me that I can't use @Initialize, but the code you posted didn't seem to do anything radical so I don't see why it should be the cause. Clarify, are you putting this code in a new file and including that file, or are you just putting this code in your stage file.
The code you posted is wrong in a few places. Line 26 for example just says, GetX and GetY, and I have no idea what those variables are.

I gave variables in the script. But if I use that script the only way it works is if I include in another task and even then nothing happens.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on August 21, 2013, 10:11:05 PM
Danmakufu tells me I can't use @Initialize in the script I include it in.
The file you are including has another @Initialize in it, which is the cause of this error. Are you trying to include the previously mentioned script that you tried to start five times?

Also, that task closes the loop before it can do anything. I've made fixes to the pastebin you had given; they are found here () (http://pastebin.com/rLEDyar4) edit: that pastebin was wrong oops, http://pastebin.com/rLEDyar4 (http://pastebin.com/rLEDyar4)

The idea behind the changes I made are this: you create a basic fairy using CreateFairy, then after creating it, (using the object that was returned from the function) you use FairyMaintenanceA1 so that it follows the properties of that task. In this case, it will simply fire one shot every second downwards. If you wanted to have different properties for different fairies (because you won't be using the same fairy throughout the stage), simply make a new task, perhaps FairyMaintenanceA2, and define new actions for it to take.

Example:
Code: [Select]
loop(5){
let e = CreateFairy(img,rand(48,GetStgFrameWidth-48),rand(48,128),325,100,100);
FairyMaintenanceA1(e);
}
// remember that since it is returning a value, you can also shorten it like this
// (if you aren't planning on using the object id again):
// FairyMaintenanceA1(CreateFairy(img,rand(48,GetStgFrameWidth-48),rand(48,256),325,100,100));

If you still get errors I'd suggest posting the full script (and the one you are trying to #include as well)

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 21, 2013, 10:54:21 PM
The file you are including has another @Initialize in it, which is the cause of this error. Are you trying to include the previously mentioned script that you tried to start five times?

Also, that task closes the loop before it can do anything. I've made fixes to the pastebin you had given; they are found here (http://pastebin.com/hnwtRq15) (http://pastebin.com/hnwtRq15)

The idea behind the changes I made are this: you create a basic fairy using CreateFairy, then after creating it, (using the object that was returned from the function) you use FairyMaintenanceA1 so that it follows the properties of that task. In this case, it will simply fire one shot every second downwards. If you wanted to have different properties for different fairies (because you won't be using the same fairy throughout the stage), simply make a new task, perhaps FairyMaintenanceA2, and define new actions for it to take.

Ok so it works, but only in Single scripts, if I use a stage script the game will create the fairy but it won't do anything. But if I create the same fairy in a single script it works.

So how do I get it to work in a stage script or how do I code single scripts so that when all fairies are gone it closes the script?


EDIT: Also, I kinda used and did a few edits to MPP's lifebar script(though it doesn't delete when the boss dies) I want to know if it's ok to use it while I do give ido full credit?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 21, 2013, 11:24:30 PM
but after some testing I noticed that if I start the same script twice it will only show up once.
Nope. It would be so much more helpful for you to actually show us what the heck you're doing rather than do "testing" and then dismiss it.

Danmakufu will only create one even though I put StartScript in five times.
This is probably the problem. You don't just keep calling StartScript, you need to load the script again, wait to compile and start it. When you call LoadScript it returns the new script's ID, and will return a different script ID even if it's the same file. If you just call StartScript a bunch it'll just ignore it because the script with that ID has already started. In practice, you're going to want to load all of the scripts a bit earlier than when you want to start them in order to start them all in quick succession, because loading a script takes about a second.


Anyways, here's an example of spawning five enemies in one script that you can call from a stage.

http://pastebin.com/MGMtm6DT

Alternatively, you can do as I originally said and have just one enemy in the one script, and run the script multiple times.

Alternatively, you can plop all the relevant functions from the enemy script into the stage script and it should work fine too.

Note that I didn't bother with @Event, but really events are super useful and are a very good reason to use scripts to spawn enemies rather than just creating them using functions, especially in full stages/games.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 21, 2013, 11:47:51 PM
Thanks again, everyone is such a big help especially you Drake. Anyway, I probably won't need to use 0.12m anymore.

EDIT: Also, I kinda used and did a few edits to MPP's lifebar script(though it doesn't delete when the boss dies) I want to know if it's ok to use it while I do give ido full credit?

I still wanna know before I start working on it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 22, 2013, 07:02:18 AM
Note that I didn't bother with @Event, but really events are super useful and are a very good reason to use scripts to spawn enemies rather than just creating them using functions, especially in full stages/games.
Are you suggesting making and running an "enemy management" script that uses its @Event to summon enemies? Because I already have a sort of system like that with sounds and graphical effects. Would that be easier than just running enemy tasks from the stage?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 22, 2013, 09:47:53 AM
Not necessarily to summon enemies, but "management" was what I was going for with the script I posted, yes. The use of @Event would be more for things like "an enemy has been destroyed" or "signal this wave to explode" or anything else that signals across and/or requests information from other non-simple entities. A script that manages enemies is one idea that seems like it would be useful, but I haven't even thought about it much, never mind using it constructively yet. The main point is that having event handling cuts through a huge number of different blockades and unnecessary overcomplications people have encountered with 0.12 (the more obvious being "global" flags, stupid overuse of commondata, ridiculous function chaining, stages doing everything) and it really deserves some thought.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 22, 2013, 08:26:42 PM
Does anyone have a script that adds the Enemy Marker to the bottom of the screen, the one that follows the boss around? If not I think I could make one, but I would still need a sprite if anyone has one of those.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 22, 2013, 11:29:53 PM
If you want to just use graphics from the Touhou games, I have image rips available here.
http://www.shrinemaiden.org/forum/index.php/topic,197.0.html
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 22, 2013, 11:58:44 PM
If you want to just use graphics from the Touhou games, I have image rips available here.
http://www.shrinemaiden.org/forum/index.php/topic,197.0.html

Thank you very much!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 23, 2013, 04:40:25 AM
Does anyone have a background tutorial for PH3? even as simple as a non moving picture would do.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 23, 2013, 05:13:33 AM
Does anyone have a background tutorial for PH3? even as simple as a non moving picture would do.
There's no longer any real special background functions or anything like @Background. Drawing a background (especially a static one) is as simple as making an effect object and drawing an image with it. Just make sure that the priority is in the background.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 23, 2013, 05:15:17 AM
There's no longer any real special background functions or anything like @Background. Drawing a background (especially a static one) is as simple as making an effect object and drawing an image with it. Just make sure that the priority is in the background.

Wow they really made this much more simple, and then to add a effect filter over it just make a new effect object right?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on August 23, 2013, 05:23:11 AM
Wow they really made this much more simple, and then to add a effect filter over it just make a new effect object right?

Yes. Typically background management is done in a separate script which can be specified for use in a script's #Background section. You can look at how the default background script called "Default_Background_IceMountain.txt" does it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 23, 2013, 06:23:24 PM
1. http://www.mediafire.com/?dbtdzfbnuturnib (http://www.mediafire.com/?dbtdzfbnuturnib); Put #include"./Cutin.txt" in the header for the file you want the cutins to be added for. Keep in mind that depending on your file structure, you may have to edit the image paths in Cutin.txt. This is true when only white squares appear instead of the proper image. When editing the image paths, keep in mind that it is relative to the script calling Cutin.txt, not relative to Cutin.txt itself. Instructions on how to use the cutins are in Cutin.txt

2. You can do it in any script you desire, the key to getting it down is "display image and text; when shot button is pressed, move on". In the download for the cutins, I added a file that i was messing around with some time ago. This file contains a crude version of a Ten Desires conversation. Add #include"./EventTest.h" into the Sample.txt file to see how it works.

3.
Code: [Select]
let objFamiliar = CreateOption;

function CreateOption{
let obj = ObjEnemy_Create(OBJ_ENEMY);
ObjEnemy_Regist(obj);
ObjPrim_SetTexture(obj, familiarimage);
ObjSprite2D_SetSourceRect(obj, rec1, rec2, rec3, rec4);
ObjSprite2D_SetDestCenter(obj);
ObjEnemy_SetLife(obj, familiarlife);
return obj;
}
With the object id you get from this task, you may use it as you desire. Alternatively, you may edit this task to suit your needs for your familiar.

I'm using the cut in file from this post and I'm having a problem where the cut ins wont delete themselves, they stick on the screen and I was wonder if the creator is still around, or if anyone knows a function I can use to wipe the screen after each card.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Darkness1 on August 23, 2013, 07:19:02 PM
or if anyone knows a function I can use to wipe the screen after each card.
From the danmakufu wiki on ph3 functions:
Code: [Select]
SetAutoDeleteObject
Arguments:
    1) Boolean
Determines whether to delete all existing objects that were created in the script at its termination.
The default value is false.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 23, 2013, 07:36:54 PM
From the danmakufu wiki on ph3 functions:
Code: [Select]
SetAutoDeleteObject
Arguments:
    1) Boolean
Determines whether to delete all existing objects that were created in the script at its termination.
The default value is false.

That is so useful....
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 25, 2013, 10:14:27 AM
I noticed drawing order and 3D drawing in ph3 is a major headache compared to 0.12m. Replicating a stage from 0.12m ended up in a train wreck. For example in 0.12m I have  floor > walls > ceiling  drawing order. If I apply this in ph3 the results will be extremely wonky. The ceiling and floor will "bleed" through the walls and move at very odd speeds/perspective. So I had to change the order to   floor > ceiling > wall, because wall falls over the ceiling.

Now a question of my own: I have some issues regarding ADD type blending and fog.  ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
(http://i40.tinypic.com/11gp0rp.jpg)

in 0.12m the texture had the same effect, but not for the entire square , only the visible graphic itself.

Logically we can work around by altering alpha based on distance, though perhaps someone figured an easier way?

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 25, 2013, 02:48:13 PM
Why not create a 3D environment using Metasequoia? I never could get the 3D in 0.12m to work like I wanted it to.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on August 25, 2013, 04:04:37 PM
Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on August 25, 2013, 05:57:17 PM
Why not create a 3D environment using Metasequoia? I never could get the 3D in 0.12m to work like I wanted it to.
I guess because Metasequoia isn't freeware.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Sage Ω (Ultima) on August 25, 2013, 06:04:18 PM
There are freeware and shareware versions. Though the shareware version is limited unless you buy a license. Though the basic features should be good enough.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 25, 2013, 06:22:31 PM
One that that I've been doing to make my 3d backgrounds was to start in Google Sketchup. I like interface more, and its made for architecture so clean cut and simple structures go up better (as appose to the smooth flowing curves which other programs have to think about). Sketchup, however, does not have good support for VN mapping. So I suggest saving the Sketchup model as an .obj file and doing that elsewhere.
I've been able to do VN Metasequoia but I also want to check out other programs. If you look into other programs just make sure you can get a .obj out of it.
Finally you may only be using Metasequoia as a converter from .obj to .mqo.

Helpful hint: the danmakufu camera, when azumith and elevation are 0, looks down the x axis so along [-1,0,0], with up being up the y axis, so [0,1,0].

Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
I was only able to do this by making multiple piece of text and moving them into place.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 25, 2013, 07:53:56 PM
I appreciate the suggestion for meta, I have the program except modelling is hard and UV mapping is even harder.

Perhaps my question wasn't exactly well explained, I am looking for a fix with the fog + ADD as shown in the screenshot. I know the workaround thanks to discussing it on IRC with Drake, but i was wondering if anybody knows the fix.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on August 25, 2013, 08:16:22 PM
I was only able to do this by making multiple piece of text and moving them into place.
So, there is no easy and convenient way to do it... I guess I'll leave it till better times.
Thank you.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 25, 2013, 09:45:48 PM
So, there is no easy and convenient way to do it... I guess I'll leave it till better times.
Thank you.
Well, not as easy and convenient as you're looking for. For example, there is a function to calculate text length. You could use that to help figure out where you should place other pieces of text.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on August 25, 2013, 10:33:58 PM
The reason why I wanted a "convenient" way is because the placement of text is done on-the-fly. I didn't try it (yet?) but I doubt that it's possible to add support for automatic processing bold and normal text. If I would do it manually then yeah, it's not a bad option but this case is different.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 26, 2013, 02:01:00 AM
Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
1. You can escape double-quotes with a backslash, like "bla \"blablabla\"".
2. Nope. You could do it manually with some effort, indeed by breaking apart text objects and repositioning them, and that could support processing of certain flags if you wanted, but it wouldn't be worth it.

I'm more or less wondering why you need bold/italics in the first place.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 26, 2013, 05:22:34 AM
So I'm not sure if I expect anyone to know about this stuff but I guess I can try asking.
I wanted to try making a 3d object from scratch so I started putting relevant functions together. There's a lot of stuff that can go wrong here so I thought I'd see what other people thought of the code. Is this, at all, on the right track?
Code: [Select]
task triangleTest() {
let path = GetCurrentScriptDirectory ~ "/Corridor/testure.png"; //sets the path for the texture (object can't be seen without it)
let obj = ObjPrim_Create(OBJ_PRIMITIVE_3D); //Creates the object
ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN); //Sets the type of 3D object (why does this even need to be set?
ObjPrim_SetVertexCount(obj,3); //Creates some vertices (I'll need these)
ObjPrim_SetVertexPosition(obj,0,0,0,0); //Some conspicuous vertex placement
ObjPrim_SetVertexPosition(obj,1,0,100,100);
ObjPrim_SetVertexPosition(obj,1,0,0,100);
ObjPrim_SetTexture(obj,path); //sets the texture
ObjPrim_SetVertexUVT(obj,0,0,0); //UV mapping
ObjPrim_SetVertexUVT(obj,1,10,0);
ObjPrim_SetVertexUVT(obj,2,0,10);

Obj_SetRenderPriorityI(obj, 20); //A render priority
Obj_SetVisible(obj, true); //Would suck if this ended up being a problem

ObjRender_SetPosition(obj,0,0,0); //Added this, just to be safe.
}

Also I tried editing the vertices of a mesh with ObjPrim_SetVertexPosition, and that didn't work. Is there anyway to edit meshes?

EDIT: I fixed the code above, Line 8 I only set 2 vertices on accident. I've now got something showing up.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 26, 2013, 06:25:05 AM
Quote
//Sets the type of 3D object (why does this even need to be set?
(http://i.imgur.com/YzxVGlx.png)
Stands for 3D primitives.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on August 26, 2013, 07:47:38 AM
1. You can escape double-quotes with a backslash, like "bla \"blablabla\"".
2. Nope. You could do it manually with some effort, indeed by breaking apart text objects and repositioning them, and that could support processing of certain flags if you wanted, but it wouldn't be worth it.

I'm more or less wondering why you need bold/italics in the first place.
1) Yeah, just found the same solution to use backslash before double quote. Anyway, thank you :)
2) Well, I'm trying to make terrible translation patch for MPP using text from wiki. Some words in the translation are marked as italic and I'm not sure how should I deal with them - try to mark them in similar way (which was shown to be complicated), leave them as normal words (like I did for now) or rephrase translation in such a way where they aren't necessary (which is out of my skills).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 26, 2013, 01:22:35 PM
(http://i.imgur.com/YzxVGlx.png)
Stands for 3D primitives.
But why even have these? Its not like these are the only shapes one wants to make so is it just for convenience sake?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 26, 2013, 03:05:31 PM
Actually, 0.12m effect objects always revolved around the usage of Primitive Strip using 4 vertexes. Just because ph3 has sprite objects now doesn't mean they are useless. They are examples to explain how each primitive type works. You know, useful for reference.

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: fondue on August 27, 2013, 03:07:27 PM
what is the trigonometry for creating the positions (x and y coordinates) of pentagrams and possibly stars?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 27, 2013, 11:02:56 PM
(http://31.media.tumblr.com/1f887fc91ef35001fe80ebaee1d22f8c/tumblr_mjoi08lXQP1s5nl47o1_500.gif)

have fun


It's much easier to draw lines from points. From an arbitrary point you can draw a line of some length, then you turn 144 degrees and draw another line, then you turn -72 and draw another, repeating until done. Or, you can take five points on a circle at 72 degree intervals, then another five points on another circle, and connect them with lines. And so on.

For pentagrams it's just starting from a point and drawing five lines turning 144 degrees.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 28, 2013, 06:45:09 AM
Okay so I have this cool snip of code
Code: [Select]
task TArrowShot(num, x, y, a, s)
{
let numcount = num;
let count = 1;
loop(num)
{
let turns = 0;
loop(count)
{
TSimpleShot(x - (20*turns), y + (20*numcount, a, s);
TSimpleShot(x + (20*turns), y + (20*numcount), a, s);
turns ++;
}
count = count * 1.5;
numcount--;
}
}

Which creates a group of bullets alignes in a stacking triangle shape like this:
||||||||
  ||||||
    ||||
       ||
It looks great, however I need to to rotate with the bullet angle so that the point of my bullet triangle is facing the angle direction. I need them to rotate as a group and I know it has something to do with cos and sin but I cannot figure out how to do it.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Maths ~Angelic Version~ on August 28, 2013, 08:08:09 PM
Animejunkey: To do that, you'll need to know about rotation matrices or something similar. I ended up using this:
Code: [Select]
task TArrowShot(num, x, y, a, s)
{
let numcount = num;
let count = 1;
loop(num)
{
let turns = 0;
loop(count)
{
TSimpleShot(x + cos(a-90)*(-20*turns)-sin(a-90)*(20*numcount), y + sin(a-90)*(-20*turns)+ cos(a-90)*(20*numcount), a, s);
TSimpleShot(x + cos(a-90)*(20*turns)-sin(a-90)*(20*numcount), y + sin(a-90)*(20*turns)+ cos(a-90)*(20*numcount), a, s);
turns ++;
}
count = count * 1.5;
numcount--;
}
}}
Currently, "a" is the angle the bullet triangle will face. I know this code is anything but pretty, but I don't know any more efficient way (you can define variables to avoid all those instances of "a-90", "20*turns", and "20*numcount", but that's about it, as there will be sines and cosines no matter what you do).
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Imosa on August 28, 2013, 08:12:59 PM
You don't NEED rotation matricies to do it but they would certainly help. 
I mention this because while rotation matricies certainly solve the problem, they also require knowledge of matricies which don't really make sense until you encounter more advanced problems to apply them to.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 28, 2013, 08:22:28 PM
Animejunkey: To do that, you'll need to know about rotation matrices or something similar. I ended up using this:
Code: [Select]
task TArrowShot(num, x, y, a, s)
{
let numcount = num;
let count = 1;
loop(num)
{
let turns = 0;
loop(count)
{
TSimpleShot(x + cos(a-90)*(-20*turns)-sin(a-90)*(20*numcount), y + sin(a-90)*(-20*turns)+ cos(a-90)*(20*numcount), a, s);
TSimpleShot(x + cos(a-90)*(20*turns)-sin(a-90)*(20*numcount), y + sin(a-90)*(20*turns)+ cos(a-90)*(20*numcount), a, s);
turns ++;
}
count = count * 1.5;
numcount--;
}
}}
Currently, "a" is the angle the bullet triangle will face. I know this code is anything but pretty, but I don't know any more efficient way (you can define variables to avoid all those instances of "a-90", "20*turns", and "20*numcount", but that's about it, as there will be sines and cosines no matter what you do).

This works perfectly! thank you!
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: animejunkey54 on August 28, 2013, 10:26:01 PM
Got another one for you guys, this one isn't a math problem though, I just cannot figure out whats wrong.

Code: [Select]
loop(20)
{
let x = rand(50, GetStgFrameWidth()-50);
let y = rand(50, GetStgFrameHeight()-50);
let count = 0;
while(count <= 300)
{
if(truncate(GetPlayerX()) == x+count || truncate(GetPlayerY()) == y+count || truncate(GetPlayerX()) == x-count || truncate(GetPlayerY()) == y-count)
{
x = rand(50, GetStgFrameWidth()-50);
y = rand(50, GetStgFrameHeight()-50);
count = 0;
}
count++;
}
CreateStraightLaserA1(x, y, 0, 75, 10, 120, DS_BALL_M_PURPLE, 30);
CreateStraightLaserA1(x+75, y+75, 180, 75, 10, 120, DS_BALL_M_PURPLE, 30);
CreateStraightLaserA1(x, y+75, 270, 75, 10, 120, DS_BALL_M_PURPLE, 30);
CreateStraightLaserA1(x+75, y, 90, 75, 10, 120, DS_BALL_M_PURPLE, 30);
TRingShot(x+37.5, y+37.5, 2, 12);
loop(5){yield}
}

This creates 20 squares made of 4 lasers each. Then a burst of bullets shoots from inside. The problem is I can;t have these boxes spawn too close to the player, so i added that while function. The function should keep the boxes at a 300 unit distance from the player, by getting a new random top left if the box would spawn over the player, but its not working and I have no idea why.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on August 28, 2013, 11:06:14 PM
Next time, when you say something is wrong, please also describe what is going wrong, not just what you want and "it isn't working". It helps.

let x = rand(50, GetStgFrameWidth()-50);
let y = rand(50, GetStgFrameHeight()-50);
while( (GetPlayerX() <= x+375 && GetPlayerX() >= x-300) || (GetPlayerY() <= y+375 && GetPlayerY() >= y-300) ){
   x = rand(50, GetStgFrameWidth()-50);
   y = rand(50, GetStgFrameHeight()-50);
}


Better? Or did I misunderstand the intent?

That being said, the problem is that 300 pixels is quite a distance. The horizontal width of the play area is 384 pixels, and your bounds end up giving you 16 pixels of space. Vertically you have 48 pixels left. So it's possible to spawn, but not if you want the whole 75x75 box 300 pixels away.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Jonath on August 30, 2013, 11:29:59 PM
Hello there.

Sorry if it already has been asked but does anyone actually knows how to do user defined item scripts ?
I'd like to be able to change the default graphics without having to edit the image.
And using the danmakufu functions lie CreateItemU1 seems to be a rather good option.
I could create these objects on my own but it would be such a pain...

Thank you in advance ^^
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on August 31, 2013, 05:07:57 PM
Odd question. I cannot seem to summon multi-dimensional arrays. I ported my code 1:1 from 0.12m to ph3 (assuming arrays were the same) but I get the error "Out of range".

in 0.12m, arrays were just made. You usually defined let array;  and then  array = [ ] or [ [],[] ] and you were done. Ph3 doesn't seem to like this. For an array, you're forced to define the variable to be an array ( let array = []; ) However, how does one define a multi dimensional array?  Cannot find the documentation on the wiki either. (Or I am missing something).

Edit:
Fixed by forum and IRC effect. orz Thanks though all helped. But it was my own dumb mistake.

[19:57:29] <Helepolis> ok
[19:57:36] <Helepolis> I seem to have done some extremely dumb.
[19:57:44] <Helepolis> My apologies.
[19:57:59] <Helepolis> Happens that I had a seperate task, which I didnt properly activate, which parsed values to the array
[19:58:17] <Helepolis> Which is why the array kept saying "I am out of range" because it had no defined element.
[19:58:22] <Helepolis> All is ok now. =.=

Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 05, 2013, 09:03:24 PM
Requesting assistance to confirm a bug in ph3 version pre15.

Please do the following.
[Step 1]
- http://www.mediafire.com/?8am51bbqib1vh2d   Get the test script here.
- Unzip it somewhere in a test folder inside script or put it somewhere in Rumia folders.
- Launch my script .
- Look at the cube/lantern, it should look normal.

[Step 2]
- Don't close ph3, edit the code and uncomment "SetCameraPerspectiveClip(0,1024);"
- Rerun the script
- The lantern should look weird now.  Like this http://i44.tinypic.com/33bio1z.png

[Step 3]
- Don't close ph3, edit the code and comment out the Perspecticeclip code by adding // again.
- Rerun the script.
- It should still be messed up.
- Reboot ph3.
- Rerun script.
- It should be normal again.

Please confirm the steps by saying Step 1 - confirmed or  unconfirmed. I already made a post on BBS of ph3 website to address it, but confirmations would be required from our side as well.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Kingault on September 05, 2013, 09:23:39 PM
Requesting assistance to confirm a bug in ph3 version pre15.

Please do the following.
[Step 1]
- http://www.mediafire.com/?8am51bbqib1vh2d   Get the test script here.
- Unzip it somewhere in a test folder inside script or put it somewhere in Rumia folders.
- Launch my script .
- Look at the cube/lantern, it should look normal.

[Step 2]
- Don't close ph3, edit the code and uncomment "SetCameraPerspectiveClip(0,1024);"
- Rerun the script
- The lantern should look weird now.  Like this http://i44.tinypic.com/33bio1z.png

[Step 3]
- Don't close ph3, edit the code and comment out the Perspecticeclip code by adding // again.
- Rerun the script.
- It should still be messed up.
- Reboot ph3.
- Rerun script.
- It should be normal again.

Please confirm the steps by saying Step 1 - confirmed or  unconfirmed. I already made a post on BBS of ph3 website to address it, but confirmations would be required from our side as well.

Confirmed. It looked fine in step 1, but when I uncommented it, this (http://gyazo.com/48e44f34c4e9289697988f11ed30a05c) happened.
Glad I could be of assistance.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on September 09, 2013, 10:49:26 PM
Code: [Select]
@Initialize
{
  enemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  ObjEnemy_Regist(enemy);
  Work;
}

//...

task Work
{
   let child = ObjPrim_Create(OBJ_SPRITE_2D);
   ObjPrim_SetTexture(child, texture);
   //set rects, blah blah

   while(!Obj_IsDeleted(enemy)) { ObjRender_SetPosition(child, ObjMove_GetX(enemy), ObjMove_GetY(enemy), 0); yield; }
}

child is always lagging one frame behind the enemy object. Is there a way to prevent this other than doing something like
Code: [Select]
let x = ObjMove_GetX(enemy) + cos(ObjMove_GetAngle(enemy)) * ObjMove_GetSpeed(enemy);
let y = ObjMove_GetY(enemy) + sin(ObjMove_GetAngle(enemy)) * ObjMove_GetSpeed(enemy);
ObjRender_SetPosition(child, x, y, 0);
because it looks kinda clunky
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 09, 2013, 11:51:07 PM
What you have should be fine as long as the enemy is moving before the child is. I suspect that the child's movement is being set before the main enemy's, whether it means you just called it sooner or something sillier is happening.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on September 10, 2013, 12:16:29 AM
I'm randomly calling SetDestAt#### in some task to move the enemy. I tried swapping Work with said task and putting Work right after SetDestAt####, same result. I have no control over the two objects' update order :(
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 10, 2013, 04:03:03 AM
Welp, SetDest functions use the SetSpeed/Angle functions which move the object separately after @MainLoop (but before drawing), as I forgot. Clearly this should be the case, since the full movement for that frame is a vector that depends on the values of both; otherwise the speed and angle would potentially be off-sync, as if you did angle++; x+cos(angle)*speed; speed++; rather than intending for the movement to update both. The best way to resolve this would be to be able to manually short-execute the movement lined up for that frame rather than waiting after @MainLoop, but I don't think this is currently possible.

I might ask for this to be added, barring some solution I'm not aware of that isn't "do it yourself". If this is that big of a deal you could just write a task that takes the same arguments and moves the object manually.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on September 11, 2013, 07:51:49 AM
Thanks for the explanation! And no, no need to ask for it to be added; I actually can't think of a lot of scenarios where I truly need to tamper with that.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 15, 2013, 01:46:36 PM
Attention ph3 scripters using meshes and perspectiveclip function. Mkm has confirmed it to be a bug and will work on it in the next version. Temporarily work around is to set the first parameter to minimum of 1. This will make your meshes appear correctly.

--Helepolis
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MoonRabbit on September 16, 2013, 11:06:57 AM
Harro  :3
I'm making a Danmakufu project with my friends (prepare to see it here someday!). In order to learn the language I use the wiki here and the huge script "Mystical Power Plant".
Now, this is what they (MPP) do every time they want to play a sound effect:
Code: [Select]
task PlaySEs(se){
let sid = ObjSound_Create;
let SE = GetAreaCommonData("Option","SE_Volume",100);

ObjSound_Load(sid,se);
ObjSound_SetVolumeRate(sid,SE);
ObjSound_SetLoopEnable(sid,false);
ObjSound_Play(sid);
SEwait(180,sid);
}

They use this function ^

My question: wouldn't it be much more efficient to load all the sound effects one time at @init and delete them one time at @finalize?
From what I understand, they load the graze.wav file into memory every time the player grazes!

What am I missing?

(Also, same question goes for textures - should I load them once or every time I use them? MPP Loads them every time)


Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: gtbot on September 16, 2013, 05:13:09 PM
My question: wouldn't it be much more efficient to load all the sound effects one time at @init and delete them one time at @finalize?

(Also, same question goes for textures - should I load them once or every time I use them? MPP Loads them every time)
It would probably be more efficient to just create one set of sound effect objects at the beginning of the game, then store them in common data for any other script to pull and use. I would assume the same for images as well, but loaded and unloaded at the beginning of stages so you don't get lag spikes (due to loading) when a boss first appears, and to get rid of the no longer needed images.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Necrotek on September 16, 2013, 05:30:30 PM
What I find to be really annoying and strange is that they store all character images at the start of the game (taking ~500mb of RAM for that) and never unload them. But the game lags a lot when the levels start and after beating a mid-boss (it would be better to load the whole level at the start of the level). They didn't really bother to optimize the game.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 16, 2013, 06:11:19 PM
I have been discussing this on IRC as well while analysing the script. The author of MPP seems to have multiple PlaySEx going around in this work. If you noticed, some of them have different wait functions delaying the deletion.

God knows why the author decided to do it like this, as it doesn't give any benefits over the regular PlaySE in terms of memory/usage, except for the control of the sound. Which is questionable, as some sound functions don't do anything like the Division function to set it to SE or BGM. By the looks of this function, it appears as if each sound object is unique and separately controlled. It is not.

Somehow ph3 ignores the unique obj id for sounds, therefore if you delete the sound object, all sounds will stop playing (being deleted).

I wouldn't know why commondata would be useful here.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MoonRabbit on September 17, 2013, 11:08:23 AM
Well, I've done some research. Here are my findings:
1. LoadTexture function actually loads the texture into the ram (you can see it in the task manager). If you try to load twice, it will ignore the second one. If you load a texture in one script, it will apply to all scripts.
2. I tried the same thing with LoadSound with a huge file, but the RAM didn't go up! So I used procmon and found this out -
What LoadSound does is to open a handle to the file. When you use PlaySE, it starts reading the file.

So - loading texture in the beginning is essential, but loading sound in the beginning only saves you the CreateFile phase (getting a handle to the file).
Also, if you use LoadSound then you can only play it on the same script, so trying to load everything together is a pain.

So...... maybe the function I showed in my last post does make sense?! I am so confused.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: ExPorygon on September 17, 2013, 10:57:12 PM
Somehow ph3 ignores the unique obj id for sounds, therefore if you delete the sound object, all sounds will stop playing (being deleted).
I don't think that it ignores the obj id for sounds. I think what it does instead is deletes the sound (or the file handle of the sound) from memory when any object with that sound loaded is deleted. As to why it does this, I have no idea. It makes playing the same sounds together difficult.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 18, 2013, 05:48:41 AM
Ah! Indeed now I remember again, you're correct Ozzy. My bad for wording it wrong. Indeed, it was regarding the same sound file though the deal stays the same. Same sound file or not, it should create a unique ID for each one and not delete them all together. Textures are pretty much handled the same way in terms of object handling.

Edit
It seems we have discussed this before on page 24 of this thread. http://www.shrinemaiden.org/forum/index.php/topic,10181.msg1004887.html#msg1004887

Talk about my bad memory orz.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Monkeypro257 on September 19, 2013, 04:02:32 AM
I need help with basically everything. (well not really) I got all the correct functions in Initialize and Event, but when I test it out in Danmakufu the folder doesn't seem to have anything even though it's suppose to. I can't seem to get what's wrong in the folder's script. I'm using NotePad++.

Code: [Select]
#Touhou Danmakufu[Single]
#ScriptVersion[3]
#Title[""]
#Text[""]

let boss Obj;
let bossX = 0;
let bossY = 0;
let imgBoss = C:\Users\my computer's name :V\Desktop\Touhou Games\th_dnh_ph3\th_dnh_ph3\script\Tutorial ~ "HTDRB.png";

@Initialize (
// define a boss in bossObj and register it
bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist(bossObj);

// texture the boss, set centre as true centre.
objPrin_SetTexture(bossObj,imgBoss);
ObjSprite2D_SetSourceRect(bossObj,0,0,240,311);
ObjSprite2D_SetDestCenter(bossObj);

// move boss to desired x y locations at desired speed
ObjMove_SetDestAtSpeed(bossObj,192,120,5);

)

@Event (
// setting the boss timer and life
alternative(GetEventType())
case(EV_REQUEST_LIFE) (
SetScriptResult{1500};
)
case(EV_REQUEST_TIMER) (
SetScriptResult(60);
)
)

@MainLoop (

)

@Finalize (

)



And, yes, Helepolis, I was looking at your how-to video. ::)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 19, 2013, 04:42:59 AM
#Touhou Danmakufu[Single]
#ScriptVersion[3]
#Title[""]
#Text[""]

let boss Obj;
let bossX = 0;
let bossY = 0;
let imgBoss = C:\Users\my computer's name :V\Desktop\Touhou Games\th_dnh_ph3\th_dnh_ph3\script\Tutorial ~ "HTDRB.png";

@Initialize (
   // define a boss in bossObj and register it
   bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
   ObjEnemy_Regist(bossObj);
   
   // texture the boss, set centre as true centre.
   objPrin_SetTexture(bossObj,imgBoss);
   ObjSprite2D_SetSourceRect(bossObj,0,0,240,311);
   ObjSprite2D_SetDestCenter(bossObj);
   
   // move boss to desired x y locations at desired speed
   ObjMove_SetDestAtSpeed(bossObj,192,120,5);
   
)

@Event (
   // setting the boss timer and life
   alternative(GetEventType())
   case(EV_REQUEST_LIFE) (
      SetScriptResult{1500};
   )
   case(EV_REQUEST_TIMER) (
      SetScriptResult(60);
   )
)

@MainLoop (
)
@Finalize   (
)


you are amazing
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Formless God on September 19, 2013, 04:45:09 AM
Did you type that from memory or your code actually looked like that? There are typos gdi drak

Code: [Select]
C:\Users\my computer's name :V\Desktop\Touhou Games\th_dnh_ph3\th_dnh_ph3\script\Tutorial ~ "HTDRB.png";needs to be
Code: [Select]
"C:/Users/my computer's name :V/Desktop/Touhou Games/th_dnh_ph3/th_dnh_ph3/script/Tutorial/HTDRB.png";The slash is /, not \. I'm not sure about that colon in the path. I'd take it out if I were you. Or just use relative pathing.
Code: [Select]
let csd = GetCurrentScriptDirectory();
let imgBoss = csd ~ "img.png"; //if picture is in the same folder as script
//or
let imgBoss = csd ~ "subfolder/img.png"; //if picture is in a subfolder

Yield the MainLoop.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 19, 2013, 04:52:18 AM
DNH paths start at its root, not the drive root. You don't need to yield the MainLoop if there's nothing else yielding for it.

Also look at the previous page for rest of comments because page'd.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 19, 2013, 05:53:13 AM
And, yes, Helepolis, I was looking at your how-to video. ::)
That is good to hear people picking it up, although as Drake and Formless have pointed out, there is a lot of things wrong with your script. Are you sure you viewed my how-to video correctly? I don't remember using parentheses instead of curly brackets :( You might want consider re-watching it carefully and view the sample script and compare it with your own.

Also you might want to read into this  (http://www.shrinemaiden.org/forum/index.php/topic,4752.0.html) regarding setting directories for your images.
Quote
Golden rule: Never, EVER use full pathnaming directly from your Harddisk, personal folders or anything.

Good luck  :ohdear:
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KuroArashi100 on September 19, 2013, 06:55:27 PM
So, I just started with ph3 and it is kind of confusing.
There is so much stuff that I don't know where to start...

But I had a question.
While trying to animate the boss sprite, I ran into a problem.
The task is here (http://pastebin.com/wDd9CbNS).
It displays the animation, and the attack sprite displays correctly, but while moving the the character it instantly skips to the last picture instead of displaying them all.
Does anybody know what I'm doing wrong?

And is there a kind of SetMovePosition03 for ph3?
I know about ObjMove_SetDestAtWeight, but is there a version that works with a specified amount of time instead of a maximum speed?
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on September 19, 2013, 07:06:28 PM
You are increasing "f" every frame when the boss is moving, but you are also declaring "f" as "0" in each iteration of the while loop; this must be interfering with the animation itself. Also, what you are looking for is ObjMove_SetDestAtFrame.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Monkeypro257 on September 19, 2013, 09:50:37 PM
Thanks for the responses. I NOW understand what you meant by full pathnaming from my harddisk.

PS: The curly brackets looked like regular parentheses in the vid. (damn, got to get my glasses up-to-date >.<)


EDIT: Well I fixed some things, but I'm glad that it at least appears when I select it in danmakufu. (obviously I still have some errors to attend to)
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: KuroArashi100 on September 20, 2013, 05:48:29 AM
You are increasing "f" every frame when the boss is moving, but you are also declaring "f" as "0" in each iteration of the while loop; this must be interfering with the animation itself. Also, what you are looking for is ObjMove_SetDestAtFrame.
I managed to find that out myself, somewhere during four 'o clock at night.
It is an error that I made a few times before, because the usually new thing I am trying(such as effect objects or the new engine) diverts all of my concentration.
But thanks anyway, and I'll try not to make this error again.

Also, I guess I worded my second question wrong.
What I meant to ask was "Is there a movement function that has a weight system(it slows down at the end of the movement) but works with a specified time instead of movement speed like the SetMovePosition03 from the old engine?"
Because ObjMove_SetDestAtFrame doesn't seem to slow down at the end of the movement. It doesn't have a weight parameter either.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Shadow on September 20, 2013, 05:59:30 AM
There is currently no such movement function, though you can define one yourself, of course. An easier way (though not 100% accurate) way to achieve what you want would be calculating the distance from the boss to the target coordinates, and then dividing it by the desired amount of frames--this should then go in the "speed" parameter.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Drake on September 20, 2013, 07:38:17 AM
It should be easy enough to define yourself, the main issue is figuring out exactly how you want your movement to be regulated. If you want to travel for a certain amount of frames it would be really easy to just have another time parameter that starts slowing you down at that point until the end.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: Helepolis on September 23, 2013, 09:36:06 AM
I am still heavily confused with the 3D stage drawing issues/glitches. Either I am doing something wrong or there is something wrong with the ph3 engine.

My code is ported from 0.12m to ph3 style functions. 3D sprites in my stages are bleeding through the 3D sprites "closer" to the camera. As if the sprites behind other sprites are forcefully drawn instead of partially obscured/blocked by the sprites in front of them. I thought Z-buffering manages this but somehow it doesn't occur.

I'll try to post some screenshots soon to clarify this, right now just raising the point in case someone else has encountered this as well.

Edit:
Ok it seems I was doing something wrong, but only with version 0.16+ / 17. Because I am bloody sure in 0.14/15 this wasn't correctly working.

Here is what you need to keep in mind for painless 3D stage modelling and mesh usage. ObjRender_SetZWrite(obj,true); for 3D sprites and SetCameraPerspectiveClip(1,param2); The minimum draw distance has to be one according to the author. I cannot explain it technically, maybe someone else can.

This is what happens if you're using no SetZWrite on the 3Dsprites and set it to true after setting CameraPerspective to minimum of 1 as well.

We can clearly note the floor bleeding through the left wall. There is a drawing order going on here as well. Leftwall >> Floor >> Rightwall.
[attach=1]

The drawing order has not been changed, only ZWriting is enabled on the sprites.
[attach=3]


If we turn our camera bit more around, we can note the lantern is bleeding through the wall. SetCameraPerspectiveClip(0,4096);  and no ZWrite. Same drawing order.
[attach=2]

Applying ZWrite and minimum of the perspectiveclip takes away all problems it seems. Drawing order remains unchanged.
[attach=4]


ZWriting was not functional in 0.14, as I had discussed this on IRC with Azure and Blargel before. Apparently after my bug report, the mkm-san has fixed it. This makes me a very very happy person. As yesterday I was tearing my hair out for the annoying bleeding on my 3rd stage. When I get home, I will confirm 100% that this method works. Right now I am at work, orz.


Edit 2:
Confirmed, applying ZBuffer for meshes and sprites takes away all your headaches. Drawing order only matters in sense of logic, instead of headache fixing

Also I would advise to use SetCameraPerspectiveClip(10,<yourdesiredmaximumclip>); Basically a minimum of 10, as this seems to give the best drawing results.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 24, 2013, 01:44:56 AM
My script is going out pretty good. The only thing that's wrong is that the boss won't show up when I start the match. Any suggestions to why?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Drake on September 24, 2013, 04:39:24 AM
No, because you've given basically no information about what you're already doing. Answer might as well be "you never drew it".
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 24, 2013, 05:10:11 AM
Sorry, I thought I lost it for a sec, but I found it somewhere in my folders.  :X

Code: [Select]
#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Decisive battle"]
#Text["A random battle"]

let bossObj;
let bossX = 0;
let bossY = 0;
let imgBoss = "script/tutorial/system ~ HTDRB.png";

@Initialize {
// define a boss in bossObj and register it
bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist(bossObj);

// texture the boss, set centre as true centre.
ObjPrim_SetTexture(bossObj,imgBoss);
ObjSprite2D_SetSourceRect(bossObj,0,0,240,311);
ObjSprite2D_SetDestCenter(bossObj);

// move boss to desired x y locations at desired speed
ObjMove_SetDestAtSpeed(bossObj,192,120,5);

}

@Event {
// setting the boss timer and life
alternative(GetEventType())
case(EV_REQUEST_LIFE) {
SetScriptResult(1000);
}
case(EV_REQUEST_TIMER) {
SetScriptResult(45);
}
}
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Helepolis on September 24, 2013, 05:53:49 AM
Code: [Select]
let imgBoss = "script/tutorial/system ~ HTDRB.png";
Don't you think something looks odd in this line? I have no idea what you're trying to do with system ~ HTDRB.png image, but the tilde usually goes when you use:  GetCurrentScriptDirectory ~ "........." and such.

Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Drake on September 24, 2013, 06:19:27 AM
"script/tutorial/system ~ HTDRB.png" is not the string you want.

These are arrays:
[1, 7, 9, 10, 9]
['D', 'r', 'a', 'k']
"Drak"

In particular, "Drak" is the same thing as ['D', 'r', 'a', 'k']. Strings are just arrays of characters.

Now ~ is the concatenation operator. A ~ B attaches the array B to the end of A given they have the same dimension. Since strings are arrays of characters, they work the same.
['D', 'r', 'a', 'k'] ~ ['e'] and "Drak" ~ "e"  will both give "Drake" and ['D', 'r', 'a', 'k', 'e'].

However "Drak" ~ 'e' does not work since it's essentially trying to do ['D', 'r', 'a', 'k'] ~ 'e', but 'e' is not an array so it will fail. "Drak" ~ ['e'] would work though!

When you use GetCurrentScriptDirectory(), it returns a string with the script's folder, from the DNH root. Like if your script was in the script/tutorial/system folder, GetCurrentScriptDirectory() would return "script/tutorial/system/". This is why when you see it it's usually in the form GetCurrentScriptDirectory() ~ "file.png": this would give "script/tutorial/system/" ~ "file.png" which would be "script/tutorial/system/file.png".

Now the problem by now should be obvious, your string is not what you intend it to be, it's currently looking for a file called "system ~ HTDRB.png" in the script/tutorial directory. While "script/tutorial/system/" ~ "HTDRB.png" would work, it's pretty much redundant since you can just do "script/tutorial/system/HTDRB.png". Clear enough?


Also you need to load the graphic.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: ExPorygon on September 24, 2013, 07:29:18 AM
Also you need to load the graphic.
As of ph3 you actually don't have to manually load graphics for them to show up anymore.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Helepolis on September 24, 2013, 07:41:11 AM
True, you don't need to load your graphic any more in advance, though I would heavily suggest people to do so. Just to keep the flow going of understand that you're preloading textures in order to improve load-times later on your game. For small scripts it is logically not noticeable but better to discipline from the beginning.

Although ph3 makes it dead easy later on to write a separate function/task to load them.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 24, 2013, 01:13:09 PM
So there are 2 options with it.
Code: [Select]
let imgBoss = GetCurrentScriptDirectory ~ "HTDRB.png";or
Code: [Select]
"script/tutorial/system/HTDRB.png";
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Helepolis on September 24, 2013, 01:36:02 PM
So there are 2 options with it.
Code: [Select]
let imgBoss = GetCurrentScriptDirectory ~ "HTDRB.png";or
Code: [Select]
"script/tutorial/system/HTDRB.png";
Don't just assume solutions as they are. The reason Drake has explained it is to make you aware of what you're trying to do with the tilde.

GetCurrentScriptDirectory is a build in function that retrieves the path where the script is located. GetCurrentScriptDirectory ~ "HTDRB.png"; is only going to work if your image is inside the same directory as the script. Roughly guessing; I suspect it is not, so it won't work.

You need to understand what the function does and how pathing works in order to properly apply it. Did you read the tutorial (http://www.shrinemaiden.org/forum/index.php/topic,4752.0.html) about relevant and absolute pathing? It is quite insightful and will save you headache for the future.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Darkness1 on September 24, 2013, 07:21:46 PM
Apparently I don't really know that well how vertexes are connected together, or something else just got entirely wrong. So, if anyone feels like enlightening me about the subject:
http://pastebin.com/iJQkXuCu (http://pastebin.com/iJQkXuCu)

To answer some questions first:
- Yes, it is really messy.
- HBobj is defined in another part of the script.
- The script works fine for creating a circular graphic, but when the life value changes, the vertexes at the edge between the full bar and the empty bar graphic starts pointing in strange directions.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 24, 2013, 09:44:50 PM
Well I do now understand how relative and absolute works so thanks. (Didn't get it the first time that much)
Though the problem still exists.
Code: [Select]
let imgBoss = GetCurrentScriptDirectory ~ "systemHTDRB.png";The graphic is in the system folder now.

PS: The image was in the same directory as in the script in my other attempt with just "HTDRB.png".
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: MoonRabbit on September 24, 2013, 10:00:11 PM
Well I do now understand how relative and absolute works so thanks. (Didn't get it the first time that much)
Though the problem still exists.
Code: [Select]
let imgBoss = GetCurrentScriptDirectory ~ "system\HTDRB.png";The graphic is in the system folder now.

PS: The image was in the same directory as in the script in my other attempt with just "HTDB.png".
"\" is an escape character, so the program parses "\H" as one character. You can use this for special characters,  for example: "\n" is a new line.

If you want to insert a slash inside a string, you can either use "\\" (which the program will parse as one real slash) or a backwards slash "/".
I personally prefer using the "/".
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Formless God on September 25, 2013, 01:55:40 AM
Code: [Select]
system/
"HTDB.png" won't give anything if your file is HTDRB.png
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 25, 2013, 02:08:27 AM
Code: [Select]
system/
"HTDB.png" won't give anything if your file is HTDRB.png

 That was a typo. . .  :derp:
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Helepolis on September 25, 2013, 06:28:22 AM
If you used forward slashes and your image still doesn't show up, it can only mean your image is most likely corrupt or faulty. Try to load an alternative image or any image just to secure your code is working. If your code works then you can safely conclude the image is corrupt. Try to re-save it as PNG in Gimp/photoshop.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Monkeypro257 on September 25, 2013, 10:16:19 PM
Finally the image showed up, thanks for all the trouble. (The re-saving it in GIMP suggestion, worked!)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: professor_scissors on September 27, 2013, 03:54:20 AM
Is there any way to change the rendering priority of specific bullets to ensure that they appear over other bullets? Obj_SetRenderPriority doesn't seem to be working.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: ExPorygon on September 27, 2013, 04:01:41 AM
Is there any way to change the rendering priority of specific bullets to ensure that they appear over other bullets? Obj_SetRenderPriority doesn't seem to be working.
I'm PRETTY sure that Obj_SetRenderPriority works on bullets now. Is your ph3 up to date?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: professor_scissors on September 27, 2013, 04:09:22 AM
Oh hey, I'm five builds behind. I guess it's time to see if updating will break any of my scripts.

edit: YUP that fixed it, hooray.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: ExPorygon on September 27, 2013, 04:24:34 AM
Oh hey, I'm five builds behind. I guess it's time to see if updating will break any of my scripts.
Unless your scripts were somehow relying on some kind of glitch that updates fixed, I wouldn't worry about anything ever breaking. Nothing is ever removed in these updates, things are only added.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Darkness1 on September 27, 2013, 04:56:18 AM
Apparently I don't really know that well how vertexes are connected together, or something else just got entirely wrong. So, if anyone feels like enlightening me about the subject:
http://pastebin.com/iJQkXuCu (http://pastebin.com/iJQkXuCu)

To answer some questions first:
- Yes, it is really messy.
- HBobj is defined in another part of the script.
- The script works fine for creating a circular graphic, but when the life value changes, the vertexes at the edge between the full bar and the empty bar graphic starts pointing in strange directions.
Anyone? Just wondering if there's a solution.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Drake on September 27, 2013, 06:37:20 AM
your code makes me want to cry

The problem is likely due to you only pairing two vertices together when trying to change the graphic.

(http://nazr.in/7JF)

You're probably aware that things render in triangles, that is, groups of three vertices. When you change only the last two vertices to a different UV set, two things happen:
-You get the one 2-3-4 triangle sticking out where really you want that part greyed as well to make the "ring" look evenly cut.
-I didn't put it in the image, but the 3-4-5 triangle also screws up, because it still uses the UVs from 3. You'd get a warped result in that triangle.

This is essentially caused by you trying to use the same object to display two different images. Unless you want to get clever with the original graphic and UV sets, even if you modify the vertices in groups of four (as you normally would) for say 2-3-4-5, the 0-1-2-3 block will also be using the UVs from 2 and 3 and the graphic will still screw up at that intersection.

The lifebar circles we already see don't use another graphic for "lost" health, they simply delete two vertices at a time. By actually deleting the two vertices, all the triangles that used those vertices just stop existing, so deleting the two vertices will give you the intended straight cut.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Darkness1 on September 27, 2013, 06:45:53 PM
Well, changing it to 4 vertices at a time instead of 2 fixed the main problem, so I'm pleased.

But how do I delete vertices?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: MoonRabbit on September 28, 2013, 04:53:00 PM
Code: [Select]
WriteLog(cos(90));
WriteLog(cos(90) == 0);
WriteLog(cos(90) > 0);

Code: [Select]
2013/09/28 19:50:27.002 0.000000
2013/09/28 19:50:27.026 false
2013/09/28 19:50:27.047 true

 :wat:
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Necrotek on September 28, 2013, 04:57:29 PM
What will happen if you try 0.0 instead of just 0? It's likely the matter of integer vs real values.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: MoonRabbit on September 28, 2013, 06:19:13 PM
I tried it, still the same. (Also I'm pretty sure there's no int in danmakufu, only float)
You only get this result with the zero that cos() returns. Every other zero is fine

???
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Necrotek on September 28, 2013, 06:28:53 PM
Probably a bug. Maybe you should report about it to the author. I don't know if he knows English but it seems Helepolis was able to send bug reports somehow.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Drake on September 29, 2013, 02:42:59 AM
It's very likely just floating point shenanigans; it's an extremely common quirk of floating-point representations that you just have to deal with and it's present in many different languages, libraries, etc (seriously just google it). It has a lot to do with approximations of pi with FP and what the cosine of that representation is.

More importantly, why is it necessary that you compare the cosine, anyway? If it's truly necessary, which I doubt it is, just check the absolute range within 0.000001 or round it or something.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: MoonRabbit on September 29, 2013, 05:37:34 AM
I've just googled it. Well, I was never aware of this problem. Weird.
Anyway, of course I don't HAVE to compare cosine, it's just something I like to use when I want to know if the angle is to the right or to the left (since I don't want to rely on the fact that the angle is always between -180 and 180 degrees)

If anyone is interested, my solution is to compare cos(angle) to cos(90) instead of zero. This way it works fine.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre17)
Post by: Drake on September 29, 2013, 07:24:44 AM
if((angle-90) % 360 < 180){ left }
if((angle-90) % 360 > 180){ right }
Or if you just wanted to check the exact angles I don't see why you can't just do
if(angle%360 == 180){ left }
if(angle%360 == 0){ right } 
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Necrotek on September 30, 2013, 06:33:05 AM
Does anyone know any trick to force text drawing function not to trim empty characters like normal whitespaces (whitespaces at the beginning of the line are trimmed) and line-breaks? I'm getting rid of Japanese text, and there ' ' was used instead of normal whitespaces and it was put between line-breaks to avoid being trimmed, but what can be done for English encoding?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: KuroArashi100 on October 03, 2013, 07:41:29 PM
Does anybody know the system requirements for ph3?
The Touhou wiki says something about it, but I don't know anything about video cards and the like.

My laptop keep running it at 60.04 or 59.96 FPS, because it keeps freezing a few frames every few seconds.
And while I know my system specs are pretty bad, does ph3 really use that much more resources than 0.12?
I can run 0.12 on my computer, and it won't lag unless I spawn something like 1000 bullets at once, but ph3 won't even let me create a boss and move it left and right every few seconds without lagging.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Helepolis on October 03, 2013, 08:10:04 PM
Does anybody know the system requirements for ph3?
The Touhou wiki says something about it, but I don't know anything about video cards and the like.

My laptop keep running it at 60.04 or 59.96 FPS, because it keeps freezing a few frames every few seconds.
And while I know my system specs are pretty bad, does ph3 really use that much more resources than 0.12?
I can run 0.12 on my computer, and it won't lag unless I spawn something like 1000 bullets at once, but ph3 won't even let me create a boss and move it left and right every few seconds without lagging.
This seems to be odd. Have you breaking it down into parts for trial & error. As in 1) Disable the boss appearance nor any other graphics / tasks for movement -> Does it lag?  2) Add the graphic for the boss only (no movement) -> Does it lag?  etc.

There should be something going on in your script. Maybe show us also your code? (Why don't people show their code and assume that we should use our crystal balls to guess what is happening)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Sage Ω (Ultima) on October 03, 2013, 10:19:06 PM
Can someone tell me why this effect object for the pause menu won't load?

I call this inside of the pause script but nothing shows up. I've tried everything I could think of.
Code: [Select]
task Pause{
let csd = GetCurrentScriptDirectory;

let Target = csd~"/default_system/img/pause.png";
let objp = ObjPrim_Create(OBJ_SPRITE_2D);

        LoadTexture(Target);
Obj_SetRenderPriorityI(objp, 100);
ObjPrim_SetTexture(objp, Target);
ObjRender_SetBlendType(objp, BLEND_ALPHA);
ObjSprite2D_SetSourceRect(objp, 0, 0, 47, 211);
ObjSprite2D_SetDestRect(objp,0,0,47,211);
ObjRender_SetPosition(objp,120,120,125);
ObjSprite2D_SetDestCenter(objp);
ObjRender_SetScaleXYZ(objp, 1, 1, 1);

         }
Also, what are the steps to creating a bullet dissolve effect?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: ExPorygon on October 04, 2013, 02:21:15 AM
Can someone tell me why this effect object for the pause menu won't load?

I call this inside of the pause script but nothing shows up. I've tried everything I could think of.
Code: [Select]
task Pause{
let csd = GetCurrentScriptDirectory;

let Target = csd~"/default_system/img/pause.png";
let objp = ObjPrim_Create(OBJ_SPRITE_2D);

        LoadTexture(Target);
Obj_SetRenderPriorityI(objp, 100);
ObjPrim_SetTexture(objp, Target);
ObjRender_SetBlendType(objp, BLEND_ALPHA);
ObjSprite2D_SetSourceRect(objp, 0, 0, 47, 211);
ObjSprite2D_SetDestRect(objp,0,0,47,211);
ObjRender_SetPosition(objp,120,120,125);
ObjSprite2D_SetDestCenter(objp);
ObjRender_SetScaleXYZ(objp, 1, 1, 1);

         }
Also, what are the steps to creating a bullet dissolve effect?

Your ObjSprite2D_SetDestRect and ObjSprite2D_SetDestCenter are redundant as both have the same function. ObjSprite2D_SetDestCenter automatically centers the image on the object's coordinates while ObjSprite2D_SetDestRect allow you to customize the location of it, so to speak. However, since the ObjSprite2D_SetDestCenter comes after, that may not be what's causing your issue. Have you checked your file paths? Also, it is not necessary to LoadTexture the image. Only v0.12m requires that.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Drake on October 04, 2013, 03:42:13 AM
You misunderstand render priority. It's understandable that you'd be like "well the larger value means it's drawn overtop!" but that isn't the case.
The higher the render priority of an image, the earlier it is drawn. An object with 50 priority will be drawn before an object with 30 priority. However, this means that if the object with 30 priority is drawn at the same position as the other, the one drawn later will be drawn overtop. So, what's really happening is that objects with high priority end up drawn on the bottom, and objects with low priority end up drawn on the top.

The problem is that anything drawn above 80 priority goes before any of the STG frame and you'll essentially never see it.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Darkness1 on October 04, 2013, 03:46:42 AM
Also, what are the steps to creating a bullet dissolve effect?
The version I use for this:
1. Create an "item" script.
2. Make the dissolve effect appear on a bullet getting itemized. You should use white graphics, so you can change the dissolve color with getshotdatainfo (delaycolor).
3. Load and start the script in the system script.

Well, ofcourse you can't have it in the "main" item script which is defining the item types. You have to create a script connected to the system script which checks if bullets are being itemized, handling the effect and so on.
(I realize this got confusing as I really don't know what to call the item script part.)
The official japanese ph3 documentation shows an example of these scripts, if you find the itemdata part.
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html (http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html)

This works well for making a generic bullet deletion effect, but requires an item to be created
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: KuroArashi100 on October 04, 2013, 06:36:07 AM
There should be something going on in your script. Maybe show us also your code? (Why don't people show their code and assume that we should use our crystal balls to guess what is happening)
Because it's not something that happens only in that script; it happens in every script, which currently means the ExRumia script, TalosMistake's and Shadow's entry for contest #10, and Darkness1's Yuuka script. It lags on all of them, except for Shadow's entry, where it drops to 30 FPS in the later spellcards.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Helepolis on October 04, 2013, 07:12:08 AM
Because it's not something that happens only in that script; it happens in every script, which currently means the ExRumia script, TalosMistake's and Shadow's entry for contest #10, and Darkness1's Yuuka script. It lags on all of them, except for Shadow's entry, where it drops to 30 FPS in the later spellcards.
Well, you haven't given us this info in your initial post. How are we suppose to know? I have no idea at this moment except for your configuration inside config.exe. ph3 isn't necessary heavier than 0.12m. In fact I think it should run smoother.

Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: KuroArashi100 on October 04, 2013, 07:58:04 AM
Well, if it happened in one script only, I would have posted said script and asked if anybody knew why it was lagging.
But I'll try to be more clear next time.

I don't think I changed any options; it currently is set windowed, the resolution is 640*480 and the third option (frameskip?) is set at the first option.
I don't think key configuration has something to do with it, and I don't know what the option tab does.

Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: trancehime on October 04, 2013, 01:29:16 PM
I don't think I changed any options; it currently is set windowed, the resolution is 640*480 and the third option (frameskip?) is set at the first option.
I don't think key configuration has something to do with it, and I don't know what the option tab does.

the option tab just has checkboxes if you want log windows to be open, log files to be saved, and for the cursor to be visible when the program is open
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Sage Ω (Ultima) on October 04, 2013, 09:05:07 PM
Your ObjSprite2D_SetDestRect and ObjSprite2D_SetDestCenter are redundant as both have the same function. ObjSprite2D_SetDestCenter automatically centers the image on the object's coordinates while ObjSprite2D_SetDestRect allow you to customize the location of it, so to speak. However, since the ObjSprite2D_SetDestCenter comes after, that may not be what's causing your issue. Have you checked your file paths? Also, it is not necessary to LoadTexture the image. Only v0.12m requires that.
It's always something. I forgot to put the "." when I wrote the file path. csd~"./ is what I should've put.


You misunderstand render priority. It's understandable that you'd be like "well the larger value means it's drawn overtop!" but that isn't the case.
The higher the render priority of an image, the earlier it is drawn. An object with 50 priority will be drawn before an object with 30 priority. However, this means that if the object with 30 priority is drawn at the same position as the other, the one drawn later will be drawn overtop. So, what's really happening is that objects with high priority end up drawn on the bottom, and objects with low priority end up drawn on the top.

The problem is that anything drawn above 80 priority goes before any of the STG frame and you'll essentially never see it.
Damn, that's exactly what I thought. I'll keep that mind when I work on drawing objects.


The version I use for this:
1. Create an "item" script.
2. Make the dissolve effect appear on a bullet getting itemized. You should use white graphics, so you can change the dissolve color with getshotdatainfo (delaycolor).
3. Load and start the script in the system script.

Well, ofcourse you can't have it in the "main" item script which is defining the item types. You have to create a script connected to the system script which checks if bullets are being itemized, handling the effect and so on.
(I realize this got confusing as I really don't know what to call the item script part.)
The official japanese ph3 documentation shows an example of these scripts, if you find the itemdata part.
http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html (http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v3.html)

This works well for making a generic bullet deletion effect, but requires an item to be created

Hmm, I'll try it this way, but on arby's miko boss I see that he used effect objects to make the dissolve effect though I tried it myself and I was instantly confused on what to do.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Darkness1 on October 04, 2013, 09:50:38 PM
Hmm, I'll try it this way, but on arby's miko boss I see that he used effect objects to make the dissolve effect though I tried it myself and I was instantly confused on what to do.
I don't really understand what you mean, since effects are pretty much always effect objects. The method I said uses effect objects too, it just activates them from the event "EV_DELETE_SHOT_TO_ITEM" and uses GetEventArgument(1)[0] and GetEventArgument(1)[1] to get the bullets X and Y positions.     

Here's my entire script files used (except for the main system file): http://pastebin.com/CsS6G2YM (http://pastebin.com/CsS6G2YM)
Use with caution, I'm no genius when it comes to these things, but I think it looks good atleast.
I have to look up what method Talos and Arby uses to compare.

Gotta fix those load function placements sometimes, since I'm pretty sure the way I'm spamming LoadSomething; spawns alot of lag. Aswell as spawning two effects per bullet..
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Sage Ω (Ultima) on October 04, 2013, 11:45:16 PM
Well arby's doesn't use items, he calls this from the player scripts, I know I would need GetShotIdInCircleA2 but I'm a bit confused on how that function even works.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Drake on October 05, 2013, 12:49:27 AM
Give it x, y, radius and type of bullets to grab. Returns an array of matched object ids.
Finding all the ids that match something (while being deleted) and then doing something based on that seems really awkward.

The way Darkness runs his item script looks a bit weird but in essence it's probably simpler and easier to expand on. By making an item script you can just call CreateItemA1 whenever you need a single case, DeleteShot to TYPE_ITEM for large cases like on pattern completion, etc, and just perform all of the nice item functions now available.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Darkness1 on October 05, 2013, 01:26:12 AM
Another thing I forgot to mention, you don't actually have to spawn items in the item script. By deleting any item creation function from the event delete_shot_to_item, you could just have the effect activate instead.

GetShotIdInCircleA2 works for some cases, but is also good at doing other things than just deletion effects. The startup code to check for all bullets on the screen and then use their ID-values would be something like this:
Code: [Select]
let shotarray = [];

shotarray = GetShotIdInCircleA2( "X", "Y", "Radius", TARGET_ENEMY);

ascent( i in 0..length(shotarray) ){

//dostuff;

Obj_Delete( shotarray[i] ); //delete the bullet, where shotarray[i] would get the id of each stored bullet.
}

This is similair to the code Talos used and should work. I don't see the reason to use it in the player scripts when system scripts and events should be able to do the same thing.
The function itself should be able to be used in alot of different ways if you're clever with it.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Sage Ω (Ultima) on October 05, 2013, 03:30:55 AM
Actually, thanks for your help guys, I did it using only effect objects.

Anyway, I guess I'll post it so that others can use it too. It doesn't look as smooth as ZUN but close enough I guess.
http://pastebin.com/JjKXgRj9
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Drake on October 05, 2013, 04:04:25 AM
Could definitely shorten that last bit:
Code: [Select]
if(timer%4==0){
    ObjSprite2D_SetSourceRect(objde, s*(timer/4), 0, s*(timer/4 + 1), 32);
}
As long as you either moved the 4th and 5th graphics over so they fit, or if you actually used the one between 128 and 160 rather than skipping over it.

You could also just redo your entire loop as
Code: [Select]
DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
ascent(i in 0..8){
    ObjSprite2D_SetSourceRect(objde, s*i, 0, s*(i+1), 32);
    loop(4){ yield; }
}
Obj_Delete(objde);
which would also avoid only using the last rect for one frame before deletion, and would actually delete the bullets the same frame as you start the effect (rather than four frames later).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre18)
Post by: Sage Ω (Ultima) on October 05, 2013, 05:02:28 AM
Ah, that works much better. Thanks again Drake.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 06, 2013, 05:21:29 PM
nvm, the problem seems to come from the shotsheet not having a shot defined for id = 0. So sometimes the dissolve code breaks the game.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 08, 2013, 03:50:04 AM
So I noticed that PlayBGM doesn't deleted the old sound anymore, or rather using RemoveSound ---> LoadSound ----> PlayBGM only works if the script that played the song is the same as the one that's playing the new one.

I've also tried various other methods such as using sound objects and playing the music inside of the plural but when you return back to the menu the music continues to play.

I'm building somewhat of a base engine(I call it MOF engine because I use stuff from MOF), the menus and everything else all work fine but it's the playing music part that doesn't work correctly.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 14, 2013, 01:45:21 PM
How do I move effect objects to a certain postion? ObjMove_SetDestAtFrame/Weight functions don't seem to work.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Darkness1 on October 14, 2013, 04:52:44 PM
How do I move effect objects to a certain postion? ObjMove_SetDestAtFrame/Weight functions don't seem to work.
Easiest way is to create an enemy or an object bullet, make them invisible/delete the hitbox and then stick the effect object to the position of the bullet/enemy every frame.

Creating an angle system and then moving the effect object by using ObjMove_SetPosition with, for example;
Code: [Select]
ObjMove_GetX( ID ) + cos( Angle ) * Speed
ObjMove_GetY( ID ) + sin( Angle ) * Speed
should work, but using this to get the desired movement effect may not be worth all the effort in the end.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 14, 2013, 05:02:16 PM
Ok thanks, I'll try those methods. Also do you know of a more efficient way of controlling the bgm? I use commondata to control what music the package script plays but I'm wondering if that causes problems in the long run(especially since sometimes the game forgets to set the commondata).
RemoveSound -> LoadSound -> PlayBGM doesn't work unless you do so in the same script. So if I use multiple scenes then my Player select scene which will start the stage can't tell the song that's still playing from the package scene to stop, instead danmakufu plays both songs at the same time.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 14, 2013, 09:25:46 PM
I really don't recommend that dummy method. Creating enemies or bullets to move them require you to register them, which makes them valid IDs for things like grabbing enemy IDs, counting bullets, deleting enemies/bullets and so on. Creating a dummy enemy and using its position to have the render object follow is incredibly awkward and unnecessary. You can very easily just define a task that moves the render object instead.

task ObjRender_SetDestAtFrame(obj, x, y, frames){
    let ox = ObjRender_GetX(obj);
    let oy = ObjRender_GetY(obj);
    let dist = ((ox - x)^2 + (oy - y)^2)^0.5;
    let angle = atan2(oy - y, ox - x);
    loop(frames){
        ObjRender_SetX(obj, ObjRender_GetX(obj) + cos(angle) * dist/frames);
        ObjRender_SetY(obj, ObjRender_GetY(obj) + sin(angle) * dist/frames);
    }
}


My question is more, why do you need to use the SetDest functions in particular for a render object in the first place?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 14, 2013, 10:41:05 PM
Thanks Drake, since I moved MMS from 0.12m to ph3 I wanted to make my stage banner look a bit less generic so I thought I'd add a nice little movement to it. I also wanted to make my own concentration effect since ph3 no longer has that function, I would use it to move the cherries/leaves/petals toward the boss. I don't think ObjMove_SetAngle works with effect objects either.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 15, 2013, 12:00:05 AM
(http://nazr.in/6qe)

ObjMove anything won't work on render objects, just as any ObjPlayer functions won't work on lasers.

Anyways, the point isn't why you want to move the objects around, but why you need that function. Like for the concentration effect, considering you'll be spawning the particles at random(?) positions around the boss, you'll already have the distance to the boss and the angle to the boss. Using the SetDest function is completely redundant since all it does is calculate the distance and angle to the destination (which you would already have), and then move it in that direction. Then, you'd want to delete the particle when it gets to the destination, which when calling the function you'd have to do by waiting, then deleting. Rather than just having a movement loop and deleting right after.
Needing to use SetDest to move a banner thing around makes even less practical sense imo.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 15, 2013, 12:08:22 AM
Well um, I didn't look at it from that point of view, using SetDest seemed to be the easiest/fastest way of doing things.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: CK Crash on October 15, 2013, 12:19:21 AM
Code: [Select]
task ObjRender_SetDestAtFrame(obj, x, y, frames){
    let ox = ObjRender_GetX(obj);
    let oy = ObjRender_GetY(obj);
    let xc = (x-ox)/frames;
    let yc = (y-oy)/frames;
    loop(frames){
        ox += xc;
        oy += yc;
        ObjRender_SetX(obj, ox);
        ObjRender_SetY(obj, oy);
        yield;
    }
}
I fixed your code to not need trig every single frame (I'm disappointed in you Drake)

Also there are some practical uses for SetDest if you're making familiars that aren't enemies for some reason.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 15, 2013, 01:34:11 AM
(http://nazr.in/882)

thisiswhyimdumb.png
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 15, 2013, 04:43:36 PM
While I'm making English translation for Mystical Power Plant, I came across some fatal defects with the script. Because I can't really contact original authors (I tried but didn't manage due to language and technical issues), I'm trying to fix them myself. I "fixed" one myself but there is one (or two?) more which I'd like to fix if it's possible.
When you restart a level multiple times (approx. 25 times), at some point the game just crashes. Here two different outputs but it's likely they have the same origin. To be sure that they weren't done by me, I checked non-modified version of the game.
Code: [Select]
配列のサイズを超えています
D:\Mystical Power Plant 1.00c\script/Th_mpp/scene/./././ControlMusic.dnh
ControlMusic.dnh 48行目


ObjSound_Load(id,Music_all[play]);
ObjSound_SetSoundDivision(id,SOUND_BGM);
ObjSound_SetVolumeRate(id,bgm_vol);
ObjSound
~~~

Code: [Select]
#includeで置換するファイル[D:\Mystical Power Plant 1.00c\script/Th_mpp/scene/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././../system//../enm/other/Ot_Enemy_Texture.dnh]が見つかりません
D:\Mystical Power Plant 1.00c\script/Th_mpp/scene/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././../system/Task_EnmPattern.dnh
Task_EnmPattern.dnh 2行目


#include"../../enm/other/Ot_Enemy_Texture.dnh"
#include"../../enm/other/Ot_Enemy_ShotPattern.dnh"
#include"../../enm/other
~~~

Does anyone have any idea how it could be fixed?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 16, 2013, 11:45:56 AM
Ok, nevermind, I found the problem. The GetCurrentScriptDirectory function is bugged, it doesn't clean its output from './' and '../' parts so at some point you might get something like "script/test/./././././././img/././../se/extra/../../data/././scores.dat" instead of "script/test/data/scores.dat".

I'll try to send an email to mkm but I'm not sure if he understands English. Did anyone try to email to him before?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Helepolis on October 16, 2013, 02:13:31 PM
Ok, nevermind, I found the problem. The GetCurrentScriptDirectory function is bugged, it doesn't clean its output from './' and '../' parts so at some point you might get something like "script/test/./././././././img/././../se/extra/../../data/././scores.dat" instead of "script/test/data/scores.dat".

I'll try to send an email to mkm but I'm not sure if he understands English. Did anyone try to email to him before?
Until some extend he understand, preferably Japanese but I noticed he is capable of decent English.

And AFAIK, this problem was present in 0.12m. It is mentioned in my pathing tutorial to avoid GetCurr(ry for #Include pathnames.
Quote from: Pathing Tutorial
Exclusive rule: If you're working with libraries and other off-site scripts, you might want to remember this exclusive rule very well. #include_script functions must always use '.\'  method when using relative paths. It seems danmakufu does not understand 'GetCurrentScriptDirectory~' for this. When storing pathnames in variables, always use 'GetCurrentScriptDirectory~' function. Again here danmakufu has his own way of handling things. Lovely isn't it?

Edit:
Presented issue with MMP is why I am using absolute pathing for my own game as much has possible. Especially for #Include I've always used absolute pathing. There is no reason for me to use relative pathing since my package is whole release which means, unpack > Run EXE > Play. And if someone decides to move out the files from my package it means he/she is doing it obviously wrong. Same goes for renaming.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 16, 2013, 02:54:02 PM
Ok, I included some images from debug window where those messed paths are visible and attached the log with errors.

Hm, actually it's true, if I did my script, I wouldn't use relative paths if it's possible because it's more complicated to know where specific file is stored.

Edit:

I was checking available functions and found ObjText_SetSyntacticAnalysis which interested me, "Allows or prevents checking for the existence of bracket tags (such as line break or ruby text) within the text for this object.". For now, the only tag I know is [r] which is a line-break. I tried to find that ruby text one but didn't find anything. So, where I could check available text tags?

Upd: why it always happens to me that as soon as I ask something, I manage to find the answer myself, even though I spent some time to find it before that. Ruby tag is used for super/subscripting, [ruby rb=\"Main Text\" rt=\"Superscript\"] (why it's called ruby?). After checking exe file, I found one more which wasn't mentioned on official website, font. Probably it uses clear and size words like rb and rt for ruby tag if I get those lines correctly so I guess it can change font and size of the selected text or something like that.


Please keep your edits/new posts in 1 post if there are no replies --Hele
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 17, 2013, 11:49:29 PM
Ok, nevermind, I found the problem. The GetCurrentScriptDirectory function is bugged, it doesn't clean its output from './' and '../' parts so at some point you might get something like "script/test/./././././././img/././../se/extra/../../data/././scores.dat" instead of "script/test/data/scores.dat".
I can't replicate this. Every time I restart through any means, the file paths stay the same in the debug console. I don't see why not cleaning the string would matter much either, unless you somehow had a loop of scripts calling each other and appending ./ every time. I can't even see in the scripts why you would get this.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 18, 2013, 07:33:56 AM
I can't replicate this. Every time I restart through any means, the file paths stay the same in the debug console. I don't see why not cleaning the string would matter much either, unless you somehow had a loop of scripts calling each other and appending ./ every time. I can't even see in the scripts why you would get this.

To be completely sure that I don't do anything weird, I loaded Windows XP in Japanese and download fresh MPP 1.00a from website. So, here what I got:

So, I don't know what's going on here. I have the same problem for Wine, latest Danmakufu ph3 and latest MPP 1.00c. Is it a problem with old OSs?

Upd: anyway, got an answer from mkm. He told that will fix the function to return absolute unique paths. So, it's fine to write to him in English, but it's better to keep it simple.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: ExPorygon on October 18, 2013, 10:58:56 PM
What IS mkm's contact info anyway? Is it listed on his site?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 18, 2013, 11:25:40 PM
Yep, there is a email in his profile page.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 21, 2013, 12:50:01 AM
Does anyone else get glitches where the game's screen is off centered? Usually during an error the script select menu shifts, but it seems to happen randomly on Package scripts too. Also, I noticed that during play sometimes the options on the player script detach and the game crashes.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: TresserT on October 22, 2013, 05:59:46 PM
Does anyone know how to make stackable bullets? By that, I mean I want to have a wave of bullets that get to the bottom of the screen and stay there, then have the 2nd wave on top of the first, then the 3rd on top of the second, etc. Like Nazrin's 7-6 in Double Spoiler. Sorry if this has already been asked.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 22, 2013, 06:54:49 PM
Random guess of someone who doesn't know Danmakufu well - set moving for bullets until ObjCol_IsIntersected(id) == true. On the other hand, nevermind.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: gtbot on October 22, 2013, 09:43:48 PM
Does anyone know how to make stackable bullets? By that, I mean I want to have a wave of bullets that get to the bottom of the screen and stay there, then have the 2nd wave on top of the first, then the 3rd on top of the second, etc. Like Nazrin's 7-6 in Double Spoiler. Sorry if this has already been asked.
The easiest way I think would be to have that bullet check for other bullets by using GetShotIdInCircleA2 (http://dmf.shrinemaiden.org/wiki/Shot_Functions#GetShotIdInCircleA2) with the x, y, and radius of the bullet, then check if the length of the returned array is greater than 0, and if so, stop the bullet. If no bullets are detected and it reaches GetStgFrameHeight, then stop the bullet. This assumes that falling bullets wouldn't get near each other.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: TresserT on October 22, 2013, 11:13:17 PM
The easiest way I think would be to have that bullet check for other bullets by using GetShotIdInCircleA2 (http://dmf.shrinemaiden.org/wiki/Shot_Functions#GetShotIdInCircleA2) with the x, y, and radius of the bullet, then check if the length of the returned array is greater than 0, and if so, stop the bullet. If no bullets are detected and it reaches GetStgFrameHeight, then stop the bullet. This assumes that falling bullets wouldn't get near each other.

That's a good idea. Then I can make it so they don't collide until they're past a certain point on the screen, so if I keep it rolling it should work out okay. Thanks very much.

Edit: So embarrassing  :blush:. I know 0.12m has the "length" function, but ph3 doesn't seem to have that. How do you measure the length of an array without it?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: gtbot on October 23, 2013, 12:59:59 AM
Edit: So embarrassing  :blush:. I know 0.12m has the "length" function, but ph3 doesn't seem to have that. How do you measure the length of an array without it?
You can still use length(array); I'm not sure why but on the danmakufu website length is listed under system syntax rather than in the functions.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: CK Crash on October 25, 2013, 07:18:48 AM
The easiest way I think would be to have that bullet check for other bullets by using GetShotIdInCircleA2 (http://dmf.shrinemaiden.org/wiki/Shot_Functions#GetShotIdInCircleA2) with the x, y, and radius of the bullet, then check if the length of the returned array is greater than 0, and if so, stop the bullet. If no bullets are detected and it reaches GetStgFrameHeight, then stop the bullet. This assumes that falling bullets wouldn't get near each other.
Use Obj_SetValue to mark the bullets that have already settled. When you get the shot IDs, check if the bullets in range are settled, then stop the bullet the bullet and change its value too.

Obj values are hella useful :V
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 26, 2013, 02:36:03 AM
I've yet to see how fast/light (or slow/heavy) they are, but basically you can make pseudo-classes of objects by arbitrarily deciding on the object's attributes, setting the values properly and writing functions for them. I plan for it to be a part of a tutorial, whenever I get around to doing tutorials. SetValue is really useful so far. I mean I can sort of guess it's probably using a hash underneath so it should be fairly quick, and since you need the object and can't directly access the variables otherwise, it's a crapton safer and usable than 0.12's EVERYTHING IS COMMONDATA. Set up right, it should be fairly easy to use.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sparen on October 26, 2013, 09:57:42 PM
Possible bug in pre19:

In TalosMistake's CURSE01 contest entry with the provided player and Miplouf's CURSE01 contest entry with the Random Player Generator, a bug appears where suddenly, the player effect graphics freeze in the transition between two attacks. The player graphic can freely move. Then, ph3 freezes, and then it crashes.

Edit: Happens in other ph3 scripts as well

Specific details:
-Seems to occur during the transition between attacks in a Plural
---May be caused by bug in player, plural, or at the end or beginning of respective attacks. It could be something completely different.
-Player OBJECT can move, the rest of the player graphics can't *Exception: Swampert cannot move because it was handled differently when being made
-NOT an Operating System problem
Quote
GetOwnScriptID is incremented by 1 each time a new script starts
When paused, this value is reverted back to 0
When scripts have SetAutoDeleteObject(true), and then close the script with GetOwnScriptID, it's possible it may terminate the player's ship script by accident
This may be the cause

Confirmed by:
Key: -person who had an issue, ---player that person used: [[image link, if available]]

TalosMistake's CURSE01 Marisa v1.01
-Trickysticks
---Talos Reimu: [http://puu.sh/50m0Y.png (http://puu.sh/50m0Y.png)]
---Talos Reimu: [http://puu.sh/505Vy.jpg (http://puu.sh/505Vy.jpg)]
-Gusano2314
---Talos Reimu: [http://puu.sh/5128Z.png (http://puu.sh/5128Z.png)]

Miplouf's CURSE01 Tenshiku v1
-Sparen
---Naut RPG: [http://puu.sh/5158j.png (http://puu.sh/5158j.png)] (Same image as attached) *First time running script, First time running script with specific player
-Gusano2314
---ReimuA
-Miransu Uwabami
---Laser Koakuma
-GTbot
---GT Medicine: [http://img33.imageshack.us/img33/4236/cr60.png (http://img33.imageshack.us/img33/4236/cr60.png)]

Miransu's LOCAA 3 Experiment 354 v1.01
-Gusano2314
---Miransu Swampert
-Miransu Uwabami
---Miransu Swampert: [http://puu.sh/50I3F.png (http://puu.sh/50I3F.png)] *In this image, the player graphic completely disappeared.
---Miransu Swampert: [http://puu.sh/50Ii2.png (http://puu.sh/50Ii2.png)] *Annotated by Miransu

FondueMaster's LOCAA 3 Swampert Boss Battle
-Gusano2314
---GT Cirno: [http://puu.sh/515Ah.png (http://puu.sh/515Ah.png)]

TalosMistake's Halloween Contest Seija Boss Fight v1.01
-Sparen
---RPG: [http://puu.sh/53l6A.png (http://puu.sh/53l6A.png)]
-Gusano2314
---RPG: [http://puu.sh/5569f.png (http://puu.sh/5569f.png)]

I will update as reports come in.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sage Ω (Ultima) on October 26, 2013, 11:23:00 PM
I mentioned something like that happening a few days ago(nearly a week), not in the specific script you're talking about though. Though I only notice this happening randomly during boss battles. In which the playerscript's options freeze and then if the player comes in contact with anything(item, bullet, ect...) danmakufu crashes.

I almost thought it was something I did personally but if others are having the same problem then someone should report it.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 26, 2013, 11:36:46 PM
It would be good to isolate an actual problem beforehand, rather than just try to report something nobody can do anything about. It might as well be a common error occurring in these various scripts or players.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sparen on October 26, 2013, 11:57:22 PM
It would be good to isolate an actual problem beforehand, rather than just try to report something nobody can do anything about. It might as well be a common error occurring in these various scripts or players.

I'm going to see if I can narrow down the specific instances where it occurs and see if there's anything in common.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 27, 2013, 05:05:47 PM
I checked all three scripts using ph3 0.19 and didn't get that bug even once. Probably it's related to the OS environment somehow, I played under Linux (wine).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sparen on October 27, 2013, 05:17:09 PM
I checked all three scripts using ph3 0.19 and didn't get that bug even once. Probably it's related to the OS environment somehow, I played under Linux (wine).

I use Mac with Wine 1.7.1 compiled and built from source.

The other testers use various Windows Operating Systems. Therefore, this bug is OS-independent
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: PhantomSong on October 27, 2013, 05:21:42 PM
I checked all three scripts using ph3 0.19 and didn't get that bug even once. Probably it's related to the OS environment somehow, I played under Linux (wine).
It happens here and there.  Not all the time
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 27, 2013, 05:25:08 PM
Wine 1.7.4
Well... probably I'm just "unlucky". Does it happen for replays too? If it does, attach one which definitely crashes at some point. I could try to run it again and again until I get something (crash, I guess).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Lavalake on October 28, 2013, 03:35:58 AM
So, I'll get straight to the point.
It seems I can't play scripts because the player scripts won't show up. I enter a script and at the player selection menu, nothing comes up. Pressing z makes danmakufu crash.
I checked the player script, have the latest version of ph3, and everything seems to be looking right.
I don't know what's the problem...
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 28, 2013, 03:48:14 AM
Download ph3 by itself and see if it works, or download another standalone like Lucas' contest 10 entry. I assume the player scripts are actually in their proper /script/player directory.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Lavalake on October 28, 2013, 05:22:26 AM
I'm trying to play TalosMistake's contest 10 entry with the player script included. Nothing inside was touched. I've also tried with other standalone scripts. I have a default player script too, but nothing appears on the player selection screen.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Drake on October 28, 2013, 06:02:21 AM
Download ph3 by itself in some random directory and see if the samples work
need to isolate the possibilities of it being an application issue or a system issue
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Sparen on October 28, 2013, 08:15:06 PM
Check the last script you downloaded/edited and make sure there aren't any weird symbols in the fields following #

Danmakufu crashed every time I tried to open a folder once because my text editor autocorrected (P) into something weird.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Lavalake on October 29, 2013, 04:00:50 AM
Nevermind my problem, turns out I didn't change my locale to japanese on my laptop. Although I'm still wondering why I could play some scripts without applocale.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: ExPorygon on October 29, 2013, 05:09:02 PM
Nevermind my problem, turns out I didn't change my locale to japanese on my laptop. Although I'm still wondering why I could play some scripts without applocale.
Danmakufu will correctly read and run any script that does NOT contain any Japanese or similar foreign characters in it. Applocale is only needed for those scripts that DO. The reason that 0.12m almost always requires Applocale as a general rule is because the default, hard-coded player characters contain Japanese in their names and are almost always loaded when trying to play scripts, even if they aren't always used.

The players you were trying to get Danmakufu to load, I suspect, contained some Japanese characters somewhere in them (I don't think it matters if they're commented out).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: KuroArashi100 on October 29, 2013, 08:18:25 PM
I'm sorry if this question has been asked before, but I'm having a problem and I can't find a solution on my own.

I'm trying to make my own shotsheet, and I ran into some problems once I wanted to test it.
Danmakufu gives an error that shot_image is undefined.
Writing a replace script seems to solve that problem.
However, when trying to use it in Danmakufu, the bullets won't show up.
I already checked the pathing and file names, and the error doesn't seem to have to do something with either of those.
Does anybody know what the problem could be?

Shotsheet data (http://pastebin.com/HWCjSmZD)
Replace script (http://pastebin.com/k1rP2QLV)
(The begin of a) test script (http://pastebin.com/aivJmgH9)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 29, 2013, 08:30:32 PM
I'm not sure if it's related to your problem but... isn't it supposed to use slash symbols instead of backslash ones for paths?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: KuroArashi100 on October 29, 2013, 08:47:21 PM
Oops. I think that might be a small error too. I think 0.12 used backslashes, and I used them out of habit.
I don't think it's related though. Swapping the backslashes for slashes gives the same result.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on October 29, 2013, 08:51:33 PM
Probably it's worth to take a look here (http://www.shrinemaiden.org/forum/index.php/topic,10181.msg822882.html#msg822882).
Upd: on the other hand, the answer wasn't found there.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: KuroArashi100 on November 02, 2013, 01:50:26 PM
Seems like I made another stupid mistake... I forgot to place a = behind rect and delay_color.
Fixed that and now it works fine.

Now I just need to move all the bullets around again, because stuff clips in the bullets everywhere :V
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on November 02, 2013, 04:12:54 PM
Seems like I made another stupid mistake... I forgot to place a = behind rect and delay_color.
But... the equal sign is there in those pastebin links...
Oh well, if it works now then it's fine.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: KuroArashi100 on November 02, 2013, 05:12:48 PM
Code: [Select]
ShotData{ id=1 rect(0,0,16,16) render=ADD angular_velocity=0 delay_color(255,64,64) }
ShotData{ id=1 rect=(0,0,16,16) render=ADD angular_velocity=0 delay_color=(255,64,64) }
No it isn't. The first line misses the equal signs in the places I mentioned, the second line is the correct one.
If you try to run this in Danmakufu with an image with something at those coordinates, the first one won't do anything, but the second one should appear correctly.
Title: Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
Post by: MoonRabbit on November 02, 2013, 05:21:05 PM
Well, I've done some research. Here are my findings:
1. LoadTexture function actually loads the texture into the ram (you can see it in the task manager). If you try to load twice, it will ignore the second one. If you load a texture in one script, it will apply to all scripts.
2. I tried the same thing with LoadSound with a huge file, but the RAM didn't go up! So I used procmon and found this out -
What LoadSound does is to open a handle to the file. When you use PlaySE, it starts reading the file.

So - loading texture in the beginning is essential, but loading sound in the beginning only saves you the CreateFile phase (getting a handle to the file).
Also, if you use LoadSound then you can only play it on the same script, so trying to load everything together is a pain.

So...... maybe the function I showed in my last post does make sense?! I am so confused.
Old post but I must correct it -
I just found out that LoadSound DOES load the file into the memory, unless you use a really big sound file.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
Post by: Necrotek on November 02, 2013, 06:09:29 PM
Code: [Select]
ShotData{ id=1 rect(0,0,16,16) render=ADD angular_velocity=0 delay_color(255,64,64) }
ShotData{ id=1 rect=(0,0,16,16) render=ADD angular_velocity=0 delay_color=(255,64,64) }
No it isn't. The first line misses the equal signs in the places I mentioned, the second line is the correct one.
If you try to run this in Danmakufu with an image with something at those coordinates, the first one won't do anything, but the second one should appear correctly.
Ah, now I get it. I didn't notice those words in ShotData lines.

Upd: heh, mkm fixed the issue with paths and now some of them which were implemented using wrong syntax don't work :)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 09, 2013, 02:38:41 PM
Asking another question, though this one might not have all that much to do with Danmakufu.
Like I said before, I am trying to create my own shotsheet, but the spinning bullets (Bubbles etc.) always appear to shake in game because they seem to be off-center.
I tried using photoshop's align with center option, but this still happens, even though I'm pretty sure my bullet should be symmetrical.


Does anyone know a solution for this?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on November 09, 2013, 03:25:37 PM
Asking another question, though this one might not have all that much to do with Danmakufu.
Like I said before, I am trying to create my own shotsheet, but the spinning bullets (Bubbles etc.) always appear to shake in game because they seem to be off-center.
I tried using photoshop's align with center option, but this still happens, even though I'm pretty sure my bullet should be symmetrical.


Does anyone know a solution for this?
There is an ancient thread regarding this, forgot where but it seems to be that Danmakufu likes to off-centre bullets, even if you set perfect rects. It has something to do with the angular movement and drawing (????).

I think having shotsheet in square size reduces this problem someone said in that ancient thread (256x256/512x512) but I have still some off-centre bullets in my shotsheet.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 09, 2013, 07:38:58 PM
There is an ancient thread regarding this, forgot where but it seems to be that Danmakufu likes to off-centre bullets, even if you set perfect rects. It has something to do with the angular movement and drawing (????).

I think having shotsheet in square size reduces this problem someone said in that ancient thread (256x256/512x512) but I have still some off-centre bullets in my shotsheet.
So there is no real solution?
Because it happened before, I tried using one image only as shotsheet (64x64) but that ends up like this (http://youtu.be/beDeiPVQY3Y).
And that is a squared image. But if I understand correctly, Danmakufu is the culprit, not the image itself?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 09, 2013, 10:17:33 PM
KuroArashi, could you share that sample script from your video?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on November 09, 2013, 10:34:06 PM
So there is no real solution?
Because it happened before, I tried using one image only as shotsheet (64x64) but that ends up like this (http://youtu.be/beDeiPVQY3Y).
And that is a squared image. But if I understand correctly, Danmakufu is the culprit, not the image itself?
Unfortunately it is danmakufu's fault. Everybody has exactly the same problem.

Even if I spawn a single bullet/sprite with a power of 2 size, danmakufu will put it off-centre for an unknown reason. Afaik there is no solution but to fiddle with the rect like decreasing a pixel one one side or adding one:  Rect(1,0,64,64); / Rect(0,0,63,64);  etc until it spins smoothly.

Quite frustrating, unless someone knows a solid solution.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: ExPorygon on November 10, 2013, 02:13:34 AM
I know of a solution that seems to work reliably but I'm not quite sure. Using a 64x64 bullet as a reference, what you want to do is to use an image editor to decrease the size of it to 63x63. Then you want to use a (0,0,63,63) rect instead. That's worked for all of the bullets I've tried it on so far.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 10, 2013, 02:24:26 PM
Too bad there is no easy solution.
I tried messing around with the rect for a while, and I can't make it stop shaking, I only make it worse.
Gotta keep trying I guess :V

@Ozzy
That doesn't seem to work on my bullets. I tried it multiple times, from multiple corners, but that doesn't seem to solve the problem.

@Vectorfish
I have no idea what you want with it, the problem doesn't have anything to do with that as far as I know.
But here it is anyway: Pastebin (http://pastebin.com/XJ9m5YNT)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 10, 2013, 02:31:23 PM
I just want to check some possible solutions but I'm lazy to write that test script myself :)
Upd: hm, something is missing, just invisible bullet in the center of the screen. Oh, well.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 10, 2013, 02:54:29 PM
Well, yes. The shotsheet is missing.
The "bullet" in the middle is the boss...
You need to put these two attachments in the same folder for it to work.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 10, 2013, 03:22:00 PM
Ok, not sure if I got the point of the problem correctly and this is what you're looking for. Just as I thought, the problem is that the image uses even number of pixels. Because of that, there is no pixel which could be used as a symmetric center for rotation and because of that the movement is shaky. If you change bullet image to be odd pixeled and set rectangle for it the same way, it won't shake.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 10, 2013, 04:08:08 PM
Thank you very much, that is indeed what I'm looking for.
Out of curiosity, what exactly did you change in the image?
It still is 64x64, so I don't completely understand what you mean with odd-pixeled.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 10, 2013, 04:29:56 PM
Technically, I increased bullet size by 1 pixel (so, it's (x+1,x+1) instead of original (x,x)), not image size. In practice, check this image (the difference is that I copied quarters instead of just moving to avoid those empty white lines), you should make a proper bullet image from scratch.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 10, 2013, 04:39:24 PM
OK, that makes sense. Again, thank you!
Now I just have to do 5 more bullets or something, and then my shotsheet is hopefully done.
I think I have to draw everything a third time though ... I have no idea how to draw things with pixels.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 10, 2013, 04:55:56 PM
I think I have to draw everything a third time though ... I have no idea how to draw things with pixels.
If you're talking about resizing existing bullets to be odd sized so they would work fine for rotation then you can just resize them in pretty much any image editor (for example, it was Kolourpaint in my case) but probably I got your words in a wrong way.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on November 10, 2013, 05:58:16 PM
No, that wasn't really what I meant. What I was talking about is that I'm really bad at drawing the bullets themselves, and because some of them don't look good IMO, I probably have to draw them again. That already happened once before, so I'm not really looking forward to that.
I don't have all that many spinning bullets, just bubbles that I still need to make, stars and these glowing orbs which weren't odd sized like it seems they need to be, and the stars don't seem to suffer from the same problem for some reason.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: AkaoniP on November 12, 2013, 03:55:44 PM
I have this (http://imgur.com/PfJ4Gvu) error message when I try to run a stage script. I know it involves EnemyBossScene but not matter what I try, I still have error. And I got this (http://imgur.com/rLZzgJF) once.
I even tried to copy-paste into google translate but it keeps appearing this corrupted text  "EnemyBossScene????????????????????"

This (http://pastebin.com/cjrhswLu) is how the stage script looks like and this (http://pastebin.com/fqCYf54J) is how the plural script looks.

the funny thing is that when you play the plural file it runs perfectly. I even tried to load and start 001.txt and 002.txt separately in the stage file but I got the same error. it's driving me crazy  :getdown:

Thanks in advance
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on November 12, 2013, 04:06:54 PM
I think its because your probably calling two bosses, assuming cirno is a boss seeing as that's what the variable is called. Something danmakufu can't do. Remove cirno.txt or plural and see what happens.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Necrotek on November 12, 2013, 05:05:13 PM
I have this (http://imgur.com/PfJ4Gvu) error message when I try to run a stage script. I know it involves EnemyBossScene but not matter what I try, I still have error. And I got this (http://imgur.com/rLZzgJF) once.
"EnemyBossSceneが作成されていません" (wasn't created) and "すでにEnemyBossSceneオブジェクトが存在します" (already exists). Not sure if it helps much.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: AkaoniP on November 12, 2013, 05:15:39 PM
How strange. Cirno was defined as ENEMY_BOSS and the files in the plural as ENEMY. Or it was because you can't make a plural file without a boss? Anyways, I manage the solve it making cirno the enemy and the enemies into boss.

Edit, new reply: Yeah, it helps! You can't make a plural file without a boss then  :V

By the way. How does CommonData works in this new engine? What's the difference using CommonData or AreaCommonData?
I couldn't understand from what I've read on the wiki
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on November 13, 2013, 07:57:12 AM
When running single scripts, one of the default_system scripts makes a boss scene for you. You tried to start the cirno boss script through the stage, so no boss scene was created. In general, trying to spawn a boss directly through the stage in this way won't work, but regular enemies don't need a boss scene to run, so switching cirno to a normal enemy "worked". Calling the enemies as bosses "worked" because you started the boss scene first and called them the way you're supposed to.

The second error would have occurred when you try to create a boss scene when the default-generated one already exists.

I'm sort of confused how you've structured the cirno boss and the other enemies. What does cirno.txt contain? You should be starting the boss scene and then adding the different patterns to the boss scene, like you currently have the 001 and 002 enemies.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: sjasogun1 on December 01, 2013, 06:05:23 PM
Not sure this should go here, but is there a way to get danmakufu running on Windows 7 Home Premium (which doesn't have language packs)?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: gtbot on December 01, 2013, 06:22:44 PM
As long as there are no Japanese characters in any of the scripts (player script/stg script), it will run without needing to switch locale.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: TresserT on December 13, 2013, 03:50:50 PM
Okay. So what I want is my bullets to bounce off some lasers, but the lasers are in the shape of an octagon along the edges of the screen. I have the formula for changing the angle of the bullets once they reach the laser; ObjMove_SetAngle(bulletObj, 180*cos(angleofthelaser)-ObjMove_GetAngle(bulletObj)). But I have no clue how to get the bullet to register that it has reached the laser. If the lasers were at 180 or 360 degrees I could just use an if statement with ObjMove_GetX or ObjMove_GetY. Is there any similar function or a mathematical forumla I could use to tell the bullet it's passed he laser? Or is there a better way to do this than if statements?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KrackoCloud on December 15, 2013, 03:15:12 AM
Man. I'm finally getting back into danmakufu, but everything is immensely hazy.

How can I get enemy bullets to not get deleted after a player dies?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on December 15, 2013, 09:09:49 AM
Man. I'm finally getting back into danmakufu, but everything is immensely hazy.

How can I get enemy bullets to not get deleted after a player dies?
Not quite sure, in 0.12m it was setting the spell resistance function for it.
http://dmf.shrinemaiden.org/wiki/Shot_Object_Functions#ObjShot_SetSpellResist

Not sure if in ph3 it is the same thing. Can someone confirm?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: JmLyan on December 15, 2013, 10:39:55 AM
Not quite sure, in 0.12m it was setting the spell resistance function for it.
http://dmf.shrinemaiden.org/wiki/Shot_Object_Functions#ObjShot_SetSpellResist

Not sure if in ph3 it is the same thing. Can someone confirm?

Spell resistance prevents deletion from player death. Unless the function that deletes bullets in the player script is set to delete TYPE_ALL instead of TYPE_SHOT.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KrackoCloud on December 15, 2013, 09:26:52 PM
Thanks! It looks like it was the player I was using that was the problem.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Alicirno on December 20, 2013, 03:38:10 PM
Hmm, how would you make a "double" boss, like the Tsukumo Sisters in DDC Extra?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: TresserT on December 20, 2013, 04:31:40 PM
Ooh, I know this one.

One way you could do it is choose one of them to be the actual boss. It doesn't matter which, and it'll have no effect on anything, I'll name it "Benben". Wherever you create the boss object "Benben", make another enemy but make this an ordinary enemy (use OBJ_ENEMY, not OBJ_ENEMY_BOSS), which I'll call "Recliner".

Change all your render tasks to have a variable parameter, such as "target", and everywhere the task would normally have "Benben", replace it with "target". Call every task requiring "target" twice, once with "Benben" and once with "Recliner".

If you want them to have a single health bar (like the Prismrivers) there are a couple ways to do it. I think the easiest way is double the amount of damage your shot does, then create only a hitbox for "Benben" at "Benben"'s location. Immediately after creating that hitbox, create another hitbox for "Benben" but create it at "Recliner"'s position. In your end task (the task that deletes the boss when it's health runs out) delete both "Benben" and "Recliner".

If you want to make each boss have a separate health bars (like in the Tsukumo's opening non spell) take your end task and give it the variable parameter "target". Call the end task twice, once with "Benben" and once with "Recliner". In the end task, remove the "CloseScript" function. Make another task that will only close the script once both enemy's health is equal to zero. Create a hitbox for each enemy and place it at their location. When you create "Recliner", also set it's health and damage rate.

If you want to make each boss have their own health bar, but have the spell end when either of them dies (like in the Tsukumo's spell cards) go about it as if they each had their own health bar (the paragraph above) but don't remove the "CloseScript" function from your end task.

Sorry if this is confusing, I hope I helped.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on December 20, 2013, 05:22:33 PM
You need a boss and a enemy. You can do it easily by having Benben as the boss and Yatsuhashi as the enemy.

First Set up Yatsuhashi's object (register her, set graphics ect...) then you want a task similar to TEnd, here's a piece of code from my Reisen and Tewi Boss.

http://pastebin.com/aZKXiT8s

obj is the Boss's object ID and fairy is the enemy's.

Then at the beginning of the next script when Yatsuhashi is called again use this.

ObjMove_SetPosition(objw, GetCommonData("tewix",NULL), GetCommonData("tewiy",NULL));

Of course, you would rename TewiX and TewiY to YatsuX and YatsuY or whatever.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Alicirno on December 20, 2013, 10:08:08 PM
Ah, thanks Tresser. I understand most of what you said, don't worry!  And also thanks Ultima! For some reason, I didn't think about using CommonData even though I had been using it for other stuff like PIV. I think I've got enough to make this.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on December 21, 2013, 11:25:00 AM
Not quite sure any more, was there a function/command to kill all active loops/threads in a script. CloseScript does this, however I was curious whether it was possible to kill the loops before calling CloseScript. If not, I'll just adjust my script flow though would make my life easier.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on December 23, 2013, 05:41:49 PM
I don't think so. Unless you're talking about break; though it only ends the task it was called in.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Kimidori on December 24, 2013, 08:57:57 AM
I'm new to this program, I have learned basic stuff like create a bullet, set boss, shot, BG, cutin graphic and such. my question is: is there any easy way to make bullets create a shape? like a star, flower, eye? or do I have to draw them by setting coordinate for every single bullet to make those shape? also once the shape is created is there anyway to rotate them while keeping the shape?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on December 24, 2013, 10:14:52 AM
You'd have to learn the geometry necessary for whatever shape you want to make. Most of the time it will involve some trigonometry. For a star of size R you could start at the center, move up R pixels and make a bullet there (making one "point" of the star), then move the spawn position from there towards another "point" on the star, then another, and so on until it makes the whole star.

(http://i.imgur.com/jTRj3mc.png)

So here you can see what I'm talking about. From the center you move up r pixels and your first bullet goes there. Then you move at a 72-degree angle and you place more bullets every so often depending on how dense you want the star to be. You do this until you hit the bottom-right point, then start moving at a 216-degree angle instead. Then a 0-degree angle, then 144, then 288 and you end up at the start with bullets placed along the red lines.

How this is accomplished is a lot more complicated than what you say you've done so far. So the answer is no, there isn't an easy way, if you want something as easy as setting backgrounds and moving around bosses.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 24, 2013, 05:19:57 PM
Hey guys,, I've got a small problem. I've created a script which almost completely works, but only almost. I don't know where this problem is. The main problem is that the laser shooting doesn't work. Whenever it shoots a laser the projectile is showed up shortly but nothing else happens. What did I wrong? The script is here (http://pastebin.com/WM2yr7uT). Oh and FYI, I'm a bit familiar with Danmakufu. In the non spell the Boss spawns some random bullets which are after some seconds aimed to the player plus some random bullets from the left and right side of the screen (similarly to Yuyuko's non spells in TD).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Rei Scarlette on December 24, 2013, 11:35:04 PM
Edit: Wait hold on, going over this again. I might have been totally wrong.
Edit2: Okay looks like I didn't click the wrong wiki section after all. I thought I forgot to click ph3 or something. Copypasting my old post then.
-----
I don't danmakufu often, so I'm sorry if I got this completely wrong. But I looked at that real quick and it looks to me like the laser is just created incorrectly. See this line.
Code: [Select]
objLaser = CreateStraightLaserA1(ex, ey, 3, dir, 50, 5, DS_NEEDLE_WHITE, 0);As can be found here (http://dmf.shrinemaiden.org/wiki/Shot_Functions#CreateStraightLaserA1), it goes (x-coordinate, y-coordinate, angle, length, width, delete time, graphic, delay).

And it looks to me like this laser lasts a very short 5 frames before being deleted. I haven't run your code or anything to be sure, but I assume that is not what you wanted.

Also, while you're fixing that, I think maybe you mixed up your length, width, and angle. Right now that'll shoot a laser, if I'm reading this correctly, that is fired at angle 3, "GetAngleToPlayer(objEnemy)" long, and 50 wide.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 25, 2013, 06:17:22 AM
Whoops, I've confused "CreateLooseLaserA1" with "CreateStraightLaserA1". My mistake. :D Oh well, at least, it works.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Kimidori on December 25, 2013, 10:34:54 AM
You'd have to learn the geometry necessary for whatever shape you want to make. Most of the time it will involve some trigonometry. For a star of size R you could start at the center, move up R pixels and make a bullet there (making one "point" of the star), then move the spawn position from there towards another "point" on the star, then another, and so on until it makes the whole star.

(http://i.imgur.com/jTRj3mc.png)

So here you can see what I'm talking about. From the center you move up r pixels and your first bullet goes there. Then you move at a 72-degree angle and you place more bullets every so often depending on how dense you want the star to be. You do this until you hit the bottom-right point, then start moving at a 216-degree angle instead. Then a 0-degree angle, then 144, then 288 and you end up at the start with bullets placed along the red lines.

How this is accomplished is a lot more complicated than what you say you've done so far. So the answer is no, there isn't an easy way, if you want something as easy as setting backgrounds and moving around bosses.

managed to create a star with loop... still have no idea how should I rotate them without breaking apart the shape though. :/

also do you have anything like that pic with a flower shape?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on December 25, 2013, 08:52:12 PM
You could get a flower shape by drawing out an epicycloid, which is a complicated shape but not too difficult to generate.
http://en.wikipedia.org/wiki/Epicycloid

Rotating the whole shape comes down to finding the distance from each bullet to the center of the shape, and moving the bullet in a circle with a radius of that distance, inside of a task. But of course you want the shape to move as well (as it's the thing being fired, really), so it's more like you want to fire the center point of the shape in some direction, know the distance from each bullet to the center according to the shape, and have the bullets rotate around the moving center keeping that distance from the center.

So if a bullet is distance r from the center of the shape, every frame you would position the bullet at (centerx + r * cos(t), centery + r * sin(t)) where t is the current angle of the shape.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on December 25, 2013, 09:25:31 PM
You could get a flower shape by drawing out an epicycloid, which is a complicated shape but not too difficult to generate.
http://en.wikipedia.org/wiki/Epicycloid

Rotating the whole shape comes down to finding the distance from each bullet to the center of the shape, and moving the bullet in a circle with a radius of that distance, inside of a task. But of course you want the shape to move as well (as it's the thing being fired, really), so it's more like you want to fire the center point of the shape in some direction, know the distance from each bullet to the center according to the shape, and have the bullets rotate around the moving center keeping that distance from the center.

So if a bullet is distance r from the center of the shape, every frame you would position the bullet at (centerx + r * cos(t), centery + r * sin(t)) where t is the current angle of the shape.

If you need code for curves, I abused them in PDD and transferring to ph3 is just a matter of renaming functions. Just keep in mind that for an epicycloid, r changes over time.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 26, 2013, 09:10:25 PM
What is the code to split bullets?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on December 26, 2013, 10:24:41 PM
What is the code to split bullets?
What exactly do you mean by 'split bullets'? Do you mean adding bullets to an existing bullet?

Example: Create a bullet and after 60 frames, make it turn right by 30 degrees. At that moment, make another bullet that turns left 30 degrees from the original angle.

Is this what you mean?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 27, 2013, 05:42:00 AM
I mean bullets which spawns another bullets and delete the old bullet. I know you can easily do it but what are you doing with this* chunk of code?

Code: [Select]
let i = 0;
while (i < length(bullets)){
if (Obj_IsDeleted(bullets[i])){
// The indexed shot has been deleted.  Remove it from the list
bullets = erase(bullets, i);

// The i-- here counters the i++ below.
// Since we're deleting the item at index i, the next element to check will
// now be at index i.
i--;
}
else
{
*the code itself*
}

         // When you're using this type of code, MAKE SURE that the loop variable is incrememted
         // properly, or the script will hang!!!
         i++;
}

Wouldn't you overwrite some variables?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: PhantomSong on December 27, 2013, 05:58:56 AM
I mean bullets which spawns another bullets and delete the old bullet. I know you can easily do it but what are you doing with this* chunk of code?
Wouldn't you overwrite some variables?

Hmmm could you post , in http://pastebin.com the whole code? I'm not quite sure what's trying to happen.

and you your trying to say like a bullet shoots down, then turns into a ring/circle of bullets?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on December 27, 2013, 06:08:02 AM
It's an array of bullets. It checks if the bullet at each index is deleted, and if it isn't it runs some code. If it is deleted it removes the object id from the array.
Say the array is [a, b, c, d, e, f] where all the entries are object ids. Then the loop runs over each entry and does something. If the object at index 3 has been deleted, erase(bullets, 3) would return [a, b, c, e, f] and then the bullets array is set to this updated array.

This sort of structure really depends on what you intend to use it for. You wouldn't use something like this without some specific reason in mind.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 27, 2013, 10:35:31 AM
Hmmm could you post , in http://pastebin.com the whole code? I'm not quite sure what's trying to happen.

and you your trying to say like a bullet shoots down, then turns into a ring/circle of bullets?
I got it cleared. However, a new appeared. The bullets which will be spitted are spawned with CreateShotA2. However, of some reason they'll spawn already with their maximal speed insteat of the speed they should spawn. That's the full command: "CreateShotA2(ex, ey, 10, angle, 1/60, 0, DS_BILL_GREEN, 5);" They should spawn with a speed of 10 but they won't move. It also happens on a different number like 1, 20, etc. or with a low acceleration. Can someone explain me why?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: ExPorygon on December 27, 2013, 10:45:26 AM
"CreateShotA2(ex, ey, 10, angle, 1/60, 0, DS_BILL_GREEN, 5);"
The sixth parameter of the CreateShotA2 function is the min/max speed of the bullet. Since you set it to 0 and have a positive acceleration, the bullet's speed can never be greater than 0. I think that the problem here is that you're giving it a positive acceleration. If I'm correctly understanding what you're trying to do, then you would want -1/60 as your acceleration. That way, the bullets will slow down, instead of trying to speed up.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: MarioFanGamer659 on December 27, 2013, 11:20:35 AM
Oh great, now the bullet move but it moves very fast. Even faster then the starting speed.

Edit: Fail, it worked. 10 is just very fast. :D
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on December 29, 2013, 11:54:48 AM
Is there a specific requirement or set of requirements for EV_GAIN_SPELL  to trigger proper?

In my spell card I am calling EV_REQUEST_LIFE, TIMER and SPELL_SCORE. Assuming SCORE is the vital requirement, as Rumia samples have the same set up. However, the EV_GAIN_SPELL won't trigger in a background script which is running next to the plural. I am not using god mode, nor using bombs.

Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on December 29, 2013, 02:04:23 PM
So you don't see anything when you clear a script? Or is the spell score not being added to your total score? 

AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));  Throw this line inside of TGainSpell.

If nothing is happening at all then I don't know because everything works fine for me.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on December 29, 2013, 03:42:38 PM
No, I was in general speaking of the EV_GAIN_SPELL event trigger. Nothing to do with score. It doesn't seem to respond and I was wondering what the conditions are as explained in my previous post. EV_TIMEOUT EV_START / END all respond proper in my background script.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: gtbot on December 29, 2013, 04:46:28 PM
Are you activating the spellcard by using ObjEnemyBossScene_StartSpell?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on December 29, 2013, 05:30:55 PM
Are you activating the spellcard by using ObjEnemyBossScene_StartSpell?
Splendid, now that was indeed the missing factor. Silly me. I remember in-depth analysing the magic circle behaviour of ExRumia before but as you dwell down to other areas, you quickly forget such simple things. orz

Thanks!
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: KuroArashi100 on December 31, 2013, 10:26:37 PM
I've been trying to recreate DDC stage 2's background, but I'm running into some trouble.
If I look at the game, it seems the stage is made up of multiple parts:
Two layers of water, the grass on the side of the road, the road, an empty surface made of stones on the other side of the road, and the dangling parts of willows that appear from above.
I think I've been successful enough in recreating most of the parts so far, except for the willow parts.

In the game, the willow parts seem to bend at certain points, and move randomly around within certain boundaries.
I just have no idea how to achieve that. Does anybody have any idea how I could do this?

If anyone wants to see, this (http://pastebin.com/2Q7wyLFS) is my current code.
It currently looks like this (http://imgur.com/RWccvHd), and I want to get something like this (http://imgur.com/gsk0Rz6).
Thanks in advance!
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on December 31, 2013, 10:51:03 PM
you would need to use 3D primitives in order to get the willows animated. sine the angle to get them to move back and forth.

I know nothing about primitives since ph3 has obj_sprite_2d.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on January 09, 2014, 09:30:51 AM
Returning to a problem which we discussed twice already, but still haven't managed to find a solid solution.

http://www.shrinemaiden.org/forum/index.php/topic,10181.msg1004887.html#msg1004887
http://www.shrinemaiden.org/forum/index.php/topic,10181.msg1021163.html#msg1021163

It is regarding again sound files being loaded into the memory. Yesterday night I noticed a huge drop in frames towards the end of my spell card. TL DR: doing trial & error + monitoring the ph3 log console, I noticed I had 4000 objects for some unknown reason. The sound files weren't deleted.

Logical, as I didn't script anything in there because I didn't want to have MPP-style sfx handling. (See above links). However, it seems the devs of MPP were already unable to figure out this issue so decided to simply delete the sound files after some random period of time. The results are painful and ugly. Sudden cutting off sounds is last thing I want.

So here I was breaking my mind about this. Let us sum up some facts we know so far:
- Sounds need to be loaded in memory first.
- A sound file can be only called once. For example: playing Master Spark sound 3x will simply overwrite each other and eventually the 3rd one will fully play.
- Huge FPS drop can occur if the number of objects are not properly removed (garbage collcting) ((I noticed this specifically with sound files)).

To explain the master spark example. Let us say we have a loop of 3x with a small delay between. Let us claim MasterSpark.wav has duration of 90 frames (to make it easier, I know it is longer).  We have scripted MPP style a delay of 90 frames, then simply call Obj_Delete. This is what will happen:

(http://i41.tinypic.com/2mequef.png)
The 2nd masterspark will overwrite the first, the third the second. However, the third master spark will be cut off by the timer from the first. (Still following this?). This is the major problem we're having.

Do we really have to go MPP style? It is quite sad that the Sound object division doesn't have a function to get the duration of a specific sound file (in samples). That way we could easily make the files auto-delete themselves after a period of time. And I know you can just give a parameter along, ie:  PlaySFX(sound,duration);  and use that to make it "flexible" but it still remains MPP style and the results are extremely ugly.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: gtbot on January 09, 2014, 01:55:11 PM
The way I handled sound was to, at the start of the script, create (and load) a sound object for each of my sounds, store the IDs into an array that's stored into common data, and then pull them out from the common data array whenever I need them. I do this by also have a second common data array that stores their names in the same order as the IDs. I imagine there are better ways to do this, but this might give you some starting ideas.

To cover your second point, playing a sound while it is already playing in this method will stop the previous sound, and start it over.

Edit: Just thought up of a better way; Save all the object IDs into variables (or array, but I think it's better to not use arrays? not sure) in the system script; while in the playing script, make a bunch of incrementing constants (0-number of sound effects), and then use NotifyEvent and EV_USER to pass the constant of the sound you want to play; in the system script, use alternative(argument) and check for which constant was sent, and play the appropriate sound. Kind of hard for me to explain, and I haven't tested it, but I imagine it would work.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on January 09, 2014, 03:29:03 PM
I like your idea, since that way no extra objects need to be created. Because if you use shot-sounds, you're going to automatically have hundreds of them anyway. Since the sound file is indeed just replayed for each time you call it within its ending, there is no reason to keep spawning sound objects. This would also definitely solve loading issues for large sound effects upon use.

I think Blargel had mentioned that arrays were slower, at least in 0.12m he did extensive testing to figure this out. Not sure about ph3, since Blargel hasn't bothered with it.

I didn't quite understand your edit to be honest.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: TresserT on January 09, 2014, 08:01:45 PM
Not quite sure if I should be putting this here, but this is what I've found. I put in
Code: [Select]
if(sin(bulletAngle) == 0)
{blahblahblah;}
with bulletAngle being 180. Nothing happened so I then tried
Code: [Select]
if(sin(180) == 0)
{blahblahblah;}
and still nothing happened. Thinking maybe I hadn't written something right, I tried
Code: [Select]
if(sin(0) == 0)
{blahblahblah;}
and it worked exactly as I wanted it to. I thought "maybe I'm just being stupid." So I googled the sine of 180 it's 0 or pi radians. Naturally, I tried to see if danmakufu would accept pi, π, 3.14, 3.134159265359, but none of them work. Is this a bug? If yes, is it known?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on January 10, 2014, 01:26:06 AM
It's an issue with floating point accuracy. In general you should never be checking if a sine or cosine value like that is exactly some number, especially if it's some angle variable that's constantly changing. Your condition is basically equivalent to (bulletAngle == 0 || bulletAngle == 180). But again if bulletAngle is changing, you aren't guaranteed to ever have it hit exactly 0 or 180. Use a different condition entirely, if possible.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on January 12, 2014, 04:35:15 PM
UPDATE: ph3 [.1 pre1] has been released!

http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_ph3.html (http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_ph3.html)

Edit: I've created pages for all 3 types of file objects and have updated most of the missing Get functions in ObjRender, etc. There is one new function from ph3 [.1 pre1] that I have not added, but the new ObjText_SetSidePitch has been added.

WARNING: The update may break scripts. A LOT of them. Please be aware that many of your scripts MAY NOT run correctly under pre1.

EDIT: The failure to load scripts, text border issues, and other problems have been confirmed by multiple people. Please DO NOT UPGRADE TO PRE1. If it works for you, that's great, but for most people, pre23 will be much more stable.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Helepolis on January 13, 2014, 02:15:39 PM
He has retracted his release on his website and is pointing at .0 release.

It is indeed wiser to stay on pre22 or 23 for now.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on January 14, 2014, 12:12:56 AM
For those who can't find pre23, I've uploaded a mirror here: http://www.mediafire.com/download/gdd643wxdx4gx10/ph3pre23.zip (http://www.mediafire.com/download/gdd643wxdx4gx10/ph3pre23.zip)

I actually don't know the identity of the [.0] release, which is sort of not easily accessible from the Wiki anyways. Please tell me if the mirror I uploaded doesn't unzip or *if I really messed up* has a different version.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Gusano Wornis on January 14, 2014, 06:45:38 PM
LOCAA is so dead T_T
well, my question is: how to make a triangle like this:
        l
       l l
      l l l
     l l l l
the angle is to the player. its for a explosive spell of my King Pig Boss Battle
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on January 14, 2014, 09:18:25 PM
Off the top of my head, if you fire the triangle at angle a and overall speed s, then each bullet of the triangle fired at angle b should be given a speed of s/cos(b-a).

EDIT: picture explanation

(http://i.imgur.com/wSlhiCi.png)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on January 14, 2014, 11:16:29 PM
Off the top of my head, if you fire the triangle at angle a and overall speed s, then each bullet of the triangle fired at angle b should be given a speed of s/cos(b-a).

EDIT: picture explanation

(http://i.imgur.com/wSlhiCi.png)

P.S. Drake: Gusano is unfamiliar with trigonometry.
Gusano: Are you trying to do something similar to Chen in PCB Stage 2? If so, both Qwerty (RaNGE 10) and I (PDD Extra) should have code that might work.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on January 15, 2014, 04:33:10 AM
Even if he's unfamiliar with trig, I gave the speed necessary. You just need to plug it in. (b-a) is just the offset, so if you did something like
ascent(i in 0..4){
   createshot(x, y, s/cos(i*3), a + i*3, g, d);
   createshot(x, y, s/cos(i*3), a - i*3, g, d);
}
it should be fine.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: TheScriptwriter on January 21, 2014, 05:27:21 PM
Ok, so I wrote this:
Code: [Select]
task fireInArc {
let dir = angleToPlayer;
let numShot = 6;
let arc = 180/2;
let arcUp = 180/numShot;
ascent(i in 0..numShot+1)
{ CreateShotA1(bossX,bossY,3,(dir-arc)+(arcUp*i),14,0); }
// ascent(i in 0..numShot)
// { CreateShotA1(bossX,bossY,3,(dir-arc)+(arcUp*(i+1)),14,0); }
}
And it works fine. I get 6 shots (+1) in a perfect 180 arc that angles toward the player. However, I wonder how can I remove that numShot+1 from ascent without breaking the arc (more correctly, making the arc fall short of 180 deg's).

This code also has that problem:
Code: [Select]
task triangleShot2 {
let s = 3; // speed.
let a = GetAngleToPlayer(bossObj)-(180/2); // angle.
let numShot = 6;

loop (numShot) {
ascent(i in 0..4) { // ascends the number of waves.
ascent(ii in 0..i+1) { // ascends the bullets spread(arc).
CreateShotA1(bossX, bossY, s/cos(i*3), (a-i) + (ii*2), 81+i, 0);
}
wait(3)
}
a += 180/numShot;
}
}
But this code, I also want the loop to fire instantly, but when I remove the wait, the Triangles become Bullet Walls. yikes!
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Shadow on January 22, 2014, 03:15:27 AM
You probably want to use the formula Arc_Width/(Bullet_Number-1) instead of increasing the number of loops by 1, if that is what you were referring to. If you simply use "numShot" in the ascent with your current angle calculation, it is only going to form 6 bullets without "closing" the arc correctly, as you're calculating the angle interval with one more bullet than you are supposed to.

As for your second problem, it is not /quite/ easily solved as you would need to rework your task logic to simultaneously create the five triangles' tips, wait three frames,  create the second layer of bullets, wait three frames, and so on. You could also make a task with an "angle" parameter, and make it fire a single triangle at that direction. Because tasks always run parallel regardless of scope, you can then call the task five times somewhere else without worrying about timing issues.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Baron_Blade on January 27, 2014, 07:09:40 PM
I'm a total noob with Danmakufu, so I'm sorry about this question. But how do I spawn an object bullet? From the wiki, it seems that you need a combination of Obj_Shot and Obj_Render commands, but I'm not sure which ones to use. Here's what I'm trying right now:
        ObjShot_Create(OBJ_SHOT);
   ObjRender_SetPosition(sides,bossX,bossY,0);
   ObjRender_SetAngleXYZ(sides,GetAngleToPlayer(bossObj),GetAngleToPlayer(bossObj),0);
   ObjShot_SetGraphic(sides,54);
   ObjShot_Regist(sides);
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sparen on January 27, 2014, 09:58:50 PM
I'm a total noob with Danmakufu, so I'm sorry about this question. But how do I spawn an object bullet? From the wiki, it seems that you need a combination of Obj_Shot and Obj_Render commands, but I'm not sure which ones to use. Here's what I'm trying right now:
        ObjShot_Create(OBJ_SHOT);
   ObjRender_SetPosition(sides,bossX,bossY,0);
   ObjRender_SetAngleXYZ(sides,GetAngleToPlayer(bossObj),GetAngleToPlayer(bossObj),0);
   ObjShot_SetGraphic(sides,54);
   ObjShot_Regist(sides);


Use ObjMove in order to control the bullet itself. Register it after creating it. You might want to set speed and angle (use ObjMove)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Shadow on January 27, 2014, 10:31:05 PM
Whoops, posted this by accident. Editing in a bit.

EDIT: And then I accidentally double post. I apologize for that, please delete this post. ^^;
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Baron_Blade on January 27, 2014, 10:40:40 PM
I did all of that, but now it comes up with an error on the line where I register the shot's ID.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Shadow on January 27, 2014, 10:44:40 PM
First and foremost, you want to first retrieve the object shot's ID so you can manipulate it. You can do this by:

Code: [Select]
let obj = ObjShot_Create(OBJ_SHOT);
This declares a variable named "obj", with the object shot's ID stored in it. This is so you can manipulate it in any way you want in the same scope you are creating it. Now, there is a second problem--"ObjRender" functions only affect sprites or other graphical objects; you are by no means actually setting the bullet's position to the boss' x and y coordinates and having it aim at the player. You do this with ObjMove functions. Taking all of this into account, you have:

Code: [Select]
ObjMove_SetPosition(obj,bossX,bossY,0);
ObjMove_SetAngle(obj,GetAngleToPlayer(bossObj));
ObjMove_SetSpeed(obj,3);
ObjShot_SetGraphic(obj,54);
ObjShot_Regist(obj);

This should create your object bullet (I gave it an arbitrary speed).

If you completely new to Danmakufu, I would suggest experimenting with CreateShotA first before delving into object bullets, though. From the looks of it, you can do the exact same thing you want using CreateShotA1 with the correct parameters.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on January 27, 2014, 11:15:46 PM
Since an object bullet is basically CreateShotA1 but broken down into parts you can use

let obj = CreateShotA1(...); and use functions like ObjMove_ functions and ObjRender_ functions respectively.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Baron_Blade on January 28, 2014, 02:27:32 AM
I forgot to mention when I was making this object that I intended to reflect it, which I've gotten to work for the most part. But when I run my current code, it has a delay on the second object, and when I have the while loops separate from the object creation blocks entirely, the second object won't reflect. Here's what I've got so far:

task bounceFire {     
   let shot1 = ObjShot_Create(OBJ_SHOT);
   ObjShot_Regist(shot1);
   ObjMove_SetPosition(shot1,bossX,bossY);
   ObjMove_SetAngle(shot1,rand(30,60));
   ObjMove_SetSpeed(shot1,4);
   ObjShot_SetGraphic(shot1,54);
   
   while(!Obj_IsDeleted(shot1)) {
      if(ObjMove_GetX(shot1) > 386) {
         ObjMove_SetAngle(shot1,180-ObjMove_GetAngle(shot1));
      }
      yield;
   }
   
   let shot2 = ObjShot_Create(OBJ_SHOT);
   ObjShot_Regist(shot2);
   ObjMove_SetPosition(shot2,bossX,bossY);
   ObjMove_SetAngle(shot2,rand(120,150));
   ObjMove_SetSpeed(shot2,4);
   ObjShot_SetGraphic(shot2,54);
   
   while(!Obj_IsDeleted(shot2)) {
      if(ObjMove_GetX(shot2) < 0) {
         ObjMove_SetAngle(shot2,180-ObjMove_GetAngle(shot2));
      }
      yield;
   }
}
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Sage Ω (Ultima) on January 28, 2014, 07:18:58 AM
The second object doesn't reflect because it doesn't exist. It doesn't exist because while loops and any kind of loop command repeats either for a set number of times (times() loop()) infinitely (loop{} @MainLoop{}) or while conditions are met aka "while" loops, when you use these commands it repeats whatever is inside of it until conditions are no longer met. This rule also applies to ascent/descent as well.

So with you're current code set up the second object isn't even spawned until after the first bullet has been deleted according to the while loop you have set. I don't exactly see the purpose in creating two objects bullets on top of each other with different reflecting rules, you can just merge it together as one bullet so eliminate unnecessary lag. If anything you can easily separate the two bullets into different tasks but again unnecessary.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Drake on January 28, 2014, 08:12:47 AM
Yes, you're currently telling it to fire the first bullet, then wait until it's deleted, then fire the second bullet.

Code: [Select]
task bounceFire(angle){     
   let shot1 = ObjShot_Create(OBJ_SHOT);
   ObjShot_Regist(shot1);
   ObjMove_SetPosition(shot1,bossX,bossY);
   ObjMove_SetAngle(shot1,angle);
   ObjMove_SetSpeed(shot1,4);
   ObjShot_SetGraphic(shot1,54);
   
   while(ObjMove_GetX(shot1) <= 386 && ObjMove_GetX(shot1) >= 0) {
      yield;
   }
   ObjMove_SetAngle(shot1,180-ObjMove_GetAngle(shot1));
}

With something like this you just need to specify the initial firing angle, as said, there's no need to make two different bullets for it.
Also I hope you can see what I did with the while loop.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre2x)
Post by: Baron_Blade on January 28, 2014, 11:52:49 AM
Oh, that makes sense. Thanks!
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on February 03, 2014, 09:42:04 PM
So, I'm finally working on an actual stage, and I've come to the quick realization that Danmakufu apparently no longer has ways to create enemies from files like in 0.12m.

I've checked around, but the only method that I can understand is Ozzy's, which involves loading a script, notifying that script's @Event, and using nested tasks in order to create enemies.

Is there a method that does not involve nested tasks? Preferably, is there a method that allows you to store individual enemy data in separate files and then load them into a stage script?

Thank you.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Validon98 on February 03, 2014, 09:58:19 PM
Well I'm utterly confused. I went and I used a functional test spell as a template for making other spell cards. However, another spell with nearly the same commands refuses to outright work, and although I've pinpointed the probelm to originating in the TShot task, I have no idea why it freezes up and fails to work in the new card when it works fine in the first. Here are the TShots in the original and new files.

Original:
Code: [Select]
task TShot
{
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let angle = 0;
while(angle<360)
{
if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0){return;}
let obj = CreateShotA2(ex, ey, 3, angle, 0, 0, DS_SCALE_GREEN, 0);//弾を発射
ObjMove_AddPatternA4(obj, 60, 4, 0, 0, 0, 0, GetPlayerObjectID, DS_SCALE_RED);
angle += 10;
}

loop(60){yield;}
}

New:
Code: [Select]
task TShot
{
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
//let px = GetPlayerX;
//let py = GetPlayerY;
let angle = 0;
let radius = 60;
let sx = 0;
let sy = 0;
//while(angle<360)
//{
//if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0){return;}
//px = GetPlayerX;
//py = GetPlayerY;
//sx = px+radius*sin(angle);
//sy = py+radius*cos(angle);
//let obj = CreateShotA2(sx, sy, 3, angle, 0, 0, DS_ICE_SKY, 0);
//angle += 120;
//}
//The below serves as an example of a shot, use whatever code is really needed. Use additional tasks if needed.
while(angle<360)
{
if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0){return;}
let obj = CreateShotA2(ex, ey, 3, angle, 0, 0, DS_SCALE_GREEN, 0);//弾を発射
ObjMove_AddPatternA4(obj, 60, 4, 0, 0, 0, 0, GetPlayerObjectID, DS_SCALE_RED);
angle += 10;
}

loop(60){yield;}
}

The commented out part is the actual code for what I want to do, but I commented it out to test the original pattern the file was based off of.

EDIT: Never mind, my problem was in the TWork task and not putting a yield where it belonged.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on February 03, 2014, 10:05:41 PM
Well I'm utterly confused. I went and I used a functional test spell as a template for making other spell cards. However, another spell with nearly the same commands refuses to outright work, and although I've pinpointed the probelm to originating in the TShot task, I have no idea why it freezes up and fails to work in the new card when it works fine in the first. Here are the TShots in the original and new files.
Code: [Select]
task TShot
{//New code
}

The commented out part is the actual code for what I want to do, but I commented it out to test the original pattern the file was based off of.

Is there an error message? Also,

   while(angle<360)
   {   
      if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0){return;}
      let obj = CreateShotA2(ex, ey, 3, angle, 0, 0, DS_SCALE_GREEN, 0);//弾を発射
      ObjMove_AddPatternA4(obj, 60, 4, 0, 0, 0, 0, GetPlayerObjectID, DS_SCALE_RED);
      angle += 10;
   }

is the same thing as

    loop(36){
      if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0){return;}
      let obj = CreateShotA2(ex, ey, 3, angle, 0, 0, DS_SCALE_GREEN, 0);//弾を発射
      ObjMove_AddPatternA4(obj, 60, 4, 0, 0, 0, 0, GetPlayerObjectID, DS_SCALE_RED);
      angle += 10;
    }

It will spawn a ring of 36 shots all at once. I don't know why you're using a while loop. Also, get rid of the Japanese; some scripts have bugs when you have Japanese characters in them.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Validon98 on February 03, 2014, 11:37:28 PM
Quote
EDIT: Never mind, my problem was in the TWork task and not putting a yield where it belonged.

But thanks anyways. Also I just used a while loop because I'm so used to them. I forgot a for() loop can do the same thing in this case. :V
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on February 04, 2014, 09:10:06 PM
But thanks anyways. Also I just used a while loop because I'm so used to them. I forgot a for() loop can do the same thing in this case. :V

Uh... for loops? They sort of don't exist in Danmakufu as far as I know...

P.S. Regarding stage enemies, I managed to do them in a neat and concise way that resembles rather unsightly ports from 0.12m to ph3.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Fraug on February 05, 2014, 07:45:33 PM
Is there a way to make a texture on a mesh scroll by constantly offsetting it?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sage Ω (Ultima) on February 05, 2014, 08:10:41 PM
No, because the texture is preset and danmakufu's texture manager just reads the data set by Meta or Elfriena(which ever one you use). Unless you wanna take a shot at using Primitive3D objects to recreate the mesh it is impossible and something you can request mkm to add because ph3 would litterally have to have the ability to set materials and such, in others the danmaku engine would be a 3D game engine.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: KuroArashi100 on February 10, 2014, 07:08:24 PM
So, I'd like someone else to look at something that has been confusing me for a while.
I'm currently trying to make a spellcard history thingy, and pretty much everything is going according to plan, everything shows up, the number of captured spells increases, the number of total attempts increases etc.

The one thing that doesn't work however, is when I fail at a spellcard, it won't always recognize that, and sometimes it actually counts the failed spellcard as a captured one.
After some testing, I think I found the error, I just don't understand what's going wrong.

For reference, I'm calling the objects and setting up the commondata at the start of the task, then I use an while(!Obj_IsDeleted(objBoss)) for placements and such, and I placed an if statement to check if the amount of bombs used/lives lost is larger than zero. This makes a variable turn from true to false, and after the boss is deleted, if the variable is true, one is added to the commondata that stores the total amount of captures.
Code: [Select]
if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) > 0 || ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT > 0)){
get = false;
}
Drawing the get variable on the screen reveals that it only checks for possible bombs used, and not for lives lost, and vice-versa if I swap the two statements.
I don't really get why it doesn't check for both - can someone else shed some light on this if they know about it?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Drake on February 10, 2014, 07:31:42 PM
Time to feel very silly:
if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) > 0 || ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT) > 0)
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: KuroArashi100 on February 10, 2014, 08:20:16 PM
... Oops. Yep, that is a pretty stupid mistake. It seems like I have a much harder time finding those than other errors. :)
But thanks anyway, because if I hadn't gotten the answer, I would be looking at this same piece of code for the next few weeks.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Drake on February 10, 2014, 11:58:50 PM
Do you use a text editor that has bracket matching? Because it's extremely helpful to have, as you can imagine.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: KuroArashi100 on February 11, 2014, 07:27:29 AM
Yes I do, I'm currently using Sublime Text 2 because my eyes get less tired because of the dark background.
I use the bracket matching quite a lot, so that isn't really the problem. I haven't really figured out why these errors leave me stumped so much; I just seem to read over them. I usually have much less trouble finding other problems.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Validon98 on February 12, 2014, 02:33:46 PM
Hurking over something that's probably just me derping somewhere, but nevertheless...
Essentially, I'm trying to get lasers to rotate around a static point (think Youkai Polygraph), but the lasers kinda refuse to rotate. I got them to be able to rotate before when they were spawned one at a time and within the while loop in the TWork, but for no apparent reason they won't work if they are simply spawned outside of that loop. I'm confused.

TWork and TShot for reference:

Code: [Select]
task TWork
{
//The below cut in function should be changed when needed.
cutin(KANAKO,rumiaCutIn,0,0,687,1000);

let cx = GetStgFrameWidth() / 2;
let cy = GetStgFrameHeight() / 2;
ObjMove_SetDestAtFrame(objEnemy, cx, cy, 60);

let objScene = GetEnemyBossSceneObjectID();
ObjEnemyBossScene_StartSpell(objScene);

//The below is for the delay between the cut in and when bullets start spawning.
loop(120){yield;}

TShot;

//The below will contain all of the tasks needed for the shots.
while(!Obj_IsDeleted(objEnemy))
{
loop(60){yield;}
}
}

Code: [Select]
task TShot
{
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let counter = 0;
let angle = 0;
let angle2 = 60;
let angle3 = 120;
let angle4 = 180;
let angle5 = 240;
let angle6 = 300;

let obj = CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30);
let obj2 = CreateStraightLaserA1(ex,ey,angle2,500,50,2700,DS_BEAM_BLUE,30);
let obj3 = CreateStraightLaserA1(ex,ey,angle3,500,50,2700,DS_BEAM_BLUE,30);
let obj4 = CreateStraightLaserA1(ex,ey,angle4,500,50,2700,DS_BEAM_BLUE,30);
let obj5 = CreateStraightLaserA1(ex,ey,angle5,500,50,2700,DS_BEAM_BLUE,30);
let obj6 = CreateStraightLaserA1(ex,ey,angle6,500,50,2700,DS_BEAM_BLUE,30);

loop(2700)
{
angle--;
angle2--;
angle3--;
angle4--;
angle5--;
angle6--;
ObjStLaser_SetAngle(obj, angle);
ObjStLaser_SetAngle(obj2, angle2);
ObjStLaser_SetAngle(obj3, angle3);
ObjStLaser_SetAngle(obj4, angle4);
ObjStLaser_SetAngle(obj5, angle5);
ObjStLaser_SetAngle(obj6, angle6);

}

yield;
}
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sage Ω (Ultima) on February 12, 2014, 02:53:04 PM
it doesn't work because there is no yield within the loop so as soon as the task is called it has already finished moving the lasers. classic case of not having your yields in the right place. There's also no need to have so many variables when you can use an array.

Here's a shortened version of the task that is cleaner and easier to manage. I also suggest making a function to get the x and y of the boss.
Code: [Select]
task TShot
{
let ex = ObjMove_GetX(objEnemy);
let ey = ObjMove_GetY(objEnemy);
let counter = 0;
let angle = 0;

let obj = [
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30),
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30),
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30),
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30),
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30),
        CreateStraightLaserA1(ex,ey,angle,500,50,2700,DS_BEAM_BLUE,30)
        ];

        ascent(i in 0..length(obj)){
        ObjStLaser_SetAngle(obj[i], angle);
        angle+=360/6;
        }

loop(2700)
        {
        ascent(i in 0..length(obj)){
        ObjStLaser_SetAngle(obj[i], angle);
        }
        angle--;
        yield;
        }


}
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Validon98 on February 12, 2014, 03:12:49 PM
Of course it was a yield; problem! It seems to be a recurring problem with me. :V
Also I can't believe I forgot arrays were a thing either. Well, I'll have to remember this for later for if I need to do similar things in the future! ^^;
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: AshyPie on February 14, 2014, 07:58:11 PM
I can't seem to load custom shot data... I use the default and it works fine but when I try loading custom data it doesn't load.

LoadEnemyShotData(GetCurrentScriptDirectory ~ "ShotData.txp");
(The .txp is intentional, that's the actual extension)
I have this under @Initialize but my shots disappear when I do this.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on February 14, 2014, 11:16:41 PM
I can't seem to load custom shot data... I use the default and it works fine but when I try loading custom data it doesn't load.

LoadEnemyShotData(GetCurrentScriptDirectory ~ "ShotData.txp");
(The .txp is intentional, that's the actual extension)
I have this under @Initialize but my shots disappear when I do this.

Are you loading the texture as well as the shot data?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sage Ω (Ultima) on February 14, 2014, 11:39:03 PM
I can't seem to load custom shot data... I use the default and it works fine but when I try loading custom data it doesn't load.

LoadEnemyShotData(GetCurrentScriptDirectory ~ "ShotData.txp");
(The .txp is intentional, that's the actual extension)
I have this under @Initialize but my shots disappear when I do this.

check that the path for the shotsheet is correct, make sure the path of the image for the shotsheet is also correct.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: AshyPie on February 15, 2014, 05:37:07 AM
Are you loading the texture as well as the shot data?
I referenced the image in the shot data is this how you do it?
shot_image = GetCurrentScriptDirectory ~ "ShotIndex.png";
Do I load the graphic in the script or is this enough...
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sage Ω (Ultima) on February 15, 2014, 02:14:45 PM
you can't use functions inside of shotsheets. "./" is the same as GetCurrentScriptDirectory~"/" you also can't use semicolons either.

so in your case you would use shot_image = "./ShotIndex.png"
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: AshyPie on February 15, 2014, 09:30:53 PM
you can't use functions inside of shotsheets. "./" is the same as GetCurrentScriptDirectory~"/" you also can't use semicolons either.

so in your case you would use shot_image = "./ShotIndex.png"
I'm not at my computer right now but I'm going to assume that is the problem... Thank you!
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on February 19, 2014, 02:48:10 PM
So I'm at a stage in DEC where I feel like I want it to be a decent game. So... I need a scoring system, and ph3 doesn't have a default (as far as I know).

So I need to use AddScore. In many places.

Point items and spell card bonuses work (thanks to point items being self-explanatory and thanks to Talos). I can probably implement graze by putting AddScore in the player script's EVent. But how would I go about adding score for hitting enemies? Would it be as simple as adding score when a player shot hits an enemy, or would it involve some script info being placed in a system file or the like?

Thanks.

EDIT: I got it to work. Balancing is a different issue.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on March 01, 2014, 05:38:28 PM
Danmakufu [.1 pre3] has been released. Scripts by TalosMistake and other scripters that #included an empty file should now work. Curvy laser tips can be set to not be transparent using ObjCrLaser_SetTipDecrement. It is now possible to test if an object is visible. You can now set intersection lines for shots and can get the total height/width of a text object. You can also set Hue, Saturation, and Value for a render object.

(The download has some problems. However, it has been reported).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Helepolis on March 02, 2014, 08:17:25 AM
Why would you include an empty file anyway in the first place? :V

This seems like a good release, also for sound effect lovers, Drake's sound-pan script was actually also realised by mkm's own method it seems.

Though wondering why mkm hasn't done anything yet regarding the multiple-times calling of wav files (so they dont replay).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sage Ω (Ultima) on March 02, 2014, 01:30:13 PM
This seems like a good release, also for sound effect lovers, Drake's sound-pan script was actually also realised by mkm's own method it seems.

Actually it was a last minute request made by gt and me. lol I made requests for fixing the alpha on the tips of lasers, ObjIsVisible, and GetVertexPosition. I guess he might've forgotten about that SetPlayerState function I had asked for, which is ok. There were other stuff I wanted but it would not be possible without rewriting the engine again.(multi-threading, Antialias)

Anyway, the download link was fixed last night so enjoy the update everyone.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Helepolis on March 03, 2014, 07:48:28 PM
I have a question regarding the boss animation it self which I am somewhat struggling in ph3. It is about the floating gently up/down (comparable to the pulsing red circle).

Now getting the floaty animation going isn't the issue, the problem is that both ObjRender_SetPos and ObjMove_SetPos alter the actual position of the object. Or in other words, when you spawn a bullet contineously, you will see the starting point of the bullet being offset by the boss' position at that time.

I am thinking of spawning 2 objects where one is the 'enemy' type and the other one a sprite. The enemy will be invisible but be the actual position and the sprite being the floaty animation. Except this is all extremely iffy and work-aroundish so perhaps someone has a better idea.

Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: ExPorygon on March 03, 2014, 10:38:11 PM
I have a question regarding the boss animation it self which I am somewhat struggling in ph3. It is about the floating gently up/down (comparable to the pulsing red circle).

Now getting the floaty animation going isn't the issue, the problem is that both ObjRender_SetPos and ObjMove_SetPos alter the actual position of the object. Or in other words, when you spawn a bullet contineously, you will see the starting point of the bullet being offset by the boss' position at that time.

I am thinking of spawning 2 objects where one is the 'enemy' type and the other one a sprite. The enemy will be invisible but be the actual position and the sprite being the floaty animation. Except this is all extremely iffy and work-aroundish so perhaps someone has a better idea.
That workaround is unnecessary. Instead of using ObjSprite2D_SetDestCenter, use ObjSprite2D_SetDestRect to move the image around the boss's coordinates without moving the boss object itself.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Drake on March 03, 2014, 10:39:43 PM
That's exactly what the Render object part is for though. An ObjEnemy is composed of a Move object and a 2D Sprite object, which is a Primitive and Render object. ObjRender_SetPosition() shouldn't affect the Move object of the enemy, and so it shouldn't affect the spawning position of bullets, unless you're using ObjRender_GetX/Y() when firing them for some reason. Something else is going wrong here.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Helepolis on March 04, 2014, 06:55:25 AM
Ozzy, that is exactly an alternative I attempted but got stuck with the repositioning. Drawing the sprite correctly using SetDestRect and moving it proper around with the boss, how do you intend to do that?

Drake, here below the familiar script to implement the same thing. I am altering ObjRender to move the sprite up/down but the bullets will "wave along"
Code: [Select]
task laserFam(x,y) {
let obj = ObjEnemy_Create(OBJ_ENEMY);
let laserPos = 0;
laserFrame = 0;

ObjEnemy_Regist(obj);
ObjPrim_SetTexture(obj,laserTex);
ObjRender_SetScaleXYZ(obj,scale,scale,0);
ObjSprite2D_SetSourceRect(obj,0,0,256,128);
ObjSprite2D_SetDestCenter(obj);
ObjMove_SetPosition(obj,x,y);

exploEffect(GetEnemyX-25,GetEnemyY,0.9,3);
concenEffect(obj,240,1,64,64,255);
concenEffect(obj,80,3,64,255,64);
while(!Obj_IsDeleted(obj)) {
ObjRender_SetPosition(obj,ObjMove_GetX(obj),ObjMove_GetY(obj)+laserPos,0);
laserPos += cos(laserFrame)/180;
laserFrame+=2;
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),1,180,103,5);
yield;
}
}

I am actually thinking of pointing this out to mkm-san. It doesn't makes any sense as Drake mentions. Render should be explicitly intended for sprite behaviour not for the true position.

Edit Posted on mkm-san's bbs with a sample script of Rumia and screenshot. Lets see what his opinion is about this.

Edit2:
Quote
[08:53:58] <Helepolis> Mkm: A object has only one position.
[08:53:58] <Helepolis> ObjMove_SetPosition and ObjRender_SetPosition are about the same.
[08:53:58] <Helepolis> (But ObjMove_SetPosition has better precision.)
[08:53:58] <Helepolis> When the bullets appear from another position,
[08:53:58] <Helepolis> it is necessary to manage another position independent with the boss object.
[08:54:02] * Helepolis shrugs

Not quite sure how to interpret his words, almost seems as if he is telling me to use 2 objects (like I initially mentioned).
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: gtbot on March 08, 2014, 10:14:39 AM
I interpreted his response as, essentially, "create a second object to manage the boss sprite".

But regarding the SetDestRect, suppose your boss image is 64x48. You'll want to manually set the dest rect so you can visually move the sprite, as such:

ObjSprite2D_SetDestRect(obj, -32, -24, 32, 24);

That will center it. To make it move up and down, introduce a sin variable that will add onto the y values.

Code: [Select]
let m = 0;
let mv = 0;
(loop){
    ObjSprite2D_SetDestRect(obj, -32, -24+m, 32, 24+m);
    m = sin(mv)*5;
    mv+=9;
}
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Helepolis on March 08, 2014, 12:59:51 PM
I see, your code looks similar to the one I implemented for the SetPos, except you're altering the DestRect as Ozzy mentioned before. I'll give that a go after lunch and report the results.

Edit
I totally understand it now. I was major confused with the code and the way to interpret it. I remember that Drake on IRC told me that it was ObjSprite2D_SetDestCenter(obj); being a culprit but for what reason I couldn't quite get. The way you explained -32 , 32 for the left to right coordinates immediately made me realise this is like the effect objects in 0.12m using 4 vertex to create a rectangle.

ObjSprite2D_SetDestRect(); begins at the centre of the obj where  ObjSprite2D_SetDestCenter(); positions the texture at the centre depending on the SourceRect.

Thanks for the info, now I can apply proper animation for my boss/enemies. Cheers.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Kimidori on March 13, 2014, 09:16:09 AM
It seem like making a nice flight path and shaped danmaku is hard without much knowledge of Geometry and/or Trigonometry. ._.

I still haven't been able to make a flower shaped danmaku without manually placing bullet to draw them out....

Would anyone be so kind to give me a sample code of drawing a flower with math?
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Sparen on March 13, 2014, 01:33:34 PM
Please elaborate on which kind of flower you are looking for. Talos has used flowers before, and polar/parametric equations can easily generate a flower pattern.
Title: Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
Post by: Helepolis on March 13, 2014, 09:54:05 PM
!

Yo yo, listen up.
Thread reached its limit.
You might want to visit.
The new thread rocking sock: http://www.shrinemaiden.org/forum/index.php/topic,16584.0.html
As this one gets the lock.

(https://pbs.twimg.com/profile_images/2804773941/dbb7e8bd78df0bdfebc03bf6bed7f8bb.jpeg)

Old thread stays sticky for 24-48h to help people notify.