Search found 3655 matches

by trooper6
Mon Mar 09, 2020 9:50 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Efficiently coding a sprite change during dialogues
Replies: 12
Views: 655

Re: Efficiently coding a sprite change during dialogues

I created a little project that works and shows how image tags work. You can run the project and see it in action. Here's the code though: define j = Character("Joseph", image="joseph") define d = Character("Diane", image="diane") # The game starts here. label start: show joseph at left show diane a...
by trooper6
Mon Mar 09, 2020 8:35 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Efficiently coding a sprite change during dialogues
Replies: 12
Views: 655

Re: Efficiently coding a sprite change during dialogues

Also, it isn’t good practice to name two different things the same name.
by trooper6
Mon Mar 09, 2020 4:27 am
Forum: Ren'Py Questions and Announcements
Topic: Time/day system
Replies: 21
Views: 856

Re: Time/day system

I've worked out your day situation, but I want to add two more things before I post. Once I finish those two things (adding in beeps for the seconds in the digital clock, and testing countdown), I'm going to update the instructions and repost in the cookbook!
by trooper6
Thu Mar 05, 2020 2:00 pm
Forum: Ren'Py Questions and Announcements
Topic: Time/day system
Replies: 21
Views: 856

Re: Time/day system

IDwedith, I’m going to look into recoding my clock to include a day marker, but I can’t do it until this weekend. But I’ll look into it!
by trooper6
Mon Mar 02, 2020 8:28 pm
Forum: Ren'Py Questions and Announcements
Topic: Time/day system
Replies: 21
Views: 856

Re: Time/day system

I don't think it would be that hard to change the code to work for your needs.
I have a big deadline this coming Friday. Let me look into the code and see what sort of changes I can make over the weekend.
by trooper6
Mon Mar 02, 2020 5:11 am
Forum: Ren'Py Questions and Announcements
Topic: Time/day system
Replies: 21
Views: 856

Re: Time/day system

Is your game going to be running in real time, or will you be adding time whenever the player does an action?
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: 260

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: 12
Views: 469

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: 406

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: 302

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: 271

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: 271

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: 271

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: 302

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: 472

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...