Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help if script
Author Message
GoranGaming Offline
Member

Posts: 173
Joined: Feb 2012
Reputation: 6
Post: #1
if script
I need a script like:

if(EntityIsActive){
//Do Stuff
}

Can you do that?

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
04-01-2012 11:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 444
Joined: Apr 2011
Reputation: 42
Post: #2
RE: if script
Create a script area at the origin of the map (0,0,0). Scale it to be really by (E.g 500,500,500 scale) so that the entire level is covered by the script area. Call it something like "script_area_world".


//Change this if you call your script area something different
const string WORLD_AREA = "script_area_world"

/* This function will return true if the given (colliding) entity exists & is active.
    asEntity may use * and "Player". */
bool GetEntityActive(string &in asEntity)
 {
   return GetEntitiesCollide(asEntity,WORLD_AREA);
 }

usage would then be something like:
void test()
{
   if(GetEntityActive("barrel01_1"))
    AddDebugMessage("Barrel 1 is active!",false);
}

04-01-2012 01:06 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)