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 I Want To Break A Ladder.
thestormcrow Offline
Junior Member

Posts: 12
Threads: 8
Joined: Apr 2013
Reputation: 0
#1
I Want To Break A Ladder.

I wanted a ladder to break as the player is climbing down it for a scare. The following is in my script file:

void OnStart()
{
AddEntityCollideCallback("Player", "LadderBreakArea", "BreakLadder", true, 1);
}

void OnEnter()
{
PlayMusic(("12_amb.ogg"), true, 1, 10, 0, false);
}

void OnLeave()
{
StopMusic(1, 0);
}

void BreakLadder(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("ladder", 0);
SetEntityActive("LadderArea_1", false);
}


The ladder does not break and the ladder area doesn't deactivate til the player leaves it. Have I made some mistake/can anyone suggest a suitable workaround?
05-16-2013, 11:50 PM
Find
str4wberrypanic Offline
Member

Posts: 241
Threads: 24
Joined: Jul 2012
Reputation: 8
#2
RE: I Want To Break A Ladder.

I think it doesn't break because the ladder haven't an animation for it.

05-17-2013, 12:06 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#3
RE: I Want To Break A Ladder.

once the player is in the area, whether it is turned on or off the player will still be on it as you said. try using playerforce ( like prop force) to move the player away from the ladder area... might work.


As for the animation I don't know.

05-17-2013, 12:19 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#4
RE: I Want To Break A Ladder.

I would try ChangePlayerStateToNormal(); to make the player fall.
Then, i'd replace the stairs with smaller parts. And don't forget the sound.

05-17-2013, 12:45 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
RE: I Want To Break A Ladder.

Have you tried pushing the player off of the ladder area when it breaks? PlayerAddForce or something like that. Can't quite remember.

Edit: Or maybe try teleporting them to a script area very close to where they would be when the event triggers. Combine that with some screen shaking and it shouldn't be noticeable.

(This post was last modified: 05-17-2013, 01:44 AM by palistov.)
05-17-2013, 01:43 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: I Want To Break A Ladder.

Easy way: FadeOut(0);
and play a sound

Trying is the first step to success.
05-17-2013, 08:44 AM
Find




Users browsing this thread: 2 Guest(s)