Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Use crowbar to open a door
Author Message
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #21
RE: [Tutorial] Use crowbar to open a door
(05-15-2012 07:18 AM)SilentStriker Wrote:  Either I'm just a bit slow today or I don't really understand what you meen (my nativ language is swedish)

I know what everything in the code does but I guess I'm not showing it properly?

Oh, I missed that you commented the code and removed the asTimer. Still, I've underlined some mysterious things for you:


//Makes it able for the Crowbar_joint to collide with the area in my case the area is named BreakDoor

//Calls a timer that places the crowbar in the door frame.
AddTimer(asEntity, 0.2, "TimerSwitchShovel");

//Remove callback incase player never touched door
SetEntityPlayerInteractCallback("NAMEOFDOOR", "", true);
SetEntityPlayerInteractCallback("NAMEOFTHEAREA", "", true);


}

//The timer we called before
void TimerSwitchShovel(string &in asTimer)
{
//Plays the sound of the player putting the crowbar in the doorframe
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", "Player", 0, false);


//Sets your crowbar_dyn active
SetEntityActive("NAMEOFYOURCROWBAR_DYN", true);

Noob scripting tutorial: From Noob to Pro

05-15-2012 09:16 AM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #22
RE: [Tutorial] Use crowbar to open a door
(05-15-2012 09:16 AM)Cranky Old Man Wrote:  
(05-15-2012 07:18 AM)SilentStriker Wrote:  Either I'm just a bit slow today or I don't really understand what you meen (my nativ language is swedish)

I know what everything in the code does but I guess I'm not showing it properly?

Oh, I missed that you commented the code and removed the asTimer. Still, I've underlined some mysterious things for you:


//Makes it able for the Crowbar_joint to collide with the area in my case the area is named BreakDoor

//Calls a timer that places the crowbar in the door frame.
AddTimer(asEntity, 0.2, "TimerSwitchShovel");

//Remove callback incase player never touched door
SetEntityPlayerInteractCallback("NAMEOFDOOR", "", true);
SetEntityPlayerInteractCallback("NAMEOFTHEAREA", "", true);


}

//The timer we called before
void TimerSwitchShovel(string &in asTimer)
{
//Plays the sound of the player putting the crowbar in the doorframe
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", "Player", 0, false);


//Sets your crowbar_dyn active
SetEntityActive("NAMEOFYOURCROWBAR_DYN", true);
//Makes it able for the Crowbar_joint to collide with the area in my case the area is named BreakDoor

BreakDoor is what I call the area the crowbar collides with that calls the function CollideAreaBreakDoor


//Calls a timer that places the crowbar in the door frame.
AddTimer(asEntity, 0.2, "TimerSwitchShovel");


hmm never thought about that, will be changed Smile


//Remove callback incase player never touched door
SetEntityPlayerInteractCallback("NAMEOFDOOR", "", true);
SetEntityPlayerInteractCallback("NAMEOFTHEAREA", "", true);


Doesn't need to be there, changed now Smile

//The timer we called before
void TimerSwitchShovel(string &in asTimer)
{
//Plays the sound of the player putting the crowbar in the doorframe
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", "Player", 0, false);


Changed


//Sets your crowbar_dyn active
SetEntityActive("NAMEOFYOURCROWBAR_DYN", true);


Changed with a better description (I think?)

05-15-2012 03:03 PM
Find all posts by this user Quote this message in a reply
VeNoMzTeamHysterical Offline
Member

Posts: 142
Joined: Dec 2012
Reputation: 0
Post: #23
RE: [Tutorial] Use crowbar to open a door
Can someone make a video tutorial of this?

would be really nice!

i still cant figher out what to do i unactivated the 2 crowbars but which one do you have to pickup then?
12-15-2012 07:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)