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
Script - Piano Music
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#12
RE: Script - Piano Music

void OnStart()
{
    FadeOut(0.01f);
    AddTimer("", 2.1f, "awake2");
    AddTimer("", 5.0f, "awake");
    FadePlayerRollTo(90, 1, 2);
    MovePlayerHeadPos(0, -1.5f, 0, 1, 0.1f);
    
    PlayMusic("00_event_gallery", true, 1, 0.1, 10, false);
    StopMusic(1.0f, 1);
    
    PreloadSound("general_piano01.snt");
    SetEntityPlayerInteractCallback("ScriptArea_001", "PianoFunc", false);
    
    AddEntityCollideCallback("Player", "Script001", "Script001", true, 1);
    AddEntityCollideCallback("Player", "kappa33", "kappa33", true, 1);
    AddUseItemCallback("", "key01", "door01", "UseKeyOnDoor", true);
    AddUseItemCallback("", "key02", "door02", "UseKeyOnDoor", true);
    
    
    AddEntityCollideCallback("Player", "ScryptArea1_1", "Scrypt2", true, 1);
    AddEntityCollideCallback("Player", "Jumpperro", "Jumpscare2", true, 1);
    AddEntityCollideCallback("Player", "jumperro022", "Jumpscare3", true, 1);
    AddUseItemCallback("", "KeyDesc01", "level_hub_1", "FUNCTION", true);
    }
    
    
    
    
void PianoFunc(string &in asEntity)
{
    StopSound("PianoSound", 2.5f);
    PlaySoundAtEntity("PianoSound", "general_piano01.snt", "Script001", 0.5f, false);
}

    
    void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
        SetSwingDoorLocked(asEntity, false, true);
        PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
        RemoveItem(asItem);
}
    
    

    
    void FUNCTION(string &in item, string &in door)
    {
    SetLevelDoorLocked("level_hub_1", false);
    PlayGuiSound("unlock_door.snt", 100);
    RemoveItem("KeyDesc01");
    }
    
    
void Scrypt2(string &in asParent, string &in asChild, int alState)
{
SetMessage("MessageCategory2", "MessageEntry2", 0);
}

void kappa33(string &in asParent, string &in asChild, int alState)
{
SetMessage("MessageCategory3", "MessageEntry3", 0);
}

void Jumpscare2(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("15_the_big_scream.snt", 1.0f);
SetEntityActive("portret1", true);
SetEntityActive("portret2", true);
SetEntityActive("portret3", true);
SetEntityActive("portret4", true);
SetEntityActive("portret5", true);
SetEntityActive("portret6", true);
SetEntityActive("portret7", true);

SetEntityActive("redlamp1", true);
SetEntityActive("redlamp2", true);
SetEntityActive("redlamp3", true);
SetEntityActive("redlamp4", true);
SetEntityActive("redlamp5", true);
SetEntityActive("redlamp6", true);
SetEntityActive("redlamp7", true);
SetEntityActive("redlamp8", true);
AddTimer("", 2.5f, "JumpscareEntity_Gone");


}

void Jumpscare3(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("15_body_impact.snt", 1.0f);
SetEntityActive("rycerz1", true);
SetEntityActive("rycerz2", true);
SetEntityActive("rycerz3", true);
SetEntityActive("rycerz4", true);
SetEntityActive("rycerz5", true);
SetEntityActive("rycerz6", true);
SetEntityActive("rycerz7", true);
SetEntityActive("rycerz8", true);
AddTimer("", 2.5f, "JumpscareEntity_Gone");
}


void awake2(string asTimer)
{
    FadeIn(5.0f);
}

void awake(string asTimer)
{
    FadePlayerRollTo(0, 1, 2);
    MovePlayerHeadPos(0, 0.0f, 0, 0.5, 0.1f);
}

When i launch game nothing but when i start in CS music in piano not work and music in intro play the infinity.
No, this is not error message


I want play a music when my character wake up with floor. And stop this music after 15 second, would not play in infinity.

Piano similarly, when my character touch script area it has piano music in room which just we had the intention to enter. And too stop music, when music comes to an end.
02-27-2016, 03:50 PM
Find


Messages In This Thread
Script - Piano Music - by Abihishi - 02-26-2016, 02:47 PM
RE: Script - Piano Music - by Spelos - 02-26-2016, 03:09 PM
RE: Script - Piano Music - by Abihishi - 02-26-2016, 04:47 PM
RE: Script - Piano Music - by Spelos - 02-26-2016, 05:51 PM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 10:32 AM
RE: Script - Piano Music - by Spelos - 02-27-2016, 11:03 AM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 11:55 AM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 01:19 PM
RE: Script - Piano Music - by Spelos - 02-27-2016, 01:32 PM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 02:54 PM
RE: Script - Piano Music - by Spelos - 02-27-2016, 03:16 PM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 03:50 PM
RE: Script - Piano Music - by Spelos - 02-27-2016, 03:58 PM
RE: Script - Piano Music - by Abihishi - 02-27-2016, 06:37 PM
RE: Script - Piano Music - by Spelos - 02-27-2016, 07:21 PM
RE: Script - Piano Music - by Abihishi - 02-28-2016, 12:11 PM
RE: Script - Piano Music - by Spelos - 02-28-2016, 12:45 PM
RE: Script - Piano Music - by Abihishi - 02-28-2016, 12:51 PM
RE: Script - Piano Music - by Spelos - 02-28-2016, 01:04 PM
RE: Script - Piano Music - by Mudbill - 02-28-2016, 06:02 PM
RE: Script - Piano Music - by Spelos - 02-28-2016, 08:12 PM
RE: Script - Piano Music - by Abihishi - 02-29-2016, 05:35 PM
RE: Script - Piano Music - by Spelos - 02-29-2016, 07:41 PM
RE: Script - Piano Music - by Abihishi - 02-29-2016, 08:11 PM
RE: Script - Piano Music - by Abihishi - 03-01-2016, 05:14 PM
RE: Script - Piano Music - by Spelos - 03-01-2016, 05:19 PM
RE: Script - Piano Music - by Abihishi - 03-01-2016, 05:44 PM
RE: Script - Piano Music - by Spelos - 03-01-2016, 05:54 PM
RE: Script - Piano Music - by Abihishi - 03-01-2016, 06:53 PM



Users browsing this thread: 2 Guest(s)