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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Question About Crowbar Puzzle
Author Message
WatzUpzPeepz Offline
Member

Posts: 106
Joined: May 2011
Reputation: 0
Post: #1
Another Question About Crowbar Puzzle

Okay, I know I am really annoying just asking the community on this forum questions on scripting,I'm trying to do my part too by helping with as many questions as I can,of course I can't help with questions about scripting but I can help with story development and scares if anyone needs help,I feel as if I'm using the community. lol
If anyone needs help with a part of a story I can offer some help.
But anyway,here is the question I'm asking:
I took the script from Daniel's room for the crowbar and its not completely working,It places the crowbar but doesnt unlock the door or break the crowbar when I move it.
I have named all the areas and the door the same or is there something missing?
void OnStart()
{
AddUseItemCallback("", "key1", "door3", "KeyOnClosetDoor", true);
AddEntityCollideCallback("Player", "DoorSlamArea", "CollideDoorSlam", true, 1);
AddUseItemCallback("", "key2", "door2", "KeyOnCellarDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "mansion_1","UseCrowbarOnDoor", true);
AddUseItemCallback("crowbaronframe", "crowbar_1", "AreaUseCrowbar", "UseCrowbarOnDoor", true);
}

void KeyOnClosetDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door3", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door3", 0.0f, true);
}

void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("door3", 10, 50, "");
AddTimer("", 0.5f, "TimerSlamDoor");
SetEntityActive("ParticleSystem_1" , true);
}
void TimerSlamDoor(string &in asTimer)
{
SetSwingDoorClosed("door3", true, true);
GiveSanityDamage(4.0f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddTimer("", 2.0f, "TimerStopLook");
SetEntityActive("armour2", true);
SetEntityActive("armour1", false);
}

void TimerStopLook(string &in asTimer)
{
StopPlayerLookAt();
}

void KeyOnCellarDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door2", 0.0f, true);
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    AddTimer(asEntity, 0.2, "TimerSwitchShovel");    
    PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
    
    //Remove callback incase player never touched door
    SetEntityPlayerInteractCallback("mansion_1", "", true);
    SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true);
    
    RemoveItem(asItem);
}
void TimerSwitchShovel(string &in asTimer)
{
    PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", asTimer, 0, false);
    
    SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
    GiveSanityBoostSmall();
    
    PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
    
    SetSwingDoorLocked("mansion_1", false, false);
    SetSwingDoorDisableAutoClose("mansion_1", true);
    SetSwingDoorClosed("mansion_1", false,false);
    
    PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
    AddPropImpulse("mansion_1", -3, 0, 0, "world");
    
    SetEntityActive("crowbar_joint_1", false);
    SetEntityActive("crowbar_dyn_1", true);
    
    AddTimer("pushdoor", 0.1, "TimerPushDoor");        
    
    AddDebugMessage("Break door!", false);    
}
void TimerPushDoor(string &in asTimer)
{
    AddPropImpulse("mansion_1", -1, 2, -4, "world");
    AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}

void TimerDoorCanClose(string &in asTimer)
{
    SetSwingDoorDisableAutoClose("mansion_1", false);
}

Thanks reading!
If you need help with a small part of your story I can help. Smile

05-25-2011 10:36 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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