LucasForums (
-   Holowan Laboratories (
-   -   GetObjectByTag fail? (

Taunger 01-30-2013 05:36 PM

GetObjectByTag fail?

I'm having trouble in scripting. The script I'm working on obviously does more than I show here, but this covers my issue:


void main() {

        object oPC = GetFirstPC();


        object oDavik = GetObjectByTag("tar08_davik081");
        object oCalo = GetObjectByTag("tar08_calo081");

        if (GetIsObjectValid(oDavik)) {
                SendMessageToPC(oPC, "oDavik is valid.");
        } else SendMessageToPC(oPC, "oDavik is invalid.");

        if (GetIsObjectValid(oCalo)) {
                SendMessageToPC(oPC, "oCalo is valid.");
        } else SendMessageToPC(oPC, "oCalo is invalid.");



I got the tag values from m08aa.git, which is part of the RIM file for Davik's Estate, where they're stored as a RESREF value (there is no "Tag" label for Davik and Calo).

Every time I run this in the feedback screen I see "oDavik is invalid" and "oCalo is invalid". I assume this happens because I'm not using the right tag values in the GetObjectByTag functions. However, I don't know where else besides the GIT file to look for the right tags... I get a feeling I'm being terribly noobish here and there is an obvious solution. Or so I hope.

Any help would be appreciated! :)

Edit: by the way, this is a script that runs during the second node of the first dialog in that module, when Davik and Calo clearly do exist :p.

Fallen Guardian 01-30-2013 05:43 PM

You have to get the tag from the creature's actual UTC file, which - in your case - can be found in KotOR tool through the following path.

Kotor 1 - RIMs - Modules - tar_m08aa_s.rim - Blueprint, Character - tar08_davik081.utc and tar08_calo081.utc

There is a second variation of UTC files for both Calo and Davik, so I'd assume one is for when you first see them in the opening cutscene in Davik's base and one is for when you when fight them.

Taunger 01-30-2013 05:53 PM

Woohoo! It's working! :D

Thanks so much for the super-fast help, Fallen Guardian!

Fallen Guardian 01-30-2013 11:04 PM

No problem. Glad I could help.

All times are GMT -4. The time now is 10:39 AM.

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