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


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advanced script widgets
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#11
RE: Advanced script widgets

Check and make sure you created areas equal to a, and named them spook_area_1, spook_area_2, etc until you reach spook_area_a.

Next, change file1.snt, file2.snt, etc to the proper sound files. You need cases in the switch function equal to d.

Make sure b and c are integers.

04-26-2011, 03:43 PM
Find
Exostalker Offline
Member

Posts: 204
Threads: 10
Joined: Aug 2010
Reputation: 3
#12
RE: Advanced script widgets

Thanks for making this, keep posting more! Big Grin

EDIT: Suggestion : Tutorial for how to after entering a level to seal and exit? I mean after loading screen you can look back on the door and let's say rocks will seal off the exit. I have seen it done in some custom stories Smile

(This post was last modified: 04-26-2011, 08:58 PM by Exostalker.)
04-26-2011, 05:22 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#13
RE: Advanced script widgets

There is a more flexible concise way to play a random sound:
void playRandomSound(string soundName, string[] sounds, string atEntity, float fadeTime, bool saveSound)
{
  //Select a random index from the array
  int rand = RandInt(0,sounds.length()-1);
  //Play the sound at that index with the given settings
  PlaySoundAtEntity(soundName, sounds[rand], atEntity, fadeTime, saveSound);
}
Usage could be something like:
//Idea 1:
void someFunction()
{
  string[] mySounds = {"Sound1.snt","Sound2.snt","randomSound.snt","Magic.snt"};
  playRandomSound("Random",mySounds,"Player",0.5f,false);
}
//Idea 2:
string[] levelSounds = {"Sound1.snt","Sound2.snt","randomSound.snt","Magic.snt"};
void OtherCodeHere() {}
void someScriptCollisionCallback(string &in asParent, string &in asChild, int alStat)
{
  playRandomSound("Random",levelSounds,asChild,0.5f,false);
}
Void MoreCodeHere() {}
But nice list, i may have one or two neat little scripts i can dig out.
(This post was last modified: 04-27-2011, 09:23 PM by Apjjm.)
04-27-2011, 09:21 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#14
RE: Advanced script widgets

Nice Apjjm I'll toss that up on the initial post. I'll put timers so it loops too Big Grin Very nice, sir. I didn't even know you could use playRandomSound() like that Big Grin

Toss functions like that up on the wiki if you get the time Smile

(This post was last modified: 04-27-2011, 10:02 PM by palistov.)
04-27-2011, 10:01 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#15
RE: Advanced script widgets

i am trying to use the ghost steps function =) but i dont know what the "scary"+asTimer is referencing in the CreateFootstep function?
05-01-2011, 10:31 PM
Find




Users browsing this thread: 1 Guest(s)