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 Help
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#8
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.
07-13-2011, 08:02 PM
Find


Messages In This Thread
Script Help - by GreyFox - 07-12-2011, 05:13 PM
RE: Script Help - by Zypherzemus - 07-12-2011, 07:17 PM
RE: Script Help - by GreyFox - 07-12-2011, 07:26 PM
RE: Script Help - by Zypherzemus - 07-12-2011, 08:38 PM
RE: Script Help - by GreyFox - 07-12-2011, 09:02 PM
RE: Script Help - by Kyle - 07-12-2011, 09:05 PM
RE: Script Help - by GreyFox - 07-13-2011, 07:05 PM
RE: Script Help - by Zypherzemus - 07-13-2011, 08:02 PM
RE: Script Help - by GreyFox - 07-13-2011, 08:13 PM
RE: Script Help - by ferryadams11 - 07-13-2011, 08:24 PM
RE: Script Help - by GreyFox - 07-13-2011, 09:16 PM



Users browsing this thread: 2 Guest(s)