Myster Posted October 28, 2005 Share Posted October 28, 2005 ok right what i want to happen is in a conv the npc will attack the pc once and then carry on talking. how can i make this happen? i tryed making the npc hostile for a couple of seconds and then changeing it back to neutral but im new to scripting and i couldent get it to work. so can somone help me out id realy appreciate it ( BTW im scripting for Kotor 1 ) Link to comment Share on other sites More sharing options...
Pavlos Posted October 28, 2005 Share Posted October 28, 2005 Within dialogue editor for scripts put a_attackonend [/Code] to get the guy to be hostile and then I suppose you could use global numbers to say that it has been done also put this in scripts [Code] void main() { SetGlobalNumber("Put your reference from the Globalcat here", 0); } [/Code] And then you can check that in a new dialogue with a conditional script: [Code] int StartingConditional() { return (GetGlobalNumber ("Whatever you said above") == 1); } [/Code] And then you can fight him, and the next time you open up a dialogue with him you can have a different conversation. It may be slightly round about and you would ahve to edit globalcat but that is really the only way I can think of at the moment. Never modded kotor though, only ever TSL I don't know why, just haven't. Link to comment Share on other sites More sharing options...
Darth333 Posted October 28, 2005 Share Posted October 28, 2005 I wouldn't use a global variable for this: it's way overkill. A local boolean would do the job and you wouldn't need to edit globalcat.2da. Local variables are stored on an object and Globals affect the whole game. Also, local variables do not require you to edit globalcat.2da (which creates mod conflicts). Use globals when you need to keep track of a quest, of the actions of your PC, per example, not a simple dialogue. Chekc this tutorial: http://www.lucasforums.com/showthread.php?t=126615 Link to comment Share on other sites More sharing options...
Myster Posted October 28, 2005 Author Share Posted October 28, 2005 Well is there a way to like get the guy to attack the pc once and the pc cant fight back or even just in the convo to show the action of my pc getting hit by the npc. Link to comment Share on other sites More sharing options...
Det. Bart Lasiter Posted October 29, 2005 Share Posted October 29, 2005 There's no script 'a_attackonend' built into KotOR 1, lest you re-create it for KotOR 1. Link to comment Share on other sites More sharing options...
Darth333 Posted October 29, 2005 Share Posted October 29, 2005 but there is a cutsceneattack function: void main() { object oAttacker=GetObjectByTag("attacker_tag"); object oPC=GetFirstPC(); //target ActionPauseConversation(); AssignCommand(oAttacker,CutsceneAttack(oPC,int nAnimation,ATTACK_RESULT_HIT_SUCCESSFUL,10)); DelayCommand(5.0,ActionResumeConversation()); } Replace int nAnimation by the correspoding row number in animations.2da . Make sure you have the correct animation or the npc will just play the animation and no real attack. And the value at the end (10) corresponds to the damage dealt on the target. Edit: to find combat animations in animations.2da, this list by Cerasumat is very useful: http://www.lucasforums.com/showthread.php?t=133683 Link to comment Share on other sites More sharing options...
Pavlos Posted October 29, 2005 Share Posted October 29, 2005 There's no script 'a_attackonend' built into KotOR 1, lest you re-create it for KotOR 1. Well there you go, hid mod is going to spiral out of control and in two years time he will have reconstructed the Odyssey Engine. Link to comment Share on other sites More sharing options...
Det. Bart Lasiter Posted October 29, 2005 Share Posted October 29, 2005 Or the dialog wouldn't have worked because the script was non-existant. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.