Turning on/off vibration in options SOLVED

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
tim640
Regular
Posts: 49
Joined: Wed May 23, 2018 4:47 pm
Contact:

Turning on/off vibration in options SOLVED

#1 Post by tim640 »

So i want to use vibration for some scenes, and i tried to follow instructions here: viewtopic.php?t=15433
But whenever i toggle the OFF button, it still vibrates; is there a way to fix that? ;_; Tried it like this:

Code: Select all

init python:
    if persistent.vibrate is None:
        persistent.vibrate = True

    def vibrate(duration):
        if persistent.vibrate is True:
            renpy.vibrate(duration)
        if persistent.vibrate is False:
           None
            
            
            
            
            ...
            
            
            
            
            
            textbutton _("On") action SetField(persistent, 'vibrate', True)
            textbutton _("Off") action SetField(persistent, 'vibrate', False)
                           
But it doesn't work :( :(
Last edited by tim640 on Sat Jan 05, 2019 11:38 am, edited 2 times in total.

User avatar
tim640
Regular
Posts: 49
Joined: Wed May 23, 2018 4:47 pm
Contact:

Re: Turning on/off vibration in options

#2 Post by tim640 »

Solveeeeeed

For the ones who might be wondering: basically that piece of code is a custom function; so it needs to be called differently, that's all ^^;

Instead of

$ renpy.vibrate(0.5)


Needed to use

$ vibrate(0.5)

Sorry! :'3

Post Reply

Who is online

Users browsing this forum: Bing [Bot]