The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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 Error at unlocking door with an item
KingCrimson Offline
Junior Member

Posts: 45
Threads: 14
Joined: Jul 2012
Reputation: 0
#1
Error at unlocking door with an item

It says:

"FATAL ERROR: main (21,23) : ERR : Expected identifier"

This is a copy of the .hps file:


Quote:////////////////////////////
// Run when the map starts
void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

AddUseItemCallback("", "secret1", "lckd", "unlock", true);

void unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(lckd, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(secret1);
}

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

}

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

}
secret1 = Key name
lckd = Locked door name

PS: I don't know if it might have something to do with the error. But the key you must use, you get it on the level before this one.

Current Projects:
DADDY - 10%
07-07-2012, 10:34 PM
Find


Messages In This Thread
Error at unlocking door with an item - by KingCrimson - 07-07-2012, 10:34 PM



Users browsing this thread: 1 Guest(s)