Difference between revisions of "Questions"

822 bytes added ,  09:37, 18 August 2006
imported>Treleth
imported>DragoonWraith
(→‎Waiting: answer)
Line 1,653: Line 1,653:
[[User:Treleth|Treleth]] 01:47, 18 August 2006 (EDT) How exactly do you tell a script to wait for a frame? I was looking at the StreamMusic article and this is what it says:
[[User:Treleth|Treleth]] 01:47, 18 August 2006 (EDT) How exactly do you tell a script to wait for a frame? I was looking at the StreamMusic article and this is what it says:


    <pre> To use this command in a cell with music-type "Default", you need to call StreamMusic random first, then wait for a frame for the command to be executed, and then use Streammusic "<filename>" </pre>
::To use this command in a cell with music-type "Default", you need to call StreamMusic random first, then wait for a frame for the command to be executed, and then use Streammusic "<filename>"


At first I thought of using getsecondspassed, but theres no way to interupt StreamMusic Random.
At first I thought of using getsecondspassed, but theres no way to interupt StreamMusic Random.
:[[User:DragoonWraith|<font face="Oblivion,Daedric Runes" size=2>D</font>ragoon <font face="Oblivion,Daedric Runes" size=2>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 09:37, 18 August 2006 (EDT): First of all, don't use code boxes for quotes; code boxes do not word wrap (at least, not in most browsers, they might in IE, but that only barely counts as a browser), so your text just goes off into the oblivion of the right side of the screen, where they cannot be read.
:Anyway, this code would do what you want:
if ( state == 1 )
  StreamMusic Random
  set state to 2
elseif ( state == 2 )
  StreamMusic <filename>
  set state to 3
endif
:The first time through, it would play the random music, and then the next time through (on the next frame), it would play what you want.