View Full Version : Small Problem with the textgosub function from Ponscripter [Solved]

2013-01-25, 07:43

i'm currently working on a German Translation of Saya no Uta and use the Ponscripter Port from Winkiller for that.

I'm currently trying to use the Right click detection over textgosub from Narcissu for Saya no Uta, because it just looks totally ugly to use rmenu for it.

But i ran into a small Problem there, basicly everthing it working fine so far..

He draws the window, shows the text, and puts the Cursor Icon right after the end of the Text..

The Problem comes now.. After the End of a Line he just erases the window and the Text, and just shows the Cursor, until i left click, to get to the next line, where it then shows the first line and the next one. But again just till he draws the Cursor again, where he removes everything again from the screen, and only shows the cursor.

I know that the Problem must be somewhere in the textgosub routine, but i really can't find it, so i'm asking does anyone have an idea what would be the cause of it?


automode_time %autospeed
; Turning on global variables

textgosub *text_lb
pretextgosub *pretext_lb


; BGM aliases
stralias s01,"sound\s01.ogg"
stralias s02,"sound\s02.ogg"
stralias s03,"sound\s03.ogg"
stralias s04,"sound\s04.ogg"
stralias s05,"sound\s05.ogg"
stralias s05_psycho,"sound\s05_psycho.ogg"
stralias s06,"sound\s06.ogg"
stralias s07,"sound\s07.ogg"
stralias s08,"sound\s08.ogg"
stralias s09,"sound\s09.ogg"
stralias s09_2,"sound\s09_2.ogg"
stralias s10,"sound\s10.ogg"
stralias s11,"sound\s11.ogg"
stralias sayanouta,"sound\sayanouta.ogg" ; A mixed version of 沙耶の唄 and s05
stralias song_of_saya,"sound\song_of_saya.ogg" ;沙耶の唄
stralias shoes_of_glass,"sound\shoes_of_glass.ogg" ;ガラスの靴
stralias spectacle,"sound\sound0204.ogg" ;郁紀光景


numalias sys_ispage,107
numalias temp_str,102
numalias temp_str2,161
numalias moji_x,128
numalias moji_y,129
numalias sys_vlog_num,130
numalias x,108
numalias y,109
numalias sys_log_ringstd,131
numalias LOGMAX,50
maxkaisoupage LOGMAX
numalias temp_num,120
numalias sys_log_ringcr,133
pindentstr basic
pbreakstr basic
numalias sys_logvoice_str,106
numalias sys_log_channel,132
numalias sys_log_voicefile,105
numalias sys_log_page,127


numalias scene,222 ; Scene name for savegame

numalias badend,10 ; Bad end trigger
numalias ending,900 ; Ending trigger
numalias end1_clear,901 ; White ending trigger
numalias end2_clear,902 ; "Bad" end trigger
numalias end3_clear,903 ; "Mad" end trigger

numalias cgset_0,904 ; Beginning
numalias cgset_1,905 ; White end
numalias cgset_2,906 ; Middle
numalias cgset_3,907 ; Blossoming end
numalias cgset_4,908 ; Mad end

numalias lic_accepted,999

; Aliases for OST menu
numalias track_num,11
numalias repeat,12

; Aliases for CG menu
numalias cgpage,13
numalias cg_sel,14

; Aliases for config menu
numalias gro,500 ; Grotesque image switcher

numalias vol0,501
numalias vol1,502
numalias vol2,503
numalias vol3,504
numalias vol4,505
numalias vol5,506
numalias vol6,507
numalias vol7,508
numalias vol8,509
numalias vol9,510
numalias vol10,511
numalias vol11,512
numalias vol12,513
numalias volsfx,514
numalias volvoice,515
numalias volmp3,516

numalias fullscr,8

numalias movplay,517

numalias textspeed,518
numalias autospeed,519

; Use archive mode (if possible)

; Effects section
effect 2,6,500
effect 3,10,600
effect 4,13,3000
effect 5,10,1000
effect 6,6,500

effect 10,10,500 ;Fade out
effect 11,18,2000,"data\effect.png" ;Cloud effect

effect 19,10,150

savename "^~~ Speichern ~~","^~~ Laden ~~","#"
savenumber 20

