Frictional Games Forum (read-only)
How do I remove callback for oil etc.? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How do I remove callback for oil etc.? (/thread-9829.html)



How do I remove callback for oil etc.? - ObsidianLegion - 08-17-2011

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




RE: How do I remove callback for oil etc.? - palistov - 08-17-2011

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.


RE: How do I remove callback for oil etc.? - ObsidianLegion - 08-17-2011

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




RE: How do I remove callback for oil etc.? - palistov - 08-17-2011

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


RE: How do I remove callback for oil etc.? - ObsidianLegion - 08-17-2011

(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?


RE: How do I remove callback for oil etc.? - palistov - 08-17-2011

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.