Frictional Games Forum (read-only)
Mixing chemicals problem ! - 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: Mixing chemicals problem ! (/thread-9607.html)

Pages: 1 2


Mixing chemicals problem ! - HumiliatioN - 08-05-2011

So I need to know why this is Not working?

Script:

void OnStart()
{
//if(ScriptDebugOn())
//{
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetEntityActive("chemical_container_full_1", true);
// SetEntityActive("glass_container_mix_done_2", true);
//}
SetLocalVarInt("EpoxyNumber", 0);
AddEntityCollideCallback("Player", "ExplosiveQuest", "AddQuest", true, 1);
AddUseItemCallback("", "kainite_1", "extaction_oven_1", "AddKainitetoOven", true);
AddUseItemCallback("", "chemical_container_1", "extaction_oven_1", "PutContainerUnderExtractor", true);
AddEntityCollideCallback("extaction_oven_lever_1", "ScriptArea_1", "Extraction1", false, 1);

AddUseItemCallback("", "glass_container_1", "epoxy_container01_1", "UseEmptyContainerOnEpoxyContainer", true);
AddUseItemCallback("", "glass_container_1", "epoxy_container02_1", "UseEmptyContainerOnEpoxyContainer", true);
AddUseItemCallback("", "glass_container_mix_notdone_1", "epoxy_container01_1", "UseEmptyContainerOnEpoxyContainer", true);
AddUseItemCallback("", "glass_container_mix_notdone_2", "epoxy_container02_1", "UseEmptyContainerOnEpoxyContainer", true);

AddUseItemCallback("", "glass_container_blood_1", "cave_in_1", "UseExplosiveOnRocks", true);
AddEntityCollideCallback("Player", "explosivegood", "BOOM", false, 1);
}

void AddQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("ExplosiveQuest", "ExplosiveQuest");
}

void InteractGlassContainer(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 6, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0.1, "");
}

void AddKainitetoOven(string &in asItem, string &in asEntity)
{
RemoveItem("kainite_1");
SetEntityActive("flask01_2", true);
AddLocalVarInt("KainiteInExtractor", 1);
}

void PutContainerUnderExtractor(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
SetEntityActive("chemical_container_static_1", true);
AddLocalVarInt("ContainerUnderExtractor", 1);
}

void Extraction1(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("KainiteInExtractor") == 1 && GetLocalVarInt("ContainerUnderExtractor") == 1)
{
PlaySoundAtEntity("", "12_epoxy_fill.snt", "chemical_container_static_1", 0, false);
SetEntityActive("ScriptArea_1", false);
SetEntityActive("flask01_2", false);
SetEntityActive("chemical_container_static_1", false);
SetEntityActive("chemical_container_full_1", true);
}
else if(GetLocalVarInt("KainiteInExtractor") != 1 && GetLocalVarInt("ContainerUnderExtractor") == 1)
{
SetMessage("Messages", "AddKainite", 0);
}
else if(GetLocalVarInt("ContainerUnderExtractor") != 1 && GetLocalVarInt("KainiteInExtractor") == 1)
{
SetMessage("Messages", "AddContainer", 0);
}
else
{
SetMessage("Messages", "AddBoth", 0);
}
}

