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
Hammer animation
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: Hammer animation

Probably not the most efficient way of doing it, but here's my script.

void OnStart()
{
AddUseItemCallback("breaklock", "stone_hammer_chipper", "padlock_1", "BreakLock", true);
}

void BreakLock(string &in asItem, string &in asEntity)
{
SetEntityActive("stone_hammer_move_1", true);
SetEntityActive("stone_chipper_move_1", true);
CreateParticleSystemAtEntity("cloud", "ps_dust_drilling.ps", "padlock_1", false);
CreateParticleSystemAtEntity("cloud", "ps_enemy_disappear_per_bone_small.ps", "padlock_1", false);
AddTimer("removelock", 0.7f, "RemoveLock");
AddTimer("bangbang", 0.2f, "bangbang");
AddTimer("removehammer", 0.8f, "removehammer");
SetMoveObjectState("stone_hammer_move_1", 0.2f);
SetMoveObjectState("stone_chipper_move_1", 0.2f);
PlayGuiSound("15_hammer1.ogg", 1);
CompleteQuest("opencellar", "OpenCellar");
}

void RemoveLock(string &in asTimer)
{
SetPropActiveAndFade("padlock_1", false, 1.0f);
SetSwingDoorLocked("CellarToWaterPart", false, true);
CreateParticleSystemAtEntity("hit", "ps_hit_metal.ps", "padlock_1", false);
CreateParticleSystemAtEntity("dust", "ps_break_wood_pulley_blocker.ps", "padlock_1", false);
}

void bangbang (string &in asTimer)
{
SetMoveObjectState("stone_hammer_move_1", -0.2f);
SetMoveObjectState("stone_chipper_move_1", -0.2f);
PlayGuiSound("15_hammer2.ogg", 1);
}

Various timers run commands at different times and plays sounds to "break" the lock. Some particles make it more realistic. There's probably a better way to do it, but I couldn't find any information about it so I experimented with it and my result looks nice Smile
07-12-2011, 12:50 AM
Find


Messages In This Thread
Hammer animation - by DRedshot - 07-12-2011, 12:05 AM
RE: Hammer animation - by Roenlond - 07-12-2011, 12:50 AM
RE: Hammer animation - by DRedshot - 07-12-2011, 10:38 PM
RE: Hammer animation - by Roenlond - 07-12-2011, 10:47 PM
RE: Hammer animation - by DRedshot - 07-12-2011, 10:51 PM
RE: Hammer animation - by Roenlond - 07-12-2011, 10:58 PM
RE: Hammer animation - by DRedshot - 07-12-2011, 11:05 PM
RE: Hammer animation - by Kyle - 07-12-2011, 11:09 PM
RE: Hammer animation - by DRedshot - 07-12-2011, 11:12 PM
RE: Hammer animation - by DRedshot - 07-13-2011, 12:25 AM
RE: Hammer animation - by Roenlond - 07-13-2011, 11:04 AM
RE: Hammer animation - by DRedshot - 07-13-2011, 01:22 PM



Users browsing this thread: 1 Guest(s)