haroldo-ok / choice4genesis

A ChoiceScript clone that generates SGDK-compatible C source for the Sega Genesis
https://haroldo-ok.itch.io/choice4genesis
MIT License
20 stars 2 forks source link

wow another nice engine/console! #66

Open zartan9 opened 1 year ago

zartan9 commented 1 year ago

getting into it! Im trying to change pictures i think i used correct pallete but the original hedgehog picture shows.. what can i do to update images? thanks! src/generated_scripts.c:20:17: error: 'Blue_Hedgehogp_png' undeclared (first use in this function) VN_background(&Blue_Hedgehogp_png);

haroldo-ok commented 1 year ago

Hello again; Which distribution is being used, and how did you execute the tool? What are the contents of the project folder? What was changed to cause the error? What are the contents of the startup.choice file?

zartan9 commented 1 year ago

hi i use the choice4genesis-0.8.0-standalone.7z for win 10. I ran Menu and example works. i added some pictures using the mega drive blue pallete converted from gimp (i cant find any other genesis palettes) and just changed the file name. hope this helps...

haroldo-ok commented 1 year ago

If you want to convert the image using GIMP, you can go to "Image -> Mode -> Indexed", "Generate Optimum Palette", "Maximum Number of Colors = 16". https://docs.gimp.org/2.10/en/gimp-image-convert-indexed.html

If you change the file name of "Blue_Hedgehog.png", you will also need to change the filename of the background command on startup.choice.

zartan9 commented 1 year ago

it works I tried in gimp and photoshop and they both let me convert images. Id like to make interactive slideshow (pictures with captions), would you recommend each picture be a scene or someother way loaded to 1 scene? thanks.

haroldo-ok commented 1 year ago

There are various ways that the code can be organized, but it's perfectly viable to have multiple pictures in a single scene; for example:

* choice
    # I would like to see the first picture
        * background "Picture 1.png"
        This is the first picture
    # I would like to see the second picture
        * background "Picture 2.png"
        This is the second picture
    # I would like to see the third picture
        * background "Picture 3.png"
        This is the third picture

The code above will show a menu allowing to select which picture the user wants to see, and displays it with a caption.

zartan9 commented 1 year ago

Ok I'll try it when I get to the house. Is there a timer option / way to do autoplay (if selected users can see next pictures automatically). This may be the engine I use for tons of images...:)

haroldo-ok commented 1 year ago

Good to know you found it useful! 👍 For autoplay, there is the wait command, that waits for as many seconds as passed on the parameter.

zartan9 commented 1 year ago

I'll look into that too thanks😁

zartan9 commented 1 year ago

alright i got it workin for instance every time user presses S it waits a second and goes to next picture from 1 scene (is there a better way to do that? a quicker wait like .4?) and it used many pictures so far thanks! As for the text though, there is one line "This is the picture" but like 4 empty lines below...is there a way to get rid of the big grey box space below text? Thank you. working so far :)

haroldo-ok commented 1 year ago

There are two ways to remove the empty space:

zartan9 commented 1 year ago

hi i think ill try the font image idea.. these may sound like silly questions but in photoshop (or gimp) how do i change bg color to 0 (the png is indexed?) and where is the outputted genesis file? thanks!

haroldo-ok commented 1 year ago

Hello;

The generated ROM file will be placed on the "out" subdirectory:

image

As for editing the font image to use color zero those are the steps, on GIMP:

  1. Open the file on GIMP: image

  2. Show the color map, if it is not already visible: Windows -> Dockable dialogs -> Colormap; the Colormap is where the palette is located, on GIMP; see https://docs.gimp.org/2.10/en/gimp-indexed-palette-dialog.html

  3. On the Colormap dialog, select color index 0: image

    1. Select the Flood fill tool (the bucket icon):

image

  1. Now, start clicking on the gray areas on the image, to replace the colors: image
zartan9 commented 1 year ago

thanks it all works! suggestion for your engine(s): hotspot/image maps! it may expand gameplay. anyway thanks again will try converting alot of images now :) !!!

zartan9 commented 1 year ago

hi again, would there be a way to have a choice jump to a middle picture? for instance I want to go to picture 51 via a choice without having to go up to 50... (at this point its one choice to cycle through the pictures)

haroldo-ok commented 1 year ago

Hello;

That depends on how the program is structured...

There could be more options, depending on what is intended.

zartan9 commented 1 year ago

i see! Im trying interactive slideshow idea so just brainstorming ways to do it. Yes the scene is easiest for me to set up but more time to do so hmm okie dokie thanks!

haroldo-ok commented 1 year ago

Okay, you're welcome.

zartan9 commented 1 year ago

i have long sentences, is there a way to /n new line *line_break somehow? ah found it works a simple enter :) would it be possible in future to use label to get around a scene? for instance my pictures could be something like:

