
function menu_load_ship( load_actor_name, load_model_name, attach_to_name, attach_to_bone, hue )
	local actor = ACTOR_preload()

	local load_actor_name_hue = format( "%s_%d", load_actor_name, hue )

	actor[cp_actor_name]		= load_actor_name_hue
	actor[cp_model_dir]			= "player"
	actor[cp_model_name]		= load_model_name

	actor[cp_actor_type]			= cat_ground
	actor[cp_i_collide_with_beasties]	= 0
	actor[cp_these_collide_with_me]		= 0

	actor[cp_launch_hue_shift] = hue

	c_preload_model( actor )

if load_model_name == "tank_head" then
	c_set_random_anim( "spin", 100.0, 100.0, 0.0, 0.0 )
	c_set_random_anim( "pulse", 500.0, 500.0, 0.0, 0.0 )
end
if load_model_name == "zappa_head" then
	c_set_random_anim( "pulse", 250.0, 250.0, 0.0, 0.0 )
	c_set_random_anim( "trailpulse", 100.0, 100.0, 0.0, 0.0 )
end
if load_model_name == "ship_head" then
	c_set_random_anim( "pulse", 800.0, 800.0, 0.0, 0.0 )
end
if load_model_name == "ball_head" then
	c_set_random_anim( "pulse", 100.0, 100.0, 0.0, 0.0 )
	c_set_random_anim( "spins", 100.0, 100.0, 0.0, 0.0 )
end

	local apo = ACTOR_PreLaunch( load_actor_name_hue, load_actor_name_hue )
	apo:setall( 0.0, 0.0, 0.0, 180.0, 100.0, 0.0, 0.0 )
	apo:launch()

	c_link_to_parent( attach_to_name, attach_to_bone )
end



function menu_load_page( load_actor_name, load_model_name )
	local actor = ACTOR_preload()

	actor[cp_actor_name]		= load_actor_name
	actor[cp_model_dir]			= "menu"
	actor[cp_model_name]		= load_model_name

	actor[cp_actor_type]			= cat_ground
	actor[cp_i_collide_with_beasties]	= 0
	actor[cp_these_collide_with_me]		= 0

	c_preload_model( actor )

if load_actor_name == "menu_belt_select" then
	c_set_random_anim( "sway1", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway2", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway3", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway4", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway5", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway6", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway7", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway8", 70.0, 130.0, 0.0, 0.0 )
end
if load_actor_name == "menu_level_select" then
	c_set_random_anim( "sway1", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway2", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway3", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway4", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway5", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway6", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway7", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway8", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway9", 70.0, 130.0, 0.0, 0.0 )
end
if load_actor_name == "menu_ms_logo" then
	c_set_random_anim( "sway", 70.0, 130.0, 0.0, 0.0 )
end
if load_actor_name == "menu_ms_logo_ru" then
	c_set_random_anim( "tilt1", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "tilt2", 70.0, 130.0, 0.0, 0.0 )
end
if load_actor_name == "menu_select_gametype" then
	c_set_random_anim( "sway1", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway2", 70.0, 130.0, 0.0, 0.0 )
end
if load_actor_name == "menu_options_select" then
	c_set_random_anim( "selectpart", 50.0, 150.0, 0.0, 0.0 )
	c_add_particle_to_anim( "selectpart", "parts01", "fe_optionglow" )
end
if load_actor_name == "menu_sound_select" then
	c_set_random_anim( "selectpart", 50.0, 150.0, 0.0, 0.0 )
	c_add_particle_to_anim( "selectpart", "parts01", "fe_optionglow" )
end
if load_actor_name == "menu_joypad_select" then
	c_set_random_anim( "selectpart", 50.0, 150.0, 0.0, 0.0 )
	c_add_particle_to_anim( "selectpart", "parts01", "fe_optionglow" )
end
if load_actor_name == "menu_highscore_select" then
	c_set_random_anim( "selectpart", 50.0, 150.0, 0.0, 0.0 )
	c_add_particle_to_anim( "selectpart", "parts01", "fe_optionglow" )
end
if load_actor_name == "menu_front_select" or load_actor_name == "menu_front_demo" then
	c_set_random_anim( "sway1", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway2", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway3", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway4", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway5", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway6", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway7", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway8", 70.0, 130.0, 0.0, 0.0 )
	c_set_random_anim( "sway9", 70.0, 130.0, 0.0, 0.0 )
end


	local apo = ACTOR_PreLaunch( load_actor_name, load_actor_name )
	apo:setall( 0.0, 0.0, 0.0, 90.0, 100.0, 0.0, 0.5 )
	apo:launch()


if load_actor_name == "menu_tally_null" then
	local actor = ACTOR_preload()

	local load_actor_name_icon = "menu_tally_icon"
	actor[cp_actor_name]		= load_actor_name_icon
	actor[cp_model_dir]			= "menu"
	actor[cp_model_name]		= "tally_icon"

	actor[cp_actor_type]			= cat_ground
	actor[cp_i_collide_with_beasties]	= 0
	actor[cp_these_collide_with_me]		= 0

	c_preload_model( actor )

	c_set_random_anim( "pulse", 70.0, 130.0, 0.0, 0.0 )

	local load_actor_name_grid
	for y = 0,8,1 do
		for x = 0,9,1 do
			if x > 0 or y > 0 then
				load_actor_name_grid = format( "%s_%d%d", load_actor_name_icon, y, x )
				local apo = ACTOR_PreLaunch( load_actor_name_icon, load_actor_name_grid )
				apo:setall( -((x*-8.6)+38.4), -((y*5.3)-16.7), 0.0, 0.0, 40.0, 0.0, 0.5 )
				apo:launch()
				c_link_to_parent( load_actor_name, "main" )
			end
		end
	end
else
	if load_actor_name == "menu_ship_select" then
		for hue = 0,300,60 do
			menu_load_ship( "menu_ship1", "tank_head", load_actor_name, "bone_01", hue )
			menu_load_ship( "menu_ship2", "zappa_head", load_actor_name, "bone_02", hue )
			menu_load_ship( "menu_ship3", "ship_head", load_actor_name, "bone_03", hue )
			menu_load_ship( "menu_ship4", "ball_head", load_actor_name, "bone_04", hue )
		end
	else
		if load_actor_name == "menu_belt_select" then
			local actor = ACTOR_preload()

			local load_actor_name_icon = "menu_belt_locked"
			actor[cp_actor_name]		= load_actor_name_icon
			actor[cp_model_dir]			= "menu"
			actor[cp_model_name]		= "belt_locked"

			actor[cp_actor_type]			= cat_ground
			actor[cp_i_collide_with_beasties]	= 0
			actor[cp_these_collide_with_me]		= 0

			c_preload_model( actor )

			local load_actor_name_grid
			for y = 2,8,1 do
				local apo = ACTOR_PreLaunch( load_actor_name_icon, load_actor_name_icon )
				apo:setall( 0.0, 0.0, 0.0, 90.0, 150.0, 0.0, 0.0 )
				apo:launch()

				load_actor_name_grid = format( "belt_%d_locked", y )
				c_link_to_parent( load_actor_name, load_actor_name_grid )
			end
		end
	end
end
end

