diff --git a/game/gamesrc/world/examples/batch_code.py b/game/gamesrc/world/examples/batch_code.py index e23c0652b8..fe43209a40 100644 --- a/game/gamesrc/world/examples/batch_code.py +++ b/game/gamesrc/world/examples/batch_code.py @@ -52,34 +52,34 @@ from ev import Object limbo = search_object('Limbo')[0] -##CODE (create red button) -# -## This is the first code block. Within each block, python -## code works as normal. Note how we make use if imports and -## 'limbo' defined in the #HEADER block. This block's header -## offers no information about red_button variable, so it -## won't be able to be deleted in debug mode. -# -## create a red button in limbo -#red_button = create_object(red_button.RedButton, key="Red button", -# location=limbo, aliases=["button"]) -# -## we take a look at what we created -#caller.msg("A %s was created." % red_button.key) -# -##CODE (create table and chair) table, chair -# -## this code block has 'table' and 'chair' set as deletable -## objects. This means that when the batchcode processor runs in -## testing mode, objects created in these variables will be deleted -## again (so as to avoid duplicate objects when testing the script many -## times). -# -## the python variables we assign to must match the ones given in the -## header for the system to be able to delete them afterwards during a -## debugging run. -#table = create_object(Object, key="Table", location=limbo) -#chair = create_object(Object, key="Chair", location=limbo) -# -#string = "A %s and %s were created. If debug was active, they were deleted again." -#caller.msg(string % (table, chair)) +#CODE (create red button) + +# This is the first code block. Within each block, python +# code works as normal. Note how we make use if imports and +# 'limbo' defined in the #HEADER block. This block's header +# offers no information about red_button variable, so it +# won't be able to be deleted in debug mode. + +# create a red button in limbo +red_button = create_object(red_button.RedButton, key="Red button", + location=limbo, aliases=["button"]) + +# we take a look at what we created +caller.msg("A %s was created." % red_button.key) + +#CODE (create table and chair) table, chair + +# this code block has 'table' and 'chair' set as deletable +# objects. This means that when the batchcode processor runs in +# testing mode, objects created in these variables will be deleted +# again (so as to avoid duplicate objects when testing the script many +# times). + +# the python variables we assign to must match the ones given in the +# header for the system to be able to delete them afterwards during a +# debugging run. +table = create_object(Object, key="Table", location=limbo) +chair = create_object(Object, key="Chair", location=limbo) + +string = "A %s and %s were created. If debug was active, they were deleted again." +caller.msg(string % (table, chair))