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 following statues
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#16
RE: following statues

sorry...
I tried this:

void OnStart()
{
    for(int i = 0; i < 4; i++)
    {
        SetEntityPlayerLookAtCallback
                ("statue_" + i, "checklookatstatue", false);
    }
    
    for (int i=0;i<4;i++)
    {    
    AddEntityCollideCallback("Player","area_"+ i, "statueFunction", false, 1);
    }
    
}    


bool lookAt = false;
void checklookatstatue(string &in asEntity, int alState)
{
    AddDebugMessage("checklookatstatue",false);
    if(alState > 0)
    {
        
        lookAt = true;
    
    }
    else
    {
        lookAt = false;
    }
}


string lastArea = "";
string activeStatue = "";

void statueFunction(string &in asParent, string &in asChild, int alState)
{
    if(! lookAt)
    {
        string areanumber = StringSub(asChild, 5, 1);
        AddDebugMessage(asChild,false);
        AddDebugMessage(areanumber,false);
        AddDebugMessage(lastArea,false);
        SetEntityActive("statue_"+lastArea,true);
        SetEntityActive(activeStatue,false);
        activeStatue = "statue_"+lastArea;
        lastArea = areanumber;    
    }
    
}

Now it works better. If you see any statue, like if you go backwards, the statues wont "follow" you.
But looking at a statue means not, that the statue is on the screen.
If you see the statue, but not in center (at the screen corner) it counts as you dont see it...
I know that from the debug messages.
so, still not 100% but a bit more..

I will go on working on it, if you have an idear you are welcome to tell me.

No one knows, how "I" goes.
(This post was last modified: 03-02-2013, 11:47 AM by Knusper..)
03-02-2013, 11:46 AM
Find


Messages In This Thread
following statues - by Knusper. - 02-28-2013, 05:14 PM
RE: following statues - by Tiger - 02-28-2013, 06:01 PM
RE: following statues - by Knusper. - 02-28-2013, 06:09 PM
RE: following statues - by Tiger - 02-28-2013, 06:13 PM
RE: following statues - by Knusper. - 02-28-2013, 08:12 PM
RE: following statues - by Adrianis - 03-01-2013, 01:59 AM
RE: following statues - by darksky - 03-01-2013, 11:48 AM
RE: following statues - by Knusper. - 03-01-2013, 03:08 PM
RE: following statues - by darksky - 03-01-2013, 03:17 PM
RE: following statues - by Knusper. - 03-01-2013, 03:35 PM
RE: following statues - by Tiger - 03-01-2013, 03:44 PM
RE: following statues - by darksky - 03-01-2013, 03:59 PM
RE: following statues - by Knusper. - 03-01-2013, 04:03 PM
RE: following statues - by Adrianis - 03-01-2013, 06:49 PM
RE: following statues - by darksky - 03-01-2013, 04:22 PM
RE: following statues - by Knusper. - 03-02-2013, 11:46 AM
RE: following statues - by darksky - 03-02-2013, 06:09 PM
RE: following statues - by Knusper. - 03-03-2013, 09:13 AM
RE: following statues - by Tiger - 03-03-2013, 10:09 AM



Users browsing this thread: 1 Guest(s)