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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1290 on: May 25, 2018, 04:31:31 AM »
Hmm, I was trying to figure it out myself and looking some others scripts for "reference"...  :blush:
Short Long Story : I can't figure dialogue.
Long Story : I know that it has do to do with pictures and frames, but I don't know where to start or any tutorial/easier example of...
A dialogue is nothing more than drawing two 2D sprite images on your screen and showing/hiding them depending on the "dialogue". Like 2D sprite A -> Alpha 255 while sprite B is Alpha 55 (transparency).

Why don't you look at the existing 0.12m dialogue functions? If you mimic the behaviour of those functions you should basically have a simple dialogue system already.

Can I use a 3d model like a sprite?(I mean like a boss sprite, with it having animations and etc)
Don't see why you can't. You just need to make sure the 3D model is following the object movement of your "invisible" boss object. (And making sure the collisions are set). About the animations, can't say.
« Last Edit: May 25, 2018, 04:34:13 AM by Helepolis »

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1291 on: May 25, 2018, 11:48:26 AM »
May I ask what the mathematics of the timing behind ObjMove_SetDestAtWeight() are?
How is it numerically related to the max speed and weight and distance values?

Drake

  • *

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

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1293 on: May 25, 2018, 10:32:00 PM »
Why I'm being "blocked"?
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1294 on: May 26, 2018, 02:42:33 AM »
Why I'm being "blocked"?

The Danmakufu Wiki is currently down and not accessible.

For the ph3 official documentation, refer to http://www.geocities.co.jp/SiliconValley-Oakland/9951/pre/th_dnh_help_v3.html
For my incomplete backup, refer to http://sparen.github.io/ph3tutorials/docs.html

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1295 on: May 26, 2018, 03:42:33 AM »
Or you could just use the Web Archive version of the wiki.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1296 on: May 26, 2018, 07:39:19 AM »
Going to relay the mediawiki error to TSO.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1297 on: May 27, 2018, 01:37:41 AM »
Is Danmakufu considered a difficult language to program compared to others?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1298 on: May 27, 2018, 01:41:08 AM »
Is Danmakufu considered a difficult language to program compared to others?

Danmakufu is highly specialized for a certain type of game. It is not comparable to general purpose languages.

For example, if I wanted to write, say, AES in Danmakufu, I would find it drastically harder than in a language such as Go or C++. If I wanted to write a program in Danmakufu that allows you to make a custom GUI by dragging and dropping buttons and exporting it to JSON, I could *technically* do it but it would likely not be worth the effort and would be better done in another language.

So is it difficult? No. Is it practical for non-Danmaku game related programming? Also no.

-----

Now, comparing to other languages/frameworks for making games, I personally have no experience with RPG Maker or Game Maker, but RPG Maker is meant for RPGs while Game Maker is more general purpose. Both are relatively easy to pick up, but when making Danmaku games, neither will be as easy to use as Danmakufu. As for Unity and C#, making a Danmaku game in Unity probably takes 20x longer than making one in Danmakufu.
« Last Edit: May 27, 2018, 01:44:17 AM by Sparen »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1299 on: May 27, 2018, 08:50:37 AM »
Hi there,

I'm currently stuck with two things I want to implement:

First is saving a highscore and spellcard-history. It should be something with CommonData, but I can't figure out how exactly I have to use that.
Second is textboxes. They are basically just pictures and text, some routine that waits for keyinput so the rest of the script can resume, but I can't get it working properly.

Help would be very appreciated, thanks!

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1300 on: May 27, 2018, 02:18:43 PM »
Hi there,

I'm currently stuck with two things I want to implement:

First is saving a highscore and spellcard-history. It should be something with CommonData, but I can't figure out how exactly I have to use that.
Second is textboxes. They are basically just pictures and text, some routine that waits for keyinput so the rest of the script can resume, but I can't get it working properly.

Help would be very appreciated, thanks!
I can say that the first you are going to use area common data.
For the second, use while(keyinput){yield;}.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1301 on: May 27, 2018, 04:19:18 PM »
First is saving a highscore and spellcard-history. It should be something with CommonData, but I can't figure out how exactly I have to use that.
Look at 34th page of this thread, I've asked the similar question and the explanations given were pretty easy to understand

