Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Use crowbar to open a door
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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


Messages In This Thread
RE: [Tutorial] Use crowbar to open a door - by SilentStriker - 05-15-2012, 03:03 PM



Users browsing this thread: 1 Guest(s)