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
How do I remove callback for oil etc.?
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#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


"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
(This post was last modified: 08-17-2011, 08:26 PM by ObsidianLegion.)
08-17-2011, 08:25 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#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


"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
(This post was last modified: 08-17-2011, 08:57 PM by ObsidianLegion.)
08-17-2011, 08:55 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#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?

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
08-17-2011, 09:04 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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




Users browsing this thread: 1 Guest(s)