Tom

  • *
  • Programmer
    • LunarCast Network
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1302 on: May 27, 2018, 10:00:44 PM »
As for Unity and C#, making a Danmaku game in Unity probably takes 20x longer than making one in Danmakufu.
Haha, I can say from experience, making a Danmaku game in Unity is indeed hard... (considering its totally unoptimized for this kind of use)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1303 on: May 28, 2018, 12:45:03 AM »
So, I'm helping my friend (jao) to make a Reimu player script.
He doesn't know how to do bombs, so he gave me a copy of the player script to implement a bomb.
All should be working correctely, but Danmakufu tells that the variable is not defined.
I try everything to solve this, but it's no use.
Here's the code:
Code: [Select]
task SpamShot(obj){
let angleT = 90;
while(!Obj_IsDeleted(obj)){
loop(15){
let obj1 = CreatePlayerShotA1(ObjMove_GetX(obj)+64*cos(angleT),ObjMove_GetY(obj)+64*sin(angleT),6,angleT,1,1,5);
let obj2 = CreatePlayerShotA1(ObjMove_GetX(obj)+64*cos(-angleT),ObjMove_GetY(obj)+64*sin(-angleT),6,-angleT,1,1,5);
angleT+=360/15;
Obj_SetRenderPriorityI(obj1,25);
Obj_SetRenderPriorityI(obj2,25);
}
angleT+=2;
wait(2);
}
}
The missing variable is obj1 and obj2.


Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1304 on: May 28, 2018, 01:19:11 AM »
CreatePlayerShotA1 doesn't return an object ID for some reason. Use ObjShot_Create or ObjSpell_Create for control over the object.

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1305 on: May 28, 2018, 01:21:11 AM »
So, I'm helping my friend (jao) to make a Reimu player script.
He doesn't know how to do bombs, so he gave me a copy of the player script to implement a bomb.
All should be working correctely, but Danmakufu tells that the variable is not defined.
I try everything to solve this, but it's no use.
Here's the code:
Code: [Select]
task SpamShot(obj){
let angleT = 90;
while(!Obj_IsDeleted(obj)){
loop(15){
let obj1 = CreatePlayerShotA1(ObjMove_GetX(obj)+64*cos(angleT),ObjMove_GetY(obj)+64*sin(angleT),6,angleT,1,1,5);
let obj2 = CreatePlayerShotA1(ObjMove_GetX(obj)+64*cos(-angleT),ObjMove_GetY(obj)+64*sin(-angleT),6,-angleT,1,1,5);
angleT+=360/15;
Obj_SetRenderPriorityI(obj1,25);
Obj_SetRenderPriorityI(obj2,25);
}
angleT+=2;
wait(2);
}
}
The missing variable is obj1 and obj2.

It's helpful to have the exact error message (i.e. a screenshot) so we can see what Danmakufu actually output and at what line.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1306 on: May 28, 2018, 01:37:35 AM »
It's helpful to have the exact error message (i.e. a screenshot) so we can see what Danmakufu actually output and at what line.

Here is the image with the error.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1307 on: May 28, 2018, 03:32:34 AM »
Yep, so it's like I said. CreatePlayerShotA1 doesn't return the player shot object's ID, so the variable remains empty, and reports it as empty when you try to use it as an object ID.

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

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1308 on: May 28, 2018, 04:39:49 AM »
Yep, so it's like I said. CreatePlayerShotA1 doesn't return the player shot object's ID, so the variable remains empty, and reports it as empty when you try to use it as an object ID.
There's apparently also a CreatePlayerShotObjectA1 that DOES return an object ID. It doesn't seem to be documented anywhere. The arguments are the same: x,y,speed,angle,damage,penetration,graphic.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1309 on: May 28, 2018, 02:12:37 PM »
There's apparently also a CreatePlayerShotObjectA1 that DOES return an object ID. It doesn't seem to be documented anywhere. The arguments are the same: x,y,speed,angle,damage,penetration,graphic.
I'll keep a note of this :|

