Author Topic: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry  (Read 243280 times)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #510 on: April 13, 2015, 06:35:07 AM »
Pretty much whenever it spots Japanese characters it reverts to ANSI, which is odd. For example:

- New file in ANSI automatically made.
- Insert random text in english > convert to UTF-8 w/o BOM
- Save and reload file
- Bottom right corner shows UTF8 no BOM.
- Set character set to shift-jis
- Insert Japanese characters now into the file
- Save and reload > boom, back to ANSI.

I have aprox 40+ spell cards which are all in shift-jis detection and a dialogue file. But these 6 files refuse to cooperate.

I tried removing the japanese characters > encode to utf8 w/o BOM then paste it in a fresh new file with steps above but nope.

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #511 on: April 13, 2015, 08:07:38 AM »
for other readers, problem was because DNH reads UTF-16 w/ BOM, not UTF-8, oops

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #512 on: April 13, 2015, 08:23:20 AM »
For the troublesome cards I set it too UTF-16 LE with BOM in Sublime Text editor. Notepad++ sees it as UCS-2 Little Endian but Drake suggested me to ignore that and not convert inside NP++

Not touching the rest of my cards since they are all in shift-jis. Random check on RSS fangame script also shows shift-jis.

I am not sure what is going on but yea. Weird stuff.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #513 on: April 14, 2015, 09:05:29 AM »
Hey guys ! I need your help :)
Okay I'm actualy creating ? game with danmakufu (original game, not ? touhou game) and I have some problems:

+ I don't manage to realise a custom shot data script. I tried everything but it don't work, I have ?n error message in which it's writtenthat the two values at the beggining  are not defined...

+ I have somes trouble with plural scripts too. It work but when ? nonspell is finished the enemy is deleted and an other enemy (the same) come from x = 0 and y =0 and continue his attack

+ I need ? mean to check the direction of the boss. My sprite is always on same direction, i would like to turn it when the boss move at the left

+ I also need help for dialog and menu script i didn't find any tutorials :/

Hum I'm so sorry to have all these problems uh. Moreover english is not my native language, so...sorry for mistakes or if you didn't understand !

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #514 on: April 14, 2015, 10:25:06 AM »
1. Please post what you have in a pastebin.

2. The boss position should automatically be tracked by the Boss Scene. In many cases, between patterns you might have one frame where the boss object does not exist, so its position is reported to be (0,0), so if you're using a custom movement function it might be affected. Anyways, please post what you have in a pastebin as well.

3. For the easy way, you can use if(cos(ObjMove_GetAngle(obj)) > 0) to check if the object is moving to the right, and if it's < 0 it's moving to the left.

However, this only works if you use movement-based functions like ObjMove_SetDestAtFrame() and ObjMove_SetAngle(), so it might not work in all cases. If you want something a bit sturdier, you can get the difference between the object's x-position and its x-position on the previous frame:
Code: [Select]
let x0 = ObjMove_GetX(objEnemy);
while(!Obj_IsDeleted(objEnemy)){
let x = ObjMove_GetX(objEnemy);
if(x - x0 < 0){
// left
}else if(x - x0 > 0){
// right
}else{
// idle
}
x0 = x; // update x-position
yield;
}

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #515 on: April 14, 2015, 08:29:27 PM »
Is there any LastSpell; functions like in 0.12? I haven't find them ???
If there no one, so what I need to do to make a "last spell sense" in a [Single] type?
[When character lose one life, current script should be closed] I tried with GetPlayerLife, but it started to behave wierd?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #516 on: April 14, 2015, 08:41:24 PM »
Not a function but an event.
Put this in @Event of your enemy script:
Code: [Select]
alternative(GetEventType())
case(EV_REQUEST_IS_LAST_SPELL){SetScriptResult(true);}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #517 on: April 15, 2015, 05:15:50 AM »
Not a function but an event.
Put this in @Event of your enemy script:
Code: [Select]
alternative(GetEventType())
case(EV_REQUEST_IS_LAST_SPELL){SetScriptResult(true);}

Thank ya :)

Jimmy

  • Shameless spender
  • gaining big pounds
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #518 on: April 18, 2015, 09:53:52 PM »
I've currently got a strange issue with Danmakufu which honestly don't know how to handle it anymore  :V
It's the following:

I've been working on an own custom shot sheet for a time, everything used to work perfectly, until today when I started Danmakufu, the bullet graphics suddenly didn't show up, the sounds of the bullets firing are still audible though.
The image file doesn't even appear in the 'Texture' section of the log window anymore.
The code is still all the same.

For the bullet definition file (bullet_def.txt):

Code: [Select]
#UserShotData

shot_image = "./img/enm_eff/bullet00.png
delay_rect = (29,958,65,994)

