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
New to this, having some trouble
DeAngelo Offline
Senior Member

Posts: 263
Threads: 26
Joined: Feb 2013
Reputation: 11
#25
RE: New to this, having some trouble

Blargh, and today's session was going so well. I've made a lot of progress and I'm happy with the way things are looking. Alas, I have an issue. I have a room with 11 doors, each are fake. The player is going crazy at this part and I want each time he clicks on a door, it disappears, then once all of them are gone, a part of the floor disappears. I'm trying to use a variable script to do this but when I try to load the game I get a Unexpected End of File error. This is my first time dealing with variables so I'm probably doing something wrong. Here's my script. The stuff giving me issues is near the bottom, but I've included the whole script for completion sake.

PHP Code: (Select All)
void OnStart() 
{ 
    
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
    
AddEntityCollideCallback("Player", "PlayerCollide_Spotlight", "SpotlightOn", true, 1);
    
AddEntityCollideCallback("Player", "PlayerCollide_SpotlightOff", "SpotlightOff", true, 1);     
    
AddUseItemCallback("", "Key_AlcDoor", "AlcDoor", "UsedKeyOnAlcDoor", true);    
    
AddEntityCollideCallback("SlantLadder", "SlantLadderArea", "ActivateLadder", true, 1);
    
SetEntityCallbackFunc("Cellar_Door_Key", "OnPickupCellarKey");
    
AddEntityCollideCallback("Player", "SkullLadder", "MakeSkullLadder", true, 1);
    
AddEntityCollideCallback("Player", "LookAtHatch", "Lookey", true, 1); 
    
AddEntityCollideCallback("Player", "TakenAlready", "TookStuffAlready", true, 1); 
    
AddEntityCollideCallback("Player", "IShouldTurnBack", "TurnBack", true, 1); 
    
SetLocalVarInt("Var1", 0);
} 

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
    
SetEntityActive("servant_grunt_1", true); 
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
}

void UsedKeyOnAlcDoor(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked("AlcDoor", false, true);
    
PlaySoundAtEntity("", "unlock_door.snt", "AlcDoor", 0.0f, true);
    
RemoveItem("Key_AlcDoor");
}
void OnPickupCellarKey(string &in asEntity, string &in type)
{
    
SetEntityActive("CellarKeyDis_*",false);
    
SetEntityActive("CellarKeyApp_*",true);
    
SetEntityActive("TakenAlready",true);
}
void SpideyGoPoof(string &in asEntity, int alState)
{
    if(
alState == 1) //Only if the player is look at the area
{
    
GiveSanityDamage(5, true);
    
AddTimer("Poof", 1.0, "Gone");
}
} 
void Gone(string &in asTimer)
{
    
SetPropActiveAndFade("Spider_1", false, 0.5f);
}
void SpotlightOn(string &in asParent, string &in asChild, int alState)
{
    
SetLightVisible("Spotlight_4", true); 
}
void SpotlightOff(string &in asParent, string &in asChild, int alState)
{
    
SetLightVisible("Spotlight_4", false);
}

void DoorLocked(string &in asEntity)
{
if(
GetSwingDoorLocked("AlcDoor") == true)
{
SetMessage("Messages", "AlLocked", 0);
}
}
void NotNow(string &in asEntity)
{
if(
GetSwingDoorLocked("hatch_ceiling_1") == true)
{
SetMessage("Messages", "NotNow", 0);
}
}

void ActivateLadder (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ladder_static_8", true);
SetEntityActive("SlantLadder", false);
SetEntityActive("LadderArea_2", true);
}
void MakeSkullLadder (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("human_skull_*", true);
SetEntityActive("Sladder_*", false);
GiveSanityDamage(5, true);
AddTimer("SkullLadderTimer", 4.0, "SkullLadderEnd");
}
void SkullLadderEnd (string &in asTimer)
{
SetPropActiveAndFade("human_skull_*", false, 0.5f);
SetEntityActive("Sladder_*", true);
}
void TakeWine(string &in asEntity)
{
SetMessage("Messages", "WineTaken", 0);
SetSwingDoorLocked("CellarDoor", true, true);
}

