View Single Post
Old 04-09-2013, 02:26 AM   #2
Master of Puppets
VarsityPuppet's Avatar
Join Date: May 2009
Location: MN
Posts: 1,289
Current Game: Chrono Trigger
Contest winner - Modding  Forum Veteran  Veteran Modder  Helpful! 
Originally Posted by Vindikorr View Post
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";

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

VarsityPuppet is offline   you may: quote & reply,