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
Can someone tell me what is wrong with this script? (once again)
Magasztos Offline
Member

Posts: 54
Threads: 21
Joined: Jun 2012
Reputation: 0
#1
Can someone tell me what is wrong with this script? (once again)

sorry to keep bothering all you nice people with my problems but I have yet another scripting problem and I just can't seem to solve it and that is probably because I tried something without knowing if it is even possible...just to make things as clear as possible it works like this:



You put something in the Extractor oven, (it is not supposed to work without something in it or with the door open) you pull the lever and the extracted material goes into the glass container.



And this is my script:

void OnStart()

{

AddUseItemCallback("", "hammer_1", "padlock_1", "BreakPadlock", true);

AddUseItemCallback("", "dagger", "corpse_1", "KnifeActive", true);

AddUseItemCallback("", "knife_1", "ScriptArea_1", "KnifeActive2", true);

AddEntityCollideCallback("lever_1", "ScriptArea_2", "AcidPrepare", false, 1);

AddUseItemCallback("", "dagger", "ScriptArea_1", "GiveMessage", true);

}



void BreakPadlock(string &in asItem, string &in asEntity)

{

SetEntityActive("Padlock_1", false);

SetEntityActive("Padlock_2", true);

CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaDust", false);

PlaySoundAtEntity("", "break_wood_metal.snt", "prison_1", 0.0f, false);

}



void KnifeActive(string &in asItem, string &in asEntity)

{

SetEntityActive("corpse_1", false);

SetEntityActive("corpse_2", true);

SetEntityActive("knife_1", true);

RemoveItem("dagger");

PlaySoundAtEntity("", "slime_attack_normal_hit.snt", "knife_1", 0.0f, false);

CreateParticleSystemAtEntity("", "blood.ps", "BloodArea", false);

}





void KnifeActive2(string &in asItem, string &in asEntity)

{

SetEntityActive("knife_2", true);

RemoveItem("knife_1");

}





void AcidPrepare(string &in asParent, string &in asChild, int alState)

{

    if(GetSwingDoorClosed("Extract") == false)

    {

        SetMessage("Messages", "CloseDoor", 0);

    }

    else

    {

        AddTimer("", 2.0, "TimerSwitchShovel");

        CreateParticleSystemAtEntity("", "blood.ps", "BloodArea2", false);

        SetEntityActive("glass_1", false);

        SetEntityActive("glass_2", true);

    }

    if(GetEntityExists("knife_2") == false)

    {

        SetMessage("Messages", "ExtractIsEmpty"

    }

    else

    {

        AddEntityCollideCallback("lever_1", "ScriptArea_2", "AcidPrepare", false, 1);

    }

}



void GiveMessage(string &in asItem, string &in asEntity)

{

SetMessage("Messages", "DaggerClean", 0);

}





void OnEnter()

{



}



void OnLeave()

{



}

It solved itself sort of...

~The Hulk is always greener on the other side~
(This post was last modified: 07-22-2012, 12:48 PM by Magasztos.)
07-21-2012, 09:36 PM
Find




Users browsing this thread: 1 Guest(s)