Search found 1143 matches

by Remix
Tue Apr 23, 2019 12:34 pm
Forum: Ren'Py Questions and Announcements
Topic: 'RevertableList' object is not callable
Replies: 1
Views: 5

Re: 'RevertableList' object is not callable

list is a reserved word in Python

suggest just change it to:

my_list = [ MyClass() ]

or somesuch
by Remix
Thu Apr 18, 2019 8:16 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Avoiding using a {color} tag each time a word is mentioned?
Replies: 3
Views: 77

Re: Avoiding using a {color} tag each time a word is mentioned?

If you define your characters in the character namespace ( define character.e = Character(...) rather than just define e = Character(...) ) you can add a bit of automation using iteration and say_menu_text_filter: default pc = "Bob" define character.b = Character("[pc]", who_color="00F") define char...
by Remix
Wed Apr 17, 2019 5:02 am
Forum: Ren'Py Questions and Announcements
Topic: Preventing the Same Selection Across Multiple Choices
Replies: 3
Views: 112

Re: Preventing the Same Selection Across Multiple Choices

Code: Select all

                    for r in unlockedRecipes:
                        textbutton r:
                            sensitive ( r not in foodMenu.values() )
                            action SetDict(foodMenu, d, r)
Maybe
by Remix
Tue Apr 16, 2019 5:34 am
Forum: Ren'Py Questions and Announcements
Topic: Pausing between sentences?
Replies: 3
Views: 80

Re: Pausing between sentences?

define config.say_menu_text_filter = lambda t: reduce( lambda t, p: t.replace(p[0], p[1]), [ (n,"{}{{w={}}}".format(n,m)) for m,v in { 0.25: [', ', '; '], # quarter second pause for these 0.5: ['. ', '? ', '! ', ': '] # half second for these }.items() for n in v ], t )
by Remix
Mon Apr 15, 2019 1:23 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Translating text in screens
Replies: 2
Views: 97

Re: Translating text in screens

text _("English")

The _() function basically tells Ren'Py to register the string as translatable, so it will add it to the relevant translation file when asked.
by Remix
Mon Apr 15, 2019 4:43 am
Forum: Ren'Py Questions and Announcements
Topic: Preventing the Same Selection Across Multiple Choices
Replies: 3
Views: 112

Re: Preventing the Same Selection Across Multiple Choices

for r in [ k for k in unlockedRecipes if k not in foodMenu.values() ]:

Might do it.

You might consider though looking into drag and drop as an alternative way to do the same.
by Remix
Fri Apr 12, 2019 7:04 pm
Forum: Ren'Py Questions and Announcements
Topic: "Takes exactly one argument" (2 given) Help!
Replies: 1
Views: 75

Re: "Takes exactly one argument" (2 given) Help!

The traceback explicitly says that you are using " inventory.remove(self, target) "
whereas you redacted shown code says otherwise.

The simplest way to track down what is wrong would be to just search your code-base for "inventory.remove(self, target)"
by Remix
Thu Apr 11, 2019 4:32 pm
Forum: Ren'Py Questions and Announcements
Topic: class variable as part of variable outside class - is that possible?
Replies: 2
Views: 60

Re: class variable as part of variable outside class - is that possible?

Your terminology is a bit wrong, nothing serious though... In Python a class attribute (as opposed to an instance attribute) is basically a variable set outside the init method and group available to all instances. In most cases it is not something you would need. Anyway, regarding your code, I woul...
by Remix
Fri Mar 29, 2019 5:54 pm
Forum: Ren'Py Questions and Announcements
Topic: Dialogue Tooltips/Hoverable words?
Replies: 6
Views: 149

Re: Dialogue Tooltips/Hoverable words?

A version that does not need inline {a} tags as it pre-parses all the dialogue strings and adds them where needed... Not sure if it would handle {a=call:...} tags in the lexicon descriptions though. Maybe worth just trying. init python: lexicon = { # ( primary phrase, optional synonyms) : descriptio...
by Remix
Fri Mar 22, 2019 6:28 pm
Forum: Ren'Py Questions and Announcements
Topic: Error text, end of line expected etc... What is wrong?
Replies: 7
Views: 6185

Re: Error text, end of line expected etc... What is wrong?

label start: scene chara_bg # Your background. show screen charaselect() # Shows the chara selection that was made in the "screens.rpy" file. # actually no need to add the () here unless passing arguments label sample1: # This is where chara1 will start. # un-indented back to the fold hide screen c...
by Remix
Fri Mar 22, 2019 3:15 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Problem calling list items in dialogue.
Replies: 2
Views: 76

Re: Problem calling list items in dialogue.

Add [0] to the sample() calls...

$ animal_select = renpy.random.sample(animal, 1)[0] ## <--- the first item of the returned random choice

For clarity, the sample function always returns a set or list of items, so we specify that we just want the first one as our value
by Remix
Fri Mar 22, 2019 5:17 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] ValueError: list.remove(x): x not in list
Replies: 4
Views: 138

Re: ValueError: list.remove(x): x not in list (Android)

If it's trying to remove something and the something isn't there, it doesn't need to actually run, so you could just wrap it in a conditional: if result in hintlist: hintlist.remove( result ) So saying, that does not resolve the logic issue of trying to remove something that isn't there, even if it ...
by Remix
Wed Mar 20, 2019 5:09 pm
Forum: Ren'Py Questions and Announcements
Topic: Translation is not displayed in the project
Replies: 1
Views: 75

Re: Translation is not displayed in the project

That old version wasn't really written for translation. Try these tweaks (though I have Not tested the translation part much): init python: lexicon = { # .... } def hyperlink_lexicon( str_to_test ): for keys in lexicon: if isinstance(keys, basestring): keys = [keys] for phrase in keys: translated_ph...
by Remix
Tue Mar 19, 2019 6:58 am
Forum: Ren'Py Questions and Announcements
Topic: How would I make a time delay?
Replies: 2
Views: 105

Re: How would I make a time delay?

Or use {w=5.0} tag to make it wait 5 seconds then {nw} tag to make the dialogue not need interaction:

Code: Select all

label start:

    e "Hi{w=2.0}{nw}"
    e "There{w=2.0}{nw}"
    e "Stranger"
by Remix
Sun Mar 17, 2019 8:22 am
Forum: Ren'Py Questions and Announcements
Topic: Display drag above of other draggroup elements during dragging
Replies: 1
Views: 57

Re: Display drag above of other draggroup elements during dragging

I think you will have to go with the single draggroup and conditional drop check option with drag_raise set to True for each draggable item.