Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Alright I just tested the credit one and it works Ty har. However the attack one doesn't seem to work. Can you guys take a look and see what I did wrong? void main() { object oObject1=GetObjectByTag("to'ggar"); object oObject2=GetObjectByTag("degar"); ChangeToStandardFaction(oObject1, 12); ChangeToStandardFaction(oObject2, 13); ExecuteScript("k_ai_master",oObject1,1005); ExecuteScript("k_ai_master",oObject2,1005); DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget)); effect eStun = EffectDeath(); object oTarget = GetObjectByTag("degar"); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget); } Ty. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 When you compile what does KOTOR Tool complain about? Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 Yeah it has one error when I try to compile it. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 Well I'm trying to figure out what the error SAYS! If you can tell me what it's complaining about I can walk you through it. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 lol sorry. it says DegarBatt(11):Error:Syntax error at "_TEMPORARY" EDIT DegarBatt is the name of the script. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 Okay, I played around with your script and it boils down to the way you made it. Anyways here's a working script that should do what you want, I made sure that it compiles on my computer: void main() { effect eStun = EffectDeath(); object oTarget = GetObjectByTag("degar"); object oObject1=GetObjectByTag("to'ggar"); object oObject2=GetObjectByTag("degar"); ChangeToStandardFaction(oObject1, 12); ChangeToStandardFaction(oObject2, 13); ExecuteScript("k_ai_master",oObject1,1005); ExecuteScript("k_ai_master",oObject2,1005); DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget)); } Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 It still has an error this time it says DegarBatt(14):Error:Syntax error at "_TEMPORARY" instead of DegarBatt(11):Error:Syntax error at "_TEMPORARY". Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 The problem I had with that line is that there is for some God awful reason a space between "TYPE" and "_TEMPORARY" I thought I removed that but now that I look at it for some reason it's still there. I edited the script in the post so that you should now be able to compile it, sorry about that. -----EDIT----- Hmmm, I went in to edit the script but it shows that there is no space where I said there was, but looking at the script it looks like there is a space. You'll have to go in manually and remove the space right where I mentioned above. I don't know why Lucasforums is doing this but as I upload the script it's fine but when I copied it, there's a space. Any just remove the space and you should be able to compile it. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 Huh. It still won't compile, same error as last time. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 You have to take the space out of the last line between TYPE and _TEMORARY Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 It doesn't look like there is a space void main() { effect eStun = EffectDeath(); object oTarget = GetObjectByTag("degar"); object oObject1=GetObjectByTag("to'ggar"); object oObject2=GetObjectByTag("degar"); ChangeToStandardFaction(oObject1, 12); ChangeToStandardFaction(oObject2, 13); ExecuteScript("k_ai_master",oObject1,1005); ExecuteScript("k_ai_master",oObject2,1005); DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget)); } Theres just a _ and thats it. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 What I'm saying is that you dont see the space until you copy it into the compiler. Anyways just download these two files, i went ahead and compiled it for you. One is the compiled version and the other is the source script. http://min.us/mmj8nKDKf Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 I downloaded it doesn't seem to have a .nss with it and when i try to open the the ncs I downloaded it just brings up kotor tool with no script. soo..I guess im not understanding something here. Edit:Ok i opend it and i was like what??? its like ten millions miles long I would post it but...its ten million miles long. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 There are TWO files. You have to tab over to the second. Note that you can't open and edit .ncs files, in human terms they are comprehensible. You can only open the source script which is the .nss file. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 Ok the files I got are K1TemplateTags and K2TemplateTags there both BFD files (not sure what those are) and when i open them in the text editer there both ten million miles long and i have no idea what to do with them. Link to comment Share on other sites More sharing options...
harIII Posted September 16, 2011 Share Posted September 16, 2011 Hmmm, that's weird. Try this, I packed the two scripts in a zip folder. http://min.us/myQme1lhO Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 16, 2011 Share Posted September 16, 2011 Very interesting indeed... the whole added " " near that"_" is quite strange. Another workaround for this is to simply use the number constants that correspond to the DURATION_TYPE_*'s.... specifically 0,1 & 2. From the lexicon: DURATION_TYPE_* Constant Group Duration types for ApplyEffectAtLocation and ApplyEffectToObject functions. Constants Constant Value Description DURATION_TYPE_INSTANT 0 Instantaneous. This would apply to any effect that is both immediate and permanent and cannot be removed. EffectDamage would be one example, as well as any of the 'fire-and-forget' visual effects. DURATION_TYPE_PERMANENT 2 Permanent duration. This is as it sounds... the effect lasts until removed or dispelled DURATION_TYPE_TEMPORARY 1 A temporary duration means that the effect must have a duration specified in the command (and is the only time this is so). Once the time has expired, the effect will be removed. This brings about a potential explanation for a failed compilation, although harIII has it working. Essentially, you have applied a temporary effect, but you have not removed it... It should, according to definition, need a time limit. Also, it is worth looking at what type of effect you are dealing with. Some effects should only be used as FNF, which means an instant duration should ONLY be applied. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 Ok the downloadthe sript ty Har . I just had the chance to try the script out. when I started the conversation it gets to the part where its activates the trigger. All it does is make the guy who was soppose to get killed by the other hostile and after the conversation ends he trys to attack me but fails because of the drop dead script and the other guy is still normal. If I make the conversation longer he just drops dead. Sooo...Now what did I do wrong? I didn't mess with the script. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 16, 2011 Share Posted September 16, 2011 void main() { object oObject1=GetObjectByTag("to'ggar"); object oObject2=GetObjectByTag("degar"); effect eStun = EffectDeath(); ChangeToStandardFaction(oObject1, 12); ChangeToStandardFaction(oObject2, 13); ExecuteScript("k_ai_master",oObject1,1005); ExecuteScript("k_ai_master",oObject2,1005); DelayCommand(5.0,ApplyEffectToObject(0,eStun, oObject2)); } This is a redo of your original script, Warlord664. The main difference is that I used the integer value of 0 instead of the word constant DURATION_TYPE_TEMPORARY. If you read my earlier post, using 0 changes this into a FNF, or fire-and-forget, effect, which is correct for the EffectDeath() function. This compiles fine, although I cannot guarantee that the results will be what you are looking for. You may also want to play with the length of the DelayCommand. EDIT: To make this all happen according to how you want it to play out, you may want to simply build the combat into the dialog, and make the dialog fire the effect of death when you want it to. You can have a dialog with no words but plenty of animation calls and camera views... Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 What I wanted was in the conversation to have To'ggar swing his weapon at degar and kill him. but these script just make to'ggar sit there while degar drops dead. Is there an attack animationin the conversation that I can give to'ggar? Edit: And I also realised that npcs that are aleady in game have alot more animation options in the dlg editer then npcs i put down. Is there a way to get these extra animations on my npcs? Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 16, 2011 Share Posted September 16, 2011 If you want To'ggar to swing his weapon and kill Degar here is the script for that: void main () { object oShooter = GetObjectByTag("to'ggar"); object oTarget = GetObjectByTag("degar", OBJECT_SELF, 1); ActionPauseConversation(); ChangeToStandardFaction(oShooter, 2); ChangeToStandardFaction(oTarget, 4); ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); } That should make To'ggar do a default attack and kill Degar. Of course, you'd have to have Degar's health set to be something very low or time out how long it takes for To'ggar to run over to Degar and kill him and then have a delaycommand that applies instant death to Degar when To'ggar swings his weapon. As to the animation you would need a script that looks something like this: AssignCommand(OBJECT_SELF, ActionPlayAnimation(25, 1.0, (-1.0))); Of course you'd have to add in voidmain at the beginning as well as put the correct animation number in the place of 25 but that's the main gist of it. Hope this helped. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 16, 2011 Author Share Posted September 16, 2011 FG it won't let me compile the first script because of an error heres what it says DegarBatt.nss(1):Error: Type mismatch in parameter 2 in call to "GetObjectByTag" Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 17, 2011 Share Posted September 17, 2011 Hmmm, Har, Glenn, any ideas? Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 17, 2011 Share Posted September 17, 2011 void main () { object oShooter = GetObjectByTag("to'ggar"); object oTarget = GetObjectByTag("degar"[color=darkorange], OBJECT_SELF, 1[/color]); [color=darkorange]// Here is the problem, either need to declare oTarget as OBJECT_SELF or by tag, but not both[/color] ActionPauseConversation(); ChangeToStandardFaction(oShooter, 2); ChangeToStandardFaction(oTarget, 4); ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); } By cutting out the orange part in the oTarget line, you will have a functional .nss that will compile fine Nice work Fallen Guardian! You are working things out quite nicely Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 17, 2011 Share Posted September 17, 2011 void main () { object oShooter = GetObjectByTag("to'ggar"); object oTarget = GetObjectByTag("degar"[color=darkorange], OBJECT_SELF, 1[/color]); [color=darkorange]// Here is the problem, either need to declare oTarget as OBJECT_SELF or by tag, but not both[/color] ActionPauseConversation(); ChangeToStandardFaction(oShooter, 2); ChangeToStandardFaction(oTarget, 4); ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); } By cutting out the orange part in the oTarget line, you will have a functional .nss that will compile fine Nice work Fallen Guardian! You are working things out quite nicely Thanks, I'm still not great at scripting as seen by my error though. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.