07th-mod / ponscripter-fork

Fork of the Ponscripter visual novel engine to take advantage of SDL2 and improve Steam integration
GNU General Public License v2.0
15 stars 4 forks source link

Broken 'Set cursor' command? #5

Closed Necpc866 closed 3 years ago

Necpc866 commented 3 years ago

Hello there. I've been using Ponscripter for porting some small doujin games and code examples made using NScripter. However I've run into a small problem.

It's a little weird but it lies in the "set cursor command"

This is my simple script. I renamed them from utf to txt to upload it. 0.txt 1.txt

here are the files for the cursors. clickwait pagebreak

This is what happens when I run the game in this build of Ponscripter. This is almost certainly a new bug as it works properly in Onscripter and the old Ponscripter. However the bug doesn't occur in the old Nacrissu2 build provide here (https://github.com/sekaiproject/ponscripter-fork/releases) so I'm certain it was introduced later.

Screenshots. Using the Onscripter, Old POnscripter, and Nacrissu2 build. Capture2 Newer Build of Ponscripter. Capture

The specifc problem seems to be with Setcursor 1, setcursor 1,":bl/3,160,0;bmp\clickwait.png",0,0

Umineko and Ciconia use a very complex way to handle text using textgosub which is complicated to implement so any help with this is appreciated.

I've uploaded a zip file containing all the files and the game itself. So it can be examined test files.zip

Necpc866 commented 3 years ago

Is there something undocumented that I'm missing? Im pretty sure that \ is supposed to clear the text and move to the next line. However it doesn't do so now.

This seems to be the behaviour with Le Sangalot des Cigales as well. As without pagebreaks working the text continues on and on until the engine crashes.

Regardless I've managed to find a sort of workaround. replacing \ with @ and adding a textclear after said @ prompts the user for an input and then clears the text. writing textclear everytime is annoying so I used 'Defsub c' to define macro 'c'

By adding *c textclear return

to the end of the script. It's certainly not that much of a practical solution.

In the newer Ponscripter release of Higurashi they used the langjp command instead of the usual text. The Higurashi script was transplanted onto the script of Umineko Saku and some of its stuff still remains. Since the original Higurashi script is already fully compatible with Ponscripter, but they spent the time adding it to the Umineko script. Perhaps they are aware of this error?

Necpc866 commented 3 years ago

Welp the code the Mion that wrote for the Onikakushi tranlation on Onscripter somehow resolves the problems? I'll keep it here in case somebody needs it. Although with how annoying this is, it should probably be added to the documentation.

For example if somebody wants to play Le Sangalot des Cigales with a newer build of Ponscripter then they should add this to the script.


; The following will allow you at add the text subroutine from the Higurashi version of Onscripter. Of which a more complicated version is used in Ciconia and Umineko as well. Even though its not it's intended pourpose it fixes problems with text handling that POnscripter has, which I ran into when using Pons to port other Nscripter games.

; This is a subroutine ported from the port of PS2 Onikakushi, the code is by Mion.

; In the script's define section we add the following code. This is before the game section.

numalias TextCursorFlag,92 numalias X ,3201
numalias Y ,3202 numalias TextCursor1,1 numalias TextCursor2,2 textgosub text_cw pretextgosub pretext_lb

; Note the textgosub command. That should be there as well.

; In the actual program script itself. We add the following code. This is usually added to the end.

*setcursor lsph TextCursor1,":l/16,80,2;Bmp\pagebreaka.png",0,0 lsph TextCursor2,":l/16,80,2;Bmp\pagebreaka.png",0,0 mov %TextCursorFlag,-1 ; used to see if cursors were set return

*setgamecursor lsph TextCursor1,":l/16,80,2;Bmp\pagebreaka.png",-5,0 lsph TextCursor2,":l/16,80,2;Bmp\pagebreaka.png",-5,0 mov %TextCursorFlag,-1 return

*text_cw ;added by Mion - for textbtn support getcursorpos %x,%y

notif %TextCursorFlag = -1 gosub *setcursor

ispage %TextCursorFlag

erasetextwindow 0

delay 20

isskip %0 if %0 = 0 jumpf if %0 = 2 jumpf if %0 = 4 && %TextCursorFlag = 1 jumpf

texec erasetextwindow 1 return

~ if %TextCursorFlag = 0 amsp TextCursor1,%x,%y:vsp TextCursor1,1 if %TextCursorFlag = 1 amsp TextCursor2,%x,%y:vsp TextCursor2,1 mov %TextCursorFlag,-1 print 1

btndef clear

*text_cw_loop

saveon

textbtnwait %0

if %0 < -2 goto text_cw_loop vsp TextCursor1,0 : vsp TextCursor2,0 : btndef "" : print 1 ;if %0 >= 50 goto notes_popup if %0 = 0 texec : erasetextwindow 1 : return if %0 = -1 mov %x,-2 : systemcall rmenu if %0 = -2 btndef clear : systemcall lookback goto *text_cw

*pretext_lb repaint return

; Then in the actual game script itself. We use "gosub *setcursor" to set the cursors.

; Some example code.

setcursor 0,":l/16,80,2;Bmp\pagebreaka.png",3,0 setcursor 1,":l/16,80,2;Bmp\pagebreaka.png",3,0

setwindow 90,80,28,40,40,0,1,2,40,1,1,"bmp\ef.png",0,0

bg "bg\PIC_0116.png",1

ld l,"tati\BUP_0006.png",0 ld c,"tati\BUP_0072.png",0 ld r,"tati\BUP_0178.png",1

gosub *setcursor

^Hello World.^@^ This is a test to make sure that text works well.^@^ Including the word wrapping of course.^@

^It's nice that everything works well.^\


Pons text fix Subroutine.txt