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
Stick a knife in Martin?
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#3
RE: Stick a knife in Martin?

I'm going to try to explain this as easy as possible. I'm not a very good explainer though, bear with me.

About the stick-a-knife-in-Martin part (I assume Martin is a body); you need to have a dagger in your inventory (you don't have to, there are other ways but I prefer this), so place a dagger from the entities/item tab in the level editor. Now, place a script area where you want your knife to be used (y'know, when you're holding an item on a place, that the item glows), in this case a little bit above the body. AND MAKE SURE TO CHECK "ItemInteraction" IN THE ENTITIES TAB OF THAT SCRIPT AREA. Then place another dagger, this one is for decoration, this is the knife that cuts into the body. So place it in the body. Make sure to set the second dagger (the one that is cutting the body) to inactive by unchecking the active box under the name. Then, go to entities (right of name), and check Static Physics. Alright, now the scripting part.

void OnStart()
{
AddUseItemCallback("", "NAMEofDAGGERyoupickedup", "NAMEoftheSCRIPTAREAabovethebody", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
RemoveItem("NAMEofDAGGERyoupickedup"); //this removes the dagger from the inventory.
SetEntityActive("NAMEofSECONDDAGGER", true);
}

That should do it. You can also add things like sounds or screen effects. If you do that, make sure you put it between the { and }.

Edit: This forum likes to screw with my walls of text.
(This post was last modified: 06-29-2012, 10:10 PM by ApeCake.)
06-29-2012, 10:07 PM
Find


Messages In This Thread
Stick a knife in Martin? - by Jagsrs28 - 06-29-2012, 03:56 PM
RE: Stick a knife in Martin? - by ApeCake - 06-29-2012, 10:07 PM



Users browsing this thread: 1 Guest(s)