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
SOLVED: Script based on the Orb Pillars not working...
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Script based on the Orb Pillars not working...

I have not used those pillars myself so I don't know if there are some quirky restrictions placed upon them. Have you made sure nothing collides with the fourth pillar? Does it always happen to that pillar or does it change depending on which pillar you knock over last?

As for the trigger, you can place script areas around the top of all the pillars. Either place one for each pillar, or place one large one across them all (I'd prefer separate). Make them cover only the top, so that when the pillars fall over, they also fall out of the area. Then you can simply use a collision callback using -1 on the alState value (to check for area exit). Here's an example:

PHP Code: (Select All)
int pillarsKnocked 0;

void OnStart() 
{
    
//Creates 4 callbacks for Pillar_1 & Area_1 up till #4.
    
for(int i 1<= 4i++) AddEntityCollideCallback("Pillar_"+i"AreaPillar_"+i"PillarExit"true, -1);
}

void PillarExit(string &in asParentstring &in asChildint alState) {
    if(
alState != -1) return; //This isn't exactly necessary since it's only called upon exit.

    
pillarsKnocked++; //This adds 1 to the variable, counting total pillars knocked.

    
if(pillarsKnocked 4) return; //Unless knocked pillars have reached 4, no further code is ran.

    //Run your code here that you want to be called upon knocking all 4 pillars over.


04-29-2016, 07:37 AM
Find


Messages In This Thread
RE: Script based on the Orb Pillars not working... - by Mudbill - 04-29-2016, 07:37 AM



Users browsing this thread: 1 Guest(s)