PDA

View Full Version : Script problems with PONScripter


pbsaffran
2008-09-16, 10:33
Hello,

I have been processing through the input of my first test readers and been doing a consequent cleaning of style tags and such.

There is a part where I thought I would put the "h_fontstyle" command to good use, but apparently it is ignored.

What I want to know is: how do I make it so that I don't need to have ~s~ at the beginning of each line?

Could it be that this function is not implemented in the exe? If so, how would I check this? (I am a noob at this, so be specific please)

Starchanchan
2008-09-25, 11:56
I'm primarily using the OSX build, but I haven't had a problem with h_fontstyle when I've used it. What code exactly are you putting in, and where in the script?

pbsaffran
2008-09-26, 01:55
Well, for starters, the build is the only one I could find, which would be the one from the Narcissu microtest.

Now, as for examples :

This is what I would like it to be:

*Sub_Tips_004
gosub *tip_s
bg Simen1,2
gosub *msys15


^ Extraits de l'édition du soir du journal Xxxxxxx
^ XX Juin de l'an 54 de l'ère Shôwa (1979)@
br
h_fontstyle ^si^
^ Le commissariat d'Okinomiya, dans le district de Shishibone, a lancé dans la nuit du XX Juin un avis de recherche.@
br
^ Après avoir arrêté cinq ouvriers, soupçonnés de meurtre avec circonstances aggravantes, @la police est maintenant à la recherche d'un sixième suspect, M. Xxxx, qui a pris la fuite et qui est désigné comme le principal coupable dans cette affaire.\

gosub *WA_021:!w200

^ D'après les premiers éléments de l'enquête, il semblerait que les six suspects aient, dans la soirée du XX, vers 21h, @attaqué avec violence le chef de chantier, M. XXXX, qui est mort de ses blessures.@ Ils auraient ensuite découpé le corps de leur victime et tenté de s'en débarrasser.\

gosub *WA_021:!w200

^ Le XX, vers 8h du matin, @la police reçut un appel anonyme provenant d'un hôpital du district de Shishibone pour dénoncer un patient qui venait d'avouer le meurtre de M. XXXX.@ Immédiatement sur les lieux, les policiers purent procéder à un premier interrogatoire, au cours duquel l'homme avoua les faits.@
br
^ Suivant ses instructions, les policiers purent retrouver l'un des morceaux du corps, puis procédèrent le jour-même à son arrestation pour meurtre avec circonstances aggravantes.\

gosub *WA_021:!w200

^ Les autres suspects furent arrêtés le jour-même, à l'exception de Xxxx, qui est désigné comme le principal responsable dans cette affaire.@ Il est toujours en fuite à l'heure où vous lisez ces lignes.@ La police est à sa recherche.@
br
^ ~b~Quel mobile?~bi~@
^"Nous avions bu et il nous en a fait la remarque, cela a dégénéré et finalement nous l'avons tué sous l'effet de la colère."@
^ ~i~Ceci est le mobile invoqué, mais les déclarations des cinq hommes ne se recoupent pas. @L'enquête devra faire la lumière sur ce point.\

h_fontstyle ^r^

wait 1000
bg black,2
gosub *tip_e
return
but this is what I need to do to get it properly on screen :

*Sub_Tips_004
gosub *tip_s
bg Simen1,2
gosub *msys15

^ Extraits de l'édition du soir du journal Xxxxxxx
^ XX Juin de l'an 54 de l'ère Shôwa (1979)@
br
^ ~si~Le commissariat d'Okinomiya, dans le district de Shishibone, a lancé dans la nuit du XX Juin un avis de recherche.@
br
^ Après avoir arrêté cinq ouvriers, soupçonnés de meurtre avec circonstances aggravantes, @la police est maintenant à la recherche d'un sixième suspect, M. Xxxx, qui a pris la fuite et qui est désigné comme le principal coupable dans cette affaire.~r~\

gosub *WA_021:!w200

^ ~si~D'après les premiers éléments de l'enquête, il semblerait que les six suspects aient, dans la soirée du XX, vers 21h, @attaqué avec violence le chef de chantier, M. XXXX, qui est mort de ses blessures.@ Ils auraient ensuite découpé le corps de leur victime et tenté de s'en débarrasser.~r~\

gosub *WA_021:!w200

