length of ()

From PenguinMod Wiki (Official)
Length of ()
Jump to navigation Jump to search

This article is about the block in the Sound category. For the block in the Operators category, see length of () (Operators). For the block in the Lists subcategory, see length of () (Lists).

The length of () block is a reporter block in the Sound category that gets the length in seconds of the selected sound. This can be worked around by using the length of the sound in the sound editor.

Workaround

This block can be worked around by using 2 lists: one with the lengths, and one with the names of the sounds in order:

when gf clicked
delete all of [sound names v]
delete all of [sound lengths v]
add [my sound] to [sound names v]
add [4.00] to [sound lengths v]
define find length of sound (name)
set [length] to (item (item # of (name) in [sound names v]) of [sound lengths v])::#0869c2 //it would find the index of the sound name wanted, and then use that to find the sound number
return (get [length]::#0869c2)::custom cap

However, the lengths and names will have to be added manually.