Mementos WILL WORK NOW! (completed)
ok so i have been working on a custom story for days now and for a whole day i was trying to figure out how to add mementos. i have watched 2 tutorial videos and i still cant do it. when i went to mudbill on one of his vids he replied once and did not reply to me when i asked him why the mementos wont work. maybe its so obvious why it wont work and thats why he stopped lol. so now i had to make an account on the forums as a last resort. my mementos wont work. i followed mudbills tutorial and it wont work. i looked through my whole script and no errors i see. the script must be working because the game does not crash but when i interact with the thing that will give a memento it will not. it refuses it. here is my WHOLE code line for the level. it has a key and crowbar function and they both work. but when i try to make a memento it wont work. i think it has something to do with putting the parts in incorrect places? if anyone looks through this and there are no errors in the code then i need to change something in the editor.
void OnStart()
{
AddUseItemCallback("", "Crowbar Used 2", "Grate", "UseCrowbarOnGrate", true);
AddEntityCollideCallback("Crowbar Joint 1", "GrateBreak", "BreakGrate", true, 1);
}
void UseCrowbarOnGrate(string &in asItem, string &in asEntity)
{
RemoveItem(asItem);
PlaySoundAtEntity("", "player_crouch.snt","Player", 0.05, false);
AddTimer(asEntity, 0.2, "TimerPlaceCrowbar");
}
void TimerPlaceCrowbar(string &in asTimer)
{
SetEntityActive("Crowbar Joint 1", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", asTimer, 0, false);
}
void BreakGrate(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Crowbar Joint 1", false);
SetEntityActive("Crowbar Used 1", true);
SetSwingDoorLocked("Grate", false, false);
SetSwingDoorClosed("Grate", false, false);
SetSwingDoorDisableAutoClose("Grate", true);
AddPropImpulse("Grate", 0, 9, 0, "world");
CreateParticleSystemAtEntity("", "ps_hit_metal.ps", "GrateDoorEffect", false);
GiveSanityBoostSmall();
PlaySoundAtEntity("", "close_gate.ps", "GrateDoorEffect", 0, false);
AddTimer("", 0.1, "TimerPushDoor");
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("Grate", -9, 9, 0, "world");
AddTimer("", 1.1, "TimerDoorCanClose");
}
void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("Grate", false);
AddUseItemCallback("", "Transept R Key", "Transept R", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "GrateLockedMem", "EventQuest", true, 1);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Transept R", false);
PlaySoundAtEntity("", "unlock_door.snt", "Transept R", 0, false);
RemoveItem(asItem);
}
void EventQuest(string &in asParent, string &in asChild, int alstate)
{
AddQuest("GrateLockedMem", "GrateLock");
}
if anyone can figure whats wrong with this i will credit at the end of my story or somethin idk. i really just want mementos. i almost just gave up on my story because it just wont work. the bottom of the script it the memento part.
(This post was last modified: 07-28-2020, 02:49 PM by MaxTheOne.)
|