If Statement for DSE isn't working

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Fenrir34
Miko-Class Veteran
Posts: 560
Joined: Fri Jul 05, 2013 4:39 am
Completed: Escaping Sorrow
Projects: Crisis Beat,Lynarsia-The Broken Song
Location: California
Contact:

If Statement for DSE isn't working

#1 Post by Fenrir34 »

So I've got some of this down, but when Alice meets Ben for example, that means that she hasn't met Chris so if she calls Chris should should say "I don't even know who that is. But instead, even though she hasn't met him she acts like she has but hasn't. Please help

Code: Select all

# This file contains the events that will be part of the game. It's
# expected that the user will add and remove events as appropriate
# for this game.


# Some characters that are used in events in the game.


init:
    define a = Character('Alice', color="#c8ffc8")
    define c = Character('Chris', color="#c8ffc8")
    define b = Character('Ben', color="#c8ffc8")
    

init:
    $ event("beach", "act == 'beach'", event.solo(), priority=200)
    $ event("cafe", "act == 'cafe'", event.solo(), priority=200)
    $ event("study", "act == 'study'", event.solo(), priority=200)
    $ event("face", "act == 'face'", event.solo(), priority=200)
    $ event("ben", "act == 'ben'", event.solo(), priority=200)
    $ event("chris", "act == 'chris'", event.solo(), priority=200)
    
    $ event("chris2", "act == 'chris2'", event.solo(), priority=200)
    $ event("ben2", "act == 'ben2'", event.solo(), priority=200)
    
label beach:
    scene bg beach with dissolve
    "I decided to go to the beach and have some fun."
    $ benpoints += 1
    return 

label cafe:
    scene bg cafe with dissolve
    "I decided to go to the cafe and have some fun."
    $ chrispoints += 2
    return 
    
label study:
    scene bg room with dissolve
    "I didn't have school, but it's always good to keep up my smarts."
    $ intelligence += 10
    $ beauty -= 10
    return
    
label face:
    scene bg room with dissolve
    "I spend time making myself look more attractive."
    $ beauty += 10
    $ intelligence -= 10
    return 
 

label ben2:
    $ metben = False
    scene bg room with dissolve
    "I don't even know who that is."
    return 

label chris2:
    $ metchris = False
    scene bg room with dissolve
    "I don't even know who that is."
    return
    
label chris:
    $ metben = False
    scene bg room with dissolve
    $ chrispoints += 2
    "I call Chris and we have a nice chat."
    return
    
label ben:
    $ benpoints += 2
    "I call Ben and we have a nice chat."
    return
    
# Below here are special events that are triggered when certain
# conditions are true. 

# This is an introduction event, that runs once when we first go
# to class. 

init:
    $ event("introductionb", "act == 'beach'", event.once(), event.only())

label introductionb:
    $ metben = True 
    scene bg beach with dissolve 
    "I head to the beach and it's beautiful."
    "As I walk through the water, I see a boy."
    show ben 
    with dissolve 
    "He looks sad."
    a   "Excuse me, are you alright?"
    "He looks at me surprised."
    b   "Yeah. I'm just a bit down."
    return 


init:
    $ event("introductionc", "act == 'cafe'", event.once(), event.only())

label introductionc:
    $ metchris = True
    scene bg cafe with dissolve 
    "I head to the cafe and see a cute looking boy."
    show chris 
    with dissolve 
    "He smiles and me and I can't help but blush."
    c   "What's your name?"
    a   "A-Alice."
    c   "That's a pretty name."
    return

Also, I did put the code on the script before going to the events page, but it still won't read the even I want. Help greatly appreciated

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: If Statement for DSE isn't working

#2 Post by Showsni »

You don't have any if statements in the code you posted; are there meant to be some?

Post Reply

Who is online

Users browsing this forum: Google [Bot], snotwurm