Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call a function when pick up an item
Author Message
RenanFOX2 Offline
Junior Member

Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #1
Call a function when pick up an item

Hey guys, I'm having a big trouble to call a function when the player pick up an item. I tried to use SetEntityPlayerInteractCallback but it didn't worked.
(This post was last modified: 04-20-2012 03:36 PM by RenanFOX2.)
04-20-2012 03:01 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 42
Post: #2
RE: Call a function when pick up an item

Wrong thread for help, it's supposed to be in Development support Smile

You can call the function with the item in the level editor

04-20-2012 03:05 PM
Find all posts by this user Quote this message in a reply
RenanFOX2 Offline
Junior Member

Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #3
RE: Call a function when pick up an item

(04-20-2012 03:05 PM)SilentStriker Wrote:  Wrong thread for help, it's supposed to be in Development support Smile

You can call the function with the item in the level editor
Please come one. Sorry for postin in the wrong thread for help, but I'm stunk here for two days.

How to call a function using this way?
04-20-2012 03:12 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 42
Post: #4
RE: Call a function when pick up an item

When creating an item in the level editor, select it and press the entity tab on the right, then in Callback func write the name of your function then in the .hps you write like this

void OnStart()
{

}

void NAMEOFFUNCTION(string &in asEntity, string &in asType)
{
//Stuff you want to happen
}

04-20-2012 03:20 PM
Find all posts by this user Quote this message in a reply
RenanFOX2 Offline
Junior Member

Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #5
RE: Call a function when pick up an item

(04-20-2012 03:20 PM)SilentStriker Wrote:  When creating an item in the level editor, select it and press the entity tab on the right, then in Callback func write the name of your function then in the .hps you write like this

void OnStart()
{

}

void NAMEOFFUNCTION(string &in asEntity, string &in asType)
{
//Stuff you want to happen
}
Thanks a lot!!!
It's working now XD
04-20-2012 03:37 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 42
Post: #6
RE: Call a function when pick up an item

You're welcome Smile

04-20-2012 03:37 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)