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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Ceremony Knife
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Ceremony Knife

For the very basics to make this work, you can use "AddUseItemCallback", having the item set to the knife and the entity as the body to cut. For example:

AddUseItemCallback("", "NAMEOFKNIFE", "NAMEOFBODY", "FUNC", false);

As for the function, simply have a key laying next to the body inactive in the level editor, then set it active using the function "SetEntityActive".


If you would like a more complex version, let me know exactly how you envision it in your mind. There are many variations of what I said, some of the simpler effects you can add to make it look more fancy are PlaySoundAtEntity (perhaps have a cutting/stabbing sound play), CreateParticleSystemAtEntity(make blood spurt out of the body). You can also have a second knife set inactive, positioned as if it has been stabbed into the body. Simply set it active as well and it will look like the player stabbed him.

Here's the full script for the most basic idea:


void OnStart()
{
AddUseItemCallback("", "NAMEOFKNIFE", "NAMEOFBODY", "FUNC", false);
}

void FUNC(string &in asItem, string &in asEntity)
{
SetEntityActive("NAMEOFKEY", true);
}

Hope that helped.

I rate it 3 memes.
07-10-2012, 05:22 AM
Find


Messages In This Thread
Ceremony Knife - by Atilla280 - 07-10-2012, 05:01 AM
RE: Ceremony Knife - by Adny - 07-10-2012, 05:22 AM
RE: Ceremony Knife - by Atilla280 - 07-10-2012, 05:33 AM



Users browsing this thread: 1 Guest(s)