displaying variables [Solved]

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
Gordon_Freeman
Newbie
Posts: 2
Joined: Tue Sep 06, 2011 1:57 pm
Contact:

displaying variables [Solved]

#1 Post by Gordon_Freeman »

Hello i'm a newbie.
i have a problem displaying integer variable.

Code: Select all

define e = Character('Eileen', color="#c8ffc8")


# The game starts here.
label start:

    e "You've created a new Ren'Py game."

    e "Once you add a story, pictures, and music, you can release it to the world!"
    
    $ attack_power = 5 
    "Your Attack Power = ",  attack_power 
    "Your Attack power is increased by 10" 
    attack_power = attack_power + 10 
    "Your Attack Power = ",  attack_power 

    return
i don't know what's wrong with this code.
please guide me.
Last edited by Gordon_Freeman on Tue Sep 06, 2011 3:04 pm, edited 1 time in total.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: displaying variables

#2 Post by Aleema »

First of all what version of Ren'Py are you using? There's a huge difference between 6.12 and 6.13 when it comes to showing variables. Right off the bat, I can see you're missing a $ sign for one of your variable changes (attack_power = attack_power + 10), and the comma is not the Ren'Py syntax for showing variables. You show them like this.

Gordon_Freeman
Newbie
Posts: 2
Joined: Tue Sep 06, 2011 1:57 pm
Contact:

Re: displaying variables

#3 Post by Gordon_Freeman »

latest version, i downloaded it today.

Wow thank you very much for the corrections
and i'm sorry i didn't read the FAQ before posting =='

my problem solved, thx again.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]