I use to have a copy of this script but recently lost it.
So i need the script that makes the NPC start attacking the PC at the End of a conversation.
Nothing to fancy just, the player and the NPC dont agree on terms and so they start fighting once the conversation is finish.
Attack on Convo End
Débuté par
Omega27
, déc. 19 2011 10:28
#1
Posté 19 décembre 2011 - 10:28
#2
Posté 19 décembre 2011 - 04:39
how about something along the lines of the following in the abort and finish scripts of a conversation?
SetIsEnemy(oPC)
DetermineCombatRound(oPC)
SetIsEnemy(oPC)
DetermineCombatRound(oPC)
#3
Posté 20 décembre 2011 - 05:25
Do i put the npc name where it says (oPC)? Also do i place this script in the (Action) Tab?
#4
Posté 20 décembre 2011 - 02:02
This is a schematic script in order to identify the functions you should try working with. In otherwords I did not write you a working script. I only pointed you in the right direction.
oPC refers to the player object. Yo will need to get the player currently in conversation with the NPC. The funcion to do so is something like GetSpeakingPC or something similar.
Which tab you put this in depends on what you want to do. There are two scripts which catch a conversation that has ended. One is called cancel or abort the other is called finished. My recommendation is to put the script in the finished conversation handler. You can also put it in a specific action tab.
But first you will have to write it. Play with the functions I gave you.
oPC refers to the player object. Yo will need to get the player currently in conversation with the NPC. The funcion to do so is something like GetSpeakingPC or something similar.
Which tab you put this in depends on what you want to do. There are two scripts which catch a conversation that has ended. One is called cancel or abort the other is called finished. My recommendation is to put the script in the finished conversation handler. You can also put it in a specific action tab.
But first you will have to write it. Play with the functions I gave you.
#5
Posté 26 décembre 2011 - 01:02
Im still a bit new to the whole script thing, sorry i've failed to mention that sooner. So im not really clear on what to do with what you gave me
.
#6
Posté 26 décembre 2011 - 09:42
Hey there Omega. Just put something like this wherever or whatever line in the conversation you need to (Actions Taken, Normal, Aborted):
//"Include" needed for the "DetermineCombatRound" function.
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
//You don't need to declare/define the NPC if this is the NPC's conversation.
//The NPC will run the script(so to speak).
//If the conversation is started with some other object then you will need to
//define the NPC object.
DetermineCombatRound(oPC);
}
//"Include" needed for the "DetermineCombatRound" function.
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
//You don't need to declare/define the NPC if this is the NPC's conversation.
//The NPC will run the script(so to speak).
//If the conversation is started with some other object then you will need to
//define the NPC object.
DetermineCombatRound(oPC);
}
Modifié par GhostOfGod, 26 décembre 2011 - 09:46 .
#7
Posté 26 décembre 2011 - 08:29
Hey ghost this script work with multiple NPC Convos. Where the PC starts talking to one NPC and another one joins in, and have the one that joined in the convo go hostile as well?
#8
Posté 26 décembre 2011 - 08:57
and would it matter that the starting NPC is a plot character, ive thought it didnt.
#9
Posté 26 décembre 2011 - 09:03
It will make the Non Player Character speaker hostile to the Player Character.
By default, the entire NPC's faction will go hostile as soon as the combat starts.
If I remember correctly, the default AI will allow plot NPC's to attack just fine.
If you only want the specific conversation members to go hostile; the easiest way may be to give them a custom faction so that everyone else doesn't attack with them. Give them 100 toward their own faction, and 50 toward everyone else. Make everyone else 50 toward them.
By default, the entire NPC's faction will go hostile as soon as the combat starts.
If I remember correctly, the default AI will allow plot NPC's to attack just fine.
If you only want the specific conversation members to go hostile; the easiest way may be to give them a custom faction so that everyone else doesn't attack with them. Give them 100 toward their own faction, and 50 toward everyone else. Make everyone else 50 toward them.
Modifié par wyldhunt1, 26 décembre 2011 - 09:05 .
#10
Posté 28 décembre 2011 - 04:56
Thanks hunt, because, at the start the PC encounters two bandits. He talks to the main bandit, and a second one joins in, i keep putting the action script on the second bandit, and it dosnt take affect.
#11
Posté 28 décembre 2011 - 11:33
If you didnt want to mess with the factions you could always just add a few lines to the script to make specific NPCs join in as well. Something kinda like so:
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
object oNPC1 = GetObjectByTag("tag of npc1");
object oNPC2 = GetObjectByTag("tag of npc2");
DetermineCombatRound(oPC);
AssignCommand(oNPC1, DetermineCombatRound(oPC));
AssignCommand(oNPC2, DetermineCombatRound(oPC));
}
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
object oNPC1 = GetObjectByTag("tag of npc1");
object oNPC2 = GetObjectByTag("tag of npc2");
DetermineCombatRound(oPC);
AssignCommand(oNPC1, DetermineCombatRound(oPC));
AssignCommand(oNPC2, DetermineCombatRound(oPC));
}
#12
Posté 30 décembre 2011 - 07:09
Hey ghost, im sorry is there anything else i need for this script?
i have it laid out the way you posted, i've replaced the
("tag of npc1/2) with the correct tags. for the two Npc's i want to join in the convo. Or is that not how it works?
Also placing the script on the "Action Tab" of the conversation Nod.
now the NPC thats the plot character of course still turns hostile and attacks, while the others remain (Commoners) and get attacked.
i have it laid out the way you posted, i've replaced the
("tag of npc1/2) with the correct tags. for the two Npc's i want to join in the convo. Or is that not how it works?
Also placing the script on the "Action Tab" of the conversation Nod.
now the NPC thats the plot character of course still turns hostile and attacks, while the others remain (Commoners) and get attacked.
#13
Posté 30 décembre 2011 - 08:15
Okay... Now I'm not sure what you're trying to do...
You have a conversation that's supposed to make a plot NPC and 2 other NPC's attack the PC.
Are you saying that 2 of them are commoners? If so, that's your problem. Commoners use a custom AI that makes them tend to do nothing or run away.
Try changing their faction.
You have a conversation that's supposed to make a plot NPC and 2 other NPC's attack the PC.
Are you saying that 2 of them are commoners? If so, that's your problem. Commoners use a custom AI that makes them tend to do nothing or run away.
Try changing their faction.
#14
Posté 02 janvier 2012 - 10:26
Should i change it to Defenders or is this the point where i need to start making my own factions? Which if that's the case then i don't be a problem i just wanted to be clear on things.
To Answer your question, yes i have a plot NPC that is scripted to attack at end of conversation, and i have two regular NPC who join in the conversation, that also at the end of the conversation attack the PC. Sorry to make this so complicated, i had this script years back but lost it.
To Answer your question, yes i have a plot NPC that is scripted to attack at end of conversation, and i have two regular NPC who join in the conversation, that also at the end of the conversation attack the PC. Sorry to make this so complicated, i had this script years back but lost it.
#15
Posté 02 janvier 2012 - 04:50
Any faction other than commoner should allow them to fight.
If they are all the same faction, it would work best. That's not a requirement though.
If they are all the same faction, it would work best. That's not a requirement though.
#16
Posté 03 janvier 2012 - 10:17
Sorry hunt, that im making this harder then it should be -.-' I really cant understand why the NPC's just stand there and do nothing. Of course the plot player attacks.
im using ghost script that he gave me
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
object oNPC1 = GetObjectByTag("tag of npc1");
object oNPC2 = GetObjectByTag("tag of npc2");
DetermineCombatRound(oPC);
AssignCommand(oNPC1, DetermineCombatRound(oPC));
AssignCommand(oNPC2, DetermineCombatRound(oPC));
}
im using ghost script that he gave me
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();//This is the player.
object oNPC1 = GetObjectByTag("tag of npc1");
object oNPC2 = GetObjectByTag("tag of npc2");
DetermineCombatRound(oPC);
AssignCommand(oNPC1, DetermineCombatRound(oPC));
AssignCommand(oNPC2, DetermineCombatRound(oPC));
}





Retour en haut






