3 world_prefix =
'/world/world_'
4 world_len = len( world_prefix ) + len(
'xxx_xxx' )
8 Crossfire.SetReturnValue( 1 )
10 player = Crossfire.WhoIsActivator()
11 gps = Crossfire.WhoAmI()
15 player.Write(
'You\'re lost in a vacuum!')
18 if ( path.find( world_prefix ) != 0 )
or ( len( path ) != world_len ):
19 player.Write(
'You can\'t position yourself here.' )
21 marked = player.MarkedItem
23 if ( marked != gps )
and ( gps.Food == 0 ):
24 player.Write(
'You must fix the origin of the positioning system first!' )
26 coord = path.split( world_sep )
27 if ( len( coord ) != 3 ):
28 player.Write(
'Strange place, you can\'t position yourself...' )
30 map_x =
int( coord[ 1 ] ) - 99
31 map_y =
int( coord[ 2 ] ) - 99
32 x = map_x * world_map_size + player.X
33 y = map_y * world_map_size + player.Y
39 player.Write(
'You reset the origin of the system.' )
43 player.Write(
'You are at %s:%s.'%( x, y ))