Search found 12 matches

by Pent
Sat Nov 17, 2018 1:37 pm
Forum: Ren'Py Questions and Announcements
Topic: If statements in screens error
Replies: 4
Views: 416

Re: If statements in screens error

--- It didn't raise an error but no matter on which spot you click first, it goes to chapter 1. Did you set hit1 and hit2 to False to start with? If they already are True you would get the result that you have. I did a quick test and the code worked fine for me. Thanks a bunch, that was my mistake....
by Pent
Thu Nov 15, 2018 1:50 pm
Forum: Ren'Py Questions and Announcements
Topic: If statements in screens error
Replies: 4
Views: 416

Re: If statements in screens error

I wanted to create something; If the player clicks on all (in this case, 2) defined hotspots, the game advances to the next part: screen bat: imagemap: ground "black.png" hover "hover.png" hotspot (50, 50, 80, 75) clicked SetVariable("hit1",True) hotspot (500, 500, 80,...
by Pent
Tue Nov 13, 2018 2:16 pm
Forum: Ren'Py Questions and Announcements
Topic: If statements in screens error
Replies: 4
Views: 416

If statements in screens error

I wanted to create something; If the player clicks on all (in this case, 2) defined hotspots, the game advances to the next part: screen bat: imagemap: ground "black.png" hover "hover.png" hotspot (50, 50, 80, 75) clicked SetVariable("hit1",True) hotspot (500, 500, 80, ...
by Pent
Mon Jun 18, 2018 9:23 am
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

Ok so I just experimented with this, and this seems to work: screen test_menu: default song = "title_screen2" if persistent.var else "title_screen" on "show" action Play("music", "%s.ogg" % song, loop=True) on "hide" action Stop("musi...
by Pent
Sun Jun 17, 2018 3:39 pm
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

I've not played with music files, but I think you just add it: https://www.renpy.org/doc/html/screens.html#add The doc says you add displayable that way, but I've seen people mention adding movies or sound that way - so it should work! No, it does not work. I wonder how the people who mentioned tha...
by Pent
Sun Jun 17, 2018 9:00 am
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

If you read what gas said - he said NOT to do it via the config variables, but to directly change the music on your main menu screen - i.e. add the music to that screen directly with your condition statement. But how do I do that? I tried out many functions, but I always get the same error: "(...
by Pent
Sun Jun 17, 2018 6:23 am
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

What exactly do you mean with "in the Main Menu Screen"? In your screens.rpy file you can see all the screens in the game, look for: screen main_menu(): When I put the code there where you said: if not persistent.var: define config.main_menu_music = "title_screen.ogg" else: defi...
by Pent
Sat Jun 16, 2018 4:01 pm
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

Obviously, as you set that persistent twice, and each time renpy load the options restore to True. Persistent have a special property, is set to None if not defined. So change your game this way # at the end of the game $ persistent.var = True # in the MAIN MENU SCREEN, not in configs if persistent...
by Pent
Sat Jun 16, 2018 7:14 am
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Re: Using a variable in a different script file

First part to the answer is that, Renpy doesn't care about whether a variable is in script.rpy or options.rpy - you can even redeclare variables in multiple script files - wherever it's declared last - by init order, will be what determines the state of the variable once the game starts. The higher...
by Pent
Sun May 20, 2018 2:25 pm
Forum: Ren'Py Questions and Announcements
Topic: Using a variable in a different script file
Replies: 12
Views: 2876

Using a variable in a different script file

Is it possible to use a variable declared in script.rpy in options.rpy? I'd like the title screen music to change when the player beats the game once. For that, I need to declare a variable in script.rpy which is true if the player reaches the ending, and then use that variable in a if-statement in ...
by Pent
Sat Apr 07, 2018 10:15 am
Forum: Ren'Py Questions and Announcements
Topic: How to make a part unskippable?
Replies: 2
Views: 2051

Re: How to make a part unskippable?

What your looking for is the hard argument of renpy.pause renpy.pause(delay=None, music=None, with_none=None, hard=False, checkpoint=None) Causes Ren'Py to pause. Returns true if the user clicked to end the pause, or false if the pause timed out or was skipped. delay If given, the number of seconds...
by Pent
Wed Apr 04, 2018 2:48 pm
Forum: Ren'Py Questions and Announcements
Topic: How to make a part unskippable?
Replies: 2
Views: 2051

How to make a part unskippable?

play music "pursuit.ogg" show text "What?" with Pause(2) show text "Step aside." with Pause(3.20) play sound "ob.mp3" I want the sound "ob.mp3" to play after the two text lines were shown for 5.20 seconds (5.20 seconds into the song "pursuit.og...