Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use Dagger?
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#1
Use Dagger?

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?
04-25-2011, 04:26 AM
Find
Poppuhik42 Offline
Junior Member

Posts: 20
Threads: 1
Joined: Apr 2011
Reputation: 0
#2
RE: Use Dagger?

-----
(This post was last modified: 12-13-2012, 10:35 PM by Poppuhik42.)
04-25-2011, 08:44 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#3
RE: Use 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:

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.

(This post was last modified: 04-25-2011, 02:04 PM by Kyle.)
04-25-2011, 01:59 PM
Find
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#4
RE: Use Dagger?

You two are awesome! Thank you!!
I can't believe i couldn't figure that out. x_x
04-25-2011, 10:09 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#5
RE: Use Dagger?

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

04-25-2011, 10:15 PM
Find
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#6
RE: Use Dagger?

(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-26-2011, 01:04 AM
Find
Hunter of Shadows Offline
Senior Member

Posts: 745
Threads: 21
Joined: Apr 2011
Reputation: 11
#7
RE: Use Dagger?

(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
04-26-2011, 01:32 AM
Website Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#8
RE: Use Dagger?

Thanks. Smile

04-26-2011, 02:19 AM
Find
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#9
RE: Use Dagger?

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

Do you happen to know? :/
04-26-2011, 03:16 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#10
RE: Use Dagger?

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.
(This post was last modified: 04-26-2011, 06:10 AM by jens.)
04-26-2011, 06:10 AM
Website Find




Users browsing this thread: 5 Guest(s)