^ ~si~Le XX, vers 8h du matin, @la police reçut un appel anonyme provenant d'un hôpital du district de Shishibone pour dénoncer un patient qui venait d'avouer le meurtre de M. XXXX.@ Immédiatement sur les lieux, les policiers purent procéder à un premier interrogatoire, au cours duquel l'homme avoua les faits.@
br
^ Suivant ses instructions, les policiers purent retrouver l'un des morceaux du corps, puis procédèrent le jour-même à son arrestation pour meurtre avec circonstances aggravantes.~r~\

gosub *WA_021:!w200

^ ~si~Les autres suspects furent arrêtés le jour-même, à l'exception de Xxxx, qui est désigné comme le principal responsable dans cette affaire.@ Il est toujours en fuite à l'heure où vous lisez ces lignes.@ La police est à sa recherche.@
br
^ ~b~Quel mobile?~bi~@
^"Nous avions bu et il nous en a fait la remarque, cela a dégénéré et finalement nous l'avons tué sous l'effet de la colère."@
^ ~i~Ceci est le mobile invoqué, mais les déclarations des cinq hommes ne se recoupent pas. @L'enquête devra faire la lumière sur ce point.~r~\


wait 1000
bg black,2
gosub *tip_e
return

Starchanchan
2008-09-28, 08:41
The solution's a lot simpler than you'd think :] Enter this:
h_fontstyle ^i^

Instead of this:
h_fontstyle ^si^

Though, what was it doing when it encountered ^si^? Did it crash, or just completely ignore the command?

[edit] Actually, that build you're using is veeeery outdated o3o PM me~

pbsaffran
2008-09-28, 12:26
It completely ignored it. You've got mail ^_^

