Alrighty! I will report back!
So, I tried that out, and for some reason, I enter the second map, and I get the unexpected end of code error... which is odd considering these are the last lines of code.
void OnLeave ()
{
}
Here is the whole thing:
////////////////////////////
// Run when entering map
void OnEnter ()
{
AddUseItemCallback("", "attickey", "atticdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("atticdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "atticdoor", 0, false);
RemoveItem("attickey");
{
AddEntityCollideCallback("Player", "monster_death", "MonsterFunc1", true, 1);
}
the {
AddEntityCollideCallback("Player", "monster_death", "MonsterFunc1", true, 1);
} you have to put this in OnStart()/OnEnter(). Now it isn't in any void to call.
MrCookieh is right, the AddEntityCollideCallback needs to be in OnEnter, also there are a few more errors below,such as open brackets where close brackets should be, I'll post a fixed version for you. Also, you dont have the
void StartCredits(string &in asName , int &in alCount)
{
StartCredits( , , , );
}
without that when you die you will just respawn.
ps: instead of SetPlayerActive(false);
- which might lower the immersion, because people will know it's a 'scripted death'
try instead SetPlayerMoveSpeedMul(0.xf);
- where x is any number you would like, also try
- SetPlayerJumpDisabled(true);
if the player can escape the monster though, stick with SetPlayerActive(false);