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"true1); 
    
AddEntityCollideCallback("Player""PlayerCollide_Spotlight""SpotlightOn"true1);
    
AddEntityCollideCallback("Player""PlayerCollide_SpotlightOff""SpotlightOff"true1);     
    
AddUseItemCallback("""Key_AlcDoor""AlcDoor""UsedKeyOnAlcDoor"true);    
    
AddEntityCollideCallback("SlantLadder""SlantLadderArea""ActivateLadder"true1);
    
SetEntityCallbackFunc("Cellar_Door_Key""OnPickupCellarKey");
    
AddEntityCollideCallback("Player""SkullLadder""MakeSkullLadder"true1);
    
AddEntityCollideCallback("Player""LookAtHatch""Lookey"true1); 
    
AddEntityCollideCallback("Player""TakenAlready""TookStuffAlready"true1); 
    
AddEntityCollideCallback("Player""IShouldTurnBack""TurnBack"true1); 
    
SetLocalVarInt("Var1"0);


void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true); 
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
}

void UsedKeyOnAlcDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("AlcDoor"falsetrue);
    
PlaySoundAtEntity("""unlock_door.snt""AlcDoor"0.0ftrue);
    
RemoveItem("Key_AlcDoor");
}
void OnPickupCellarKey(string &in asEntitystring &in type)
{
    
SetEntityActive("CellarKeyDis_*",false);
    
SetEntityActive("CellarKeyApp_*",true);
    
SetEntityActive("TakenAlready",true);
}
void SpideyGoPoof(string &in asEntityint alState)
{
    if(
alState == 1//Only if the player is look at the area
{
    
GiveSanityDamage(5true);
    
AddTimer("Poof"1.0"Gone");
}

void Gone(string &in asTimer)
{
    
SetPropActiveAndFade("Spider_1"false0.5f);
}
void SpotlightOn(string &in asParentstring &in asChildint alState)
{
    
SetLightVisible("Spotlight_4"true); 
}
void SpotlightOff(string &in asParentstring &in asChildint 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 asParentstring &in asChildint alState)
{
SetEntityActive("ladder_static_8"true);
SetEntityActive("SlantLadder"false);
SetEntityActive("LadderArea_2"true);
}
void MakeSkullLadder (string &in asParentstring &in asChildint alState)
{
SetEntityActive("human_skull_*"true);
SetEntityActive("Sladder_*"false);
GiveSanityDamage(5true);
AddTimer("SkullLadderTimer"4.0"SkullLadderEnd");
}
void SkullLadderEnd (string &in asTimer)
{
SetPropActiveAndFade("human_skull_*"false0.5f);
SetEntityActive("Sladder_*"true);
}
void TakeWine(string &in asEntity)
{
SetMessage("Messages""WineTaken"0);
SetSwingDoorLocked("CellarDoor"truetrue);
}

void CellarDoorLockedWhy(string &in asEntity)
{
if(
GetSwingDoorLocked("CellarDoor") == true)
{
SetMessage("Messages""WhyDoorLocked"0);
SetSwingDoorLocked("hatch_ceiling_1"falsetrue);
SetEntityActive("wood_box02_4"false);
SetEntityActive("LookAtHatch"true);
}
}
void Lookey (string &in asParentstring &in asChildint alState)
{
SetPlayerActive(false);
StartPlayerLookAt("hatch_ceiling_1"1.0f1.0f"");
SetMessage("Messages""IsKeyThere"0);
AddTimer("DoneLooking"2.0"DoneLookingAtHatch");
}
void DoneLookingAtHatch(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}
void TookStuffAlready(string &in asParentstring &in asChildint alState)
{
SetMessage("Messages""PickedUpAlready"0);
}
void TurnBack(string &in asParentstring &in asChildint alState)
{
SetMessage("Messages""WhereamI"0);
SetEntityActive ("WhatThe"true);
SetEntityActive ("TurnBack"true);
}
void WallHasAppeared(string &in asEntityint alState)
{
    if(
alState == 1//Only if the player is look at the area
{
    
GiveSanityDamage(5true);
    
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)