...

which I included into the shot constants file (bullet_lib.txt):

Code: [Select]
local
{
    let current = GetCurrentScriptDirectory();
    let customShot = current ~ "bullet_def.txt";
    LoadEnemyShotData(customShot);
}

...

which is again included in my main boss script:

Code: [Select]
#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["ASM - Aragami01"]
#Text["nonspell"]

#include "script/Tutorial/bullet_lib.txt"
#include "script/Tutorial/boss_effects.txt"
#include "script/Tutorial/effect_MagicCircle.txt"

let bossObj;
...

and then included the defined shot IDs in the CreateShotA1 function. But the graphics don't show up when I execute the script. ???


I really don't know if I did something wrong or it is just a technical error, so if someone here can give some advice would be greatly appreciated. :)
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy, HSiFS, WBaWC
Hard 1cc: IN, DDC, HSiFS
Extra clears: MoF, DDC, HSiFS, WBaWC

Goals: Going Extra Hard!

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #519 on: April 18, 2015, 10:02:21 PM »
I've currently got a strange issue with Danmakufu which honestly don't know how to handle it anymore  :V
It's the following:

I've been working on an own custom shot sheet for a time, everything used to work perfectly, until today when I started Danmakufu, the bullet graphics suddenly didn't show up, the sounds of the bullets firing are still audible though.
The image file doesn't even appear in the 'Texture' section of the log window anymore.
The code is still all the same.

For the bullet definition file (bullet_def.txt):

//...

and then included the defined shot IDs in the CreateShotA1 function. But the graphics don't show up when I execute the script. ???

I really don't know if I did something wrong or it is just a technical error, so if someone here can give some advice would be greatly appreciated. :)

First thing's first - is the file path correct? And if so, are you using the shot constants or just the number? (shot constant sheet requires an #include)

If that doesn't work, is the texture file path correct in the shot sheet?

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #520 on: April 19, 2015, 12:58:34 AM »
Well, if that's a direct paste of your script, the shot_image doesn't have any ending double-quote.

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

Jimmy

  • Shameless spender
  • gaining big pounds
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #521 on: April 19, 2015, 11:14:16 AM »
Well, if that's a direct paste of your script, the shot_image doesn't have any ending double-quote.
Oh sorry, my bad, there's a closing double quote in my actual script, I didn't directly copy-pasted it here.

First thing's first - is the file path correct? And if so, are you using the shot constants or just the number? (shot constant sheet requires an #include)

If that doesn't work, is the texture file path correct in the shot sheet?
The file paths were the first thing I've checked when the issue first occurred. Everything is like when it still worked normally about two days ago, the bullets showed up as expected. Until the time when this problem began, I didn't make any change on the code and file paths of the shot image, definition and constants files, except for adding some more bullet definitions. After that, the bullet graphics didn't show up, the path of the texture file also doesn't appear in the log window anymore.

I'm using the numbers defined for each bullet, and I did and do still use #include on the shot constants file in the main boss script.
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy, HSiFS, WBaWC
Hard 1cc: IN, DDC, HSiFS
Extra clears: MoF, DDC, HSiFS, WBaWC

Goals: Going Extra Hard!

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #522 on: April 19, 2015, 12:05:35 PM »
Check the bullet definitions you recently added (or just pastebin the whole thing).
If you can't find anything by eye, comment out all the bullet definitions but one and test it by gradually adding in more until it breaks again.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #523 on: April 19, 2015, 03:28:33 PM »
Trial & error only solution here. Confirming it here from own experience. A shot sheet will never throw an error at you. The bullets will simply not show up at all and you will wonder what happened.


Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #524 on: April 26, 2015, 07:19:38 AM »
I saw that the engine uses the function rand() and the syntax is pretty similar to C, is the rand used in the engine the same as the stdlib rand() from C?
http://www.tutorialspoint.com/c_standard_library/c_function_rand.htm

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #525 on: April 26, 2015, 11:20:13 AM »
There is a copyright notice for the Mersenne twister in the license, so that's almost definitely no. Mersenne is much better than C's rand() anyways, which is a pretty crap RNG.
« Last Edit: April 26, 2015, 11:22:29 AM by Drake »

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #526 on: April 26, 2015, 11:28:19 AM »
There is a copyright notice for the Mersenne twister in the license, so that's almost definitely no. Mersenne is much better than C's rand() anyways, which is a pretty crap RNG.

Yes I know stdlib's rand() is crap, can you set up the rand() function as you can Mersenne twister in C? (it has many settings).

