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.
-
Calissa Leigh
- Regular
- Posts: 54
- Joined: Wed Apr 11, 2012 11:04 am
- Completed: No games, just books. :)
- Projects: Murder Mystery 1
- Organization: Arcato Publishing
- Location: Among the people, and Cajuns
-
Contact:
#1
Post
by Calissa Leigh » Sat Apr 21, 2012 12:10 pm
The defining code code is:
Code: Select all
register_stat("Wash", "dirty", 10, 300)
and the event line is
Code: Select all
$ event("unclean", "act == 'clean'" and dirty >=10, event.only(), priority=210)
The error keeps saying the error is for the event line and the error is: Name error: name dirty is not defined.
It does this with other defined names as well. It seems to have a problem when I try to make it check for a stat is greater than or less than before heading to an event. I've checked the demo. I'm not seeing how it isn't catching this?
-
sciencewarrior
- Veteran
- Posts: 356
- Joined: Tue Aug 12, 2008 12:02 pm
- Projects: Valentine Square (writer) Spiral Destiny (programmer)
- Location: The treacherous Brazilian Rainforest
-
Contact:
#2
Post
by sciencewarrior » Sat Apr 21, 2012 3:19 pm
The problem is where the double quotes are. The correct is:
Code: Select all
$ event("unclean", "act == 'clean' and dirty >=10", event.only(), priority=210)
Basically, Ren'Py takes this string and evaluates it several times during the game. With the variable "dirty" outside the string, it tries to evaluate it on the spot, but it still doesn't exist, because it will be registered later, when the game starts.
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.
-
Calissa Leigh
- Regular
- Posts: 54
- Joined: Wed Apr 11, 2012 11:04 am
- Completed: No games, just books. :)
- Projects: Murder Mystery 1
- Organization: Arcato Publishing
- Location: Among the people, and Cajuns
-
Contact:
#3
Post
by Calissa Leigh » Sat Apr 21, 2012 6:57 pm
Oh. That'll make sense. I can fix the rest of the problems. Thanks again!

Users browsing this forum: No registered users