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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Meanings of Error Messages
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#3
RE: Meanings of Error Messages

Bah. I suppose so. I just renamed things from my post to here. Though thanks on the light, I missed that.
There are going to be some functions that are EntityInteractCallback through the editor.
///////////////////
void OnStart()
{
    AddUseItemCallback("", "Lockpick", "StudyDoor", "UnlockStudy", true);
    AddUseItemCallback("", "Lockpick", "Chest", "UnlockChest", false);
    SetLeverStuckState("Chest", -1, true);
    SetLocalVarInt("HasShirt", 0);
    SetLocalVarInt("HasGem", 0);
    PlayMusic("20_amb.ogg", true, 1, 5, 1, true);
}
void UnlockStudy(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("StudyDoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "StudyDoor", 0, false);
    SetMessage("ScreenText", "BrokenPick", 5);
}
void UnlockChest(string &in asItem, string &in asEntity)
{
    SetLeverStuckState("MedChest", 0, true);
    PlaySoundAtEntity("", "unlock_door", "Chest", 0, false);
}
void WearShirt(string &in asEntity)
{
    SetEntityActive("Shirt", false);
    PlaySoundAtEntity("", "pick_generic", "Shirt", 0, false);
    AddLocalVarInt("HasShirt", 1);
    
}
void BedroomDoorStatus(string &in asEntity)
{
    if (GetLocalVarInt("HasShirt") == 1) && (GetLocalVarInt("HasGem") == 1)
    {
        SetSwingDoorLocked("BedroomDoor", false);
    }
    if (GetLocalVarInt("HasShirt") == 1) && (GetLocalVarInt("HasGem" == 0))
    {
        SetMessage("OblivScreenText", "ShirtNoGem", 5);
    }
    if (GetLocalVarInt("HasShirt") == 0) && (GetLocalVarInt("HasGem" == 1))
    {
        SetMessage("OblivScreenText", "GemNoShirt", 5);
    }
}
void GemPickup(string &in asEntity)
{
    StartEffectFlash(0.5, 1, 0.5);
    PlaySoundAtEntity("", "insanity_imageflash.snt", "Player", 0, false);
    StopMusic(0, 1);
    PlayMusic("03_amb.ogg", true, 1, 3, 0, true);
    AddLocalVarInt("HasGem", 1);
}
void Gem2Pickup(string &in asEntity)
{
    AddEntityCollideCallback("Player", "FallBody", "Corpsefall", 1, true);
    StartEffectFlash(0.5, 1, 0.5);
    PlaySoundAtEntity("", "insanity_imageflash.snt", "Player", 0, false);
    StopMusic(0, 0);
    PlayMusic("17_amb.ogg", true, 1, 3, 1, true);
}
void Corpsefall(string &in asParent, string &in asChild, int alState)
{
    StartScreenShake(0.3, 5, 2, 1);
    PlaySoundAtEntity("", "21_intro_scream.snt", "Player", 0, false);
    SetEntityActive("corpse_male_*", true);
    GiveSanityDamage(25, true);
/////////////////////////////////
//Creates other effects outside the room.
    SetEntityActive("mansion_3", false);
    SetEntityActive("mansion_off_hinges_1", true);
    SetEntityActive("Slime*", true);
    SetLightVisible("StatueEye*", true);
    AddEntityCollideCallback("Player", "DisableLight", "StatueEyeRemove", 1, true);
}
void Daddy(string &in asEntity)
{
    SetMessage("ScreenText", "Father", 4);
    GiveSanityDamage(90, true);
    StopMusic(0, 1);
    PlayMusic("ui_terror_meter.ogg", true, 3, 1, 2, true);
    AddTimer("closet1", 4, "ClosetScare");
    AddTimer("closet2", 6, "ClosetScare");
    AddTimer("closet3", 8, "ClosetScare");
    AddTimer("closet4", 10, "ClosetScare");
    SetEntityActive("Painting*", false);
    SetEntityActive("Map*", false);
    SetEntityActive("MechSketch*", false);
    SetEntityActive("InsanePainting*", true);
    SetEntityActive("Rust*", true);
    SetEntityActive("mansion_2", false);
    SetEntityActive("PrisonExit", true);
}
void ClosetScare(string &in asTimer)
{
    if(timer == "closet1")
    {
        PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
        CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
        AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
        AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
        StartPlayerLookAt("DustArea", 1, 1, "");
    }
    if(timer == "closet2")
    {
        PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
        CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
        AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
        AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
        StopPlayerLookAt();
    }
    if(timer == "closet3")
    {
        PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
        CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
        AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
        AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
    }
    if (timer == "closet4")
    {
        PlaySoundAtEntity("", "break_wood.snt", "DustArea", 0, false);
        CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "DustArea", false);
        SetSwingDoorLocked("cabinet_nice_2*", false, false);
        AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
        AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
        AddEntityCollideCallback("Player", "EndLightArea", "EndLight", 1, true);
    }
}
void StatueEyeRemove(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("StatueEye*", false);
}
void EndLight(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("HallLight", true);
}

(This post was last modified: 08-22-2011, 03:39 PM by Obliviator27.)
08-22-2011, 03:37 PM
Find


Messages In This Thread
Meanings of Error Messages - by Obliviator27 - 08-22-2011, 03:12 PM
RE: Meanings of Error Messages - by MrBigzy - 08-22-2011, 03:33 PM
RE: Meanings of Error Messages - by Obliviator27 - 08-22-2011, 03:37 PM
RE: Meanings of Error Messages - by Kyle - 08-22-2011, 03:53 PM
RE: Meanings of Error Messages - by Apjjm - 08-22-2011, 03:59 PM
RE: Meanings of Error Messages - by Obliviator27 - 08-22-2011, 04:01 PM



Users browsing this thread: 1 Guest(s)