Jump to content

Home

Script


darth-me

Recommended Posts

Hi, i'm just trying to learn how to script (so I'll probably end asking a lot more than just my original question). I'm trying to write a script to make character "Narlav" (that's the tag), use power attack (during a conversation) on character "JanorQ". This is what I've got:

 

void main() {
   AssignCommand("NarlaV",ActionUseFeat(int FEAT_POWER_ATTACK, object "JanorQ");
}

 

But it won't compile. I get all the usual compiling text, then:

AttackJanor.nss(2): Error: Syntax error at "int"

Compilation aborted with errors

total execution time = 0ms

 

Obviously I'm doing something wrong, so could anyone help me please?

Link to comment
Share on other sites

Well, you're script seems to be one big error :xp:

First of all, delete "int" in your script. Also, word "object" must be delete. It's just "a type" (well, I'm calling it like that :xp: somebody else will explain it better).

Next thing, always when you're writing a tag of NPC, you must use GetObjectByTag function. So it should be

[...]GetObjectByTag("NarlaV")[...]

Last thing, if you're usign two function in one script, you have to add one more ")" at the end of script. That's all error I see here... So script should looks like this:

void main() {
AssignCommand(GetObjectByTag("NarlaV"),ActionUseFeat(FEAT_POWER_ATTACK, GetObjectByTag("JanorQ")));
}

Hope it was clear enough, but I'm sure somebody else can explain this stuff better :)

Link to comment
Share on other sites

darth-me wrote:

Hi again. I've got another question. How do I put a persuasion attempt in my dialogue? I'll keep looking, but if anyone could help I'd be grateful.

Simply add [Persuade] or [Force Persuade] to the reply you want to use as persuade attempt and [success] or [Failure] to the entries that come after it. You'll need to add starting conditionals to the entries depending on how you want to determine if the attempt succeeds or fails. Both games contain standard starting conditionals for use with persuade attempts in their scripts.bif files. For KotOR 1 they are k_con_perseasy, k_con_persmed and k_con_pershigh. For TSL they are c_sc_per_bet, c_sc_per_lt, c_sc_per_gt and c_sc_per_eq. The source files of these scripts will help you understand how to use them.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...