PDA

View Full Version : I need another script...


Exile007
01-13-2008, 11:48 PM
Umm, can someone make a Script that makes an NPC neutral once it hits a certain number of VP. Like someone battling a jedi and once the jedi hits one VP the battle stops and dialog begins. I'd really appreciate it if one of you could do this.

DarthJebus05
01-14-2008, 12:01 AM
Click me! (http://www.lucasforums.com/showthread.php?t=126615)

Exile007
01-14-2008, 11:33 AM
Um, I followed that tutorial and got the scripts, but for some reason, the invinciblity is still turned on. I can't 'end' the fight.

DarthJebus05
01-14-2008, 09:15 PM
Download Kotor Saved Game Editior (KSE), open it, find your save game and check if the Min 1 HP thing is on Yes. If it is, put it on No and that should fix it.

Exile007
01-14-2008, 09:25 PM
I did, still doesn't fix the problem.

DarthJebus05
01-14-2008, 09:46 PM
What mods do you have in your Override?

Exile007
01-14-2008, 09:57 PM
Just force power mods, and some of the scripts that tk102 gave aren't compiling...

DarthJebus05
01-14-2008, 10:05 PM
Post the scripts you're using please.

Exile007
01-16-2008, 01:44 AM
First one:

int StartingConditional() {
int nResumeTalk = GetLocalBoolean(OBJECT_SELF,0);
return nResumeTalk;
}

I can't find the one that turns the enemy hostile, but that one is working fine.

So next, this one won't compile

void main()
{
//
GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED);

GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT);
GN_SetListeningPatterns();
GN_WalkWayPoints();
}


And the last one, I think this one is to turn off the immortality.

void main()
{
int nCurrentHP;
int nUser = GetUserDefinedEventNumber();
if(nUser == 1006) // DAMAGED
{
nCurrentHP=GetCurrentHitPoints();
if (nCurrentHP<10) {
CancelCombat (OBJECT_SELF);
ClearAllActions();
ChangeToStandardFaction(OBJECT_SELF, 5);

//
SetLocalBoolean(OBJECT_SELF,0,TRUE);

//
SetMinOneHP(OBJECT_SELF,FALSE);
object oPC=GetFirstPC();
ActionDoCommand(ActionStartConversation(oPC));
}

}

And yeah, the enemy won't change back to neutral, and it's invincible.

}

DarthJebus05
01-16-2008, 02:12 AM
void main()
{
int nCurrentHP;
int nUser = GetUserDefinedEventNumber();
if(nUser == 1006) // DAMAGED
{
nCurrentHP=GetCurrentHitPoints();
if (nCurrentHP<10) {
CancelCombat (OBJECT_SELF);
ClearAllActions();
ChangeToStandardFaction(OBJECT_SELF, 5);

//
SetLocalBoolean(OBJECT_SELF,0,TRUE);

//
SetMinOneHP(OBJECT_SELF,TRUE);
object oPC=GetFirstPC();
ActionDoCommand(ActionStartConversation(oPC));
}


Try that ;)

stoffe
01-16-2008, 08:59 AM
I can't find the one that turns the enemy hostile, but that one is working fine.

So next, this one won't compile
(snip)


In order to compile that script you need the line...
#include "k_inc_generic"
...at the top of the script. The script contains custom functions that will not be found unless you use the proper include file.

That you haven't compiled the OnSpawn script is most likely the cause of your problem, since the second script (which stops the fight) will not do anything at all without the setting it toggles.



#include "k_inc_generic"

void main() {
GN_SetSpawnInCondition( SW_FLAG_EVENT_ON_DAMAGED );
GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT );
GN_SetListeningPatterns();
GN_WalkWayPoints();
}

Exile007
01-16-2008, 08:06 PM
Awesome, it finally works! Thanks you guys, I really appreciate the help.