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
#1
A complex script problem

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
05-22-2013, 06:24 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: A complex script problem

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.
(This post was last modified: 05-22-2013, 07:12 PM by Tomato Cat.)
05-22-2013, 06:56 PM
Find
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
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: A complex script problem

All of your names match and such?
05-22-2013, 07:13 PM
Find
Bridge Offline
Posting Freak

Posts: 1,971
Threads: 25
Joined: May 2012
Reputation: 128
#5
RE: A complex script problem

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

Again in line 39: "bruner_off".
(This post was last modified: 05-22-2013, 07:19 PM by Bridge.)
05-22-2013, 07:17 PM
Find
Neelke Offline
Senior Member

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

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

Ye, its a typo
(This post was last modified: 05-22-2013, 07:23 PM by Neelke.)
05-22-2013, 07:19 PM
Find




Users browsing this thread: 1 Guest(s)