dsp2003
2008-09-28, 21:27
A...ano...i have some problems with graphic layers (text window renders behind the sprites). My build is 2007-7-21. Got no reply from Haeleth so far (i know, he's busy). If you have a better build, PM me please (w/ sources of course).

Starchanchan
2008-09-28, 22:57
I have a better build, yes, but I can say... try changing the sprite numbers? I had that problem too (for instance, with the sprites that were supposed to over the text window going under instead) but I fixed it by making the window number higher than the sprites. I'm still not sure what numbers correspond to what order they display in XD;; I just sort of mess with the numbers til I fix it (hey, if it works...) but my textwindow and sprites display with 265 for the window, 200 and up a bit for the rest (I have a bunch of sprites I still need to make *redoing text window completely*).

And yeah, Haeleth's been busy D: I've sent him a bunch of questions/reports over the past week or two, and he replied to say he'd gotten them, but couldn't reply yet, not til he had time. (Which I'M fine with XD but yes, he is busy.)

pbsaffran
2008-09-30, 13:38
It still doesn't work, and I can't figure out why.

Starchanchan
2008-10-01, 21:01
Well, for starters, is your script file 0.utf? PONS reads from .utf files, not .txt.

It SHOULD work, unless you have a screwy bit of code somewhere or your fonts are messed up; I entered a very basic script with what you gave as an example as the text, and it worked perfectly for me. I can show you screencaps of the text, if you like, but here's what I put in:

;mode640
;gameid fontstyle test

*define

nsa
versionstr "fontstyle test","no one"
caption "fontstyle test"

h_mapfont 0, "fonts/n019003l.pfb", "fonts/n019003l.afm"
h_mapfont 1, "fonts/n019023l.pfb", "fonts/n019023l.afm"
h_mapfont 2, "fonts/n019004l.pfb", "fonts/n019004l.afm"
h_mapfont 3, "fonts/n019024l.pfb", "fonts/n019024l.afm"
h_mapfont 4, "fonts/n021003l.pfb", "fonts/n021003l.afm"
h_mapfont 5, "fonts/n021023l.pfb", "fonts/n021023l.afm"
h_mapfont 6, "fonts/n021004l.pfb", "fonts/n021004l.afm"
h_mapfont 7, "fonts/n021024l.pfb", "fonts/n021024l.afm"
h_rendering none, integer
h_rendering none, integer

h_defwindow "main",35,35,580,200,15,0,0,1,1,5,#999999,0,0,640,480


game
*start
h_ligate "fi", 0xfb01
h_ligate "fl", 0xfb02

bg black

h_usewindow "main"

^ Extraits de l'édition du soir du journal Xxxxxxx
^ XX Juin de l'an 54 de l'ère Shôwa (1979)@
br
h_fontstyle ^si^
^ Le commissariat d'Okinomiya, dans le district de Shishibone, a lancé dans la nuit du XX Juin un avis de recherche.@
br
^ Après avoir arrêté cinq ouvriers, soupçonnés de meurtre avec circonstances aggravantes, @la police est maintenant à la recherche d'un sixième suspect, M. Xxxx, qui a pris la fuite et qui est désigné comme le principal coupable dans cette affaire.\

^ D'après les premiers éléments de l'enquête, il semblerait que les six suspects aient, dans la soirée du XX, vers 21h, @attaqué avec violence le chef de chantier, M. XXXX, qui est mort de ses blessures.@ Ils auraient ensuite découpé le corps de leur victime et tenté de s'en débarrasser.\

^ Le XX, vers 8h du matin, @la police reçut un appel anonyme provenant d'un hôpital du district de Shishibone pour dénoncer un patient qui venait d'avouer le meurtre de M. XXXX.@ Immédiatement sur les lieux, les policiers purent procéder à un premier interrogatoire, au cours duquel l'homme avoua les faits.@
br
^ Suivant ses instructions, les policiers purent retrouver l'un des morceaux du corps, puis procédèrent le jour-même à son arrestation pour meurtre avec circonstances aggravantes.\

^ Les autres suspects furent arrêtés le jour-même, à l'exception de Xxxx, qui est désigné comme le principal responsable dans cette affaire.@ Il est toujours en fuite à l'heure où vous lisez ces lignes.@ La police est à sa recherche.@
br
^ ~b~Quel mobile?~bi~@
^"Nous avions bu et il nous en a fait la remarque, cela a dégénéré et finalement nous l'avons tué sous l'effet de la colère."@
^ ~i~Ceci est le mobile invoqué, mais les déclarations des cinq hommes ne se recoupent pas. @L'enquête devra faire la lumière sur ce point.\

h_fontstyle ^r^

reset

pbsaffran
2008-10-02, 04:30
Yes, but I don't have pfb and afm datas, since I don't use that kind of fonts.
I did define the h-fontmap up to the <int> and <string>, but the command is still ignored.
Then again, apparently, I wouldn't need this since I am using opentype and truetype fonts.

Starchanchan
2008-10-02, 18:18
Well, it's where you set your fonts in h_mapfont. Copying from the manual:

0 text book regular
1 text book italic
2 text bold regular
3 text bold italic
4 display book regular
5 display book italic
6 display bold regular
7 display bold italic

So if you want more than one font, you'll have to set it in slots 4-7 and alter your code to reflect those slots.

For instance, your current code works with these defined:

h_mapfont 0, "fonts/times.ttf"
h_mapfont 1, "fonts/timesitalic.ttf"
h_mapfont 2, "fonts/timesbold.ttf"
h_mapfont 3, "fonts/timesbolditalic.ttf"
h_mapfont 4, "fonts/times.ttf"
h_mapfont 5, "fonts/timesitalic.ttf"
h_mapfont 6, "fonts/timesbold.ttf"
h_mapfont 7, "fonts/timesbolditalic.ttf"

...with the same font listed as both text and display fonts. If you want other fonts, though, then set only 0-3 with your first font and its different styles as that first font; with this, you'll have to alter your code to reflect which face you're using by toggling with ~s~. If you only set the first slots to that font, then the only change you'd have to make to that current slice of code would be to change h_fontstyle ^si^ to h_fontstyle ^i^.

pbsaffran
2008-12-09, 14:07
*Riiiiise up from your grave*

I'm loving Notepad2 and the fact that it takes 2miliseconds to make an auto search and replace in a 7mb script.
However, I still have problems sometimes.

Let's take for example these:
Here (http://img503.imageshack.us/img503/5954/higurashin1jg5.jpg) the narrow no break space works ('100 yens')
Here (http://img258.imageshack.us/img258/1392/higurashin2ce6.jpg) it doesn't. ('Satoko !')

Also, it seems that a gosub order defining the window with (in my script) h_usewindow "maing" will not be enough. Is this normal ?

Starchanchan
2008-12-10, 15:29
Err, I'm not sure what you mean about it not being enough in a gosub... can you post the code in question? (And the window's defined with h_defwindow at the beginning, and used with h_usewindow... not defined with h_usewindow. I'm guessing you just mistyped, though?)

pbsaffran
2008-12-10, 15:57
Here are the parts (I did not include everything, but just enough to give you an idea):

define block:
;mode640
;gameid Le sanglot des cigales

*define

;テキストの枠の定義
h_defwindow "mainw",31,16,548,448,26,0,2,10,1,1,#ffffff,0,0,639,479
h_defwindow "maing",31,16,548,448,26,0,2,10,1,1,#999999,0,0,639,479
h_defwindow "mainfullw",8,16,570,448,26,0,2,10,1,1,#ffffff,0,0,639,479
h_defwindow "mainfullg",8,16,570,448,26,0,2,10,1,1,#999999,0,0,639,479

;フォントの定義
h_mapfont 0,"fonts\georgia.ttf"
h_mapfont 1,"fonts\georgiai.ttf"
h_mapfont 2,"fonts\georgiab.ttf"
h_mapfont 3,"fonts\meiryo.ttc"
h_mapfont 4,"fonts\pala.ttf"
h_mapfont 5,"fonts\palai.ttf"
h_mapfont 6,"fonts\palab.ttf"
h_mapfont 7,"fonts\palabi.ttf"
h_rendering none, integer
h_ligate basic
h_ligate "_ _", 202F ;this is intended so, but works on and off
h_ligate "%-", 2011 ;this doesn't work at all, needs investigation
h_ligate "fi", 0xfb01
h_ligate "fl", 0xfb02

game
*start


narrow non breakable space works :
*Sub_Tips_001
;■うちって学年混在?


gosub *tip_S
gosub *data_tati
bg Kyousitu1,3

gosub *msys1

[...]
^"Heh_ _!@ Abandonne, Rena.@ À ce jeu-là, tu as perdu d'avance.@ Mais si tu y tiens, on peut parier 100_ _yens par mois de différence."@
[...]


The nnbsp doesn't work:
*Sub_Tips_002
gosub *tip_S
gosub *data_tati
bg Kyousitu3,2
gosub *lsys12
[...]
gosub *G_sys:ld l,$Re_DefA1,80

^"Oh, mais tes habits sont très mignons, Satoko_ _! J'aimerais en porter des comme ça_ _!"@


Now, I found out that the tips window was defined under the *tip_S routine which goes like this :
*tip_S

setcursor 0,":l/3,160,2;Bmp\Efe\cursor0.bmp",0,0
setcursor 1,":l/3,160,2;Bmp\Efe\cursor1.bmp",0,0
textclear
gosub *data_tati
csp -1
print 22
rmode ON
h_usewindow "maing"
gosub *E_A
!sd

return

Starchanchan
2008-12-10, 21:04
I'm about to take a look at it, but first—were the "pala" fonts Palatino, or something else? I've got Georgia, and Palatino too if that's what you're using there, but I don't think I have Meiryo.

Starchanchan
2008-12-10, 22:39
...okay! I know why the nnbsp wasn't working, and there were... three separate reasons. XD;; what was actually happening was that it wasn't working at all—you were just getting a normal space displayed.

Reason #1: defining "_ _" didn't work. It seems PONS doesn't read _ in lines as a character (I tried it earlier today, in fact, and it didn't show up at all). So even though you had it defined, when you typed it out in a line, the regular space was all that was showing. When I tried defining it with "%.", it worked.

Reason #2: Instead of defining the unicode symbols in UTF-16BE format, which you were doing (202f), you needed to define them in UTF-16 hex format (0x202f).

Reason #3: It appears that, uh, the font Georgia doesn't even read nnbsps at all. XD;; not that I could get, anyway. I don't think too many fonts DO read it, though please correct me if I'm wrong—I just experimented with several. But when I used the Helvetica font, it showed fine.

SO. In the end, I got the nnbsps to show with this:

h_mapfont 0,"fonts\helvetica.ttf"

h_ligate "%.", 0x202f

^"Oh, mais tes habits sont très mignons, Satoko%.! J'aimerais en porter des comme ça%.!"@

^"Heh%.!@ Abandonne, Rena.@ À ce jeu-là, tu as perdu d'avance.@ Mais si tu y tiens, on peut parier 100%.yens par mois de différence."@

...in their respective places.

To illustrate, here are some screenshots I took (yes, I know the lines are in the wrong places, but I inserted them together to test, since they were the examples you gave). All of the following are in Helvetica.

In both, the first set has the spaces displayed with "%.", the second has it with "_ _" (I had both defined with h_ligate).

When defined with 0x202f:
http://img.photobucket.com/albums/v287/starchanchan/misc/helvetica-0x202f.jpg

And when defined with 202f:
http://img.photobucket.com/albums/v287/starchanchan/misc/helvetica-202F.jpg

Line 1 in the first image is how it should display when properly coded.
Line 2 in the first image shows you that it is, after all, just displaying "_ _" as the space in it.

Line 1 in the second image shows that 202f does not, in fact, work as displaying anything (or at least not what you want in this case).
Line 2 in the second image... well, for some reason it displays a little differently, but if you look, you can still see it's a full space and not the narrow one you wanted.

...and that was pretty long, but I hope you see what I was trying to say there. XD;; I haven't taken a look at the other one you said wasn't working, "%-", but I'd say the problem lies in the unicode format as well. (Maybe the font too, though I'm just guessing there, since I haven't even looked up what symbol that unicode displays. ^^;; The 2011 format is definitely one issue, though.)

pbsaffran
2008-12-11, 06:08
Well, THAT is a very thorough answer.

...okay! I know why the nnbsp wasn't working, and there were... three separate reasons. XD;; what was actually happening was that it wasn't working at all—you were just getting a normal space displayed.

Hmmm. You know, I noticed a few months ago that PONS didn't read "_", so I thought I could use it to bind words together. Hence the "_ _" bypass to an unbreakable space. I guess that was a bit too naive.

I still think it's funny that it worked with the "100 yens" bit. That brought me on the completely wrong track...

Reason #2: Instead of defining the unicode symbols in UTF-16BE format, which you were doing (202f), you needed to define them in UTF-16 hex format (0x202f).


While I do understand what you are getting at, I got the unicode number from a special "convert a sign to it's unicode number" site and since I didn't know any better, took the one I thought was correct. Thanks for clearing that up.

Reason #3: It appears that, uh, the font Georgia doesn't even read nnbsps at all. XD;; not that I could get, anyway. I don't think too many fonts DO read it, though please correct me if I'm wrong—I just experimented with several. But when I used the Helvetica font, it showed fine.

Now THAT is a catastrophe. I am dead set on using the pair "Georgia - Palatino"...


In both, the first set has the spaces displayed with "%.", the second has it with "_ _" (I had both defined with h_ligate).

I will try them, but just so you know:
In my define block I have a ligate defined with "%-" which doesn't work, it still shows the % sign. But this may be caused by the other issues you pointed out...

Line 2 in the second image... well, for some reason it displays a little differently, but if you look, you can still see it's a full space and not the narrow one you wanted.

Well, I thought all these were common signs, I didn't expect them not to exist. But I suppose getting a no-break space is still better than nothing.

The other sign btw is a no break hyphen (again, common in french...).

Thanks for all that. I think I will worry about the tip_S subroutine later.

Edit : I've just noticed your answer before that last one.
Yes, as you guessed, the fonts are Georgia, Palatino Linotype, and Meiryo. Meiryo is actually a Vista font, but it's the only japanese font which has a separate set for italics, bold and such. (at least, that I could find on a Windows environment).
I might need to change these of course, if the needed letters don't even exist in them...

pbsaffran
2008-12-13, 07:57
Just a very small update : the % signs disappeared once I replaced the narrow no break space with the regular no break space. I assume it's the same problem with the no-break hyphen.

Starchanchan
2008-12-27, 20:57
Ahh, I kept forgetting to ask—what was the problem with the tip_S subroutine? I didn't notice anything off, but there could have been something that was supposed to happen that I missed; I didn't look as closely into that, since I didn't see any noticeable problems.

I can't take a look at the game for another week or so, since I'm at home for the holidays and my laptop is... about five years old, has a 40 GB hard drive, and is quite slow... so yeah, I only put the necessary files on it for the trip. (Plus, I found that glitches in the code that make PONS crash cause my entire laptop to lock up, guh. It's not a problem on my desktop computer, but again... old laptop.)

pbsaffran
2008-12-28, 07:52
Well I am doing a script overhaul at the moment, and the "only" issues left are the localestring things (which are probably not implemented in the exe itself, so there's nothing you could do here, I suppose) and the (still) non-working h_fontstyle orders.

I thought these would be fixed once my windows are correctly set with the h_usewindow orders, but it appears that is not the case. The tips window is defined with the tip_S subroutine, which seems to be correct and defines the window using proper PONS language, but the h_fontstyle still never works, and it's making me sad.

Then again, I learned to live without it.

I dunno if this is related but h_locate works correctly, as does h_centerline.

My last concern for chagrin is that the h_usewindow system is not all gravy when you have 52 different window settings in the game (most of them used only once).

Starchanchan
2008-12-28, 10:55
h_fontstyle STILL doesn't work for you? That's quite odd, because when I did that testing last time, I had no problems getting the command to work—I was able to display pages in italics, etc. How were you defining the commands? h_fontstyle ^i^ should have worked. (And remember that ^si^ and ^i^ are different... "s" toggles the display face.) Again, I don't have the files to look at right now, but I'm not quite sure why it won't work for you—I know it should. If you haven't gotten it by the time I go home next week, I'll look at it again then.

[edit] And I agree with the multiple window settings being annoying when you only use most of them once or twice—I actually emailed Haeleth recently about something similar, though not as general. I should probably send him another email asking if there's a way to make that any simpler for situations like that.

pbsaffran
2008-12-28, 13:01
You did mention that it worked for you, so I assume that other parts of the define block are conflicting, or something.

About the ^si^ business, I use it to introduce written material such as investigation notes, labo reports or newspaper extracts. These are lengthy so a h_fontstyle would do wonders, but I can manage just fine without it. It just takes a lot of crosschecking.

Last question about windows, a general question actually.
Let's see what I have here...

setwindow 31,16,22,16,26,26,0,2,20,1,1,#ffffff,0,0,639,479
setwindow 80,180,22,16,30,30,0,2,20,1,1,#ffffff,0,0,639,479

In these examples, both windows are defined as 22 sjis characters length and 16 heigth, but the actual area available is smaller in the latter one (and that's even if we ignore that the second window has a bigger font).
Could I use whatever value I replaced "22,16" with in the first one, or do I have to adapt it to the 80,180 mask? Or is it irrelevent? (as it appears to be for setwindow anyway)

Starchanchan
2008-12-28, 19:18
I'll definitely check again when I get home, but for now, all I can suggest is trying ^i^ instead of ^si^... I don't know if you've tried that already, but without the means to check, that's all I can think of off the top of my head.

As for the window question—do you mean that the window is smaller after you convert it to a h_defwindow command, or just used as setwindow? And if you do mean h_defwindow, could you post the code you used to define them with? That might give me a better idea. If you just meant setwindow as is, though, I'm not sure, as I always redefine windows in h_defwindow for PONS builds pretty much right away.

pbsaffran
2008-12-28, 21:00
No, I mean something slightly different.

Assuming I convert
"setwindow 31,16,22,16,26,26,0,2,20,1,1,#ffffff,0,0,639,479"
to something PONS can work with, like for instance
h_defwindow "example1",31,16,548,448,26,0,2,10,1,1,#ffffff,0,0,639,479

Here the panel of the text window would be placed at x=31 and would reach until x=579 in length. 579 is less than 639 (which is the last x value) so everything is cool.

But what about
"setwindow 140,120,22,16,35,35,0,2,20,1,1,#ffffff,0,0,639,479"
then?
If I use the same values for 22,16, it becomes
h_defwindow "example2",140,120,548,448,35,0,2,10,1,1,#ffffff,0,0,639,479
In that case though, the text window panel would reach from x=140 to x=688, which would be off the screen!

This problem apparently doesn't bother whoever designed those windows in the first place, and that is puzzling me...

Starchanchan
2008-12-29, 15:29
It appears to be off the screen in the original setwindow too though, doesn't it? I just typed them into another game as a test, and it went offscreen there too. I guess if you don't want it offscreen, then it's best to resize the window dimensions yourself... was the original just a few words, too short to run all the way to the edge of the screen? Or were they centered? If they were centered, then there's an easier way to center text in PONS, which I think you've already seen, yes? But if not... then yeah, you'll have to alter that to make it work for you.

pbsaffran
2008-12-31, 05:29
That's the weird thing, I have played the game a lot before and I never noticed anything of the like.
I decided to adapt them, just to be on the safe side.

pbsaffran
2009-01-05, 05:04
Small but important update:
As far as I know, I am done converting the Nscript orders to PONS grammar. Admittedly, I left quite a few "locate" strings as they were, but they seem to work just fine.

Is there actually a tool that converts 0.utf to a script.dat? Just curious. I AM trying for a commercial release, I guess...

dsp2003
2009-01-05, 05:35
program utf2dat;

{$APPTYPE CONSOLE}

uses
SysUtils,
Classes;

var InputFile, OutputFile : TStream; i : integer; j : byte; WhereAreWe : string;

begin
WhereAreWe := ExtractFilePath(paramstr(0));

if (paramstr(1) <> '') and FileExists(paramstr(1)) then begin
try
InputFile := TFileStream.Create(paramstr(1),fmOpenRead);
OutputFile := TFileStream.Create(WhereAreWe+'pscript.dat',fmCreate);

InputFile.Position := 0;
OutputFile.Position := 0;

for i := 0 to InputFile.Size - 1 do begin
InputFile.Read(j,1);
j := j xor $84;
OutputFile.Write(j,1);
end;

FreeAndNil(InputFile);
FreeAndNil(OutputFile);
write('Conversion done. ');
except
FreeAndNil(InputFile);
FreeAndNil(OutputFile);
write('Conversion failed. ');
end;

end else writeln('Usage: ' + ExtractFileName(paramstr(0)) + ' <UTF file>');
writeln('Press Enter to quit.');
readln;

end.


Simply xor your 0.utf by 0x84 to get pscript.dat. There's no "bytecode" conversions as you can see (but insani's site claims the opposite... -_-).

By the way, if you're lazy and unfamiliar with HEX editors, compile my "coded-in-5-minutes" source in Delphi 7\9 or later.

pbsaffran
2009-01-05, 05:50
*LOL*
Thank you for that very fast reply, but I did not understand a single word of what you wrote, being absolutely programming illiterate.

EDIT:
I went to your site and somehow got it right, I suppose. Thank you !

Starchanchan
2009-01-05, 21:41
Oh! Did you get everything working, then? If you were still having trouble with the fontstyle commands, I'm home now, so I can look at the files if you want.

pbsaffran
2009-02-10, 12:54
Another month has passed...
I am talking to publishers while trying to repair some stuffs.

I had the case of a flag that could not be activated anymore - I dunno if it was due to PONscripter, but I had to bypass it altogether and force the game to grant you access to that hidden part.

Right now I am trying to figure out the meaning of this :
if %EXE_TIPS = TIPS_052 gosub *jp_sys:goto *Tumi_day12_2
if %EXE_TIPS = TIPS_052 gosub *jp_sys:goto *Tumi_day9_2

I mean, I didn't notice anything when I was playing the game, but then again I played it like 2 years ago.
I noticed other errors like that, yet the game plays flawlessly as far as I can check.

Last but not least, erasing the envdata and save.dat seems to fix many crashes. I find that to be quite funny, to be honest.

Sonozaki Futago-tachi
2009-02-10, 13:27
Right now I am trying to figure out the meaning of this :
if %EXE_TIPS = TIPS_052 gosub *jp_sys:goto *Tumi_day12_2
if %EXE_TIPS = TIPS_052 gosub *jp_sys:goto *Tumi_day9_2


Eh, that second line never executes, since if the first line executes it does a goto and never returns. There's other similar bits of cruft in the higurashi scripts that never get called.

EDIT: Actually, the entire subroutine that contains these 2 lines never gets called. Like I said, chunks of cruft...

Mion (Sonozaki Futago-tachi)

pbsaffran
2009-02-10, 15:41
I see...
Do you think it would make sense to clean the script a bit? I did supress the (unaccessed) minigames in matsuribayashi, but I woudn't want to erase possible templates...

Starchanchan
2009-02-16, 18:06
Did you ever get the fontstyle commands to work? I hadn't heard back from you after I sent the files that had worked for me.

Sonozaki Futago-tachi
2009-02-16, 21:33
Hi Starchanchan,

I heard from pbsaffran that the fontstyle commands still weren't working for him.

I'm curious about it myself; could you perhaps PM me with one of your working-fontstyle scripts?

Thanks,
Mion (Sonozaki Futago-tachi)