lfnetwork.com mark read register faq members calendar

Thread: Qui-Gon's Script Shack
Thread Tools Display Modes
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Prev Previous Post   Next Post Next
Old 04-03-2013, 07:11 AM   #11
Thrak Farelle
Lurker
 
Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by JCarter426 View Post
Code:
// 341: A creature can have up to three classes.  This function determines the
// creature's class (CLASS_TYPE_*) based on nClassPosition.
// - nClassPosition: 1, 2 or 3
// - oCreature
// * Returns CLASS_TYPE_INVALID if the oCreature does not have a class in
//   nClassPosition (i.e. a single-class creature will only have a value in
//   nClassLocation=1) or if oCreature is not a valid creature.
int GetClassByPosition(int nClassPosition, object oCreature=OBJECT_SELF);
So, if you want to check if a creature has any particular class:
Code:
int StartingConditional(){

	object oCreature = [whatever];
	int iClass = [whatever];
	int iC1 = GetClassByPosition(1, oCreature);
	int iC2 = GetClassByPosition(2, oCreature);
	int iC3 = GetClassByPosition(3, oCreature);

if(	iC1 == iClass ||
	iC2 == iClass ||
	iC3 == iClass ){
	return TRUE;
	}
return FALSE;

}
I'm not sure how the class positions get assigned, so depending on what you need it could be trickier than just that.
Thanks very much, combining some of that with code from another script that had another bit of what I needed allowed me to write the necessary script, and I've tested it ingame, so I know it works

Thanks again
Thrak Farelle is offline   you may: quote & reply,
Post a new 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 > Qui-Gon's Script Shack

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 03:29 PM.

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