void UseEmptyContainerOnEpoxyContainer(string &in asItem, string &in asEntity)
{
if(GetLocalVarInt("EpoxyNumber") == 0 && asEntity == "epoxy_container01_1")
{
CreateParticleSystemAtEntity("Drip1_1", "ps_liquid_epoxy_drip", "EpoxyDrip_1", true);
StartPlayerLookAt("glass_container_mix_notdone_2", 2, 2, "");
SetEntityActive("glass_container_mix_notdone_2", true);
RemoveItem(asItem);
SetLocalVarInt("EpoxyNumber", 1);
AddTimer("donelook", 1.5f, "EpoxyTimer");
}
else if(GetLocalVarInt("EpoxyNumber") == 0 && asEntity == "epoxy_container02_1")
{
CreateParticleSystemAtEntity("Drip1_2", "ps_liquid_epoxy_drip", "EpoxyDrip_2", true);
StartPlayerLookAt("glass_container_mix_notdone_1", 2, 2, "");
SetEntityActive("glass_container_mix_notdone_1", true);
RemoveItem(asItem);
SetLocalVarInt("EpoxyNumber", 1);
AddTimer("donelook", 1.5f, "EpoxyTimer");
}
else if(GetLocalVarInt("EpoxyNumber") == 1 && asEntity == "epoxy_container01_1")
{
CreateParticleSystemAtEntity("Drip2_1", "ps_liquid_epoxy_drip", "EpoxyDrip_1", true);
StartPlayerLookAt("glass_container_mix_done_2", 2, 2, "");
SetEntityActive("glass_container_mix_done_2", true);
RemoveItem(asItem);
SetLocalVarInt("EpoxyNumber", 2);
AddTimer("donelook", 1.5f, "EpoxyTimer");
}
else if(GetLocalVarInt("EpoxyNumber") == 1 && asEntity == "epoxy_container02_1")
{
CreateParticleSystemAtEntity("Drip2_2", "ps_liquid_epoxy_drip", "EpoxyDrip_2", true);
StartPlayerLookAt("glass_container_mix_done_1", 2, 2, "");
SetEntityActive("glass_container_mix_done_1", true);
RemoveItem(asItem);
SetLocalVarInt("EpoxyNumber", 2);
AddTimer("donelook", 1.5f, "EpoxyTimer");
}
else if(GetLocalVarInt("EpoxyNumber") == 2)
{
SetMessage("Messages", "EpoxyFull", 0);
}
}

void EpoxyTimer(string &in asTimer)
{
StopPlayerLookAt();
DestroyParticleSystem("Drip1_1");
DestroyParticleSystem("Drip1_2");
DestroyParticleSystem("Drip2_1");
DestroyParticleSystem("Drip2_2");
}

void UseExplosiveOnRocks(string &in asItem, string &in asEntity)
{
RemoveItem(asItem);
SetEntityActive("explosive_static", true);
SetLocalVarInt("ExplosiveReady", 1);
}

void BOOM(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("ExplosiveReady") == 1)
{
StartPlayerLookAt("AreaLookAt", 4, 4, "");
PlaySoundAtEntity("epoxyignite", "12_epoxy_blow", "cave_in_1", 0, false);
AddTimer("donelook", 2, "TimerDoneLookAt");
}
}

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
StartScreenShake(0.08, 2.5f, 0, 1.0f);
CreateParticleSystemAtEntity("", "ps_break_cavein", "AreaLookAt", false);
SetEntityActive("cave_in_1", false);
SetEntityActive("cave_in_destroyed_1", true);
SetEntityActive("explosive_static", false);
CompleteQuest("ExplosiveQuest", "ExplosiveQuest");
SetLocalVarInt("ExplosiveReady", 0);
}

Inventory.hps file:

void OnGameStart()
{
AddCombineCallback("", "chemical_container_full_1", "glass_container_mix_done_1", "CombineExplosive", false);
AddCombineCallback("", "chemical_container_full_1", "glass_container_mix_done_2", "CombineExplosive", false);
}

void CombineExplosive(string &in asItemA, string &in asItemB)
{
RemoveItem(asItemA);
RemoveItem(asItemB);
GiveItem("glass_container_blood_1", "Puzzle", "explosive", "glass_container_blood.tga", 0);
}

I can fill container those two liquids and then "Put" that "kainite" extaction oven then "flash" becames active but then I try to mix that "container on oven but "I can't" It's not working where is the problem?

Thanks.



RE: Mixing chemicals problem ! - HumiliatioN - 08-07-2011

Hey! Can anybody help me I'm stuck with this chemical puzzle thing. Damn.


RE: Mixing chemicals problem ! - Apjjm - 08-07-2011

(08-07-2011, 01:48 PM)HumiliatioN Wrote: Hey! Can anybody help me I'm stuck with this chemical puzzle thing. Damn.

Is your oven called "extraction_oven_1" or "extaction_oven_1"?


RE: Mixing chemicals problem ! - HumiliatioN - 08-07-2011

