z_mirror/dancing-miku
git clone https://git.raiguard.me/z_mirror/dancing-miku
9e453c3
trunk
1local sprite_frames =29 2local sound_frames =145 3local sprite_fps =30 -- If this is 60 then it doesn't work... WTF? 4local overall_frames =sprite_fps * sound_frames 5 6local overall_frame =0 7 8for sound_frame =1 , sound_frames do 9for sprite_frame =1 , sprite_fps do 10overall_frame =overall_frame + 1 11local item ={ 12type ="item" , 13name ="miku-" .. overall_frame , 14localised_name ={ "item-name.miku" } , 15icon ="__dancing-miku__/graphics/items/miku/" .. (( sprite_frame % sprite_frames ) + 1 ) .. ".png" , 16icon_size =96 , 17hidden =true , 18stack_size =1 , 19flags ={ "not-stackable" } , 20spoil_ticks =1 , 21spoil_result ="miku-" .. (( overall_frame % overall_frames ) + 1 ), 22auto_recycle =false , 23send_to_orbit_mode ="automated" , 24} 25if sprite_frame == 1 then 26item . spoil_to_trigger_result ={ 27trigger ={ 28type ="direct" , 29action_delivery ={ 30type ="instant" , 31source_effects ={ 32type ="play-sound" , 33sound ={ filename ="__dancing-miku__/sounds/ievan-polkka/" .. sound_frame .. ".ogg" , volume =0.5 } , 34} , 35} , 36} , 37items_per_trigger =1 , 38} 39end 40data : extend ( { item } ) 41end 42end