Author Topic: PC become NPC in Sequel?  (Read 318 times)

Legacy_Quillmaster

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
PC become NPC in Sequel?
« on: June 04, 2011, 01:37:21 pm »


               Heres' a question for you all.

I'd like to somehow record what a PC is wearing and armed with at the end of a module, so that in a sequel when the player uses a different character, they can encounter their first character as an NPC equipped in the manner that the player finished the prequel.  Can it be done?
               
               

               


                     Modifié par Quillmaster, 04 juin 2011 - 04:12 .
                     
                  


            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #1 on: June 04, 2011, 02:29:41 pm »


               Before the end of first module save the character to a database (StoreCampaignObject()) and than summon that character with RetrieveCampaignObject() in next module.
               
               

               
            

Legacy_Quillmaster

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #2 on: June 13, 2011, 11:14:32 pm »


               Sorry for the slow response, only I've been looking into this.  It sounds too good to be true, but unfortunately my scripting experience consists of editing stuff generated by Lilac Souls Script Generator, plus a bit of dabbling with Gestalts Cutscene system.  Having checked both in toolset and the Lexicon, I can honestly say this feels beyond me,  I don't understand how the parameters work.  '<img'>
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #3 on: June 14, 2011, 03:29:50 pm »


               The steps would be something like this -

At the end of your module, I'd advise setting up a script that makes a NPC copy of the PC.

void main()
{
  object oPC = GetPCSpeaker(); //Assume they are in a conversation at the end of the module
  object oPCCopy = CopyObject(oPC, GetLocation(oPC));
  StoreCampaignObject("PCtoNPCDatabaseName", "PCtoNPCVariableName", oPCCopy);
  DestroyObject(oPCCopy, 0.2);
}

Then, in the new module, you would need code like this to recreate the NPC copy of the PC at a waypoint you give a Tag called WP_PCtoNPCCreationPoint

void main()
{
  object oNPC = RetrieveCampaignObject("PCtoNPCDatabaseName", "PCtoNPCVariableName", GetLocation(GetWaypointByTag("WP_PCtoNPCCreationPoint")));
}
               
               

               


                     Modifié par Thayan, 14 juin 2011 - 02:32 .
                     
                  


            

Legacy_Quillmaster

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #4 on: June 14, 2011, 09:01:45 pm »


               Thanks Thayan, think I understand it now. '<img'>
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #5 on: June 14, 2011, 09:21:57 pm »


               I would add to the sugestions made by Thayan.  

Since it sounds like you will not have a need for most of the items the PC will have in there back pack.  Go ahead and destroy all the items in the NPC's inventory before saveing them to the DB.  I just see no reason to store that many items into the DB.  

If there is a chance the NPC will get killed in the next chapter, Go ahead and strip him of gold and make there equipted items undropable now..  

The NPC will not have a script set for NPC events.  So you may want to dominate the NPC to have his event scripts changed to the NW_CH_AC* script set.   Then make a  NPC copy of the PC copy.  This new NPC will then at least have a default script set.
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #6 on: June 14, 2011, 09:37:11 pm »


               Glad to help. I'll agree with Lightfoot and add that there's lots here that you may need to do and/or add to if you plan to use the NPC copy for more than just eye candy.

First off, I'm fairly certain the PC Copy will have no AI scripts. There are workarounds to this (which I can't remember at the moment since I'm at work and don't have access to my module), but you'd need to take that into consideration if you want it to fight intelligently other than simply commanding it using ActionAttack() (which is a recipe for a quick death for a wizard PC copy for example). Also, if you want to associate a conversation to it, you'll need to have the conversation scripted to start on it since you can't set the conversation on it through the toolset. If you provide ideas of what you plan to do with the copy I'm sure we can provide additional specific information on how to accomplish it (if you any need help, that is!).
               
               

               
            

Legacy_Quillmaster

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
PC become NPC in Sequel?
« Reply #7 on: June 14, 2011, 10:17:13 pm »


               Hmmm...well it kind of stated as a dream, to play a sequel and simply meet the character they played with previously in the prequel all decked out so they appeared exactly as the PC remembered dressing them.  Of course there's always the potential henchman to consider too.  I'm currently undecided, but thought I should at least put the export side in place in case I do decide to use it later.  The points raised by Lightfoot are certainly worth considering.