Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Fri May 24, 2013 6:00 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jan 30, 2011 8:35 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
Dumb question time.

The switch to SL seems like it would be perfect for adding whatever we want to game menus, since having a custom preference option wasn't possible with imagemap layouts before.

Thing is, I'm stupid, and I can't figure out how to add a custom preference option to the preferences screen that isn't hard coded in.

What actions should I implement for this to happen, so I could have an option to turn off mini-games, for example?
Is it possible? Because I'm looking at the guts of Ren'Py, and the "preferences constructor" looks pretty hard coded to not accept anything but what's there ...

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Last edited by Aleema on Sun Jan 30, 2011 10:10 am, edited 1 time in total.

Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 9:21 am 
Lemma-Class Veteran
User avatar

Joined: Mon Jul 21, 2008 5:41 pm
Posts: 3401
Projects: Planet Stronghold: Warzone, Loren The Amazon Princess, Queen Of Thieves, DIM, Undead Lily, and more...
I did that on PS to change layout and add the "difficulty" setting in the options, but it's no use posting the code here since is a total hack. I'd like to see (whenever pytom has time of course) some tutorials about doing this the "official way". Another option I wanted to use is "delete savegame" option in the load/save, but since I had fear of deleting users wrong files I gave up on this one :D

_________________
follow me on Image Image Image Image
computer games


Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 9:32 am 
Veteran
User avatar

Joined: Sun May 31, 2009 7:15 am
Posts: 216
Location: Korea, Republic of
Aleema // Well, there's ToggleVariable or SetVariable action and I think you can simply add it to your preference screen.
Code:

init:
    screen preference:
        #....
        has vbox
        text 'Do you want to do Mini-Games?'
        hbox:
            textbutton 'Yes' action SetVariable('minigame', True)
            textbutton 'No' action SetVariable('minigame', False)

#...
     
label minigame:
    if not minigame:
        return
    else:
    # ....

Anyway I didn't test it so I'm not sure it would work with your minigame code. :|

_________________
렌파이 위키 Ren'Py Wiki Reference Manual(kr)
렌파이 매뉴얼 Ren'Py Documentation(kr)


Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 9:41 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
Oh, the variable has to be in quotes? I saw that action and tried it, got some string error, so I guess that was the original problem. Thanks, it worked. :)

Next problem: preferences should be persistent so you don't have to set them every time. I replaced a generic variable with this:
Code:
textbutton _("Yes") action SetVariable('persistent.stopjukebox', True)

Got:
Code:
AttributeError: 'module' object has no attribute 'persistent.stopjukebox'

Tell me I'm just being stupid again. >_<

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 9:51 am 
Lemma-Class Veteran
User avatar

Joined: Mon Jul 21, 2008 5:41 pm
Posts: 3401
Projects: Planet Stronghold: Warzone, Loren The Amazon Princess, Queen Of Thieves, DIM, Undead Lily, and more...
That's the problem I had, I used a Class to set my variable (wasn't a persistent one though)

_________________
follow me on Image Image Image Image
computer games


Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 10:05 am 
Veteran
User avatar

Joined: Sun May 31, 2009 7:15 am
Posts: 216
Location: Korea, Republic of
Ah... Try using SetFeild.

Code:
init:
    $ persistent.stopjukebox = '1'
    screen test:
        hbox:
            textbutton "Yes" action SetField(persistent, 'stopjukebox', True)
            textbutton "No" action SetField(persistent, 'stopjukebox', False)
            textbutton "return" action Return()

label start:
    call screen test
    if persistent.stopjukebox:
        #...
    else:
        # ....

_________________
렌파이 위키 Ren'Py Wiki Reference Manual(kr)
렌파이 매뉴얼 Ren'Py Documentation(kr)


Top
 Profile Send private message  
 
PostPosted: Sun Jan 30, 2011 10:09 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
:D It worked!!
Thank you very much! You sure know your way around SL. :)

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Anibal


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group