預留名 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