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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I remove callback for oil etc.?
Author Message
JackoIsDeath Offline
Member

Posts: 171
Joined: Jun 2011
Reputation: 0
Post: #1
How do I remove callback for oil etc.?
Ok, I want to use the oil so I can use it on a table and set it alight.

And maybe use a special tinderbox to do so. but to do that, I'd have to remove that tinderboxes' callback too.

Primarily, all I need to know is how to remove basic items' callbacks so I can use them another way.

Please help Huh

(This post was last modified: 08-17-2011 08:26 PM by JackoIsDeath.)
08-17-2011 08:25 PM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,175
Joined: Mar 2011
Reputation: 56
Post: #2
RE: How do I remove callback for oil etc.?
You'll need to create a custom oil item. Since the default oil is of the potion type, it is consumed as soon as you use it. And you can always script in the tinderbox lighting part. Create an area where you want the oil slick to be, and add the item use callback for the oil. Once it is used, deactivate the oil area and activate an similar area which is a player interaction area (put your callback name in the PlayerInteractCallback). Then with script, change the focus-over icon to the tinderbox icon with SetEntityCustomFocusCrossHair(string& asName, "Ignite");. In the callback, check to make sure the player has a tinderbox (I think you can use HasItem("tinderbox") but if it doesn't work, use a global variable throughout your game to track it) and then upon use, remove 1 tinderbox.

(This post was last modified: 08-17-2011 08:53 PM by palistov.)
08-17-2011 08:52 PM
Find all posts by this user Quote this message in a reply
JackoIsDeath Offline
Member

Posts: 171
Joined: Jun 2011
Reputation: 0
Post: #3
RE: How do I remove callback for oil etc.?
So, if I have the Oil,which is called TableIgnite and the special Tinderbox, which is called TableIgnition, how would I set it out?

EDIT: And the area will be called SlickArea

Thanks for your help

(This post was last modified: 08-17-2011 08:57 PM by JackoIsDeath.)
08-17-2011 08:55 PM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,175
Joined: Mar 2011
Reputation: 56
Post: #4
RE: How do I remove callback for oil etc.?
If you want to use a custom tinderbox just use AddUseItemCallback(string& name, string& item, string& entity, string& callback, bool destroy); for both the oil and tinderbox and the script area.

Use a local variable or some other tracking method to make sure the oil has been used, and then you can allow the tinderbox to be used on the oil slick area.

Give it a shot, I'm sure you can get it working Smile

08-17-2011 09:02 PM
Find all posts by this user Quote this message in a reply
JackoIsDeath Offline
Member

Posts: 171
Joined: Jun 2011
Reputation: 0
Post: #5
RE: How do I remove callback for oil etc.?
(08-17-2011 09:02 PM)palistov Wrote:  If you want to use a custom tinderbox just use AddUseItemCallback(string& name, string& item, string& entity, string& callback, bool destroy); for both the oil and tinderbox and the script area.

Use a local variable or some other tracking method to make sure the oil has been used, and then you can allow the tinderbox to be used on the oil slick area.

Give it a shot, I'm sure you can get it working Smile

Thanks alot, man (:

So, I just use that Callback and i won't need to bother about removing it's original callbacks?

08-17-2011 09:04 PM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,175
Joined: Mar 2011
Reputation: 56
Post: #6
RE: How do I remove callback for oil etc.?
If they're custom items (they have to be Puzzle items, which you change in the user-defined variables) then yes they will only do what your script allows them to. So you control them.

08-17-2011 09:12 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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