lfnetwork.com mark read register faq members calendar

Thread: Scripting: Getting all objects in an area
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 04-08-2013, 07:41 AM   #1
Vindikorr
Rookie
 
Vindikorr's Avatar
 
Join Date: Apr 2013
Posts: 123
Current Game: TOR
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.
Vindikorr is offline   you may: quote & reply,
Old 04-09-2013, 02:26 AM   #2
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,256
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Quote:
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.

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

VarsityPuppet is offline   you may: quote & reply,
Old 04-09-2013, 06:36 AM   #3
Vindikorr
Rookie
 
Vindikorr's Avatar
 
Join Date: Apr 2013
Posts: 123
Current Game: TOR
Thanks
Vindikorr is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Scripting: Getting all objects in an area

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:24 AM.

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