local logf_console = nil function logf( fmt, ... ) logf_console = get_console() logf = logf_main logf_main( fmt, ... ) end function logf_main( fmt, ... ) local c = select( "#", ... ) if c <= 0 then -- nothing to format logf_console:execute( ":" .. string.gsub( fmt, " ", "\160" ) ) else logf_console:execute( ":" .. string.gsub( string.format( fmt, ... ), " ", "\160" ) ) end end function spawn_zombie( position, total, level_vertex, game_vertex ) local index local new_pos, x_offset, z_offset local area_longitude, area_latitude = total*10, total*10 local height = 10 local bob = nil logf("start adding zombie") for index = 1, total do -- spawns dutyers numbering from index to total (1...total) x_offset = math.random(-(area_longitude/2),(area_longitude/2)) z_offset = math.random(-(area_latitude/2),(area_latitude/2)) new_pos = vector():set( position.x + x_offset, position.y + height, position.z + z_offset ) bob = alife():create("zombie_strong", new_pos, level_vertex, game_vertex ) logf( "zombie %i created", index ) end end function tell_story( actor, npc ) logf("tell_story() called") local spawn_point = spawn_zombie( vector():set( -165, -18.29, -127.68 ), 20, db.actor:level_vertex_id(02), db.actor:game_vertex_id(02) ) logf("tell_story() completed") end