Search found 3589 matches

by trooper6
Tue Feb 18, 2020 1:20 am
Forum: Ren'Py Questions and Announcements
Topic: Showing elapsed time for phone call
Replies: 2
Views: 65

Re: Showing elapsed time for phone call

In my signature is a link to my cookbook on a clock. The clock is probably way more than you'd need, but studying the code might give you some ideas.
by trooper6
Sat Feb 15, 2020 7:39 pm
Forum: Ren'Py Questions and Announcements
Topic: Making Python take an argument or string as a variable name
Replies: 11
Views: 168

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

I don't have a completely clear view of what exactly you are doing, but maybe put all of the dictionaries into a class and then have the class do the accessing and modifying? Also, how many turns is this game going to be? Do you have a dictionary for each minute...will there be hundreds and hundreds...
by trooper6
Sat Feb 15, 2020 6:55 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Proper way of using classes
Replies: 7
Views: 155

Re: Proper way of using classes

Also, your classes need to inherit from Object if you want them to work properly with save, load, rollback, etc. init python: class TimeClock(object): def __init__(self, time, day): self.time = time self.day = day def incTime(self): if self.time == 3: self.time = 0 self.day += 1 else: self.time += 1...
by trooper6
Thu Feb 13, 2020 1:56 am
Forum: Ren'Py Questions and Announcements
Topic: Stats in their own file.
Replies: 4
Views: 153

Re: Stats in their own file.

And that should be outside of any block of code.
by trooper6
Wed Feb 12, 2020 3:14 am
Forum: Ren'Py Questions and Announcements
Topic: Accessing 2 Object Variables in a Single Interpolation
Replies: 5
Views: 108

Re: Accessing 2 Object Variables in a Single Interpolation

No worries. Using properties enables you to avoid a bunch of shenanigans.
by trooper6
Wed Feb 12, 2020 3:05 am
Forum: Ren'Py Questions and Announcements
Topic: Accessing 2 Object Variables in a Single Interpolation
Replies: 5
Views: 108

Re: Accessing 2 Object Variables in a Single Interpolation

You could use properties. So this is a little script I made, check it out: init python: class Game(object): def __init__(self): self._day_times = ["Morning", "Noon", "Afternoon", "Evening", "Night"] self._current_time = 0 @property def current_time(self): #getter return self._day_times[self._current...
by trooper6
Wed Feb 12, 2020 2:15 am
Forum: Ren'Py Questions and Announcements
Topic: Accessing 2 Object Variables in a Single Interpolation
Replies: 5
Views: 108

Re: Accessing 2 Object Variables in a Single Interpolation

It seems like these variables are part of a class, is that true? How is the class defined?
by trooper6
Wed Feb 12, 2020 2:11 am
Forum: Ren'Py Questions and Announcements
Topic: Stats in their own file.
Replies: 4
Views: 153

Re: Stats in their own file.

Please remember, you initialize variables that you plan on changing like so:

default bob_money = 0

not

$ bob_money = 0
by trooper6
Sun Feb 09, 2020 3:10 pm
Forum: Ren'Py Questions and Announcements
Topic: Double quotation marks or single?
Replies: 5
Views: 332

Re: Double quotation marks or single?

It shouldn't make a difference between double and single quotes. Though it is important that there are those fancy curved quotes that editors sometimes switch you to that won't work. All of that said, I'd recommend dumping Editra for Atom. I used to be an Editra user, but is hasn't been updated by t...
by trooper6
Tue Feb 04, 2020 1:01 am
Forum: Ren'Py Questions and Announcements
Topic: Indentation Mismatch Error
Replies: 2
Views: 100

Re: Indentation Mismatch Error

Your indentation is all sorts of off. Note also that indentation should be 4 spaces. menu: a "What are your pronouns?" "He/Him": $ dpronouns("he") jump pronouns_done "She/Her": $ dpronouns("she") jump pronouns_done "They/Them": $ dpronouns("they") jump pronouns_done label pronouns_done: $ selpron = ...
by trooper6
Fri Jan 31, 2020 1:24 am
Forum: Ren'Py Cookbook
Topic: Tutorial & Code: Analog/Digital Clock as User Defined Displa
Replies: 21
Views: 13778

Re: Tutorial & Code: Analog/Digital Clock as User Defined Displa

Okay, I jumped back into the code. The clock class is built to stretch the width of the image so that it will adjust to fit the size of the font. It will make the image wider if you are also showing seconds, a narrower if you aren't. It is meant to make it so you don't have to do as much work. Howev...
by trooper6
Fri Jan 31, 2020 12:32 am
Forum: Creator Discussion
Topic: In search for useful renpy tutorials
Replies: 1
Views: 268

Re: In search for useful renpy tutorials

I can tell you how I learned Ren'Py. 1) I went to the documentation: https://www.renpy.org/doc/html/ and then I just started working through it, making sample projects where I would work through each section. I haven't done all the sections, but that was one of the things I did. 2) I looked through ...
by trooper6
Fri Jan 24, 2020 6:59 pm
Forum: Ren'Py Cookbook
Topic: Tutorial & Code: Analog/Digital Clock as User Defined Displa
Replies: 21
Views: 13778

Re: Tutorial & Code: Analog/Digital Clock as User Defined Displa

Could you make a project with just the code and images for your clock the size you want it and attach it here? There is some trickiness with the font and I want to be able to see what’s going on. Because If I can fix it, I will!
by trooper6
Thu Jan 23, 2020 3:28 am
Forum: Ren'Py Questions and Announcements
Topic: Re: Local variable referenced before assignment [SOLVED]
Replies: 4
Views: 258

Re: Local variable referenced before assignment

You do make variables global by using the default statement, the problem comes with the functions. Functions will create brand new local variables by default. If you want the function to use one of your global variables you've already defined rather than create a local one, you have to tell it by sa...
by trooper6
Sat Jan 18, 2020 5:59 pm
Forum: Ren'Py Questions and Announcements
Topic: Problem with variable toggling
Replies: 3
Views: 235

Re: Problem with variable toggling

Just remember:
default is used for variables that can change
define is used for variables that won't change