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 Need help with Crowbar on door
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Need help with Crowbar on door

I have a tip for you. If you are using Notepad ++. Go over to language and change it to C++. You will see all the errors you are making ALOT easier.


Quote:void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
AddEntityCollideCallback("Player", "monsterspawn_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("servant_brute_1", "servant_grunt_1_remove", "RemoveMonster", true, 1);
AddUseItemCallback("", "crowbar_1", "mansion_1", "CrowbarOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brue_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
}
void RemoveMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
}
void CrowbarOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("crowbar_1");
}

void OnEnter()
{

}

void OnLeave()
{
}
I haven't checked whether or not you want to have the animation of the crowbar. Or if it just disappears and the door opens. Either way; I fixed up some of the errors. You are making some mistakes by not closing your strings with another ". Or not even doing them at all sometimes. Do what I said with the notepad and try to figure out the problem from there. It is alot easier than using the regular notepad. Smile

12-30-2011, 05:58 AM
Find


Messages In This Thread
Need help with Crowbar on door - by jessehmusic - 12-30-2011, 04:10 AM
RE: Need help with Crowbar on door - by flamez3 - 12-30-2011, 05:58 AM
RE: Need help with Crowbar on door - by flamez3 - 12-30-2011, 04:04 PM
RE: Need help with Crowbar on door - by flamez3 - 12-31-2011, 02:06 AM



Users browsing this thread: 5 Guest(s)