Jump to content

Home

Help with a script


Myster

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...