Search found 286 matches

by RicharDann
Mon Feb 24, 2020 10:45 am
Forum: Ren'Py Questions and Announcements
Topic: Managing save slots
Replies: 1
Views: 411

Re: Managing save slots

For the first problem, when using or checking the value of persistent variables, you need to include persistent before their name: if not persistent.hardcoreMode: # show save pages For the second problem, you could use 'on show' statement to force the game to show a particular page (unsure if this w...
by RicharDann
Mon Feb 24, 2020 9:02 am
Forum: Ren'Py Questions and Announcements
Topic: Specifying variable image file in blur
Replies: 4
Views: 548

Re: Specifying variable image file in blur

Is there any way to incorporate the 'location' variable into the expression you've come up with at all? If I'm understanding this question correctly, you want to specify the location using a variable? You can just use the variable itself as parameter: $ current_location = "bedroom" scene ...
by RicharDann
Fri Feb 21, 2020 9:21 am
Forum: Ren'Py Questions and Announcements
Topic: Specifying variable image file in blur
Replies: 4
Views: 548

Re: Specifying variable image file in blur

im.Blur does require a specific path for the image, so using image statement will not work, however if you use the same convention for all of your backgrounds, you could try something like this: init python: # A function that receives a string and optional xrad and yrad parameters, and returns a blu...
by RicharDann
Tue Feb 18, 2020 12:10 pm
Forum: Ren'Py Questions and Announcements
Topic: Making Python take an argument or string as a variable name
Replies: 12
Views: 1057

Re: Making Python take an argument or string as a variable name

Both of these give an AttributeError: 'unicode' object has no attribute 'objects' This might be because you're passing the c attribute, the name of the variable, as a string. You can just pass the object name directly. # Cell object definition default cell_A = Cell(objects=[], characters=[], exits=...
by RicharDann
Sun Feb 16, 2020 9:18 am
Forum: Ren'Py Questions and Announcements
Topic: Making Python take an argument or string as a variable name
Replies: 12
Views: 1057

Re: Making Python take an argument or string as a variable name

I haven't used dictionaries in a long time but the code seems correct.

How and where are the player_locations variables defined? And how are you checking if they are being updated?
by RicharDann
Sun Feb 16, 2020 8:09 am
Forum: Ren'Py Questions and Announcements
Topic: Making Python take an argument or string as a variable name
Replies: 12
Views: 1057

Re: Making Python take an argument or string as a variable name

You should definitely use classes for this, at least to define your cells, and classes do allow the use of lists or dictionaries as attributes. As for your original question, I still don't quite understand what are you trying to do or why python isn't doing what you want. You should at least show us...
by RicharDann
Fri Feb 14, 2020 2:50 pm
Forum: Creator Discussion
Topic: Gender and personality of the protagonist bias
Replies: 12
Views: 6502

Re: Gender and personality of the protagonist bias

Generally I prefer male characters, mostly because the abundance of them in most VNs and games I've played have made me more familiar with their usual tropes. That doesn't mean I don't sometimes play games centered on female characters, however, though it heavily depends if the story or gameplay cat...
by RicharDann
Fri Feb 14, 2020 9:58 am
Forum: Ren'Py Questions and Announcements
Topic: Saving and Loading Information Stops Working?
Replies: 4
Views: 623

Re: Saving and Loading Information Stops Working?

The way it breaks is really strange. The map_point correctly prints out the current location name to the screen. However when I enter the map screen the map seems to no longer agree on the current location. It blacks out all the other areas and doesn't mark the current location. This cause you to b...
by RicharDann
Thu Feb 13, 2020 4:46 pm
Forum: Ren'Py Questions and Announcements
Topic: Saving and Loading Information Stops Working?
Replies: 4
Views: 623

Re: Saving and Loading Information Stops Working?

Most of the time (in my experience), save and loading problems have to do with the way you define your variables. It's very hard to know for sure just by looking at the code you posted. How did you define your map_point variable? For a system like this it probably should be initialized with default ...
by RicharDann
Tue Feb 11, 2020 3:23 pm
Forum: Ren'Py Questions and Announcements
Topic: ATLTransform on imagebutton hover not working
Replies: 4
Views: 573

Re: ATLTransform on imagebutton hover not working

This is only a guess but I think that the cropping process is somehow interfering with the method Ren'Py uses to detect if the button is being hovered. Maybe because it changes the visibility or position of the image at the same time as the program is trying to see if the mouse is over it or not. I ...
by RicharDann
Tue Feb 11, 2020 10:33 am
Forum: Ren'Py Questions and Announcements
Topic: ATLTransform on imagebutton hover not working
Replies: 4
Views: 573

Re: ATLTransform on imagebutton hover not working

According to the documentation here: https://renpy.org/dev-doc/html/screens.html#button says that the hovered property expects an action, or a list of actions, not an ATL transform, that could be the cause of the error. You could try adding a hover clause to your transform: transform choicehover(): ...
by RicharDann
Mon Feb 10, 2020 4:31 pm
Forum: Ren'Py Questions and Announcements
Topic: [help] inventory with images
Replies: 4
Views: 539

Re: [help] inventory with images

Add an image attribute to your Item class, then when you create your items, fill it with the corresponding image: class Item(object): def __init__(self, name, image, **kwargs): self.name = name self.image = image default rose = Item("Rose", "rose.png") Then you can show it in you...
by RicharDann
Sun Feb 02, 2020 11:41 am
Forum: Ren'Py Questions and Announcements
Topic: Beginner can't figure out Inventory system error
Replies: 2
Views: 460

Re: Beginner can't figure out Inventory system error

In this line:

Code: Select all

$ inventory_list.append("burger")
You're appending the string "burger" to the inventory, which is the unicode object the error is talking about.
You need to append the burger object itself:

Code: Select all

$ inventory_list.append(burger)
by RicharDann
Wed Jan 22, 2020 11:37 am
Forum: Ren'Py Questions and Announcements
Topic: Re: Local variable referenced before assignment [SOLVED]
Replies: 4
Views: 508

Re: Local variable referenced before assignment

If you want different functions to affect the same variables, you'll want to make them global instead of local, by creating them with default statement. # initialize/create the variables default mix1 = None default mix2 = None default selected_item = None init python: def MixItems(): global mix1, mi...
by RicharDann
Thu Jan 16, 2020 12:09 pm
Forum: Ren'Py Questions and Announcements
Topic: For loops, list, and screens
Replies: 4
Views: 794

Re: For loops, list, and screens

In your code, you're passing your list name as a string object, hence the error. Instead, you need to pass the list or set name directly:

Code: Select all

textbutton "Apple" action AddToSet(my_list, "Apple")