Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spoiler Some Script-Problems
BlueRsX Offline
Junior Member

Posts: 5
Threads: 1
Joined: Feb 2013
Reputation: 0
#8
RE: Some Script-Problems

Thank you, but I think im the stupidest person on the world Big Grin

So I need a bit help with this code...
I wanna make a closed door, wich I have to open with a key.
void OnStart()

{
AddUseItemCallback("", "Schluessel", "Schluesseltuer", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)

{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
    SetSwingDoorClosed("door2", true, true);
    }

So everything works... Thank god!

Then I wanna make this "breakdown" of this door for a scary moment.
Ive got the script and everythings fine.
So I tried to insert that "breakdown" code in the .hps file.

Im not sure how to insert it, because I get every time an error!
I tried it like this:
void OnStart()

{
AddUseItemCallback("", "Schluessel", "Schluesseltuer", "FUNCTION", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void FUNCTION(string &in asItem, string &in asEntity)

{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
    SetSwingDoorClosed("door2", true, true);
    }
    
    {
void func_slam(string &in asParent, string &in asChild, int alState)
    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);

}

But I always got an error. The programm says:
Could not load script blablabla: (20,5):ERR: Unexpected token {

So I just deleted this "{" But another error:
(22,5) expected , or ;
(23,22) expected identifier
(23,81) expected identifier
(24,21) expected identifier
(26,1) unexpected token }


Then I just tried to copy the 2nd code just behind the 1st with and without braces, but it allways errors...

I just cant understand why it cant work!

Help again? I know Im annoying Big Grin
(This post was last modified: 02-09-2013, 11:32 PM by BlueRsX.)
02-09-2013, 11:30 PM
Find


Messages In This Thread
Some Script-Problems - by BlueRsX - 02-09-2013, 03:41 PM
RE: Some Script-Problems - by NaxEla - 02-09-2013, 06:02 PM
RE: Some Script-Problems - by The chaser - 02-09-2013, 06:59 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 09:43 PM
RE: Some Script-Problems - by palistov - 02-09-2013, 10:20 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 10:27 PM
RE: Some Script-Problems - by palistov - 02-09-2013, 10:41 PM
RE: Some Script-Problems - by BlueRsX - 02-09-2013, 11:30 PM
RE: Some Script-Problems - by BlueRsX - 02-10-2013, 09:29 AM



Users browsing this thread: 1 Guest(s)