Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Random Looped Sound
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Random Looped Sound

When you copy an area, it makes a new one with another number at the end. For example ScriptArea_1 and ScriptArea_2. That allows you to write the name "ScriptArea_" because they both have this name, and then you can, through the script, add all the numbers at the end.

In this example, the int variable iArea will add the numbers randomly. If you have 10 areas with the same name, just different numbers at the end, then make iArea = RandFloat(1, 10);

Then when you do "ScriptArea_" + iArea in your script, it will add a random number to the name and thus play the sound at a random area, as long as the names match.

PS: I think int iArea needs to use RandInt and not RandFloat because it is an int and not a float.

(This post was last modified: 07-25-2014, 05:05 PM by Mudbill.)
07-25-2014, 05:04 PM
Find


Messages In This Thread
Random Looped Sound - by Plazmater - 07-25-2014, 03:20 PM
RE: Random Looped Sound - by i3670 - 07-25-2014, 03:29 PM
RE: Random Looped Sound - by Plazmater - 07-25-2014, 04:16 PM
RE: Random Looped Sound - by Mudbill - 07-25-2014, 05:04 PM
RE: Random Looped Sound - by Plazmater - 07-25-2014, 05:10 PM
RE: Random Looped Sound - by Mudbill - 07-25-2014, 05:13 PM
RE: Random Looped Sound - by Plazmater - 07-25-2014, 05:17 PM
RE: Random Looped Sound - by Mudbill - 07-25-2014, 05:20 PM
RE: Random Looped Sound - by Plazmater - 07-25-2014, 05:23 PM
RE: Random Looped Sound - by i3670 - 07-25-2014, 07:28 PM
RE: Random Looped Sound - by Plazmater - 07-25-2014, 07:57 PM



Users browsing this thread: 3 Guest(s)