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?
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 :)
No, you explained fine. It works perfectly now, thanks! Also, I really feel like I learned something about scripting (now I should be able to improve my other script).:D Thanks!
this is probably a really stupid question, but how do I add new dialogue into the game? I'm a total noob at scripting so all I know how to do is make it so you can receive an item.
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.
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.