Ren'Py Loop Infinity, Bar value, Sound ???

no im not

Newbie
Game Developer
Oct 5, 2018
31
64
Hi, i trying to create simulator game and i have three question:
1/How can i make scene loop infinity without windows text ?
this is my prolem
screenshot0002.png
when i click, game show dialogue
screenshot0003.png
2/How can i set bar value in script, i want bar interact with players choice ?
3/Where you get sound effect like sucking moaning sound ?

Thanks for reading and sorry for my bad english
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,037
7,374
1. and 2. are contained on along with many other features, you may want to look its code.
In short, for option number 1, just think of it like you are making a Gallery or a main menu, just a scene, see how it is done either from the link above^ or renpy itself.
For option number 2, "$variable_name += 1" to trigger on choice.

3. Ask someone to record those sounds for you or google "moan sound sfx royalty free" (terms like that, in short) but remember to erase your history after that.
 

no im not

Newbie
Game Developer
Oct 5, 2018
31
64
1. and 2. are contained on along with many other features, you may want to look its code.
In short, for option number 1, just think of it like you are making a Gallery or a main menu, just a scene, see how it is done either from the link above^ or renpy itself.
For option number 2, "$variable_name += 1" to trigger on choice.

3. Ask someone to record those sounds for you or google "moan sound sfx royalty free" (terms like that, in short) but remember to erase your history after that.
Thanks you so much :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,167
1/How can i make scene loop infinity without windows text ?
Firstly you create your animation.
For this, you need to , but instead of just giving it the name of a picture, you'll defined it (Animation and Transform Language). So, something like this :
Code:
image myAnimation:
    "myAnim/first frame.jpg"
    pause 0.5
    "myAnim/second frame.jpg
    pause 0.5
    repeat
The name of the created image object is "myAnimation", and it contain two pictures, "myAnim/first frame.jpg" and "myAnim/second frame.jpg". Ren'py will wait 0.5 seconds after it have displayed each picture, and it will repeat this indefinitely.
Note that you don't need to give the full path. Like Ren'py expect a picture here, it will automatically add "game/images/" on top of the relative path you gave.
Here, the animation is basic, but the ATL permit to do way more .

Once you've defined the animation, you just need to display it, and ask Ren'py to wait for the player to do something, indefinitely if needed. For this, just use the pause statement.
Code:
label blablabla:
    "I'll play you a little animation"
    show myAnimation
    pause
    hide myAnimation
    "Now return to the game"

2/How can i set bar value in script, i want bar interact with players choice ?
Your question lack of precision. Is the player directly interacting with the bar ? Is the bar some kind of visual representation of a counter ? Is it something other ? The answer is to use the statement of the screen language, but difficult to give a practical example without knowing what you effectively want. So, here a decreasing counter.
As it, it will prevent any action of the player during a given amount of time. Coupled to your animation it will force the player to see it whole at least once, then let him decide how many time he want to wait after this :
Code:
image myAnimation:
    "myAnim/frame01.jpg"
    pause 0.5
    "myAnim/frame02.jpg"
    pause 0.5
    "myAnim/frame03.jpg"
    pause 0.5
    "myAnim/frame04.jpg"
    pause 0.5
    "myAnim/frame05.jpg"
    pause 0.5
    "myAnim/frame06.jpg"
    pause 0.5
    repeat

label blablabla:
    "I'll play you a little animation"
    show myAnimation
    # 6 frames with 0.5 pause between each, so a 3 seconds animation
    call screen myScreen( 3.0 )
    pause
    hide myAnimation
    "Now return to the game"

screen myScreen( delay=1.0 ):

    zorder 2000

    default remainingTime = delay
    default step = 0.01

    timer step repeat True action If( remainingTime <= 0, Return(), SetScreenVariable( "remainingTime", remainingTime - step ) )

    # Here is the bar.
    bar:
        # The actual value of the bar
        value remainingTime
        # The value representing 100% of the bar.
        range delay
        xpos 50
        ypos config.screen_height - 5
        xsize config.screen_width - 100
        ysize 5
 
  • Like
Reactions: no im not

no im not

Newbie
Game Developer
Oct 5, 2018
31
64
You don't have permission to view the spoiler content. Log in or register now.
I'm so grateful, btw i have another question can you show me how to create simple calendar system i was try but it's doesn't work
You don't have permission to view the spoiler content. Log in or register now.
And how can i code countdown time for minigame ?
Thanks you
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
I'm so grateful, btw i have another question can you show me how to create simple calendar system i was try but it's doesn't work
You don't have permission to view the spoiler content. Log in or register now.
And how can i code countdown time for minigame ?
Thanks you
Check this...

Day/Night system:



Timer:
 

no im not

Newbie
Game Developer
Oct 5, 2018
31
64
Check this...

Day/Night system:



Timer:
OMG i can create caledar now, thanks you, but i still can't understand how Timer work ?
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,037
7,374
I assume you are talking about the self variable on:
Code:
        def __init__( self, interval, fnct ):
            self._interval = interval
            self._fnct = fnct
            self.__ticks = int( interval * 20 )
Self, as the name implies, refers to the object itself.
This may mean nothing to you or make you more confused, so I digged up a tutorial which explains it nicely here:


It is an old tutorial but it has more to do with python than Ren'Py.
 
  • Like
Reactions: no im not

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,167
[...] but i still can't understand how Timer work ?
Don't remember exactly what I wrote on the how-to, but there's more than one way to use them. I should probably go back on it and make something more generic, that goes more in depth over the different possibilities.
 
  • Like
Reactions: no im not

no im not

Newbie
Game Developer
Oct 5, 2018
31
64
I assume you are talking about the self variable on:
Code:
        def __init__( self, interval, fnct ):
            self._interval = interval
            self._fnct = fnct
            self.__ticks = int( interval * 20 )
Self, as the name implies, refers to the object itself.
This may mean nothing to you or make you more confused, so I digged up a tutorial which explains it nicely here:
Its very usefull Thank for your conscientious and your knowledge .