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
Script Help Script help needed
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Script help needed

Okay!

I think I figured it out.
Big Grin

void OnStart()
{


    AddEntityCollideCallback(*objectthing*,*area*,"oven_check_x",true,1);
    *Add your other collides, etc*

    SetEntityConnectionStateChangeCallback("Lever1","CheckIngredients");
    
    SetLocalVarInt("AllCorrect",0);
    SetLocalVarInt("check",0);
}

void CheckIngredients(string &in asEntity, int alState)
{    
    int StateSwitch = GetLocalVarInt("oven_correct");
    
    if(alState == 1)
    {
    
    switch(StateSwitch)
    {
        case 0:
          //Do whatever if order of said objects isn't correct///
        break;
        
        case 1:
             //This case will execute if the order is correct///
            AddLocalVarInt("AllCorrect",1);
            AllCorrectFunc();
        break;
    }
        
    }
}

void oven_check_x(string &in asParent, string &in asChild, int alState)
{
   *repeat this function for as many objects you have*
    ///Will add if the object is in correct place///
    AddLocalVarInt("check",1);
    Setlocal();
    
}

void AllCorrectFunc()
{
    if(GetLocalVarInt("AllCorrect") == 1)
    {
    ///Do whatever if everything is correct///
    }
}

void Setlocal()
{
    if(GetLocalVarInt("check") == *how ever many number of objects that you have in ovens*)
    {
    SetLocalVarInt("oven_correct",1);
    }
}

Then again, I'm not too confident, but try something like this and see if it works.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 09-11-2012, 06:43 PM by Tomato Cat.)
09-11-2012, 06:02 PM
Find


Messages In This Thread
Script help needed - by Steve - 09-11-2012, 03:35 PM
RE: Script help needed - by Tomato Cat - 09-11-2012, 06:02 PM
RE: Script help needed - by Steve - 09-11-2012, 06:46 PM
RE: Script help needed - by Tomato Cat - 09-11-2012, 10:24 PM
RE: Script help needed - by Steve - 09-12-2012, 07:35 AM
RE: Script help needed - by Your Computer - 09-12-2012, 02:11 PM
RE: Script help needed - by FlawlessHappiness - 09-12-2012, 02:21 PM
RE: Script help needed - by Steve - 09-16-2012, 09:18 PM
RE: Script help needed - by FlawlessHappiness - 09-16-2012, 09:29 PM
RE: Script help needed - by Steve - 09-19-2012, 05:32 PM
RE: Script help needed - by Your Computer - 09-19-2012, 06:30 PM
RE: Script help needed - by Steve - 09-19-2012, 08:29 PM
RE: Script help needed - by FlawlessHappiness - 09-19-2012, 06:38 PM
RE: Script help needed - by Your Computer - 09-19-2012, 08:38 PM
RE: Script help needed - by Steve - 09-19-2012, 08:51 PM
RE: Script help needed - by Steve - 10-04-2012, 03:46 PM
RE: Script help needed - by Steve - 10-05-2012, 04:55 PM
RE: Script help needed - by Robby - 10-05-2012, 05:48 PM
RE: Script help needed - by The chaser - 10-05-2012, 08:33 PM
RE: Script help needed - by Steve - 10-06-2012, 08:02 PM
RE: Script help needed - by The chaser - 10-06-2012, 08:32 PM
RE: Script help needed - by Steve - 10-06-2012, 09:37 PM
RE: Script help needed - by Robby - 10-06-2012, 08:02 PM
RE: Script help needed - by Your Computer - 10-06-2012, 08:37 PM
RE: Script help needed - by Robby - 10-06-2012, 08:45 PM
RE: Script help needed - by Steve - 10-08-2012, 03:23 PM



Users browsing this thread: 1 Guest(s)