Sound

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
Hi, wanted to ask.
How do I change the pitch of current sound by chat message? (If I type -pitch # (0 - 10)) And why this trigger turns on when i type anything but not only entered chat string?

  • Music
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -Music 1
        • Then - Actions
          • Sound - Stop Music[1] After fading
          • Sound - Stop Music[2] After fading
        • Else - Actions
          • Sound - Play Music[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -Music 2
        • Then - Actions
          • Sound - Stop Music[1] After fading
          • Sound - Stop Music[2] After fading
        • Else - Actions
          • Sound - Play Music[2]
 
Level 5
Joined
Jul 15, 2012
Messages
101
I want event that if you type -pitch # = set pitch to #

example : -pitch 1.5123123 = set sound pitch to 1.5123123
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The parsing of the string is independent. You take the Event Response - Entered Chat String to gain the whole msg the player typed in and apply the Substring function on it, from 8th character ("-pitch " has a length of 7) to the end of the string (there is a String Length function). Now you have cut out "1.5123123" as string and convert it to real via the function Convert String To Real and place the result in the Sound - Set Sound Pitch action.
 
Status
Not open for further replies.
Top