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
Making Hammer and Chipper break open door?
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Making Hammer and Chipper break open door?

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("", "HammerChipper", "RustyLock", "DoorUnlockAnim", true);
}

void DoorUnlockAnim(string &in asItem, string &in asEntity)
{
SetPropHealth("RustyLock", 0.0f); //RustyLock is the Lock.
SetPropHealth("DoorName", 0.0f); //Door is hit with damage too as you explained it. Change doorname to what ever your door's name is.
SetSwingDoorLocked("DoorName", false, false); //Change doorname to whatever your door's name is.
PlaySoundAtEntity("", "LOCKBREAK.snt", "Player", 0.0f, false); //Change LOCKBREAK.snt to the sound of a lock broken with the extension .snt.
SetEntityActive("Hammer", true); //Hammer.
SetEntityActive("Chipper", true); //Chipper.
AddTimer("", 1.4f, "HammerChipperMove");
}

void HammerChipperMove(string &in asTimer)
{
SetMoveObjectState("Hammer", 0.40);
SetMoveObjectState("Chipper", 0.40);
AddTimer("", 1.1f, "HammerChipperMove2");
}

void HammerChipperMove2(string &in asTimer)
{
SetMoveObjectState("Hammer", 0.1f);
SetMoveObjectState("Chipper", 0.1f);
AddTimer("", 0.5f, "TimerLoop");
}

void TimerLoop(string &in asTimer)
{
AddTimer("", 0.2f, "HammerChipperMove");
AddTimer("", 0.3f, "HammerChipperMove2");
AddTimer("", 2.4f, "HammerChipperEnd"); //Change 2.4f to how long you want the smashing process to endure.
}

void HammerChipperEnd(string &in asTimer)
{
SetEntityActive("Hammer", false);
SetEntityActive("Chipper", false);
RemoveTimer("HammerChipperMove");
RemoveTimer("HammerChipperMove2");
} 
Please note that I've wrote this from scratch - meaning that some errors must be in there. Just try it out.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-21-2013, 01:59 PM
Find


Messages In This Thread
RE: Making Hammer and Chipper break open door? - by PutraenusAlivius - 04-21-2013, 01:59 PM



Users browsing this thread: 1 Guest(s)