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
How do I do this? (scripting)
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#8
RE: How do I do this? (scripting)

First off, you need to create a callback for the player entering the room. Put this function under your OnStart() function:

AddEntityCollideCallback("Player", "AreaRoomTrigger", "FuncScaryStuff", false, 1);

~~

The footsteps thing can be created using a loop:

for(int i=1;i<7;i++) AddTimer("step"+i, 1.5 * i, "FuncCreateStep");

void FuncCreateStep(string &in asTimer)
{
PlaySoundAtEntity(asTimer, "soundfile.snt", "area_"+asTimer, 0, false);
if(asTimer == "step6") StopMusic(3.0f, 3);
}

Do NOT create an area_step6. The extra timer in the loop is only to stop the music. Make sure the int alPrio in your music is above the ambient music. I put 3 as an example. That three that is bolded is the alPrio of the music you want to stop; it must be equal to the music you want to play during the event.


Create 5 script areas and name them area_step1, are_step2, etc

(This post was last modified: 04-07-2011, 07:40 PM by palistov.)
04-07-2011, 07:39 PM
Find


Messages In This Thread
How do I do this? (scripting) - by Solarn - 04-07-2011, 05:14 PM
RE: How do I do this? (scripting) - by Russ Money - 04-07-2011, 05:24 PM
RE: How do I do this? (scripting) - by Solarn - 04-07-2011, 05:43 PM
RE: How do I do this? (scripting) - by MrBigzy - 04-07-2011, 05:45 PM
RE: How do I do this? (scripting) - by Solarn - 04-07-2011, 05:56 PM
RE: How do I do this? (scripting) - by Dalroc - 04-07-2011, 07:36 PM
RE: How do I do this? (scripting) - by MrBigzy - 04-07-2011, 06:12 PM
RE: How do I do this? (scripting) - by palistov - 04-07-2011, 07:39 PM
RE: How do I do this? (scripting) - by Solarn - 04-07-2011, 08:12 PM
RE: How do I do this? (scripting) - by palistov - 04-08-2011, 12:34 AM



Users browsing this thread: 1 Guest(s)