Ulic and Cay
07-11-2007, 06:13 AM
Can someone explain some basics of UserDefineNumbers? I'm having some trouble...
During the arena battle with Bendak Starkiller in KotOR I want to stop combat and launch a dialog when he gets down to 1hp.
I know that in his particular UserDefine script the arena battle starts at User Defined Event Number 6000. I edited his UserDefine script there adding the "SetMinOneHP()" command, (for the purposes of the mod I'm building I only want this to happen if a particular Global Number I created has been set so that's in there too).
This part works fine. The part I can't get to work is the pause combat, start a dialog, part. I know that this is because I'm checking for his HP at the beginning of combat before any damage has been done (If I switch the "GetCurrentHitPoints(oBendakstar021) == 1" line to "GetCurrentHitPoints(oBendakstar021) > 1" the dialog will start up but at the beginning of the battle).
What I, think, I need to know is how to then advance to another Event Number when he gets down to 1hp so I can have new commands run.
Here's a portion of the script I'm using, ignore the sub1 line, it is working fine.
void main() {
int int1 = GetUserDefinedEventNumber();
if ((int1 == 6000)) {
ChangeToStandardFaction(OBJECT_SELF, 1);
sub1(GetFirstPC());
object oBendakstar021 = GetObjectByTag("Bendakstar021", 0);
if ((GetGlobalNumber("Tar_LSBenBou") == 1)) {
SetMinOneHP(oBendakstar021, 1);
if ((GetCurrentHitPoints(oBendakstar021) == 1)) {
AssignCommand(oBendakstar021, ActionStartConversation(oBendakstar021, "", 0, 0, 1, "", "", "", "", "", ""));
}
}
}
}
I realize that this question isn't very clear but that's because I'm not sure what I'm really asking. Are UserDefinedEvent the way to go about accomplishing what I want to do? If so, can someone help me with the scripting, if not, can someone point me in the right direction?
Thanks in advance
During the arena battle with Bendak Starkiller in KotOR I want to stop combat and launch a dialog when he gets down to 1hp.
I know that in his particular UserDefine script the arena battle starts at User Defined Event Number 6000. I edited his UserDefine script there adding the "SetMinOneHP()" command, (for the purposes of the mod I'm building I only want this to happen if a particular Global Number I created has been set so that's in there too).
This part works fine. The part I can't get to work is the pause combat, start a dialog, part. I know that this is because I'm checking for his HP at the beginning of combat before any damage has been done (If I switch the "GetCurrentHitPoints(oBendakstar021) == 1" line to "GetCurrentHitPoints(oBendakstar021) > 1" the dialog will start up but at the beginning of the battle).
What I, think, I need to know is how to then advance to another Event Number when he gets down to 1hp so I can have new commands run.
Here's a portion of the script I'm using, ignore the sub1 line, it is working fine.
void main() {
int int1 = GetUserDefinedEventNumber();
if ((int1 == 6000)) {
ChangeToStandardFaction(OBJECT_SELF, 1);
sub1(GetFirstPC());
object oBendakstar021 = GetObjectByTag("Bendakstar021", 0);
if ((GetGlobalNumber("Tar_LSBenBou") == 1)) {
SetMinOneHP(oBendakstar021, 1);
if ((GetCurrentHitPoints(oBendakstar021) == 1)) {
AssignCommand(oBendakstar021, ActionStartConversation(oBendakstar021, "", 0, 0, 1, "", "", "", "", "", ""));
}
}
}
}
I realize that this question isn't very clear but that's because I'm not sure what I'm really asking. Are UserDefinedEvent the way to go about accomplishing what I want to do? If so, can someone help me with the scripting, if not, can someone point me in the right direction?
Thanks in advance