预留名 link
Ren’Py预留了所有不以数字和字母开头的文件名,以及所有以“00”开头的文件名。有个非常特殊的例外,Ren’Py内部使用以“00”和“_”开头的文件。
Ren’Py预留了所有以单下划线(_)开头的名称。不要以单下划线开头定义任何名称,因为有可能未来的某个Ren’Py版本就会将那个名称用作预留名,这会让你的游戏崩掉。
下面是一个Python所使用的预留名列表。复用这些名称可能会导致“令人抓狂/无法调试/拍坏键盘”的问题。
ArithmeticError
AssertionError
AttributeError
BaseException
BufferError
BytesWarning
DeprecationWarning
EOFError
Ellipsis
EnvironmentError
Exception
False
FloatingPointError
FutureWarning
GeneratorExit
IOError
ImportError
ImportWarning
IndentationError
IndexError
KeyError
KeyboardInterrupt
LookupError
MemoryError
NameError
None
NotImplemented
NotImplementedError
OSError
OverflowError
PendingDeprecationWarning
ReferenceError
RuntimeError
RuntimeWarning
StandardError
StopIteration
SyntaxError
SyntaxWarning
SystemError
SystemExit
TabError
True
TypeError
UnboundLocalError
UnicodeDecodeError
UnicodeEncodeError
UnicodeError
UnicodeTranslateError
UnicodeWarning
UserWarning
ValueError
Warning
ZeroDivisionError
abs
absolute_import
all
any
apply
ascii
basestring
bin
bool
buffer
bytearray
bytes
callable
chr
classmethod
cmp
coerce
compile
complex
delattr
dict
dir
divmod
enumerate
eval
execfile
file
filter
float
format
frozenset
getattr
globals
hasattr
hash
hex
id
input
int
intern
isinstance
issubclass
iter
len
list
locals
long
map
max
memoryview
min
next
object
oct
open
ord
pow
print
property
range
raw_input
reduce
reload
repr
reversed
round
set
setattr
slice
sorted
staticmethod
str
sum
super
sys
tuple
type
unichr
unicode
vars
xrange
zip
下面是一个Ren’Py所使用的预留名列表。尽管在某些情况下重定义这些名称也情有可原,不过我们还是要尽量避免,不然容易出现“令人抓狂/无法调试/拍坏键盘”的问题。
ADVCharacter
ADVSpeaker
Action
Alpha
Animation
Bar
Button
ColorMatrix
ContrastMatrix
DictEquality
DynamicCharacter
FactorZoom
FieldEquality
ImageButton
ImageReference
Input
LiveComposite
LiveCrop
LiveTile
Motion
Move
MoveFactory
MoveIn
MoveOut
NVLCharacter
NVLSpeaker
OldMoveTransition
PY2
Pan
ParameterizedText()
Particles
Position
Return
Revolve
RevolveInOut
RotoZoom
RoundRect
Set
SizeZoom
Speaker
SplineMotion
SubTransition
TextButton
TransformMatrix
Viewport
VoiceInfo
Window
Zoom
ZoomInOut
achievement
adv_narrator
alt
anim
audio
bchr
bord
bubble
build
centered
color
config
default
default_transition
director
division
easeinbottom
easeinleft
easeinright
easeintop
easeoutbottom
easeoutleft
easeoutright
easeouttop
extend
gui
hyperlink_function
hyperlink_sensitive
hyperlink_styler
iap
icon
im
incdir
irisout
layeredimage
layout
library
moveinbottom
moveinleft
moveintop
moveoutbottom
moveoutleft
moveouttop
nvl
nvl_clear_next
nvl_erase
nvl_list
nvl_narrator
nvl_show_core
nvl_variant
nvl_window
os
persistent
predict_menu
predict_say
preferences
print_function
pushdown
pushleft
pushup
pygame_sdl2
pystr
python_dict
python_list
python_object
python_set
renpy
shaderdoc
slideawaydown
slideawayright
slideawayup
slidedown
slideright
slideup
srcdir
store
style
suppress_overlay
sv
swing
theme
tobytes
toggle_skipping
top
ui
unicode_literals
updater
vcentered
wipedown
wiperight
wipeup
with_statement