Game Development Reference
In-Depth Information
The Key command and all its parameters are inserted into your script.
Once entered, the Keycode becomes inactive and typing in the script
window returns to normal.
All the script commands inside the Key(). . .EndKey statement are run
upon the designated keypress.
Example
Each time the b key is pressed the sound bassnote is played.
On NewFrame
Key (66) <B>
playsound bassnote
EndKey
End NewFrame
Playing sounds
You can play sounds contained within your Toon3D project directly from
TScripts:
playsound soundname
The soundname is the name given to the sound file in your project and
must be referenced exactly as it appears in the Control Window (case
sensitive).
The sound will be looped indefinitely until it is stopped, if it has its
properties set to loop.
To stop a sound:
stopsound soundname
To stop all sounds:
stopallsounds
Example
Each time the m key is pressed the sound music is played, and when the
n key is pressed the music is stopped.
On NewFrame
Key (m)
playsound music
EndKey
Key (n)
stopsound music
EndKey
End NewFrame
Search Nedrilad ::




Custom Search