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
Lever when pull play sound
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Lever when pull play sound

(04-13-2013, 10:19 PM)Hauken Wrote: Hi

Im trying to connect a lever to a door which is working
However i want a sound to play once i pull it, I've been messing around looking at the script wiki page but after I did this i get a error token saying 9,1 "{" is wrong.

void OnStart()
{
    InteractConnectPropWithMoveObject("","valve", "slidedoor",true, false, 0);
    PlayMusic("01_amb_darkness", true, 1, 0, 0, true);
}

void SetEntityPlayerInteractCallback("","Soundlever", true);

{
    PlaySoundAtEntity("","quest_completed.snt","slidedoor");
}

Currently i have a simple lever connected to a door, it is facing upwards and if i pull it it will stuck and the door opens. Easy and working.

The trouble is the sound i want to play when pull!

Im sure you guys can see the problem already Angel

Edit: the Playmusic is just temp so it wont be so silent when im testing around..

void OnStart()
{
InteractConnectPropWithMoveObject("","valve", "slidedoor",true, false, 0);
PlayMusic("01_amb_darkness", true, 1, 0, 0, true);
AddEntityCollideCallback("slidedoor", "AreaLeave", "DoSound", true, -1);
}

void DoSound (string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("","quest_completed.snt","slidedoor");
}

Make an area which is IN the slidedoor. Scale it enough so that when the slide door reaches the top, the area finishes. The -1 that I used in the CollideCallback function means that when slidedoor goes out of the area, the sound will happen.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 04-13-2013, 10:37 PM by The chaser.)
04-13-2013, 10:37 PM
Find


Messages In This Thread
Lever when pull play sound - by Hauken - 04-13-2013, 10:19 PM
RE: Lever when pull play sound - by The chaser - 04-13-2013, 10:37 PM
RE: Lever when pull play sound - by Hauken - 04-13-2013, 10:38 PM
RE: Lever when pull play sound - by The chaser - 04-13-2013, 10:42 PM
RE: Lever when pull play sound - by Hauken - 04-13-2013, 10:48 PM
RE: Lever when pull play sound - by The chaser - 04-13-2013, 11:06 PM
RE: Lever when pull play sound - by Hauken - 04-13-2013, 11:26 PM
RE: Lever when pull play sound - by NaxEla - 04-13-2013, 11:42 PM
RE: Lever when pull play sound - by Hauken - 04-13-2013, 11:51 PM
RE: Lever when pull play sound - by NaxEla - 04-13-2013, 11:58 PM
RE: Lever when pull play sound - by Hauken - 04-14-2013, 12:11 AM



Users browsing this thread: 3 Guest(s)