Frictional Games Forum (read-only)
How to make entities fall? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+--- Thread: How to make entities fall? (/thread-25099.html)



How to make entities fall? - Artsy - 04-18-2014

Basically what I'm trying to do is get a statue to fall. I've tried this:

PHP Code:
void OnStart(){
    
//Timers
    
{    
        
AddTimer("StatueFall_timer"0.8f"StatueFall");
    }
}

    
void StatueFall(string &in asTimer){
    {
        
SetEntityActive("CrudeManChainsInit"false);
        
SetEntityActive("CrudeManChainsFall"true);
    }


and for some reason both of them are still active entities (CrudeManChainsFall is floating in mid air while CrudeManChainsInit is still active). How do I make that to fall down and not float in mid air while the normal one just disappears? I've got Static Physics enabled too.


RE: How to make entities fall? - PutraenusAlivius - 04-18-2014

You can't. The CrudeMan is a staticprop, and thus it cannot be de-activated and it'll always static, hence the name.

Here are some solution:

SOLUTION
Spoiler below!

1) Open up the entity file in the Model Editor
2) Go to Settings > User Defined Variables
3) Change the type from StaticProp to Object (Subtype Slide)
4) Adjust the settings as you want.
5) Save it in some other location (Probably in your CS folder, don't want to change the original, that'll cause some problems)
6) Enjoy!




RE: How to make entities fall? - Artsy - 04-18-2014

When I opened it and went to User Defined Variables, it was already like this:
Type: Objects
Subtype: Static


RE: How to make entities fall? - Romulator - 04-18-2014

Quote:I've got Static Physics enabled too.

Static Physics means it has no mass, therefore no gravity, which means no force. Therefore, they won't move. Perhaps this is your problem?


RE: How to make entities fall? - PutraenusAlivius - 04-18-2014

(04-18-2014, 02:30 PM)artsyracoon Wrote: When I opened it and went to User Defined Variables, it was already like this:
Type: Objects
Subtype: Static

Don't enable Static Physics. It'll make it Static.


RE: How to make entities fall? - Artsy - 04-18-2014

I disabled Static Physics on both and still:

Edit: CrudeManChainsInit inactive now as I just noticed the typo in the Level Editor. That's working. The other one is still floating though. And sorry for the chaos.


RE: How to make entities fall? - Mudbill - 04-18-2014

Even if you set an entity to no longer be static, they still need a mass to their body in order to have gravity. Open the model in the model editor, and if you select the collision box (body) of the entity, you can choose what mass it should have. Also make sure "Has Gravity" is checked at the bottom.


RE: How to make entities fall? - Artsy - 04-18-2014

THANK YOU.
But is there like a way to disable COMPLETE interaction with the entity when it falls?
I mean I can't touch it but I can move it just by walking by it. I set the entity's body mass to 1 btw. Not sure if that's right.

Edit: Never mind, forgot to uncheck Pushed by character gravity.
Edit 2: Had some problems with it as I even got out of the map because the force was so big. Fixed it by setting the entity's body mass to 20. All is good. No problems. Big Grin


RE: How to make entities fall? - Mudbill - 04-19-2014

Yeah, mass around 1 and less is quite easily bugged in the engine. 20 is a good number for something of that size.