The include
statement can be used to include entity definitions
into a world file. For example, the world file from the previous section
can be divided into an include file called myrobots.inc
:
# This is an include file. # It uses the 'define' construct to define a new type of entity. define myrobot position ( player() laser() )and a world file called
myworld.world
:# This world file creates two robots with lasers. # It uses the 'include' statement to include the robot definitions. include "myrobots.inc" environment ( file "cave.pnm" scale 0.03 ) myrobot ( name "robot1" port 6665 pose [1 1 0] ) myrobot ( name "robot2" port 6666 pose [2 1 0] )The definitions are included using the
include "<filename>"
statement. Stage searches for <filename> in these directories, in this order: