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.
-
Mr. E
- Regular
- Posts: 139
- Joined: Sat Apr 29, 2006 6:47 pm
-
Contact:
#1
Post
by Mr. E » Thu Mar 27, 2008 6:47 pm
I would like to know if it's possible to assign a numerical variable to a string variable. A sketchy example follows:
Code: Select all
$ number =+ 7
$ word = "House" + number
if word = "House7":
'It worked!'
Last edited by
Mr. E on Thu Mar 27, 2008 7:00 pm, edited 1 time in total.
-
Wintermoon
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
-
Contact:
#2
Post
by Wintermoon » Thu Mar 27, 2008 6:57 pm
Code: Select all
$ word = "House%s" % number # The placeholder-substitution method.
$ word = "House" + str(number) # The simple, direct method.
-
Mr. E
- Regular
- Posts: 139
- Joined: Sat Apr 29, 2006 6:47 pm
-
Contact:
#3
Post
by Mr. E » Thu Mar 27, 2008 7:01 pm
Thanks for the help, wintermoon. I knew it was simple but it was still bugging me for the last hour or so...
Users browsing this forum: Bing [Bot], Google [Bot], Passion3D