Author Topic: Attack on Convo End  (Read 446 times)

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« on: December 19, 2011, 10:28:55 am »


                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.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Attack on Convo End
« Reply #1 on: December 19, 2011, 04:39:50 pm »


               how about something along the lines of the following in the abort and finish scripts of a conversation?

SetIsEnemy(oPC)
DetermineCombatRound(oPC)
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #2 on: December 20, 2011, 05:25:44 am »


               Do i put the npc name where it says  (oPC)?  Also do i place this script in the (Action) Tab?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Attack on Convo End
« Reply #3 on: December 20, 2011, 02:02:21 pm »


               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.
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #4 on: December 26, 2011, 01:02:02 am »


               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 '<img'>.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Attack on Convo End
« Reply #5 on: December 26, 2011, 09:42:25 am »


               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);
}
               
               

               


                     Modifié par GhostOfGod, 26 décembre 2011 - 09:46 .
                     
                  


            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #6 on: December 26, 2011, 08:29:38 pm »


               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?
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #7 on: December 26, 2011, 08:57:20 pm »


               and would it matter that the starting NPC is a plot character, ive thought it didnt.
               
               

               
            

Legacy_wyldhunt1

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +0/-0
Attack on Convo End
« Reply #8 on: December 26, 2011, 09:03:57 pm »


               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.
               
               

               


                     Modifié par wyldhunt1, 26 décembre 2011 - 09:05 .
                     
                  


            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #9 on: December 28, 2011, 04:56:17 am »


               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.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Attack on Convo End
« Reply #10 on: December 28, 2011, 11:33:48 am »


               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));
}
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #11 on: December 30, 2011, 07:09:01 pm »


               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.
               
               

               
            

Legacy_wyldhunt1

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +0/-0
Attack on Convo End
« Reply #12 on: December 30, 2011, 08:15:21 pm »


               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.
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Attack on Convo End
« Reply #13 on: January 02, 2012, 10:26:03 am »


               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.
               
               

               
            

Legacy_wyldhunt1

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +0/-0
Attack on Convo End
« Reply #14 on: January 02, 2012, 04:50:00 pm »


               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.