(08-07-2011, 04:02 PM)Apjjm Wrote:
(08-07-2011, 01:48 PM)HumiliatioN Wrote: Hey! Can anybody help me I'm stuck with this chemical puzzle thing. Damn.

Is your oven called "extraction_oven_1" or "extaction_oven_1"?

Extaction_oven_1? What about that?


RE: Mixing chemicals problem ! - Apjjm - 08-07-2011

(08-07-2011, 08:14 PM)HumiliatioN Wrote:
(08-07-2011, 04:02 PM)Apjjm Wrote:
(08-07-2011, 01:48 PM)HumiliatioN Wrote: Hey! Can anybody help me I'm stuck with this chemical puzzle thing. Damn.

Is your oven called "extraction_oven_1" or "extaction_oven_1"?

Extaction_oven_1? What about that?
I was guessing you made a typo in the script, because calling the object in the map "extraction_oven_1" would make more sense considering you spelled it correctly everywhere else? You might want to double check that the names are exactly the same including case. Failing that, it is most likely still a problem with the callback being triggered in the first place. You will want to put debug messages in your script, one per function, to track what is actually getting triggered.


RE: Mixing chemicals problem ! - HumiliatioN - 08-07-2011

(08-07-2011, 08:23 PM)Apjjm Wrote:
(08-07-2011, 08:14 PM)HumiliatioN Wrote:
(08-07-2011, 04:02 PM)Apjjm Wrote:
(08-07-2011, 01:48 PM)HumiliatioN Wrote: Hey! Can anybody help me I'm stuck with this chemical puzzle thing. Damn.

Is your oven called "extraction_oven_1" or "extaction_oven_1"?

Extaction_oven_1? What about that?
I was guessing you made a typo in the script, because calling the object in the map "extraction_oven_1" would make more sense considering you spelled it correctly everywhere else? You might want to double check that the names are exactly the same including case. Failing that, it is most likely still a problem with the callback being triggered in the first place. You will want to put debug messages in your script, one per function, to track what is actually getting triggered.

Oh found the problem. That Debug message thing is very good ! Thanks for help !


RE: Mixing chemicals problem ! - Selyp - 08-07-2011

What was the problem? I am having a similar problem and would like to know how you fixed it.


RE: Mixing chemicals problem ! - HumiliatioN - 08-08-2011

(08-07-2011, 11:45 PM)Selyp Wrote: What was the problem? I am having a similar problem and would like to know how you fixed it.

That "Exctation" / "Exctraction" I have named wrong that. But show that script if you want. Tongue

I can try to help you.


RE: Mixing chemicals problem ! - Selyp - 08-08-2011

My script is

void OnGameStart()
{
AddCombineCallback("", "Vinegar", "PhosphoricAcid", "CombineFunc", true);
}
void CombineFunc(string &in asItemA,string &in asItemB)
{
SetMessage ("Descriptions", "Piano", 10);
GiveSanityBoost();
RemoveItem("Vinegar");
RemoveItem("PhosphoricAcid");
GiveItem("", bucket_of_tar", "bucket_of_tar", "bucket_of_tar.tga", 1);
}

The message is just there so I can determine if the function is being called. Since it's not showing up I'm assuming that the function is being called at all, which is strange because I am positive the names of the items are correct. I have triple checked them multiple times lol.



RE: Mixing chemicals problem ! - HumiliatioN - 08-08-2011

(08-08-2011, 12:08 AM)Selyp Wrote: My script is

void OnGameStart()
{
AddCombineCallback("", "Vinegar", "PhosphoricAcid", "CombineFunc", true);
}
void CombineFunc(string &in asItemA,string &in asItemB)
{
SetMessage ("Descriptions", "Piano", 10);
GiveSanityBoost();
RemoveItem("Vinegar");
RemoveItem("PhosphoricAcid");
GiveItem("", bucket_of_tar", "bucket_of_tar", "bucket_of_tar.tga", 1);
}

The message is just there so I can determine if the function is being called. Since it's not showing up I'm assuming that the function is being called at all, which is strange because I am positive the names of the items are correct. I have triple checked them multiple times lol.

Hmm.. This is strange. Maybe you have hps. file something wrong. Don't know really weird. Undecided