Frictional Games Forum (read-only)
Help with using ACID on a DOOR - 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: Help with using ACID on a DOOR (/thread-16331.html)



Help with using ACID on a DOOR - Cetex1337 - 06-20-2012

So i'm trying to make a script where some acid from the inventory should break a door. The script so far looks like this:


PHP Code:
void OnStart(){ AddUseItemCallback("""acid""acid_door"aciddoortrue);}
void aciddoor(string &in asItemstring &in asEntity){SetPropHealth("acid_door"0.0f);} 


But it wont let me do that, it says that its some wrong signature or something. I have checked everything, but i don't understand.


RE: Help with using ACID on a DOOR - JMFStorm - 06-20-2012

Can't tell straight away... It might depend on what door entity you are using.


RE: Help with using ACID on a DOOR - Cetex1337 - 06-20-2012

(06-20-2012, 05:25 PM)JMFStorm Wrote: Can't tell straight away... It might depend on what door entity you are using.
It is just the normal "Castle Door"


RE: Help with using ACID on a DOOR - MaZiCUT - 06-20-2012

(06-20-2012, 07:35 PM)Cetex1337 Wrote:
(06-20-2012, 05:25 PM)JMFStorm Wrote: Can't tell straight away... It might depend on what door entity you are using.
It is just the normal "Castle Door"
Then use this!


http://wiki.frictionalgames.com/hpl2/tutorials/script/scripting_by_xtron_-_item_that_unlocks_a_door



RE: Help with using ACID on a DOOR - Apjjm - 06-20-2012

The callback function needs to have it's name passed by string. Use:
Code:
void OnStart()
{
  AddUseItemCallback("", "acid", "acid_door", "aciddoor", true);
}

void aciddoor(string &in asItem, string &in asEntity)
{
  SetPropHealth("acid_door", 0.0f);
}