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 Exploding door
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#1
Exploding door

Hey guys, I have done this scripts before, but this time, i just can't get the door to explode (break)

SetEntityPlayerInteractCallback("CellarKey_2", "AreaActive", true);
AddEntityCollideCallback("Player", "ExplodingDoorArea_1", "Explode2", true, 1);


void AreaActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ExplodingDoorArea_1", true);
}


void Explode2(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("ExplodingDoor_1", 0);
CreateParticleSystemAtEntity("", "ps_area_fog_falling", "ExplodingDoor_1", false);
PlaySoundAtEntity("", "break_wood", "ExplodingDoor_1", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10, true);
}


Can you help me out on this one

CURRENT PROJECT:
A Fathers Secret == Just started
07-11-2012, 07:15 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Exploding door

wrong callback syntax:
the callback syntax of SetEntityPlayerInteractCallback should be: void MyFunc(string &in asEntity)

Think, before you speak Google, before you post
(This post was last modified: 07-11-2012, 07:28 PM by Cruzore.)
07-11-2012, 07:28 PM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#3
RE: Exploding door

NEVERMIND I GOT NINJA'D


Spoiler below!

I see this

void AreaActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ExplodingDoorArea_1", true);
}



------------FIXED-----------
void AreaActive(string& asEntity)

{
SetEntityActive("ExplodingDoorArea_1", true);
}

(This post was last modified: 07-11-2012, 07:29 PM by Kazakarumariou.)
07-11-2012, 07:28 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Exploding door

correction:
it should be string &in asEntity, not string&

Think, before you speak Google, before you post
07-11-2012, 07:29 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#5
RE: Exploding door

Thanks.

I just copied it from another hps file, but apparently forgot to edit all 100%

I have stop scripting, when im sleepy

CURRENT PROJECT:
A Fathers Secret == Just started
07-11-2012, 07:33 PM
Find




Users browsing this thread: 2 Guest(s)