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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crowbar / Door
H. Filipe Offline
Junior Member

Posts: 22
Threads: 6
Joined: Jun 2011
Reputation: 0
#1
Question  Crowbar / Door

i don't know why when i put the crowbar in the door he breaks himself (the door unlock but the idea is interact with the crowbar)

My script:

////////////////////////////
// Run when enter map
void OnEnter()
{
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "door_2","UseCrowbarOnDoor", true);
AddUseItemCallback("crowbaronframe", "crowbar_1", "AreaUseCrowbar", "UseCrowbarOnDoor", true);
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    AddTimer(asEntity, 0.2, "TimerSwitchShovel");    
    PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
    
    SetEntityPlayerInteractCallback("door_2", "", 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("door_2", false, false);
    SetSwingDoorDisableAutoClose("porta_2", true);
    SetSwingDoorClosed("door_2", false,false);
    
    PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
    
    CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
    AddPropImpulse("door_2", -3, 0, 0, "world");
    
    SetEntityActive("crowbar_joint_1", false);
    SetEntityActive("crowbar_dyn_1", true);
    
    AddTimer("pushdoor", 0.1, "TimerPushDoor");    
}

void TimerPushDoor(string &in asTimer)
{
    AddPropImpulse("door_2", -1, 2, -4, "world");
    AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}

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

E-mail: postal2DeusEx@hotmail.com
Xbox/Live Account: HUGO BOLT 0GTA0

Working on a Custom Story :)
(This post was last modified: 07-05-2011, 05:41 PM by H. Filipe.)
07-05-2011, 05:41 PM
Find




Users browsing this thread: 1 Guest(s)