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
Help with "advanced widget script"
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#4
RE: Help with "advanced widget script"

if(asTimer == "step2")
This is just an example of how to check for a specific footstep - in this case the second one. You don't need this line, or can change it to a different footstep. Why? well you might want to lower player sanity or shut a door or something on a given step.

Quote:So for this bit, would I have to create 10 'areas' named step1, step2 etc which the function would call each at 0.8 seconds? And for the bit i put in bold, what is that??

that function is of the following form:
//From the script functions page in the wiki:
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

//The code used
PlaySoundAtEntity("scary"+asTimer, "scare_wood_creak_mix.snt", "StartFootstepsArea", 0, false);
The first argument is just a name to give the sound you are playing - it is given the name "scarystepX" (where X is a number between 1 and 10) in this case - so each sound is uniquely named. The next argument is the sound you want to play.
asEntity, is the place to play the footstep at - and set to "StartFootstepsArea". This means you only need one script area called "StartFootstepsArea". The last two arguments state a fade-in time (of 0) and whether the state of the sound should be saved.

However, if you want to make it so you have 10 areas - one for each footstep, you can simply do the following:
PlaySoundAtEntity("scary"+asTimer, "scare_wood_creak_mix.snt", "Foot"+asTimer, 0, false);
"Foot"+asTimer will yeild "Footstep1" through "Footstep10" as the entity names.
05-08-2011, 02:32 PM
Find


Messages In This Thread
Help with "advanced widget script" - by Ge15t - 05-07-2011, 03:19 PM
RE: Help with "advanced widget script" - by Apjjm - 05-07-2011, 05:26 PM
RE: Help with "advanced widget script" - by Ge15t - 05-08-2011, 06:41 AM
RE: Help with "advanced widget script" - by Apjjm - 05-08-2011, 02:32 PM



Users browsing this thread: 1 Guest(s)