darth-me Posted November 11, 2008 Share Posted November 11, 2008 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 More sharing options...
zbyl2 Posted November 11, 2008 Share Posted November 11, 2008 Well, you're script seems to be one big error 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 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 More sharing options...
darth-me Posted November 11, 2008 Author Share Posted November 11, 2008 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). Thanks! Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted November 13, 2008 Share Posted November 13, 2008 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. Link to comment Share on other sites More sharing options...
darth-me Posted November 13, 2008 Author Share Posted November 13, 2008 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. Link to comment Share on other sites More sharing options...
swfan28 Posted November 13, 2008 Share Posted November 13, 2008 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 More sharing options...
darth-me Posted November 15, 2008 Author Share Posted November 15, 2008 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.