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
[HELP] Keg Pop
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#1
[HELP] Keg Pop

Hi, I'd like to make it so my dagger that the user can find is able to puncture through a keg to allow it to flow out the containments, here is my code

    //===========================================
    // This runs when the player enters the map
    void OnEnter()
    {
     AddUseItemCallback("popgoesthekeg", "breakkegknife", "winekeg", "boomkegopen", true);
    }
     void boomkegopen(string &in asItem, string &in asEntity)
     {
     PlaySoundAtEntity("bruto2", "put_knife.snt", "Player", 0.0f, false);
     SetEntityActive("breakkeg_1", true);
     }

But, when approached with the knife and attempted to be used on it says "No object to use item on" or something like that.
06-30-2012, 01:51 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: [HELP] Keg Pop

Some entities can't be interacted with in such a way, luckily, there's a way to work around it. Simply create a script area (8 in the level editor>Script) and make it roughly the same size as the keg (try to make it as close as possible), and make sure it completely surround the keg entity. Next, select the script area, and press the "Area" tab. Make sure "Item Interaction" is checked. Name this script area whatever you'd like.

For the scripting portion, instead of using the actual keg's name as the entity for the knife to be used on, replace it with the name of the script area.


void OnStart()
{
AddUseItemCallback("", "breakkegknife", "NAMEOFSCRIPTAREA", "boomkegopen", true);
}

void boomkegopen(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("bruto2", "put_knife.snt", "Player", 0.0f, false);
SetEntityActive("breakkeg_1", true);
}

Hope that helped.

I rate it 3 memes.
06-30-2012, 02:11 AM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#3
RE: [HELP] Keg Pop

Thank you lots.

Actually, still having problems, here's my area.
[Image: untitleasd.png]
(This post was last modified: 06-30-2012, 03:51 AM by himynamebob1.)
06-30-2012, 02:57 AM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: [HELP] Keg Pop

You have to go more on detail. What's wrong? Do you get an error message, or something just won't work?
06-30-2012, 11:08 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#5
RE: [HELP] Keg Pop

If you can interact with it, tell me exactly what you are trying to accomplish in game and how you are trying to do it with your scripts. The more information you give us the more likely we can effectively help you.

I rate it 3 memes.
06-30-2012, 01:11 PM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#6
RE: [HELP] Keg Pop

What I want to happen is, the player picks up a knife and needs what the barrel contains because it is like acid so the player stabs the knife in it makes a sound sets a knife entity active for 2 seconds then turns it off and a particle and water noise start.
06-30-2012, 05:05 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#7
RE: [HELP] Keg Pop

Look how FG made it in the main game.

Think, before you speak Google, before you post
06-30-2012, 05:09 PM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#8
RE: [HELP] Keg Pop

They don't use a knife.
06-30-2012, 05:33 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#9
RE: [HELP] Keg Pop

but they use a drill, it's pretty similiar. The only thing you have to change is that the knife won't rotate, but you just set a second knife active.

Think, before you speak Google, before you post
06-30-2012, 05:35 PM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#10
RE: [HELP] Keg Pop

Well I have no idea which map they did that on.
06-30-2012, 05:37 PM
Find




Users browsing this thread: 1 Guest(s)