void CellarDoorLockedWhy(string &in asEntity)
{
if(
GetSwingDoorLocked("CellarDoor") == true)
{
SetMessage("Messages", "WhyDoorLocked", 0);
SetSwingDoorLocked("hatch_ceiling_1", false, true);
SetEntityActive("wood_box02_4", false);
SetEntityActive("LookAtHatch", true);
}
}
void Lookey (string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("hatch_ceiling_1", 1.0f, 1.0f, "");
SetMessage("Messages", "IsKeyThere", 0);
AddTimer("DoneLooking", 2.0, "DoneLookingAtHatch");
}
void DoneLookingAtHatch(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}
void TookStuffAlready(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "PickedUpAlready", 0);
}
void TurnBack(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "WhereamI", 0);
SetEntityActive ("WhatThe", true);
SetEntityActive ("TurnBack", true);
}
void WallHasAppeared(string &in asEntity, int alState)
{
    if(
alState == 1) //Only if the player is look at the area
{
    
GiveSanityDamage(5, true);
    
SetMessage("Messages", "WhatThe", 0);
}
}
void CDoor1(string &in asEntity)
{
SetEntityActive("DoorRoomApp1_*", true);
SetEntityActive("DoorRoomDis1_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor2(string &in asEntity)
{
SetEntityActive("DoorRoomApp2_*", true);
SetEntityActive("DoorRoomDis2_*", false);
AddLocalVarInt("Var1", 1);
func12();
void CDoor3(string &in asEntity)
{
SetEntityActive("DoorRoomApp3_*", true);
SetEntityActive("DoorRoomDis3_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor4(string &in asEntity)
{
SetEntityActive("DoorRoomApp4_*", true);
SetEntityActive("DoorRoomDis4_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor5(string &in asEntity)
{
SetEntityActive("DoorRoomApp5_*", true);
SetEntityActive("DoorRoomDis5_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor6(string &in asEntity)
{
SetEntityActive("DoorRoomApp6_*", true);
SetEntityActive("DoorRoomDis6_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor7(string &in asEntity)
{
SetEntityActive("DoorRoomApp7_*", true);
SetEntityActive("DoorRoomDis7_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor8(string &in asEntity)
{
SetEntityActive("DoorRoomApp8_*", true);
SetEntityActive("DoorRoomDis8_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor9(string &in asEntity)
{
SetEntityActive("DoorRoomApp9_*", true);
SetEntityActive("DoorRoomDis9_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor10(string &in asEntity)
{
SetEntityActive("DoorRoomApp10_*", true);
SetEntityActive("DoorRoomDis10_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor11(string &in asEntity)
{
SetEntityActive("DoorRoomApp11_*", true);
SetEntityActive("DoorRoomDis11_*", false);
AddLocalVarInt("Var1", 1);
func12();
} 
void func12(string &in asEntity)
{
if(
GetLocalVarInt("Var1") == 11)
    {
    
SetEntityActive("CRoomCarpet", false);
    }
}
void OnLeave()
{
} 

A Late Night Drink http://www.moddb.com/mods/a-late-night-drink
Check out my LP channel, CatBearGaming, I take all Custom Story requests!
03-01-2013, 02:29 PM
Find


Messages In This Thread
New to this, having some trouble - by DeAngelo - 02-27-2013, 07:23 AM
RE: New to this, having some trouble - by NaxEla - 02-27-2013, 07:40 AM
RE: New to this, having some trouble - by NaxEla - 02-27-2013, 08:51 AM
RE: New to this, having some trouble - by NaxEla - 02-27-2013, 09:36 AM
RE: New to this, having some trouble - by DeAngelo - 03-01-2013, 02:29 PM
RE: New to this, having some trouble - by NaxEla - 03-02-2013, 10:05 AM



Users browsing this thread: 1 Guest(s)