Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Script

Page: 1 of 1
 darth-me
11-11-2008, 2:53 PM
#1
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?
 zbyl2
11-11-2008, 3:03 PM
#2
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 :)
 darth-me
11-11-2008, 3:14 PM
#3
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!
 Mandalore_The_Great
11-12-2008, 9:50 PM
#4
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.
 darth-me
11-13-2008, 12:47 PM
#5
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.
 swfan28
11-13-2008, 7:34 PM
#6
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.
 darth-me
11-15-2008, 12:50 PM
#7
thanks
Page: 1 of 1