I really wish some of the undocumented but working functions were officially documented by mkm, but... that's asking too much.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1310 on: May 28, 2018, 06:27:18 PM »
There is more undocumented functions out there? If yes, what functions?

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1311 on: May 29, 2018, 12:07:38 AM »
There's apparently also a CreatePlayerShotObjectA1 that DOES return an object ID. It doesn't seem to be documented anywhere. The arguments are the same: x,y,speed,angle,damage,penetration,graphic.
Was the function implemented?
It's saying that it doesn't exist... grammar check plz?
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1312 on: May 29, 2018, 12:51:21 AM »
Code: [Select]
function CreatePlayerShotObjectA1(x, y, speed, angle, damage, penetration, graphic){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj, x, y);
ObjMove_SetSpeed(obj, speed);
ObjMove_SetAngle(obj, angle);
ObjShot_SetDamage(obj, damage);
ObjShot_SetPenetration(obj, penetration);
ObjShot_SetGraphic(obj, graphic);
ObjShot_Regist(obj);
return obj;
}

wau
« Last Edit: May 29, 2018, 02:29:03 AM by Drake »

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

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1313 on: May 29, 2018, 03:03:47 AM »
Code: [Select]
function CreatePlayerShotObjectA1(x, y, speed, angle, damage, penetration, graphic){
let obj = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj, x, y);
ObjMove_SetSpeed(obj, speed);
ObjMove_SetAngle(obj, angle);
ObjShot_SetDamage(obj, damage);
ObjShot_SetPenetration(obj, penetration);
ObjShot_SetGraphic(obj, graphic);
ObjShot_Regist(obj);
return obj;
}

wau
I'm very dumb sometimes

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1314 on: May 30, 2018, 07:28:12 AM »
The wiki has been down for a few days now, any news?


Tom

  • *
  • Programmer
    • LunarCast Network
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1316 on: May 30, 2018, 07:28:32 PM »
Keep in mind that using the command the returns an object ID might prevent certain optimizations from happening.  Best practice would be to use it only when needed and use the non object command for regular shots.  Player shots unlike enemy shots are designed to be "dumb" as in "fire and forget" since they are spawned in mass quantities and remain on the screen for a small amount of time (since they move fast and either hit or go off screen).

If the command does not return an object ID it relieves itself of the responsibility of maintaining an object ID mapping for that "short term" object.  It can also make several assumptions such as that the object's trajectory will not be modified once its fired, and also that the object can not be deleted prematurely via commands.  Lastly it can rearrange the object's location in memory without worrying about updating references to it (possibly the most important optimization).

I do not know if ph3 actually performs these optimizations however these are a valid reasons for not returning an object ID for a player shot and providing 2 commands (and discouraging the use of the 2nd one by not documenting it).

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1317 on: May 31, 2018, 04:15:20 AM »
I disagree. If that were the case you would need a separate classification of objects that ignore further access altogether, which is essentially never what you would actually want. Allowing the objects to lock themselves away from any further set and get operations is a bad idea for the programmer, never mind not doing it in a transparent way. And why would it matter whether the object can't be accessed through the script when it can still be modified/etc by the engine itself? Most script functions will translate pretty much directly to functions called by the engine, and if those functions are called besides from the script then there's no point in locking it away from the programmer. Going from object ID to actual reference is also just going to be a table lookup; if the object actually has to readdress that isn't a significant burden on the script side whatsoever.

This also definitely wouldn't be a good reason to not document the other function nor document why you might use the void one in the first place, theoretically speaking. That's actually just dumb.

Anyways we know all this isn't the case because you can always use functions like GetShotIdInCircle to retrieve the object ID even when it would have not been known initially. There does not seem to be any fundamental difference between shot objects with a returned ID and one without.
« Last Edit: May 31, 2018, 04:17:46 AM by Drake »

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1318 on: May 31, 2018, 04:21:57 AM »
The wiki has been down for a few days now, any news?
Seems so.

Last update I had from TSO was that she would look into it. I think it slipped past her again due to busy RL.

Will check with her again.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1319 on: May 31, 2018, 11:39:42 AM »
Does anyone have a complete list of ph3 functions, because https://dmf.shrinemaiden.org/wiki/Functions_(ph3) isn't working for me