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
lever problem
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#4
RE: lever problem

(07-27-2012, 03:43 PM)andyrockin123 Wrote: The script looks fine and should work properly. Make sure:

-the new script file you pasted it into is an actual c++ script file and not just a .txt file
-the .map and .hps files are named exactly the same
-the .map and .hps files are in the same folder
-both the lever and door names in the .hps file are exactly the same as in the level editor.
it is a c++ script file, and i have other scripts that works fine in the same map and the lever and door names are excatly the same in both level editor and the .hps file

I can upload the entire script. There might be something i missed


////////////////////
//Run first time entering map
void OnStart()
{
AddEntityCollideCallback("Player", "StartMusicArea", "StartMusic", true, 1);
AddUseItemCallback("", "RustyKey", "metal_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("ScareCabinet", "RoarScare", true);
SetEntityConnectionStateChangeCallback("bro_lever", "UnLockDoor");
AddEntityCollideCallback("Player", "DeadBroArea", "BroStare", true, 1);
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambience_haunting", true, 1, 2, 1, true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("RustyKey");
}

void RoarScare(string &in asEntity)
{
PlaySoundAtEntity("", "brute/enabled", "castle_1", 0, false);
}

void UnLockDoor(string &in asEntity, int level_state)
{
if (level_state == 1)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "ui_sanity_gain", "Player", 0, false);
GiveSanityBoost();
}
}

void BroStare(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("grunt_body_part2_1", 1, 10, "");
SetPlayerActive(false);
AddTimer("player_stare", 2, "Stare");
GiveSanityDamage(50, true);
}

void Stare(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}

////////////////////
//Run when entering map
void OnEnter()
{

}

////////////////////
//Run when leaving map
void OnLeave()
{

}

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-27-2012, 03:52 PM by Lizard.)
07-27-2012, 03:50 PM
Find


Messages In This Thread
lever problem - by Lizard - 07-27-2012, 03:30 PM
RE: lever problem - by Adny - 07-27-2012, 03:43 PM
RE: lever problem - by Lizard - 07-27-2012, 03:50 PM
RE: lever problem - by Steve - 07-27-2012, 03:43 PM
RE: lever problem - by Adny - 07-27-2012, 03:53 PM
RE: lever problem - by Lizard - 07-27-2012, 03:58 PM



Users browsing this thread: 1 Guest(s)