Jump to content

Home

Scripting: Getting all objects in an area


Vindikorr

Recommended Posts

Hi everyone, I have a quick question about scripting.

 

I'm trying to make a script that finds all the objects in a module with a specific tag, unfortunately there seems to be no function to do this. Anyone got any ideas?

 

BTW, This is for KotOR 1.

Link to comment
Share on other sites

Hi everyone, I have a quick question about scripting.

 

I'm trying to make a script that finds all the objects in a module with a specific tag, unfortunately there seems to be no function to do this. Anyone got any ideas?

 

BTW, This is for KotOR 1.

 

 

void main(){
   // Loop all objects in us, an area
   object oArea = GetArea(GetFirstPC());
   object oObject = GetFirstObjectInArea(oArea);
   string sTag = "taghere";

   while(GetIsObjectValid(oObject)){
        // Destroy any objects tagged "DESTROY"
        if(GetTag(oObject) == sTag){
            //Do stuff here
        }
        oObject = GetNextObjectInArea(oArea);
   }
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...