background "50.png"#flag This is the 50 picture wait 1 background "51.png"#flag This is the 51 picture wait 1 background "52.png"#flag This is the 52 picture ..and a search box to type "52" to go to that picture (or button etc)!! Thanks!

haroldo-ok commented 1 year ago

Yes, the label and goto commands would have this role; their implementation is pending; see #10 .

zartan9 commented 1 year ago

wonderful. I notice wheni have a paragraph of 6 lines the next picture/caption shows some previous text (bottom line). Is there a text limit?

haroldo-ok commented 1 year ago

Yes, there's a text limit, that depends of the size of the configured window. It should automatically paginate if the text overflows, but that is not implemented yet. See: https://github.com/haroldo-ok/choice4genesis/issues/22

zartan9 commented 1 year ago

can hardly wait! Im really liking choice4genesis! Idea: have some words of text hyperlinked/able to be interactive! Keep on making great software :)

zartan9 commented 1 year ago

project.zip hi please see attached zip. it loads the scene gen19 but issue is with pictures (was working in earlier version). thank you

haroldo-ok commented 1 year ago

I see... the image seems to be in the wrong format; scrolling up a few lines, this error message appears:

'D:\Temp\choice4genesis-0.9.0-standalone\choice4genesis\examples\test2\res\..\project\g19v1.png' is in 32 bpp format, only indexed images (8,4,2,1 bpp) are supported.
Error: cannot compile resource 'IMAGE g19v1_png "../project/g19v1.png" APLIB ALL'
java.lang.IllegalArgumentException: 'D:\Temp\choice4genesis-0.9.0-standalone\choice4genesis\examples\test2\res\..\project\g19v1.png' is in 32 bpp format, only indexed images (8,4,2,1 bpp) are supported.
        at sgdk.rescomp.resource.Image.<init>(Image.java:32)
        at sgdk.rescomp.processor.ImageProcessor.execute(ImageProcessor.java:66)
        at sgdk.rescomp.Compiler.execute(Compiler.java:678)
        at sgdk.rescomp.Compiler.compile(Compiler.java:134)
        at sgdk.rescomp.Launcher.main(Launcher.java:65)

