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
Script Help Stop Player Look at [Solved]
ShipinShen Offline
Junior Member

Posts: 23
Threads: 7
Joined: Apr 2014
Reputation: 0
#1
Stop Player Look at [Solved]

Hey, maybe anyone can me help.
I want to let the player stop looking at the door.

//Door-Slam
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("AutoDoor", true, true);
StartPlayerLookAt("AutoDoor", 9, 9, "door");
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddTimer("", 1, "stop");
}

void stop()
{
    StopPlayerLookAt();
}

If i write the StopPlayerLookAt(); in the func_slam, it wont even look at the door.
I think its quite simple, but i dont get it :/

ShipinShen - YouTube
(This post was last modified: 04-21-2014, 12:14 PM by ShipinShen.)
04-21-2014, 05:42 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Stop Player Look at

Your mistake is in:

void stop()
{
StopPlayerLookAt();
}

Because you are clearly calling a timerfunction with

AddTimer("", 1, "stop");

Therefore the script-functino must be:

void stop(string &in asTimer)
{
StopPlayerLookAt();
}


Do you see what i added?
These are called parameters, and they help the script understand what kind of function you want to call.

This might help:
http://www.frictionalgames.com/forum/thread-18368.html

Trying is the first step to success.
04-21-2014, 10:36 AM
Find
ShipinShen Offline
Junior Member

Posts: 23
Threads: 7
Joined: Apr 2014
Reputation: 0
#3
RE: Stop Player Look at

(04-21-2014, 10:36 AM)FlawlessHappiness Wrote: Your mistake is in:

void stop()
{
StopPlayerLookAt();
}

Because you are clearly calling a timerfunction with

AddTimer("", 1, "stop");

Therefore the script-functino must be:

void stop(string &in asTimer)
{
StopPlayerLookAt();
}


Do you see what i added?
These are called parameters, and they help the script understand what kind of function you want to call.

This might help:
http://www.frictionalgames.com/forum/thread-18368.html

Alright! I understand, i thought the "stop" in the timer would say the script, that he use the function stop Big Grin Thanks!

ShipinShen - YouTube
04-21-2014, 12:14 PM
Find




Users browsing this thread: 1 Guest(s)