Frictional Games Forum (read-only)

Full Version: An annoying script problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone,

I'm working on a script file to my map, the problem is I want to make a script that if player tries to open the locked door, he hears ghostly sounds and gets an instant sanity damage, but for some reason this doesn't work. The function also adds a timer which is 7 second, and after it, the door should open, but it does not as well. I added debug messages and they do not show up in-game. Anyone knows the solution?

The "not-working" part of my .hps file

PHP Code:
void Func_StartMadness(string &in entity)
{
    if(
GetSwingDoorLocked("hub_1") == true)
    {
        
AddDebugMessage("Feel the wrath of Shao Kahn!"false);
        
AddTimer("TriggerOpenDoor"7.0f"TriggerOpenDoorFunc"); 
        
SetMessage("Messages""drzwi2"0);
        
GiveSanityDamage(10.0f,true);
        
PlaySoundAtEntity("Ghostly_Sounds""00_cuts_3d""Ghostly_SoundsArea"0false);
    }
}

void TriggerOpenDoorFunc(string &in asTimer)
{
    
AddDebugMessage("Feel the power of Shao Kahn!"false);
    
ChangePlayerStateToNormal();
    
SetPlayerActive(true);
    
SetSwingDoorLocked("hub_1"falsetrue);
    
PlaySoundAtEntity("""unlock_door.snt""hub_1"0.0ftrue);
    
SetPlayerCrouching(false);
    
FadeImageTrailTo(0,1);


ofc the door names in the notepad and level editor are the same. Any help will be appreciated.

EDIT: nvmd, I fixed it. This thread may be closed now.
How are you calling the function?
(04-02-2014, 07:51 PM)Wapez Wrote: [ -> ]How are you calling the function?

I already fixed it - I forgot to add a line to PlayerInteractCallback in Level editor.