Author Topic: Interjections System  (Read 910 times)

Legacy_HugoLuman

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Interjections System
« on: September 19, 2010, 03:47:42 am »


               Okay... I am trying to set up an interjections system like the one in HOTU, only instead of henchmen interjecting I want a nonexistant NPC who's conversation comes from a placable (like, for example, enseric) to interject. This means that I use one blueprint res trigger for all interjections, and the interjection called is based on the key tag of the triggers.
  Only thing is, I haven't the foggiest idea where to begin.
               
               

               
            

Legacy_FR Mulm

  • Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Interjections System
« Reply #1 on: September 19, 2010, 04:04:59 pm »


               Flavor Text Triggers or Interactive Triggers is what you are looking for though you can also do it some other ways. I saw one with an intelligent sword that made remarks by the area it was in or battle or weather.



http://nwvault.ign.c....Detail&id=3214

http://nwvault.ign.c....Detail&id=2690

http://nwvault.ign.c....Detail&id=3237
               
               

               
            

Legacy_HugoLuman

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Interjections System
« Reply #2 on: September 19, 2010, 05:10:22 pm »


               None of those start a conversation, though.
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Interjections System
« Reply #3 on: September 19, 2010, 05:26:37 pm »


               A trigger to interject a conversation with a placeable requires two things.

1 - a placeable that is not set as STATIC within the trigger.
2 - a trigger to fire the conversation with the placeable.

void main()
{

object oPC = GetEnteringObject();

  int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

  if (DoOnce==TRUE) return;

  if( GetIsPC( oPC ) )
       {

       SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
       AssignCommand (oPC, ClearAllActions());

       DelayCommand(1.0, AssignCommand( oPC, ActionStartConversation( oPC, "NAME_OF_CONVO_HERE" ) ) );

       }
}


Create your conversation and replace NAME_OF_CONVO_HERE in the script above with the name of the conversation file you saved it under.

Make sure the placeable you wish to speak with the PC entering the trigger has a UNIQUE TAG. I always like using an _ before the name of the TAG so it always appears at the top of the list within the conversation file itself.

Select your first conversation NODE.

Change the SPEAKER TAG using the DROPDOWN BOX to the TAG of the placeable.

So if you called it _PLACEABLE1, that's what you would use the dropdown box to select.

Give your placeable the appropriate portrait as well if you'd like.

That's it.

Now when the player enters the trigger, it will fire the conversation based on what you put in the script and use the placeable object as the speaker.

Putting the placeable too far away from the trigger will cause the conversation to fail.

FP!
               
               

               


                     Modifié par Fester Pot, 19 septembre 2010 - 04:26 .
                     
                  


            

Legacy_HugoLuman

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Interjections System
« Reply #4 on: September 19, 2010, 08:25:06 pm »


               Will require a conversation for each trigger? Or can I use a conversation file with a different node for each event?
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Interjections System
« Reply #5 on: September 20, 2010, 12:55:44 am »


               Sure, you can use the same conversation file and simply create different nodes for each event.

The thing is, by going this route, you're going to have to specify what node in the conversation is to fire. You can do this by setting a variable for each individual trigger and when the conversation is done, change the variable to something else.

Example -

Jimmy walks into a trigger. The script fires and in the script is -

SetLocalInt(oPC, "c1ar0510convo", 1);


Then you would write individual scripts for each conversation node to check for a matching variable. If it equals 1, that's the node which is fired.

At the end of the conversation, you reset the variable to 0.

FP!
               
               

               


                     Modifié par Fester Pot, 19 septembre 2010 - 11:55 .
                     
                  


            

Legacy_HugoLuman

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Interjections System
« Reply #6 on: September 20, 2010, 04:21:36 am »


               That's exactly what I was looking for! Thanks '<img'>
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Interjections System
« Reply #7 on: June 22, 2012, 06:53:34 pm »


               A little late to the party on this one.
So for the first script that was given up above with the placeable, does this work the same way with a hench/NPC?

So say i have "Hero/Guss" walking in a tunnel, before they reach the end (they step on the trigger), Guss then says to hero, "I sense something". Starting a conversation with Hero.
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Interjections System
« Reply #8 on: June 23, 2012, 02:49:25 pm »


               Yup, that can work but a conversation will not fire with a companion if they're too far away from the PC when the script fires.

To get around this, you could simply change the speaker tag in the conversation to a placeable near the trigger that fires the script. This placeable would then have the portrait of the companion to make it look like the conversation is happening with the companion, regradless of how far away they are or not.

I believe for a conversation to fire between PC and NPC, the radius is 8.0. Anything greater, the conversation will break or not fire at all.

FP!
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Interjections System
« Reply #9 on: June 23, 2012, 05:27:42 pm »


               Thanks Fester, im going to give this a try right now!