Frictional Games Forum (read-only)

Full Version: REsolved
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi guys
have a bit of problem with my hps file here......they tell me something wrong with it
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_3", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}
void OnStart()
{
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
}


void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("pot_explode", 0);
}


void OnEnter()
{
}


void OnLeave()
{
void OnEnter()

{
AddEntityCollideCallback("Player", "bang", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", 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);
}
Wrong section, moving to development support.
you forgot the } at void OnLeave()
(07-20-2012, 07:59 PM)Steve Wrote: [ -> ]you forgot the } at void OnLeave()


???
(07-20-2012, 08:32 PM)zecuro Wrote: [ -> ]???

In other words, OnEnter and func_slam are inside OnLeave. You also have two OnStart functions.
(07-20-2012, 09:13 PM)Your Computer Wrote: [ -> ]
(07-20-2012, 08:32 PM)zecuro Wrote: [ -> ]???

In other words, OnEnter and func_slam are inside OnLeave. You also have two OnStart functions.

i don't understand really cuz i try the script befor and it work well the slaming door and the key script but when i tried the script for exploding pot well added it to my hps file it dosent work did i place it wrong....
like this ????
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_3", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

{
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
}

void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("pot_explode", 0);
}

void OnEnter()
{
}

void OnLeave()
{
void OnEnter()

{
AddEntityCollideCallback("Player", "bang", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", 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);
}
(07-20-2012, 11:31 PM)zecuro Wrote: [ -> ]like this ????

No. Like this:

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""explode_scare""Explode"true1);
AddUseItemCallback("""key_1""mansion_3""FUNCTION"true);
}

void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity0false);
RemoveItem(asItem);
}

void Explode(string &in asParentstring &in asChildint alState)
{
SetPropHealth("pot_explode"0);
}

void OnEnter()
{
AddEntityCollideCallback("Player""bang""func_slam"true1);
}

void OnLeave()
{
}

void func_slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("mansion_2"truetrue);
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
PlaySoundAtEntity("""react_scare""Player"0false);
PlaySoundAtEntity("""close_door.snt""Player"0false);
GiveSanityDamage(5.0ftrue);