Frictional Games Forum (read-only)

Full Version: How to create falling rock?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to create that once player has passed one hole, a many rocks or huge rock would fall in front of it and player cant return anymore to the previous room.

How can I do that Smile?
Well the easiest way would to make some rocks in the editor, set them to inactive. Then when they trigger your event, you set them active.
Hmm yes, I thought about that possibility as well... But I more meant like when person is looking live action. Is that possible Smile?
Yes it is. You can do it using different ways. Physics, animation, movable props. Think a little bit and you'll find a way.
You could set the rocks inactive until the player triggers the event (Like what Rapture said) by setting up a script in the level editor then setting everything up in the .hps file

For instance, you use "AddEntityCollideCallback("Player", "rocksfalling", "rocksfall", true, 1);"
This means when the player collides with the "rocksfalling" script box (that you setup in the level editor) the event "rocksfall" begins, hence, the rocks fall and block the door.

Then "void rocksfall (string &in asParent, string &in asChild, int alState)" and use your commands from there.

So technically like this for example:

void OnStart()
{
AddEntityCollideCallback("Player", "rocksfalling", "rocksfall", true, 1);
}

void rocksfall (string &in asParent, string &in asChild, int alState)
{
(put all your commands in here, which would be the rocks falling)
}
I always thought the easiest way was to set the rocks up in the air, making sure they're entites so they'll move around, and setting them inactive. When the player hits the script area, have them all activate and they'll look realistic falling from the ceiling.