View Full Version : Zephie's ONScripter Questions

2006-09-10, 17:47
I searched through the topics until about a page back to see if some of these issues were addressed in recent times, but only a vague resemblance to what I need answered was addressed. So here goes:

After I was unable to submit my localization for a game in al|together 2006 due to the author asking I not, I figured that instead of localizing a game, I'd make one myself. My problems lie in the scripting -- right now there is only one, but there will, I'm sure, be more as I continue along (I'll reuse this topic to ask further questions -- thus the reason for its title).

Right now my problem is this:

I am scripting my menu at the moment, and as I have seen in such games as Red Shift, its rollover menu options are in one image file (ie. when the mouse is not on the image, only half the image is shown, and when someone mouses over that half of the image, it switches to the other half).

Unlike Red Shift, though, my images are horizontal and the code is therefore uncompatible and I simply can't copy/paste and mess with it to make the dimensions and positioning correct for my needs. I've tried looking in several other recent games like Visions from the Other Side and At Summer's End and even Narcissu to see how they do their rollover images (be it menu or somewhere else). So far I've come across the following:

Form #1: lsp 1,":l/4,160,0;image.bmp",0,0
Form #2: lsp 1,":a/2,0,3;image.jpg",32,400
Form #3: lsp 1,":c/2,160,3;image.jpg",150,300

I know what the lsp command is and all of that, but what I can't understand, and what I assume controls the rollover, is the ":letter/number,number,number" commands (ie. :l/4,160,0). I've played around with them before asking here, of course, but I can't make sense of it. Am I missing something, am I wrong, or am I just really, really stupid?

Hopefully this is a simple issue to answer, and I appreciate any help. :)

2006-09-10, 18:12
I'm no ONScripter genius, but I believe your answer lies not in the code, but in the image itself.

Example: The "extras" menu in the game my group localized for at2006. The image mask looks like this:


With the second and last images being the mask, and the first and third images being the actual onscreen image. The second image set is the one that appears upon rollover. The code to show it looks like this:

lsp 47,":a/2,0,3;dat•menu•omake.jpg",410,240

Hope that helped you some ^^

(edit) also, incase you wanted to see the result onscreen:

Normal: http://img148.imageshack.us/img148/4061/normalve7.jpg
Rollover: http://img46.imageshack.us/img46/6800/rolloverbe9.jpg

(The black background is part of the screen, not the menu option image itself.)

2006-09-10, 18:55
...what I assume controls the rollover, is the ":letter/number,number,number" commands (ie. :l/4,160,0).

These are image transparency and sprite animation declarations. In fact, they work regardless of whether the image is loaded as a sprite, (at least, I'm certain the letters do) and might also work for standing pictures.

What the letters do:

'l' declares that the image is to be assumed drawn on a single-color transparent background, and the color of that bacground is to be taken from the top left pixel of the image. Whichever RGB color it is will be transparent.
'r' is the same but the transparent pixel is top right.
'a' declares that the image is stored with it's alpha mask (white is total transparency, black is total opacity) stored to the right of the image data. In files containing multiple images meant for animation, alpha masks are stored with their corresponding frames
'c' declares that the image to be displayed exactly as is, with no masking or transparency.
'm' declares a separate image (name given before the ';') to be the alpha mask just as in 'a'.
's' declares some fairly complex transition mode which I'm not about to understand at 7 AM. :) I'm not sure what '#' and '!' would do either.

Next is a comma-separated list:

<number of cels in image>,<duration of each cel in microseconds>,<loop mode>

Loop mode is:

// 0 ... restart at the end
// 1 ... stop at the end
// 2 ... reverse at the end
// 3 ... no animation

2006-09-10, 21:18
Thank you Starchanchan and Mihara. It sheds some light on my thinking. Hopefully more than my brain can comprehend now, at 1:15 AM. I'll take another look tomorrow before I go in to work. :)

Edit (Next Morning): Yes, it works! Thank you both. I've entered what you've talked about into my NScripter command reference so I won't forget, either. :)