gemot encubed  

Go Back   gemot encubed > Gemot > Technical Issues

Technical Issues For bug reports, problem solving, and help running Japanese software.

Reply
 
Thread Tools Display Modes
  #1  
Old 2006-10-11, 22:52
JanX JanX is offline
Visitor
 
Join Date: Oct 2006
Posts: 2
Default making unlockable gallery in ONscripter

Firstly -- thank you all for the hard work. I wouldn't have been able to play these games without the translations.

I've been making a visual novel using ONscripter -- Definitely not a programmer, so there's probably a lot more the engine can do that I haven't figured out. At this point, I've got enough basic knowledge to go ahead and make the game.

The problem is that I simply can't figure out how to make an unlockable gallery.

Here's how I want it to work: The gallery has several blank squares on it where thumbnails of the CGs will be. If you haven't unlocked a CG, then the square will remain blank. After unlocking a CG, the thumbnail will appear. Then you can click on it to view at full size.

How would one write the code?
Reply With Quote
  #2  
Old 2006-10-12, 00:19
Message's Avatar
Message Message is offline
Obsessive
 
Join Date: Dec 2003
Location: Netherlands
Posts: 333
Default

I probably shouldn't be pasting copyrighted code here... But since I've been working on this very recently, here's an undressed version of how Tsukihime handles it:

Code:
*ark_gallery
(if gallery page==1)
(put path\filename.jpg into a row of $strings)
(if gallery page==2)
(put other images into the $strings)

gosub *imagemode
goto *ark_gallery

*ciel_gallery
(if gallery page==1)
(put path\filename.jpg into a row of $strings)
(if gallery page==2)
(put other images into the $strings)

gosub *imagemode
goto *ciel gallery

*imagemode
(compare the $strings to "" and put the result in %variables)

notif %variable1==0 && fchk $string1 lsp 0,":c;image\gallery\notreg.jpg",X,Y
(same for %variable2 with $string2 for lsp 1, etc)

bg $4000,%type_crossfade_fst
btndef $4010
if %variable1!=0 && fchk $string1 btn 4001,60,15,160,120,0,0
(same for %variable2 with &string2, etc)

btnwait %4011
(return and csp -1 if right-click or exit button pressed)
(go back to btnwait %4011 if nothing happened)

csp -1
bg $%4011,%type_crossfade_fst
btndef ""
btnwait %4011

goto *imagemode
I've removed the logic to remember what page you're on etc, so the above should only be used to get a general idea of how they do it. $4000 points to the background image with faded thumbnails of all images on this page, $4010 points to a buttons image, containing the unfaded thumbs as well as highlighted buttons.
Reply With Quote
  #3  
Old 2006-10-12, 04:52
Starchanchan's Avatar
Starchanchan Starchanchan is offline
Obsessive
 
Join Date: Jul 2006
Location: in the rainstorm
Posts: 226
Send a message via AIM to Starchanchan Send a message via MSN to Starchanchan
Default

Or, you could do it somewhat like this:

Upon showing the image in-game:

bg "data„cg„cg10a.jpg"„
mov %200,1

And for the CG mode:

*cg_mode
bg "data„system„cg_mode01a.jpg",12
btndef "data„system„cg_mode01b.jpg"
btn 1,575,30,60,32,575,30

*cg_loop

btnwait2 %0
if %0<=0 goto *cg_loop

btndef ""

if %0=1 && %200=1 bg "data„cg„cg01a.jpg",12:click:goto *cg_mode




^^;; that's a cropped version of the code I'm using for my own visual novel. Let me know if you need me to elaborate.
Reply With Quote
  #4  
Old 2006-10-12, 07:49
Message's Avatar
Message Message is offline
Obsessive
 
Join Date: Dec 2003
Location: Netherlands
Posts: 333
Default

Hint: Using fchk saves you a LOT of trouble setting and checking all kinds of variables. ONS keeps a record of what's been viewed automatically. [edit: Make that a record of what's been loaded. This doesn't have to mean that the image was really shown.] I probably should have added that above, the fchk command is the heart of the gallery mode. The rest is mostly to make it modular.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 14:50.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.