Search found 33 matches

by DoubleProlix
Wed May 09, 2018 4:51 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Adding text input to character creation screen
Replies: 11
Views: 1483

Re: Adding text input to character creation screen

Okay, I like this so far:

Image

But while I can enter text in the top "First Name" field, I can't seem to switch over to the second input. Clicking on the box does nothing, tab won't do it, etc.
by DoubleProlix
Wed May 09, 2018 3:12 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Adding text input to character creation screen
Replies: 11
Views: 1483

[SOLVED] Adding text input to character creation screen

So far my intro asks the player for their first and last name, and then calls the character creation screen where they select other options. What I'd like to do is simplify things so that the character creation screen is a one-stop shop for all this info. Current code: vbox: #label "Character Select...
by DoubleProlix
Mon Nov 27, 2017 6:21 pm
Forum: Ren'Py Questions and Announcements
Topic: Variable Scope
Replies: 2
Views: 310

Re: Variable Scope

Ah, works, tahnks.
by DoubleProlix
Mon Nov 27, 2017 5:41 pm
Forum: Ren'Py Questions and Announcements
Topic: Variable Scope
Replies: 2
Views: 310

Variable Scope

I've got a variable to keep track of the time of day, segmented into five periods (dawn, morning, afternoon, evening, late). It's timeOfDay, defined in an init-2: block. $ global timeOfDay $ timeOfDay = 1 In an init-1 block I've got a function that uses timeOfDay: def advanceTime(x): n = 0 while n <...
by DoubleProlix
Wed Nov 22, 2017 5:06 pm
Forum: Ren'Py Questions and Announcements
Topic: Text Input on screens
Replies: 1
Views: 893

Text Input on screens

I've got a character creation screen that allows players to choose their various options via radio buttons. It's working fine, but I'd like to allow them to set the character's name on the screen as well. (Currently the name is set through standard renpy.input statements outside of the custom charac...
by DoubleProlix
Mon Nov 06, 2017 5:04 pm
Forum: Ren'Py Questions and Announcements
Topic: Characters as objects and names
Replies: 7
Views: 3393

Re: Characters as objects and names

Okay, trying to implement that as a cludge: init -1: python: class NPC(object): def __init__(self, name): self.reputation = 0 self.name = name def reputationChange(self, x): self.reputation += x if x > 0: renpy.notify("Relationship with [self.name] improved") else: renpy.notify("Relationship with [s...
by DoubleProlix
Mon Nov 06, 2017 2:43 pm
Forum: Ren'Py Questions and Announcements
Topic: Characters as objects and names
Replies: 7
Views: 3393

Characters as objects and names

I'd like to define characters as objects with properties to define their current attitude towards the player, attitude, and other stats. Something where I can just call on Jane.reputation or Jane.mood or Jane.health or whatever. I can implement that fine, but at the same time I'm wondering how to in...
by DoubleProlix
Fri Nov 03, 2017 9:23 pm
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Well, what I was originally trying to do was set up events as objects, with each object having a method called to evaluate whether or not the event was currently valid (returning True or False) and a method to be executed when the event triggered. When an event was required, the handler would make a...
by DoubleProlix
Fri Nov 03, 2017 8:11 pm
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

I think that using weakref to simulate a Singleton pattern might not be pickle-able...
Is there a way to do what I'm trying to go for in a manner more pickleable?
by DoubleProlix
Fri Nov 03, 2017 7:46 pm
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Have you perhaps considered a factory or dispatcher style pattern? Personally I'd edge toward one overlord class that just holds and spawns sub classes for events, basically a handler or over-seer class. Init that in a 0 or -1 offset and just register/amend/delete events from that. Ren'py should ha...
by DoubleProlix
Fri Nov 03, 2017 7:00 pm
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Okay, I've got things mostly working, except for the small detail where I define my objects in init but their methods don't fire after saving and loading. I've figured out that I need to define my objects outside of init and after the start label, but then the instances throw errors because the Even...
by DoubleProlix
Tue Oct 24, 2017 2:41 am
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

So I'd store the conditionals as strings?

'a == 1 && b == 2 && c == 3'
if eval(x):
foo
by DoubleProlix
Mon Oct 23, 2017 10:57 pm
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Great! One other object related question, though. Say I wanted the requirement to be more complex; for example, to trigger, it has to be at night time, the player has to have met Mary, and they need $10 on hand. I think it'd be easiest to have a method to check ~whatever~ in each object, returning T...
by DoubleProlix
Fri Oct 20, 2017 11:18 am
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Ah, so there really isn't a way to just construct a list of all objects of class Events?
by DoubleProlix
Fri Oct 20, 2017 10:19 am
Forum: Ren'Py Questions and Announcements
Topic: Random events via objects and methods?
Replies: 20
Views: 2699

Re: Random events via objects and methods?

Looks great.

How would I make a dynamic list of events whose requirement was currently returning True? I'd like to do this at runtime every time a check had to be made - gather up all the currently possible events and run one of them.