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
Multiple use of a void OnStart, need help D:
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#13
RE: Multiple use of a void OnStart, need help D:

void OnStart()
{
AddUseItemCallback("", "crowbar_1", "mansiondoor1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_Joint", "CollideAreaBreakDoor", true, 1);
}


void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("mansiondoor1", false, true);
AddPropImpulse("mansiondoor1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("mansiondoor1", true);
SetSwingDoorClosed("mansiondoor1", false, false);
SetMoveObjectState("mansiondoor1", 1);
PlaySoundAtEntity("","break_wood_metal", "ScriptArea_Dust", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "ScriptArea_Dust", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

void Scare()
{
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
}


void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(300000, 0, 0, false);
}


void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansiondoor1", true, true);
SetSwingDoorLocked("mansiondoor1", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_slam", 0, false);
}


Attached Files
.png   push area.png (Size: 345.65 KB / Downloads: 118)
.png   doorslam.png (Size: 461.4 KB / Downloads: 120)
.png   door.png (Size: 444.93 KB / Downloads: 126)
03-16-2013, 04:41 PM
Find


Messages In This Thread
RE: Multiple use of a void OnStart, need help D: - by KeysOfMyMind - 03-16-2013, 04:41 PM



Users browsing this thread: 1 Guest(s)