Frictional Games Forum (read-only)
[SCRIPT] Adduseitem callback not working? - 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: [SCRIPT] Adduseitem callback not working? (/thread-14777.html)



Adduseitem callback not working? - zombiehacker595 - 04-14-2012


AddUseItemCallback("", "chemical_container_1", "epoxy_container02_1", "pickepoxy", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_2", "pickepoxy1", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_3", "pickepoxy2", true);
}

void pickepoxy(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("", "chemical_container_epoxy_1", "", "chemical_container_epoxy.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

void pickepoxy1(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("", "chemical_container_epoxy_1", "", "chemical_container_epoxy.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

void pickepoxy2(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("", "chemical_container_epoxy_1", "", "chemical_container_epoxy.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

ok the script above is from my lab.map and it works pefectly but below when i try to mix the epoxy

with the acid container on my kitchen.map it wont work did i do anything wrong here



AddUseItemCallback("", "chemical_container_epoxy_1", "acid_container_1", "pickacid", true);
}

void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_epoxy_1");
GiveItem("", "chemical_container_full_1", "", "chemical_container_full.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}



RE: Adduseitem callback not working? - heyitsrobert97 - 04-14-2012

need to make an internal name for the chemicals that you add

{
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_1", "pickepoxy", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_2", "pickepoxy", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_3", "pickepoxy", true);
}

void pickepoxy(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("chemical_1", "chemical_container_epoxy_1", "", "chemical_container_epoxy.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
AddUseItemCallback("", "chemical_1", "acid_container_1", "pickacid", true);
}

void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_epoxy_1");
GiveItem("finishedchemical", "chemical_container_full_1", "", "chemical_container_full.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

Cleaned up Big Grin I saw your map on moddb it looks good Cool Check Out Mine http://www.moddb.com/mods/this-darn-house




RE: Adduseitem callback not working? - zombiehacker595 - 04-14-2012

(04-14-2012, 12:48 PM)heyitsrobert97 Wrote: need to make an internal name for the chemicals that you add

{
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_1", "pickepoxy", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_2", "pickepoxy", true);
AddUseItemCallback("", "chemical_container_1", "epoxy_container02_3", "pickepoxy", true);
}

void pickepoxy(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("chemical_1", "chemical_container_epoxy_1", "", "chemical_container_epoxy.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
AddUseItemCallback("", "chemical_1", "acid_container_1", "pickacid", true);
}

void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_epoxy_1");
GiveItem("finishedchemical", "chemical_container_full_1", "", "chemical_container_full.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

Cleaned up Big Grin I saw your map on moddb it looks good Cool Check Out Mine http://www.moddb.com/mods/this-darn-house


thanks Big Grin oh and also i have played your map really good! Smile