; This is it, no fancy right-click menus :(
;rmenu "^~~ Speichern ~~",save,"^~~ Laden ~~",load,"^",,"^~~ Log mode ~~",lookback,"^",,"^~~ Zurück zum Hauptmenü ~~",reset
;rmenu "^~~~ Klick mich ~~",systemmenu
menusetwindow 18,18,0,0,1,1,#484848
menuselectcolor #fc0000,#ffffff,#ffffff
selectcolor #fc0000,#ffffff

windoweffect 10,250

;lookbackbutton ":a;system\uoncur.bmp",":a;system\uoffcur.bmp",":a;system\doncur.bmp",":a;system\doffcur.bmp"

;h_mapfont 0,"fonts\SazanamiGothic-Cyrillic.ttf"
;h_mapfont 1,"fonts\DejaVuSansCondensed-Oblique.ttf"

h_rendering none, integer
h_mapfont 0, "fonts/face0.ttf"
h_mapfont 1, "fonts/face1.ttf"
h_mapfont 2, "fonts/face2.ttf"
h_mapfont 3, "fonts/face3.ttf"
h_mapfont 4, "fonts/face4.ttf"
h_mapfont 5, "fonts/face5.ttf"
h_mapfont 6, "fonts/face6.ttf"
h_mapfont 7, "fonts/face7.ttf"

clickstr "",2

; Game caption
caption "Saya no Uta - PONScripter Edition"

; Game version
versionstr "Saya no Uta PONScripter","(c) Nitro+"

localestring message_save_confirm "^ Spiel auf Speicherplatz (%s%n) speichern?"
localestring message_load_confirm "^ Möchtest du Spielstand (%s%n) laden?"
localestring message_reset_confirm "^ Möchtest du wirklich zum Hauptmenü zurück ?"
localestring message_yes "^ Ja
localestring message_no "^ Nein
localestring days "Son","Mon","Die","Mitt","Don","Fre","Sam"
localestring months "jan.","feb.","märz","apr.","mai","juni","juli.","aug","sept.","okt.","nov.","dec."
localestring message_save_exist "%a %b %i %_H:%i%M"

;h_defwindow "main", 130,358,540,240,fs_main, 0, 0,1, 1,5, #ffffff ,0 ,0,799,599
h_defwindow "main", 60 ,70 ,540,240 ,20 , 0, 0,%textspeed ,1,1,":a;data\f05.png",40,50
; Game logics section begin

; Allowing GUI buttons to be drawn normally
; 0 - 8 sprites are used for GUI
;humanz 8

; Test


lsph 0,":a/7,160,0;data\cur00.png",0,0
lsph 1,":a/5,160,0;data\cur01.png",0,0

ispage %sys_ispage
getcursorpos %x,%y
if %sys_ispage == 0 amsp 0,%x,%y,255:vsp 0,1:vsp 1,0
if %sys_ispage == 1 amsp 1,%x,%y+2,255:vsp 1,1:vsp 0,0
;vsp 0,1
;vsp 1,1


btndef clear

textbtnwait %11

if %11 == 0 goto *end_textbtn
if %11 == -1 vsp 0,0:vsp 1,0:gosub *systemmenu:vsp 0,1
if %11 == -2 vsp 0,0:gosub *backlog:vsp 0,1:goto *textbtnloop
if %11 == -3 goto *end_textbtn

goto *textbtnloop


vsp 1,0
vsp 0,0
print 1

if %sys_ispage == 1 dwavestop 0

add %sys_log_ringstd,1
if %sys_log_ringstd > LOGMAX mov %sys_log_ringstd,1
mov %temp_num,%sys_log_ringstd

itoa $temp_str,%sys_log_channel
mov $%temp_num,$temp_str
add $%temp_num,"/"



gosub *box9
mov %sys_log_page,1

checkpage %temp_num,%sys_log_page
if %temp_num == 0 return

checkpage %temp_num,%sys_log_page + 1
if %temp_num == 0 gosub *backlog_spload_logdown
if %temp_num == 1 gosub *backlog_spload

gosub *backlog_drawing



btndef clear

gosub *backlog_btndef

btnwait %11

if %11 == 1 gosub *backlog_logtext:goto *backlog_loop

if %11 == 0 goto *backlog_loop
if %11 == -1 goto *end_backlog
if %11 == -2 goto *backlog_up
if %11 == -3 goto *backlog_down

if %11 == 2 goto *backlog_up
if %11 == 3 goto *backlog_down


goto *backlog_loop


gosub *backlog_spclear
print 1




checkpage %temp_num,%sys_log_page + 1
if %temp_num == 0 goto *backlog_loop

checkpage %temp_num,%sys_log_page + 2
if %temp_num == 0 csp 201

add %sys_log_page,1

gosub *backlog_drawing
print 1

goto *backlog_loop


sub %sys_log_page,1

if %sys_log_page <= 0 goto *end_backlog

gosub *backlog_spload
gosub *backlog_drawing
print 1

goto *backlog_loop


lsp 201,":l/2,0,3;system\uoncur.bmp",776,0


lsp 202,":l/2,0,3;system\doncur.bmp",776,576



csp 200,202


cellcheckspbtn 200,202,1


getlog $temp_str,%sys_log_page

;say $temp_str

mov %sys_log_ringcr,%sys_log_ringstd - %sys_log_page
if %sys_log_ringcr <= -1 mov %sys_log_ringcr,LOGMAX + (%sys_log_ringstd - %sys_log_page)
add %sys_log_ringcr,1
add %sys_log_ringcr,sys_logvoice_str - 1

mov $temp_str2,$%sys_log_ringcr
split $temp_str2,"/",%lg_sys_channel,$lg_sys_voicefile

if $lg_sys_voicefile == "" logsp2utf 200,$temp_str,%moji_x,%moji_y,17,17,0,3,#FFFFAA
if $lg_sys_voicefile != "" logsp2utf 200,$temp_str,%moji_x,%moji_y,17,17,0,3,#AAFFFF,#FFAAFF

;strsp 200,$temp_str,0,0,20,5,20,20,0,0,0,0,#FFFFFF,#FF0000
;logsp2 200,$temp_str,%moji_x,%moji_y,17,17,0,3,#FFFFAA,#AAFFFF



;画面の一番左上の文字の座標を知る(%sys_ispage == 1だと一番最初が認識不可能だから)
gettext $temp_str
if $temp_str == "" getcursorpos %moji_x,%moji_y:mov %sys_vlog_num,0


And a snippet of the first page:

h_usewindow "main"
if %vol2<>-1 dwave 0,"voice\2\000104.ogg"
;^"Url," the wriggling lump of flesh burbles, "jul qba'g jr tb fbzrjurer jvgu fxngvat sbe guvf lrne'f fxv gevc?"@
^"Url," die zappelnden Fleischklumpen plappern, "jul qba'g jr tb fbzrjurer jvgu fxngvat sbe guvf lrne'f fxv gevc?"@
if %vol4<>-1 dwave 0,"voice\2\000205.ogg"
;^"Fxngvat? Jul tb gb n fxv erfbeg gb fxngr?"@
^"Fxngvat? Jul tb gb n fxv erfbeg gb fxngr?"@
if %vol3<>-1 dwave 0,"voice\2\000302.ogg"
^"Unun. Tvir ure n oernx, Gfhxhon. Fur'f orra vagb fxngvat erpragyl."@
;^ Three such creatures are sitting around the table in front of me, slurping filthy sludge from their cups as they trade whines, growls, and sounds that I can hardly describe.\
^ Drei solcher Kreaturen sitzen vor mir am Tisch, schlürfen schmutzigen Schlamm aus ihren Bechern, fauchen und machen töne die ich kaum beschreiben kann.\

bg "cg\bp02me0.jpg",10,200

if %vol2<>-1 dwave 0,"voice\2\000404.ogg"
^"Url! Vf vg fb fgenatr gung V'q arire orra fxngvat orsber?"@
if %vol3<>-1 dwave 0,"voice\2\000502.ogg"
^"V qba'g guvax gurer'er znal svefg-gvzr fxngref va gurve gjragvrf gurfr qnlf."@
if %vol2<>-1 dwave 0,"voice\2\000604.ogg"
^"V jnf xvaqn fpnerq jura V jnf yvggyr. Gubfr fubrf frrzrq yvxr xavirf gb zr."\

2013-01-29, 04:51
I solved it with a simple "Erasetextwindow 0" after the *start label and before the goto routine.