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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crowbar Script
Author Message
TheBaker Offline
Junior Member

Posts: 17
Joined: Aug 2011
Reputation: 0
Post: #1
Crowbar Script
I want to open a door with a crowbar like in the guest room and I've been trying to copy the script and the areas in the editor. I've also searched in the forum but I still can't get it to work and I hope you guys can help.

This is what my script looks like now and I got this from another thread in the forum.

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "CrowbarAppear", true, 1);
AddEntityCollideCallback("Crowbar_1", "mansion_2", "CrowbarAppear", true, 1);

AddEntityCollideCallback("Crowbar_joint", "break", "BreakDoor", true, 1);

void CrowbarAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Crowbar_joint", true);
RemoveItem("Crowbar_1");
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_2", false, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
PlaySoundAtEntity("", "break_wood", "BreakEffect", 0.0, false);
SetEntityActive("Crowbar_joint", false);
SetEntityActive("crowbar", true);
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

So if it's possible please copy my script and repost it as it should be and of course tell me what's wrong with it Smile
Thanks in advance!
I saw that I missed one of the"}" in the beggining of the script but it still wont work, just letting you know.
(This post was last modified: 08-26-2011 11:57 PM by TheBaker.)
08-26-2011 11:54 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Crowbar Script - TheBaker - 08-26-2011 11:54 PM
RE: Crowbar Script - Prelauncher - 08-27-2011, 12:32 AM
RE: Crowbar Script - TheBaker - 08-27-2011, 10:45 AM
RE: Crowbar Script - TheBaker - 08-27-2011, 12:35 PM



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