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
An annoying script problem.
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#1
An annoying script problem.

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: (Select All)
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.
(This post was last modified: 04-02-2014, 07:53 PM by Slanderous.)
04-02-2014, 07:32 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#2
RE: An annoying script problem.

How are you calling the function?

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
04-02-2014, 07:51 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#3
RE: An annoying script problem.

(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.
04-02-2014, 07:54 PM
Find




Users browsing this thread: 1 Guest(s)