Frictional Games Forum (read-only)
[SCRIPT] Need some help with flying body. - 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)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Need some help with flying body. (/thread-13401.html)



Need some help with flying body. - ammislol - 02-18-2012

Hello there. I've got some problems.
I understand how to make the body fly normal, but I want a script that makes the body fly out of a closet. Cause I can't make it work, the body wont fly out, just kinda stays in the closet.. Is there anyone out there that wanna help me with the script?

I have a area called : FlyingJesus_5
I have a body called : Jesus_5
I have a closet called : Closet_5

If you need that.

Thank you // Ammislol.


RE: Need some help with flying body. - Your Computer - 02-18-2012

If the mass and force of an object is not enough to push something open, then you're going to have to do it for it. For most objects AddPropForce will suffice in launching the object.


RE: Need some help with flying body. - ammislol - 02-18-2012

(02-18-2012, 11:54 AM)Your Computer Wrote: If the mass and force of an object is not enough to push something open, then you're going to have to do it for it. For most objects AddPropForce will suffice in launching the object.
The thing is, I have AddPropForce, but the doors of the closet wont open. Do I have to do anything with the closet? Or just add more to the AddPropForce?


RE: Need some help with flying body. - Your Computer - 02-18-2012

(02-18-2012, 01:37 PM)ammislol Wrote: The thing is, I have AddPropForce, but the doors of the closet wont open. Do I have to do anything with the closet? Or just add more to the AddPropForce?

Try AddBodyForce, then. Open the entity in the model editor and find the name of the bodies that make up the doors. Then, for AddBodyForce's object name, separate the entity name and the body name with an underscore (e.g. EntityName_BodyName). Do so for each door of the closet.


RE: Need some help with flying body. - ammislol - 02-18-2012

Okay, I've got another question for you if you dont mind.

I have a secret wall, with a painting infront of it, when you remove the painting you see the key. I want when the player pick up the key a head / corpse to show up and the sound - 12_girl_scream.snt will come. Is that possible? If you understand what I mean..?

Thank you.


RE: Need some help with flying body. - flamez3 - 02-18-2012

void OnStart()
{
SetEntityPlayerInteractCallback("key", "Scare1", true);
}


void Scare1 (string &in asEntity)
{
SetEntityActive("Head/Corpse", true);
PlaySoundAtEntity("", "
12_girl_scream.snt", "Player", 0, false);
}


RE: Need some help with flying body. - ammislol - 02-18-2012

Thanks alot mate!