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
Problems Trying To Script
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#1
Problems Trying To Script

I've been trying to make it so the player hears a loud noise and stares at this closed door but I don't how to make the player stop looking any ideas?
04-22-2011, 04:47 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Problems Trying To Script

Where do you want the player to hear this load noise? What kind of load noise? Specific noise? ID/Name of closed door?

I'll try my best.

OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Funtion01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("[door name]", 2, 4, "");
AddTimer("", [however long you want the player to look at door], "StopLooking");
}
void StopLooking(string &in asTimer)
{
StopPlayerLookAt();
}

That's mostly all I can do for now.

(This post was last modified: 04-22-2011, 05:05 AM by Kyle.)
04-22-2011, 04:56 AM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#3
RE: Problems Trying To Script

(04-22-2011, 04:56 AM)Kyle Wrote: Where do you want the player to hear this load noise? What kind of load noise? Specific noise? ID/Name of closed door?

I'll try my best.

Well the player was supposed to unlock the door to the cell which is working and then there is a locked door next to a open one but I wanted the crashing sound to play from the locked one using the script which I have got working although I cant find out how to stop the player from staring at the door making the rest of the level awkward
04-22-2011, 05:00 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: Problems Trying To Script

(04-22-2011, 05:00 AM)D3AD UPR1S1NG Wrote: Well the player was supposed to unlock the door to the cell which is working and then there is a locked door next to a open one but I wanted the crashing sound to play from the locked one using the script which I have got working although I cant find out how to stop the player from staring at the door making the rest of the level awkward

You add this:
AddTimer("", [however long you want the player to stare], "PlayerStareStop");
Also add this for the function that goes with the timer:
void PlayerStareStop(string &in asTimer)
{
StopPlayerLookAt();
}

(This post was last modified: 04-22-2011, 05:10 AM by Kyle.)
04-22-2011, 05:08 AM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#5
RE: Problems Trying To Script

Big Grin
(04-22-2011, 05:08 AM)Kyle Wrote:
(04-22-2011, 05:00 AM)D3AD UPR1S1NG Wrote: Well the player was supposed to unlock the door to the cell which is working and then there is a locked door next to a open one but I wanted the crashing sound to play from the locked one using the script which I have got working although I cant find out how to stop the player from staring at the door making the rest of the level awkward

You add this:
AddTimer("", [however long you want the player to stare], "PlayerStareStop");
Also add this for the function that goes with the timer:
void PlayerStareStop(string &in asTimer)
{
StopPlayerLookAt();
}

Alright thanks Big Grin I'll let you know if it works Smile
(04-22-2011, 05:08 AM)Kyle Wrote:
(04-22-2011, 05:00 AM)D3AD UPR1S1NG Wrote: Well the player was supposed to unlock the door to the cell which is working and then there is a locked door next to a open one but I wanted the crashing sound to play from the locked one using the script which I have got working although I cant find out how to stop the player from staring at the door making the rest of the level awkward

You add this:
AddTimer("", [however long you want the player to stare], "PlayerStareStop");
Also add this for the function that goes with the timer:
void PlayerStareStop(string &in asTimer)
{
StopPlayerLookAt();
}

Still hasn't worked he still stares at that door Sad
(This post was last modified: 04-22-2011, 05:34 AM by D3AD UPR1S1NG.)
04-22-2011, 05:11 AM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#6
RE: Problems Trying To Script

It's alright managed to get it working thanks anyway Smile
04-22-2011, 02:01 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#7
RE: Problems Trying To Script

No problem.

04-22-2011, 02:36 PM
Find




Users browsing this thread: 2 Guest(s)