Zypherzemus
Member
Posts: 94
Threads: 7
Joined: Jul 2011
Reputation:
0
|
RE: Script Help
(07-13-2011, 07:05 PM)GreyFox Wrote: Okay I tried moving around my script so my Monster activate and all that is at the start but now i get the same error but for Line 12, 1 which once again is {.
I don't know what to do. Looking at my script I noticed all the SetXXXXXXXX Commands are after the Void Commands except this one is that the problem?
////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Mansion_5", "MonsterActivate", true);
}
void MonsterActivate(string &in Entity)
{
SetEntityActive("Frank", true);
}
{
AddUseItemCallback("", "LockedDoorKey_1", "LockedDoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Scare_1", "CollideScare_1", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
RemoveItem("LockedDoorKey");
}
void CollideScare_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("ScareDoor_1", true, true);
GiveSanityDamage(20, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
///////////////////////////
//Run when leaving map
void OnLeave()
{
}
Thank you Once again
-Grey Fox
Your "AddUseItemCallback" and "AddEntityCollideCallback" both belong in the "void OnStart()"
like so:
////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Mansion_5", "MonsterActivate", true);
AddUseItemCallback("", "LockedDoorKey_1", "LockedDoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Scare_1", "CollideScare_1", true, 1);
}
void MonsterActivate(string &in Entity)
{
SetEntityActive("Frank", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
RemoveItem("LockedDoorKey");
}
void CollideScare_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("ScareDoor_1", true, true);
GiveSanityDamage(20, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
///////////////////////////
//Run when leaving map
void OnLeave()
{
}
and also, "GiveSanityDamage" should have a decimal number instead of a whole number.
|
|