LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Scripting: Getting all objects in an area (http://www.lucasforums.com/showthread.php?t=212101)

Vindikorr 04-08-2013 06:41 AM

Scripting: Getting all objects in an area
 
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.

VarsityPuppet 04-09-2013 01:26 AM

Quote:

Originally Posted by Vindikorr (Post 2830599)
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.


Code:

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);
    }
}


Vindikorr 04-09-2013 05:36 AM

Thanks


All times are GMT -4. The time now is 07:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.