Frictional Games Forum (read-only)
Use Dagger? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Use Dagger? (/thread-7624.html)

Pages: 1 2


Use Dagger? - ricky horror - 04-25-2011

I'm working on a custom story, and I have the dagger in it and a sacrificial body placed on a bed. But I can't figure out the script to use the dagger on the body, and for the door to unlock once you stab the body. :/ I can't even figure it out far enough to just use the dagger on it. Does anyone know the script to be able to use the dagger?


RE: Use Dagger? - Poppuhik42 - 04-25-2011

-----


RE: Use Dagger? - Kyle - 04-25-2011

I think that if you want the dagger to be visible on the body, you will have to make a copy of the dagger thats in the body and set it unactive.Also make sure the dagger copy has static physics. Then use this in combination with the script:

Code:
void OnStart()
{
AddUseItemCallback("", "ceremony_knife_1", "corpse_male_1", "UsedDaggerOnBody", true);
}
UsedDaggerOnBody(string &in asItem, string &in asEntity)
{
SetEntityActive("ceremony_knife_2", true);
SetSwingDoorLocked("castle_1", false, true);
}

You can later add a sound like a blade-piercing-flesh kind of sound.


RE: Use Dagger? - ricky horror - 04-25-2011

You two are awesome! Thank you!!
I can't believe i couldn't figure that out. x_x


RE: Use Dagger? - Kyle - 04-25-2011

You're welcome, I try to help all I can.


RE: Use Dagger? - ricky horror - 04-26-2011

(04-25-2011, 10:15 PM)Kyle Wrote: You're welcome, I try to help all I can.

I have one more question.

I can only seem to get it to work with "corpse_male_1".
But I'd prefer to use "ritual_prisoner_1" under characters.
Yet, literally, the only body entity it'll work with is "corpse_male_1". ]: How come?


RE: Use Dagger? - Hunter of Shadows - 04-26-2011

(04-25-2011, 10:09 PM)ricky horror Wrote: You two are awesome! Thank you!!
I can't believe i couldn't figure that out. x_x

Kyle is awesome yes


RE: Use Dagger? - Kyle - 04-26-2011

Thanks. Smile


RE: Use Dagger? - ricky horror - 04-26-2011

(04-26-2011, 02:19 AM)Kyle Wrote: Thanks. Smile

Do you happen to know? :/


RE: Use Dagger? - jens - 04-26-2011

The entity is probably a static prop, which is a simplified entity that can not be used for certain things, such as using an item on it. Either you change the type of entity it is (with the model editor) or you create a script area in the level editor and place it over the corpse, then you create AddUseItem callback for the dagger and the area. I think that last option is the easiest.