Frictional Games Forum (read-only)
A complex script 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: A complex script problem (/thread-21578.html)



A complex script problem - Neelke - 05-22-2013

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


RE: A complex script problem - Tomato Cat - 05-22-2013

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.


RE: A complex script problem - Neelke - 05-22-2013

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);
}


RE: A complex script problem - Tomato Cat - 05-22-2013

All of your names match and such?


RE: A complex script problem - Bridge - 05-22-2013

Line 27: "bruner_on" - I assume that's a typo?

Again in line 39: "bruner_off".


RE: A complex script problem - Neelke - 05-22-2013

Yes, I've double checked quite alot, but theres obviously something wrong in the level editor then

Ye, its a typo