Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Question! Would scripting my button this way break any rules?

A topic by Tofu Sheets Visual created Aug 09, 2020 Views: 280 Replies: 4
Viewing posts 1 to 3
(1 edit)

Hi!

I just stumbled upon this jam, and it looks really fun! I am curious what can be accomplished with this limitation~

I have a question to make sure I don't accidentally break  the "no multiple buttons" rule. Is it OK to have multiple label jumps? I'll be using Ren'Py for my game (although it's meant for visual novels, I know a mock-up way to do a clicker with the use of an imagebutton and hiding the text window).  Sadly a button can only do one action at a time, so I may need to script the same button with different actions (the same button will just jump to another label).

I made a dummy example in one of my test projects to demonstrate what I mean----

The main script variable labels:

label start:
    
    show screen button
    window hide
    $ ist = True
    $ erd = False
    scene black
    sub ""
    jump start
    
label firstpress:
    
    $ ist = False
    $ tnd = True
    scene black
    sub ""
    jump firstpress
    
label secondpress:
    
    $ tnd = False
    $ erd = True
    scene black
    sub ""
    jump secondpress


The actual button script:

if ist:
        imagebutton:
            xpos 500
            ypos 40
            hover "button_h.png"
            idle "button.png"
            action Jump('firstpress')
        
    if tnd:
        imagebutton:
            xpos 500
            ypos 50
            hover "button_h.png"
            idle "button.png"
            action Jump('secondpress')
        
    if erd:
        imagebutton:
            xpos 500
            ypos 60
            hover "button_h.png"
            idle "button.png"
            action Jump('start')

I kept making the button change position so I'd be able to make sure the button was actually working lol. Also under the labels, there's a loop jump and an empty string (where dialogue usually is) so when you press outside the button, nothing happens (since clicking advances dialogue in this engine, so that is how I got around it). 

Anyway, would doing multiple label jumps (and making an imagebutton of the same button but with different actions) be OK, or does it technically break the multi-button rule? This is just so I can get the one button to do more than one action, there will never be multiple buttons on screen. Let me know! If not, I can try another method!

Thank you ^^

(+1)

Just my two cents:

You could make the action for the button be to jump to a label that holds all your if statements.

Also to keep the game from going when you don't have text on screen you can use $ renpy.pause(hard=True)

(1 edit) (+1)

Ah a renpy.pause statement would be better! And I shall try to see if using the if statement within the imagebutton will work, that would make it a lot easier than the tedious method! Thank you so much for the suggestion ^^

Jam HostSubmitted(+2)

Hi!

The "FUN" button can have multiple functions, and these functions can change over time (or "over clicks").

The important thing is that the user must see on the screen only one button at a time. If you need to make multiple buttons to give to the button different functions, I don't see a problem with that, as long as you show only one button at a time.

Let me know if I answered your question.

-Cah

Thank you! Yes, this answers my question ^^