09-23-2014, 05:33 AM
Hi there, I was working on a custom story and I was wondering how I would make the screen shake, sort of like when the shadow roars. I used the wiki and made this code, however, it doesn't work when run. Any suggestions would be really appreciated. Here's what I've got so far:
PHP Code:
void OnStart()
{
AddUseItemCallback("OpenDoor", "librarykey", "level_wood_3", "UnlockLevelDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "ShakeFunction", true, 1);
}
void OnEnter()
{
PlayMusic("02_amb_safe.ogg", true, 0.9, 1.0, 1, true);
}
void OnLeave()
{
StopMusic(1 , 1);
}
void UnlockLevelDoor(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false);
AddPlayerSanity(100);
RemoveItem("librarykey");
CompleteQuest("", "LibraryDoorQuest");
}
void memento(string &in asEntity)
{
AddQuest("", "LibraryDoorQuest");
}
void ShakeFunction()
{
StartScreenShake(1,2,1,4);
}