Frictional Games Forum (read-only)

Full Version: How do I remove callback for oil etc.?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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

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.
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

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)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?
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.