Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help I need some help I can't check if the 4 chemicals are placed in the acid machine
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#1
I need some help I can't check if the 4 chemicals are placed in the acid machine

I tried to do a chemical acid but how can I check if the VarInt is = to 4 chemicals? Can the help me? i give you my hps file and the map for modify the hps file and check in the map what have i did
my hps file: https://www.mediafire.com/?8mq0vgei8595hfd
my map: http://www.mediafire.com/download/i03at3...Level5.map
send it from e-mail pls after modified the hps file with corrections in CAPS LOCK Please ask me
(This post was last modified: 02-22-2014, 07:05 PM by davide32.)
02-22-2014, 07:04 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: I need some help I can't check if the 4 chhemicals are placed in te acid machine

Ive checked your scripts and you have too many VarInts. Try deleteing a few and check later if it helps.
02-22-2014, 09:32 PM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#3
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.)
02-23-2014, 10:29 PM
Find




Users browsing this thread: 1 Guest(s)