Frictional Games Forum (read-only)

Full Version: Use Dagger?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
-----
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.
You two are awesome! Thank you!!
I can't believe i couldn't figure that out. x_x
You're welcome, I try to help all I can.
(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?
(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
Thanks. Smile
(04-26-2011, 02:19 AM)Kyle Wrote: [ -> ]Thanks. Smile

Do you happen to know? :/
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.
Pages: 1 2