Jump to content

Home

script example please


ace92

Recommended Posts

*sigh* If you have a problem, please state what game...

Anyways, if for TSL:

There is a script called c_lighthigh. Here is the source script, as I cannot decompile because DeNCS hates me.

//:: c_lighthigh
/*
   checks to see if pc is really good
*/
//:: Created By:  Jason Booth
//:: Copyright (c) 2002 Bioware Corp.

#include "k_inc_debug"
#include "k_inc_utility"

int StartingConditional()
{
 return IsLightHigh();
}

I'm not sure if there is a way to see if there is a way to know how high it is, except the dialog your companions have when you are kinda LS/DS, and mostly LS/DS. So use that as a guideline.

Link to comment
Share on other sites

Is not better if you put

if (GetFactionAverageGoodEvilAlignment(oPC) < 84) return FALSE;

?

Thinking about npc with 90 lightside points which can return false.

 

Well it depends on whether or not ace wants it to be 85 or higher. Admittedly ace hasn't been very clear but I think that 85+ would be better since its rare than anyone will have exactly 85.

Also its GetAlignmentGoodEvil(); to return the alignment as an integer.

 

int StartingConditional()
{
   return (GetAlignmentGoodEvil(GetFirstPC()) >= 85);
}

Link to comment
Share on other sites

ohh i see, sorry i didn't mention it but yes it's for TSL, i meant that he has at least 85 so it's should be:

int StartingConditional()
{
   return (GetAlignmentGoodEvil(GetFirstPC()) >= 85);
}

right?

another question if i may, is it possible to write a script that it's condition is that if the player finished a quest?

Link to comment
Share on other sites

Right.

another question if i may, is it possible to write a script that it's condition is that if the player finished a quest?

Its certainly possible, most quests have a global variable assigned to them to track their progress. So I guess if you wanted to see if they had completed a quest you would have to find the global for that quest and compare the number with the number that would mean it was completed. AFAIK there is easier script function to get the progress of a quest. Do you know which quest it is that you want to check?

 

The script will be something like this:

int StartingConditional()
{
   int iFinished = [color=cyan](Complete value)[/color];
   return (GetGlobalNumber([color=cyan]"quest_global_ref"[/color]) >= iFinished);
}

Link to comment
Share on other sites

Obviously you need a way to track the quest, if you use journal entries to track it then this script would do, just replace entry with the name of the journal entry and 60 with whatever state it is to be completed.

 

int StartingConditional() 
{

return (GetJournalEntry("ENTRY")==60);

}

Another way to do it is to use globals, again replace global with the name of the global you're using and 2 with whatever state it needs to be at.

 

int StartingConditional() 
{

return (GetGlobalBoolean("GLOBAL")==2);

}

--Stream

Link to comment
Share on other sites

The global.jrl file is located for TSL:

 

Open up Kotor Tool>Kotor II>dialogues.bif>Journal File>global.jrl. To extract it, simply select it and press the Extract file button at the right.

 

For Kotor 1:

 

Open up Kotor Tool>Kotor I>_newbif.bif>Journal File>global.jrl. To extract it, do the same thing as with TSL.

 

You can then open the global.jrl file with a GFF editor.

 

|I|

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...