Search found 62 matches

by theCodeCat
Tue Dec 07, 2021 5:13 pm
Forum: Ren'Py Questions and Announcements
Topic: Proper method of editing save-game data
Replies: 2
Views: 422

Re: Proper method of editing save-game data

Did you consider simply blocking rollback past current point in case player loads save file with version mismatch? I did. It's an option but it feels like a work-around when I want to know how to do it "properly". That said, maybe that's the better approach anyway. Rollback history might ...
by theCodeCat
Tue Dec 07, 2021 3:48 pm
Forum: Ren'Py Questions and Announcements
Topic: Proper method of editing save-game data
Replies: 2
Views: 422

Proper method of editing save-game data

Hi, For a project I'm working with I want to make sure that save files from old versions can be loaded by new versions. Since the format in which data is stored may change, I'd like to setup a function that can modify save data after it has been loaded. To give a basic example, let's say in version ...
by theCodeCat
Fri Feb 24, 2017 5:13 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Basic Python
Replies: 5
Views: 949

Re: Basic Python

You need to put your python function definitions into a "init python:" block. You are mostly correct about the global variables thing, but you only need to add the "global ..." line if you are modifying the value of the variable. If you are just reading from it, the "global ...
by theCodeCat
Thu Aug 04, 2016 10:03 pm
Forum: Ren'Py Questions and Announcements
Topic: Need Fresh eyes on Choice code
Replies: 5
Views: 522

Re: Need Fresh eyes on Choice code

This is just a guess but I think this line might be causing problems:

Code: Select all

action action
Try renaming the action variable to something like "choiceAction".
by theCodeCat
Thu Jul 28, 2016 6:32 pm
Forum: We are offering Paid Work
Topic: Looking for a good/new programmer (paid)
Replies: 6
Views: 1922

Re: Looking for a good/new programmer (paid)

SM_Team wrote:
Cypher wrote:What language.
PM sent.
Why would you want to keep the language being used a secret?
Potential applicants can't know if they are qualified if they don't know which language is required of them.
by theCodeCat
Mon Jul 25, 2016 4:36 pm
Forum: Ren'Py Questions and Announcements
Topic: Limiting amount of choices from menu that can be selected
Replies: 2
Views: 377

Re: Limiting amount of choices from menu that can be selecte

You could do something like: label start: "content leading into choice" python: # 0 = Not toured, 1 = Toured touredSpotA = 0 touredSpotB = 0 touredSpotC = 0 touredSpotD = 0 label tourChoice: # Count how many locations have been visited and check if that number is above some threshold if to...
by theCodeCat
Mon Jul 25, 2016 10:37 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Return to main menu after jumping to another label
Replies: 6
Views: 700

Re: Return to main menu after jumping to another label

Use 'call labelName' instead of 'jump labelName' if you want to return to that line at some point.
by theCodeCat
Sat Jul 23, 2016 7:56 am
Forum: Ren'Py Questions and Announcements
Topic: the sprite expression wont change??
Replies: 2
Views: 371

Re: the sprite expression wont change??

The problem is that showing "rblush" doesn't hide "rhappy" or vice versa. "show rblush" probably just covered your rhappy image so it looked correct, and "show rhappy" doesn't do anything since "rhappy" is already on screen. One way to fix this would...
by theCodeCat
Thu Jul 21, 2016 7:29 pm
Forum: Ren'Py Questions and Announcements
Topic: Attribute error i'm having trouble solving
Replies: 1
Views: 445

Re: Attribute error i'm having trouble solving

I'm pretty sure that this line is the problem: SetVariable(currentoverlay[x][y].unit_present, deployment_list[0].name) I assume you want this action, when executed, to do the same as the python statement: currentoverlay[x][y].unit_present = deployment_list[0].name The problem is that "SetVariab...
by theCodeCat
Tue Jul 12, 2016 5:49 pm
Forum: Ren'Py Questions and Announcements
Topic: Remembering random coin drops
Replies: 5
Views: 880

Re: Remembering random coin drops

"renpy.random.randint(15, 40)" is the part that generates the random number, "randcoin" is just the variable used to hold the value. Whenever you need a new random value you'll need to call "renpy.random.randint(15, 40)" again. Ex: label start: $ money = 0 $ randcoin = ...
by theCodeCat
Mon Jul 11, 2016 12:30 am
Forum: Ren'Py Questions and Announcements
Topic: why my game detected as virus ?
Replies: 5
Views: 2820

Re: why my game detected as virus ?

False positive. I've had the same issue with another Renpy game I worked on.

Antivirus programs can only really guess whether a program is harmful and sometimes they guess incorrectly.
by theCodeCat
Mon Jul 11, 2016 12:27 am
Forum: Ren'Py Questions and Announcements
Topic: Problem with cache and sound
Replies: 4
Views: 628

Re: Problem with cache and sound

I think it might work if you move the "renpy.sound.play("sound/effects/shock2.ogg")" line into the __init__ function of the 'Shaker' class. So something like: def __init__(self, start, child, dist): renpy.sound.play("sound/effects/shock2.ogg") <rest of code>
by theCodeCat
Sun Jul 10, 2016 6:02 pm
Forum: Ren'Py Questions and Announcements
Topic: Problem with cache and sound
Replies: 4
Views: 628

Re: Problem with cache and sound

Can you show the code for how you added the sound effect to 'Shake'?

You might have added it in such a way that the sound is triggered when the object is created, and not necessarily when the visual effect is executed.
by theCodeCat
Sat Jul 09, 2016 1:07 am
Forum: Ren'Py Questions and Announcements
Topic: creating a next page function
Replies: 6
Views: 2652

Re: creating a next page function

I actually don't have much experience working with set objects in python, but it looks like the set class doesn't have an "items" property, so chest.items is meaningless. At any rate, the screen code I gave assumes its been given a list and I would recommend using a list structure anyways ...
by theCodeCat
Fri Jul 08, 2016 6:33 pm
Forum: Ren'Py Questions and Announcements
Topic: creating a next page function
Replies: 6
Views: 2652

Re: creating a next page function

I would suggest something like this: screen shop(itemList,page=0): python: # Ideally the total number of pages should be calculated based off of # the number if items in the itemList, but to keep this simple I've hardcoded # the page count totalPages = 4 # Grabs which items should be displayed on th...