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

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #840 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.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #841 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.
« Last Edit: October 14, 2013, 04:55:57 PM by Darkness1 »

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #842 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.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #843 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?
« Last Edit: October 15, 2013, 01:41:07 AM by Drake »

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

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #844 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.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #845 on: October 15, 2013, 12:00:05 AM »


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.
« Last Edit: October 15, 2013, 12:12:37 AM by Drake »

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

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #846 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.

CK Crash

  • boozer
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #847 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.
« Last Edit: October 15, 2013, 12:21:15 AM by CK Crash »

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #848 on: October 15, 2013, 01:34:11 AM »


thisiswhyimdumb.png

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

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #849 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?
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #850 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?
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #851 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.
« Last Edit: October 16, 2013, 02:18:46 PM by Helepolis »

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #852 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
« Last Edit: October 18, 2013, 07:10:43 AM by Helepolis »
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #853 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.

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

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #854 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.
« Last Edit: October 18, 2013, 01:29:36 PM by Vectorfish »
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #855 on: October 18, 2013, 10:58:56 PM »
What IS mkm's contact info anyway? Is it listed on his site?

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #856 on: October 18, 2013, 11:25:40 PM »
Yep, there is a email in his profile page.
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #857 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.

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #858 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.
My name is Tres. It sounds like "Tray". Tressert is "Tray-zurt"; like Tres dessert.
I've cleared every touhou game on Lunatic, and beaten every extra except SoEW.
NMNB: MoF Hard, SA Extra, UFO Extra

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #859 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.
« Last Edit: October 22, 2013, 06:56:23 PM by Vectorfish »
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #860 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 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.
« Last Edit: October 22, 2013, 09:45:26 PM by gtbot »

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #861 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 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?
« Last Edit: October 23, 2013, 12:16:05 AM by TresserT »
My name is Tres. It sounds like "Tray". Tressert is "Tray-zurt"; like Tres dessert.
I've cleared every touhou game on Lunatic, and beaten every extra except SoEW.
NMNB: MoF Hard, SA Extra, UFO Extra

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #862 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.

CK Crash

  • boozer
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #863 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 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

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #864 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.
« Last Edit: October 26, 2013, 02:37:51 AM by Drake »

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #865 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]
---Talos Reimu: [http://puu.sh/505Vy.jpg]
-Gusano2314
---Talos Reimu: [http://puu.sh/5128Z.png]

Miplouf's CURSE01 Tenshiku v1
-Sparen
---Naut RPG: [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]

Miransu's LOCAA 3 Experiment 354 v1.01
-Gusano2314
---Miransu Swampert
-Miransu Uwabami
---Miransu Swampert: [http://puu.sh/50I3F.png] *In this image, the player graphic completely disappeared.
---Miransu Swampert: [http://puu.sh/50Ii2.png] *Annotated by Miransu

FondueMaster's LOCAA 3 Swampert Boss Battle
-Gusano2314
---GT Cirno: [http://puu.sh/515Ah.png]

TalosMistake's Halloween Contest Seija Boss Fight v1.01
-Sparen
---RPG: [http://puu.sh/53l6A.png]
-Gusano2314
---RPG: [http://puu.sh/5569f.png]

I will update as reports come in.
« Last Edit: November 02, 2013, 06:20:28 PM by Sparen »

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #866 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.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #867 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.

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #868 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.

Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (latest version pre1x)
« Reply #869 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).
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.