« Last Edit: April 26, 2015, 01:02:32 PM by Senkan »

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #527 on: April 26, 2015, 02:19:50 PM »
No, unfortunately. Even the seed is set by the engine on script start, and can't be manually overridden. Is there anything particular you were aiming to do?

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #528 on: April 26, 2015, 02:25:43 PM »
Hmm I thought it could be interesting to see how different distribution types affect the same bullet spawn patterns.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #529 on: April 26, 2015, 04:11:50 PM »
Hey ^.^

Today danmakufu produced an error message I have never seen before:

"@" cannot use in inner function and task.
(イベントを深い階層に記述することはできません)

What does that mean?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #530 on: April 26, 2015, 06:14:55 PM »
It just mean you can't use a @ (like @Initialize, @Event, @Mainloop, etc) in a task or a function.
I think you forgot a } somewhere and a @something is included in a task/function. Check above the @ in your script ;)


Gusano Wornis

  • Member of Team Mystique
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #531 on: April 26, 2015, 07:52:53 PM »
Hi, I have an small question about something in dnh.

I want in a spell of PG to create familiars that have an square made of lasers, that rotate(like Youkai Kori Kassen's final boss last spellcard for both sides, but those are triangles)
I know its using CreateStraightLaserA, but how about the laser movement(along with their angle so it always will be a square)?
carrying dead weight since 2015~

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #532 on: April 26, 2015, 08:21:09 PM »
Hi, I have an small question about something in dnh.

I want in a spell of PG to create familiars that have an square made of lasers, that rotate(like Youkai Kori Kassen's final boss last spellcard for both sides, but those are triangles)
I know its using CreateStraightLaserA, but how about the laser movement(along with their angle so it always will be a square)?

Maybe a task that takes the laser object and its offset from the center (angle, and if the square is not of a constant size, radius) as its parameters.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #533 on: April 27, 2015, 02:23:12 AM »
Hi, I have an small question about something in dnh.

I want in a spell of PG to create familiars that have an square made of lasers, that rotate(like Youkai Kori Kassen's final boss last spellcard for both sides, but those are triangles)
I know its using CreateStraightLaserA, but how about the laser movement(along with their angle so it always will be a square)?

Drawing this up:


In general this is how you'd make an n-gon (triangle, pentagon, heptagon, whatever). You have your center point, and each "corner" point is going to be r distance from the center. The angle a will start at an offset of 0, and each next corner point will increase the angle by 360/n. The position of the point is then (r*cos(a), r*sin(a)), plus the x/y of the center. The length of the sides (the lasers, in this case) will be 2*r*sin(180/n) and should be pointed at the angle a+90+180/n. Spinning the whole n-gon around is just a matter of increasing the angle offset per frame and recalculating the positions and directions. Additionally you can replace the lasers with bullets with just a little extra work.

I can write down some code if you find this too difficult to implement.

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

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #534 on: April 27, 2015, 03:25:53 AM »
Drawing this up:


In general this is how you'd make an n-gon (triangle, pentagon, heptagon, whatever). You have your center point, and each "corner" point is going to be r distance from the center. The angle a will start at an offset of 0, and each next corner point will increase the angle by 360/n. The position of the point is then (r*cos(a), r*sin(a)), plus the x/y of the center. The length of the sides (the lasers, in this case) will be 2*r*sin(180/n) and should be pointed at the angle a+90+180/n. Spinning the whole n-gon around is just a matter of increasing the angle offset per frame and recalculating the positions and directions. Additionally you can replace the lasers with bullets with just a little extra work.

I can write down some code if you find this too difficult to implement.

Addendum: what I also did (with bursts, though), was return one laser of the formation and task the others to move to its position every tick. In your case none of the lasers are at the center, but you can use an invisible, hitboxless bullet in the center as a substitute.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #535 on: April 27, 2015, 04:18:58 AM »
The problem may appears to be caused by the ObjText_SetText function packaged in th_dnh.exe.
Is there anyone who has dissambled the .exe and knows how to make it read non-Shift-JIS text?

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #536 on: April 27, 2015, 05:11:11 AM »
It also reads UTF16-LE with BOM, as written in the official documentation. You should be fine using this, I think.

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #537 on: April 27, 2015, 08:34:37 AM »
it works,however it has no use.

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #538 on: April 27, 2015, 09:17:58 AM »
I'm not really sure what you mean by that, sorry.

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #539 on: April 27, 2015, 09:24:44 AM »
well, I mean,Simplified Chinese shows ????? in this game text.

our programmer solved this problem by adding an empty line in lib_boss.dnh and lib_enemylibs.dnh
[attach=1]
[attach=2]
line numbers of ?#include? goes wrong when changing to UTF-16.


eg.[attach=3]

[attach=4]

it should read "zakodraw", but it reads"/zakolib/zakolib/..."



edit:it causes more strange bugs, sad
« Last Edit: April 27, 2015, 09:46:05 AM by rsy_type1 »