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
A complex script problem
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#3
RE: A complex script problem

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);
}
05-22-2013, 07:09 PM
Find


Messages In This Thread
A complex script problem - by Neelke - 05-22-2013, 06:24 PM
RE: A complex script problem - by Tomato Cat - 05-22-2013, 06:56 PM
RE: A complex script problem - by Neelke - 05-22-2013, 07:09 PM
RE: A complex script problem - by Tomato Cat - 05-22-2013, 07:13 PM
RE: A complex script problem - by Neelke - 05-22-2013, 07:19 PM
RE: A complex script problem - by Bridge - 05-22-2013, 07:17 PM



Users browsing this thread: 1 Guest(s)