It looks like the affected image is not in a 16 color format. There are plans to convert them automatically (#25), but for now, the conversion must be done manually.

zartan9 commented 1 year ago

got it~ ok ill wait for auto convert and work on the text in mean time thank you!!

-----Original Message----- From: Haroldo de Oliveira Pinheiro @.> To: haroldo-ok/choice4genesis @.> Cc: zartan9 @.>; Author @.> Sent: Wed, Oct 26, 2022 5:40 pm Subject: Re: [haroldo-ok/choice4genesis] wow another nice engine/console! (Issue #66)

I see... the image seems to be in the wrong format; scrolling up a few lines, this error message appears:'D:\Temp\choice4genesis-0.9.0-standalone\choice4genesis\examples\test2\res..\project\g19v1.png' is in 32 bpp format, only indexed images (8,4,2,1 bpp) are supported. Error: cannot compile resource 'IMAGE g19v1_png "../project/g19v1.png" APLIB ALL' java.lang.IllegalArgumentException: 'D:\Temp\choice4genesis-0.9.0-standalone\choice4genesis\examples\test2\res..\project\g19v1.png' is in 32 bpp format, only indexed images (8,4,2,1 bpp) are supported. at sgdk.rescomp.resource.Image.(Image.java:32) at sgdk.rescomp.processor.ImageProcessor.execute(ImageProcessor.java:66) at sgdk.rescomp.Compiler.execute(Compiler.java:678) at sgdk.rescomp.Compiler.compile(Compiler.java:134) at sgdk.rescomp.Launcher.main(Launcher.java:65) It looks like the affected image is not in a 16 color format. There are plans to convert them automatically (#25), but for now, the conversion must be done manually.— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

haroldo-ok commented 1 year ago

Until that is done, it is possible to manually convert the images to 16 color format using GIMP or other similar tool. Please, see: https://github.com/haroldo-ok/choice4genesis/issues/66#issuecomment-1277919581

zartan9 commented 1 year ago

got it yes thanks! either way Im glad to be using choice4genesis to help it come together thanks!

-----Original Message----- From: Haroldo de Oliveira Pinheiro @.> To: haroldo-ok/choice4genesis @.> Cc: zartan9 @.>; Author @.> Sent: Wed, Oct 26, 2022 6:07 pm Subject: Re: [haroldo-ok/choice4genesis] wow another nice engine/console! (Issue #66)

It is possible to manually convert the images to 16 color format using GIMP or other similar tool.— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zartan9 commented 1 year ago

hi working in this great engine!! im trying to replace/format text but getting error: de31.choice: Error at line 80: Inconsistent indentation, this line uses both spaces and tabs. in notepad++ im finding: find whole numbers... \d{1,2}

and replacing with this \t \twait z \n \t \t background "dezzv.png" \n \t \t (this has the * not sure if its showing up in post here)

visually it matches the correct layout but im doing something wrong please advise. de31.zip

haroldo-ok commented 1 year ago

Hello! The problem is that, just like Choicescript, choice4genesis does not allow mixing space and tabs in the indentation. It will have to be consistent.

zartan9 commented 1 year ago

thanks so whats the best way? before I was just manually by hand adjusting text/code.. could the regex be tweaked to have it work ? anything to do with: (i.e. >> 2 "string with spaces" 2 4 noSpacesString true) i saw this in version .11 nice3 it converts the images :)

haroldo-ok commented 1 year ago

Hello, again;

I have taken a manual look at "de31.choice", by activating the Show White Space and TAB functionality on NotePad++ (don't worry, most code editors will have a similar option):

image

As you can see above, the yellowish dots represent spaces, and the yellowish arrows represent tabs. Line 80 has <Space><Tab><Space><Tab> while line 76 has .

One way to fix that would be by using regex to replace \t, that is, with \t, that is, :

image

That way, now the tabs become consistent:

image

zartan9 commented 1 year ago

works now great! thanks

zartan9 commented 1 year ago

just got updated version keep up the great work!! I have a long sound file, but when i test the wav it only plays a second? should this be mp3 or do i have to preload it somehow? is there a voice vs song documentation? thanks!!

haroldo-ok commented 1 year ago

The sounds must be in WAV format, as MP3 is not supported. The difference between music and sound is that the music keeps looping until you stop it, while the sound only plays once per invocation. There's no limit on sound duration, as long as there's enough ROM.

zartan9 commented 1 year ago

ok ill turn into music. when it goes to new scene does the music stop? ill test it out..

haroldo-ok commented 1 year ago

BTW, while implementing #85, I did find a bug on the engine regarding sound length. The bug will probably be fixed on the next release.

zartan9 commented 1 year ago

the wav worked! the wav worked. cant wait for gifs!! exciting!

zartan9 commented 1 year ago

is there a way to stop the other choice ? i have 2 choices but if i chose one it then goes to the other choice

haroldo-ok commented 1 year ago

You have to indent them correctly:

* choice
    # do it
        just.
    # dont do it
        Nike.

In the example above, if you choose "do it", it will display "just", and nothing else; similarly, if you choose "dont do it", it will say "Nike.", and nothing else.

zartan9 commented 1 year ago

thanks, so to understand if they chose "just" how to i tweak it to go to 2 more options? what is the rule do i tab 2 more times? im gettin confused on nesting here! :)

haroldo-ok commented 1 year ago

In this case, the tabulation indicates hierarchy; taking the code above as an example:

If you want to add more options, you can just add more menu options prefixed with "#":

* choice
    # Option 1
        You chose option 1
    # Option 2
        You chose option 2
    # Option 3
        You chose option 3
    # Option 4
        You chose option 4

And, in order to have a menu inside another, you can nest a "* choice" command (and, in fact, any command) inside a menu option of another, as long as you indent them correctly to indicate the hierarchy:

* choice
    # I want to buy a mouse
        * choice
            # I want a ball mouse
                So, you want a ball mouse?
            # I want an optical mouse
                So, you want an optical mouse?
    # I want to buy a monitor
        * choice
            # I want a CRT monitor
                So, you want a CRT monitor?
            # I want a LCD monitor
                So, you want a LCD monitor?
zartan9 commented 1 year ago

so if i buy ball mouse, itwill go to buying a monitor or just end?

haroldo-ok commented 1 year ago

At first, it will ask if you want a mouse or a monitor:

zartan9 commented 1 year ago

how could it go from ball mouse to then ask about a monitor?

haroldo-ok commented 1 year ago

By moving one menu inside the other:

* choice
    # I want a ball mouse
        So, you want a ball mouse?
        * choice
            # I want a CRT monitor
                So, you want a CRT monitor?
            # I want a LCD monitor
                So, you want a LCD monitor?
    # I want an optical mouse
        So, you want an optical mouse?
zartan9 commented 1 year ago

and when it jumps to a new scene, is there way it wont go back to original scene.. ok ill look into it.

haroldo-ok commented 1 year ago

If you want to keep jumping back to the same scene, you could use the * goto_scene command. For example, the following code will keep looping again and again into myscene:

myscene.choice:

* choice
    # Yes
        OK, then.
    # No
        Are you sure?

* goto_scene myscene
zartan9 commented 1 year ago

heya I maybe mentioned this idea, but when calling in a picture in the top left (or wherever) maybe have it clickable to go to new scene if this is viable/easy enough to add it would extend gameplay :) Thanks be well.

haroldo-ok commented 1 year ago

That's kinda similar to the pending issue #68

zartan9 commented 1 year ago

o yea! you're right! I hope your engine keeps expanding! Its already very powerful :)