Page 1 of 1

Point-Based Endings

Posted: Tue Aug 19, 2008 6:48 pm
by VaanAshe
Forgive me for asking what is probably a real n00bish question, but I'm having a little trouble with this. I actually want to work the system so that it's like a dating system (with three characters, where the ending results with which girl the main character is paired up with depending on who has the highest points).

I tried editing it around, and got an error message. So, instead, I thought I'd try copy and pasting exactly what is on the page and seeing what actually happens. In fact, I got the same error message. I've copied exactly what is in the above link, no changes and nothing added and all that.

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


On line 18 of D:\Users\BTK\Documents\renpy-6.6.3\Feather/game/script.rpy: if statement expects a non-empty block.
if winners == [0]:
                  ^

On line 20 of D:\Users\BTK\Documents\renpy-6.6.3\Feather/game/script.rpy: elif clause must be associated with an if statement.
elif winners == [1]:
    ^

On line 22 of D:\Users\BTK\Documents\renpy-6.6.3\Feather/game/script.rpy: elif clause must be associated with an if statement.
elif winners == [2]:
    ^

On line 24 of D:\Users\BTK\Documents\renpy-6.6.3\Feather/game/script.rpy: elif clause must be associated with an if statement.
elif winners == [3]:
    ^
As such, the error continues on to include each and every single "elif" statement there. Sorry if this is incredibly obvious as to what the problem is.

(As a minor side-note, considering I've not done this before, how would I go about increasing the values of each attribute as well? And, on a similar note, can the points go below 0, or does it stop at 0?)

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 7:05 pm
by N0UGHTS
VaanAshe wrote:I've copied exactly what is in the above link, no changes and nothing added and all that.
So does every elif and if block in your script only contain only the elif line and a comment line? If that's the case, that explains the traceback saying that Ren'Py expects a non-empty block; Ren'Py (and pretty much any other programming language with comment lines) ignore comment lines and go straight for lines relevant to the scripting itself.

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 7:14 pm
by VaanAshe
N0UGHTS wrote:
VaanAshe wrote:I've copied exactly what is in the above link, no changes and nothing added and all that.
So does every elif and if block in your script only contain only the elif line and a comment line? If that's the case, that explains the traceback saying that Ren'Py expects a non-empty block; Ren'Py (and pretty much any other programming language with comment lines) ignore comment lines and go straight for lines relevant to the scripting itself.
...oh...*sweatdrop* I knew that...

So basically, it can't find something to display if the if statement is true, right?

...oh god, I feel so stupid. ;_;

EDIT: Aya...that was obvious...Sorry! ;_;

EDIT: Okay, I've got that sorted out. Sorry about that! I really should think before I post... ;_;

EDIT...AGAIN: Saying that, I have no clue on how to increase the values. I've tried "$ strength_points = +2", but it just changes the value to 2, rather than increase it by two. ...help?

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 7:36 pm
by N0UGHTS
The = sign is equivalent to "is" or "becomes" in the English language. So you're effectively telling Ren'Py "After spending four hours at the gym, the protagonist's strength is now 2 (positive) points worth!"

Just make it "$ strength_points + 2".

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 7:39 pm
by VaanAshe
N0UGHTS wrote:The = sign is equivalent to "is" or "becomes" in the English language. So you're effectively telling Ren'Py "After spending four hours at the gym, the protagonist's strength is now 2 (positive) points worth!"

Just make it "$ strength_points + 2".
As such, I've added the following:

Code: Select all

    "yes"
    $ strength_points + 2
    $ wisdom_points + 1

    "no"
    $ wisdom_points + 2
(Ignore my random "Yes" and "No" =P) It's telling me that strength and wisdom are equal, despite the fact that wisdom should be one point higher. ;_;

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 9:09 pm
by PyTom
Actually, you want something like:

$ strength = strength + 2

or the equivalent and shorter

$ strength += 2

Just having a + alone makes Ren'Py (really, Python) do the calculation, but then not store it anywhere.

Re: Point-Based Endings

Posted: Tue Aug 19, 2008 9:16 pm
by VaanAshe
...if this was MSN, I'd flood this post with pictures of foxes, but I can't. In which case, I'll just say THANK YOU VERY MUCH! =D