PDA

View Full Version : Clicking not working in ONScripter?


Starchanchan
2006-09-13, 20:27
Huu... I'm slowly attempting to make a patch for a Hikaru no Go BL game, and I'm having a bit of an issue. At certain points, you get an image of a go board, and you have "a" and "b" spots on the board; you click on whichever you think is right, and the stone will appear on the board. If you click anywhere else other than those spots, the instructional text repeats. My problem is, the game's made wih NScripter, so when I began to test it with ONScripter, for some reason, clicking on the board's spots doesn't register- no matter where I click, it simply keeps repeating the instructions, as if I had clicked on a non-a/b spot. The code for one such instance looks like this:

*gogame_2

lsph 502,":a;sys\q2.bmp",187,37
;Q2
lsph 413,":a;sys\kuro.bmp",370,40
lsph 414,":a;sys\kuro.bmp",390,40

vsp 502,1 :print 2
textclear
saveon
`It's black's turn.
`Where should black be played in order to kill white?\

clickpos %0,%1

if %0>=390 && %0<=410 && %1>=40 && %1<=60 goto*huseikai_2

if %0>=370 && %0<=390 && %1>=40 && %1<=60 goto*seikai_2

gosub *kankeinai_all:goto *gogame_2



*seikai_2


vsp 413,1 :print 2

wait 300
vsp 413,0:print 1:vsp 502,0:print 1
vsp 414,0:print 1


goto *seikai_all


*huseikai_2

vsp 413,0 :print 3
vsp 414,1 :print 2

wait 300
vsp 414,0:print 1:vsp 502,0:print 1
vsp 413,0:print 1
goto *huseikai_all



Any help would be appreciated @_@ thankyou~

Haeleth
2006-09-14, 00:42
When you have a bug like this, the first thing to do is always to check the debug output (on Windows look in stderr.txt, on other platforms run the game from a console/terminal window).

In this case I rather suspect that will reveal that ONScripter does not understand the clickpos command. ^^

Try replacing it with getmousepos, which ONScripter does support; it is basically equivalent unless the player moves their mouse very quickly after clicking.

Starchanchan
2006-09-14, 09:39
Ahhh, that was indeed the problem, and replacing it fixed it! Thankyou! ^^