| RE: I need some help I can't check if the 4 chemicals are placed in the  acid machine 
 
				today i found the solution but I can't make a fire but the lights are placed in the map and i set it with particle system created with script CreateParticleSystemAtEntity So i delete some varints setted
 so I removed some varInts
 This is my script:
 void OnStart()
 {
 SetLocalVarInt("CheckChemicalsinMachine", 0); //VarInt of the 4 chemicals
 for(int i=0; i<=4; i++)
 {
 SetWheelStuckState("Valve_" +i, -1, true);
 }
 
 SetWheelStuckState("ValveIgnite", -1, true);
 
 SetPlayerSanity(10);
 SetLocalVarInt("Var2", 0);
 SetLocalVarInt("Var1", 0);
 AddUseItemCallback("placebottle", "container", "AreaUseMachine", "ItemJarOnMachine", true);
 AddUseItemCallback("placebottle2", "container", "AreaPlaceJar", "ItemJarOnMachine", true);
 AddUseItemCallback("placebottle3", "container", "ValveIgnite", "ItemJarOnMachine", true);
 AddUseItemCallback("", "Cuprite", "JarEmptyChemical_1", "Cupritesound", true);
 AddUseItemCallback("", "Oripment", "JarEmptyChemical_2", "Oripmentsound", true);
 AddUseItemCallback("", "Aqua Regia", "JarEmptyChemical_3", "AquaRegiasound", true);
 AddUseItemCallback("", "Calamine", "JarEmptyChemical_4", "Calaminesound", true);
 }
 void ItemJarOnMachine(string &in asItem, string &in asEntity)
 {
 if (GetLocalVarInt("Var2") == 0)
 {
 RemoveItem(asItem);
 SetEntityActive("Container_static_1", true);
 PlaySoundAtEntity("PlaceJar","puzzle_place_jar", "AreaCompleteSuccess", 0, false);
 CheckChemical();
 {
 }
 }
 else if (GetLocalVarInt("Var4")== 2)
 {
 AddLocalVarInt("Var4", 2);
 SetWheelInteractionDisablesStuck("ValveIgnite", true);
 }
 }
 void Cupritesound(string &in asItem, string &in asEntity)
 {
 AddLocalVarInt("CheckChemicalsinMachine", 1);
 RemoveItem(asItem);
 SetEntityActive("JarChemical_1", true);
 SetEntityActive("JarEmptyChemical_1", false);
 PlaySoundAtEntity("", "puzzle_add_chemical.snt", "Player", 0.1, false);
 CheckChemical();
 }
 
 void Oripmentsound(string &in asItem, string &in asEntity)
 {
 
 AddLocalVarInt("CheckChemicalsinMachine", 1);
 RemoveItem(asItem);
 SetEntityActive("JarChemical_2", true);
 SetEntityActive("JarEmptyChemical_2", false);
 PlaySoundAtEntity("", "puzzle_add_chemical.snt", "Player", 0.1, false);
 CheckChemical();
 }
 void AquaRegiasound(string &in asItem, string &in asEntity)
 {
 AddLocalVarInt("CheckChemicalsinMachine", 1);
 RemoveItem(asItem);
 SetEntityActive("JarChemical_3", true);
 SetEntityActive("JarEmptyChemical_3", false);
 PlaySoundAtEntity("", "puzzle_add_chemical.snt", "Player", 0.1, false);
 CheckChemical();
 }
 
 void Calaminesound(string &in asItem, string &in asEntity)
 {
 AddLocalVarInt("CheckChemicalsinMachine", 1);
 RemoveItem(asItem);
 SetEntityActive("JarChemical_4", true);
 SetEntityActive("JarEmptyChemical_4", false);
 PlaySoundAtEntity("", "puzzle_add_chemical.snt", "Player", 0.1, false);
 CheckChemical();
 }
 
 void Puzzle(string &in asEntity, int alState)
 {
 for (int i=0; i<=4; i++)
 {
 SetWheelInteractionDisablesStuck("Valve_"+i, true); //loop as the 4 Valve are Disable the StuckState
 //else if the Var !=4 it compares the message
 SetMessage("Messages", "conteiner", 0);
 }
 // check the varint
 if (GetLocalVarInt("Var1") <=5)
 {
 if (alState == 1) //if the ValveIgnite +alState == 1 it unstuck the Valves
 {
 AddLocalVarInt("Var1", 1);
 SetWheelInteractionDisablesStuck("Valve_1", true);
 }
 else AddLocalVarInt("Var1", 1);
 if (alState == 1) //Valve_1
 {
 AddLocalVarInt("Var1", 1);
 SetWheelInteractionDisablesStuck("Valve_3", true);
 }
 else if(alState ==1)	//Valve_2
 {
 AddLocalVarInt("Var1", 1);
 if (alState == 1) //Valve_3
 {
 AddLocalVarInt("Var1", 1);
 SetWheelInteractionDisablesStuck("Valve_4", true);
 }
 }
 }
 }
 
 void CheckChemical() //it check until the 4 wheels are stucked in state 1 the container will be active and the static container will be disapair, and give the boost sanity//
 {
 if (GetLocalVarInt("CheckChemicalsinMachine") !=4)
 {
 
 }
 else if(GetLocalVarInt("CheckChemicalsinMachine") ==4)
 {
 GiveSanityBoost();
 SetEntityActive("chemical_1", true);
 SetEntityActive("Container_static_1", false);
 }
 for(int i=0; i<=4;i++)
 {
 CreateParticleSystemAtEntity("", "ps_fire_lab_burner.ps", "PointLight_"+i, false);
 }
 }
 
				
(This post was last modified: 02-23-2014, 10:37 PM by davide32.)
 |