View Single Post
Old 01-30-2013, 05:36 PM   #1
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Question GetObjectByTag fail?

Hi!

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

Code:
void main() {

	object oPC = GetFirstPC();

	ActionPauseConversation();

	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.");

	ActionResumeConversation();

}
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 .

Last edited by Taunger; 01-30-2013 at 05:43 PM. Reason: Added info.
Taunger is offline   you may: quote & reply,