Frictional Games Forum (read-only)

Full Version: A complex script problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This script is about boiling blood to proceed with a magical potion. Everything is working just perfectly, the game aint crashing or anything, but when I've put the container on the burner and turn the wheel, nothing is happening. So, could someone be a nice guy and make a quick script for me? You would do me a great favour
Just post what you have now. It's easier to fix what might be broken than to make an entirely new one.


Check the wiki as well.
void GlassJarHeaterWithBlood(string &in asItem, string &in asEntity)
{
SetEntityActive("glass_container_blood_static_1", true);

RemoveItem(asItem);

PlaySoundAtEntity("placeglass", "26_place_glass", asEntity, 0.0f, false);

//Delay the boil a bit
AddTimer("BloodInPlace", 1, "TimerBloodInPlace");
}

void TimerBloodInPlace(string &in asTimer)
{
SetLocalVarInt("BloodOnBurner", 1);

//Check if blood is ready to boil!
CheckBoilBlood();
}

//------------------------------------------

void TurnSpecialBurner(string &in asEntityName, int alState)
{
if(alState == 1)
{
PlaySoundAtEntity("bruner_on","26_burner_ignite.snt", "AreaBurner", 0, false);

CreateParticleSystemAtEntity("burnerfire", "ps_fire_lab_burner.ps", "AreaBurner", true);

PlaySoundAtEntity("burnerfire","26_burner_loop.snt", "AreaBurner", 1, true);

SetLocalVarInt("BurnerReady", 1);

AddTimer("burnerfullspeed",2, "TimerBurnerFullSpeed");
}
else if(alState == -1)
{
PlaySoundAtEntity("bruner_off","26_burner_ignite.snt", "AreaBurner", 0.15f, false);

DestroyParticleSystem("burnerfire");
StopSound("burnerfire", 1);

RemoveTimer("burnerfullspeed");

SetLocalVarInt("BurnerReady", 0);
}

AddDebugMessage("Burner state: "+ alState, false);
}

void TimerBurnerFullSpeed(string &in asTimer)
{
SetLocalVarInt("BurnerReady", 1);

//Check if blood is ready to boil!
CheckBoilBlood();
}

//------------------------------------------

void CheckBoilBlood()
{
//If the burner is a full speed, blood is in place and blood is not boiled yet, then
if(GetLocalVarInt("BurnerReady")==1 && GetLocalVarInt("BloodOnBurner")==1 && GetLocalVarInt("BloodBoiled")==0)
{
SetLocalVarInt("BloodBoiled", 1);

CreateParticleSystemAtEntity("bloodboil", "ps_glass_container_blood_bubbles.ps", "AreaBloodBoil", false);
PlaySoundAtEntity("bloodboil","puzzle_boil.snt", "AreaBloodBoil", 1, false);

AddTimer("boileffectdone", 3, "TimerBoilEffectDone");
}
}

void TimerBoilEffectDone(string &in asTimer)
{
DestroyParticleSystem("bloodboil");
StopSound("bloodboil",1);

AddTimer("fadeoutblood", 0.3, "TimerBoilEffectFadeOutBlood");
SetPropActiveAndFade("boiled_blood", true, 0.5);

PlaySoundAtEntity("boildone","puzzle_acid", "AreaBloodBoil", 0, false);
}

void TimerBoilEffectFadeOutBlood(string &in asTimer)
{
SetPropActiveAndFade("glass_container_blood_static_1", false, 0.5);
}
All of your names match and such?
Line 27: "bruner_on" - I assume that's a typo?

Again in line 39: "bruner_off".
Yes, I've double checked quite alot, but theres obviously something wrong in the level editor then

Ye, its a typo