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
[SOLVED]Sanity script problem
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#1
[SOLVED]Sanity script problem

void OnStart()
{
AddTimer("", 1, "AmountOfSanity");
}

void AmountOfSanity(string &in asTimer)
{
if(GetPlayerSanity() < 100.0f)
{
PlaySoundAtEntity("Player", "insanity_whisper.snt", "Player", 0, false);
PlaySoundAtEntity("Player", "insanity_baby_cry.snt", "Player", 0, false);
}
}


So , I need a normal script, if sanity is lower than x amount, in my case is 100 for test, player hears insane sounds. But in my script its not happening. Anybody can give me a working script example?

I putted many scare areas and get 0 sanity but nothing...

Thanks, + reputation for man that will help me Smile

Egypt CS
[Image: 27003.png]
(This post was last modified: 11-17-2014, 07:40 PM by Catalyst.)
10-18-2014, 06:44 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Sanity script problem

In the void amounth of sanity you missing a timer wich will time or replay the sounds.
Just add a timer in that fanction and add the amounth of nanity in it.
That should do the trick.
10-18-2014, 08:16 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#3
RE: Sanity script problem

(10-18-2014, 08:16 PM)DnALANGE Wrote: In the void amounth of sanity you missing a timer wich will time or replay the sounds.
Just add a timer in that fanction and add the amounth of nanity in it.
That should do the trick.

ok, but i can make a timer that never stops, i mean circular one?

You can give a example, I dont know with what to start...

Egypt CS
[Image: 27003.png]
(This post was last modified: 10-19-2014, 10:16 AM by Catalyst.)
10-19-2014, 10:08 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Sanity script problem

void OnStart()
{
AddTimer("", 1, "AmountOfSanity");
}

void AmountOfSanity(string &in asTimer)
{
if(GetPlayerSanity() < 100.0f)
{
PlaySoundAtEntity("Player", "insanity_whisper.snt", "Player", 0, false);
PlaySoundAtEntity("Player", "insanity_baby_cry.snt", "Player", 0, false);

AddTimer("", 10, "AmountOfSanity");// <-- This timer will LOOP your timer-script every 10 seconds -> AmountOfSanity

}
}
10-19-2014, 11:51 AM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#5
RE: Sanity script problem

(10-19-2014, 11:51 AM)DnALANGE Wrote: void OnStart()
{
AddTimer("", 1, "AmountOfSanity");
}

void AmountOfSanity(string &in asTimer)
{
if(GetPlayerSanity() < 100.0f)
{
PlaySoundAtEntity("Player", "insanity_whisper.snt", "Player", 0, false);
PlaySoundAtEntity("Player", "insanity_baby_cry.snt", "Player", 0, false);

AddTimer("", 10, "AmountOfSanity");// <-- This timer will LOOP your timer-script every 10 seconds -> AmountOfSanity

}
}

Thank you Smile

Egypt CS
[Image: 27003.png]
10-19-2014, 11:52 AM
Find




Users browsing this thread: 1 Guest(s)