Author Topic: Starting Conditional Question  (Read 374 times)

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Starting Conditional Question
« on: August 01, 2011, 04:15:18 am »


               I'm trying to slim down scripts in a module and am looking at all the separate starting conditional scripts for NPC conversations and am wondering if they can be combined into one starting conditional? For example there are separate guilds for each class and each has its own guild master with conversation and a starting conditional based on class for said guild. Is is possible to do a check for each class and if class is say "fighter" drop the current conversation and start the fighter conversation? 

If that isn't possible, how cpu intensive would it be to do an OnPerception and have them initialize the conversation based on class?

Or maybe in the OnUserDefined I do a class check and initialize the proper conversation?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Starting Conditional Question
« Reply #1 on: August 01, 2011, 04:44:54 am »


               You can reuse a starting conditional script for multiple conversations but you can't really combine them for one conversation simply due to the fact that they are conditionals. If you need line 1 to appear if the player is a fighter and line 2 to appear if the player is a cleric, you can't really make one conditional that says if the player is a fighter or cleric return true. Then both lines would be true..yet only one can appear.
Hopefully I understood what you were asking and hopefully my response might have made a little sense.':lol:'
               
               

               


                     Modifié par GhostOfGod, 01 août 2011 - 09:28 .
                     
                  


            

Legacy_CID-78

  • Sr. Member
  • ****
  • Posts: 261
  • Karma: +0/-0
Starting Conditional Question
« Reply #2 on: August 01, 2011, 06:49:54 am »


               well he can allways terminate a conversation and start a new one depening one or more conditions. in that case it's not a "Text Appear when" script. It's rather a OnConversation script.

However you only need one Textapperwhen "IsMember" script in this case that return true/false depending on player vs guild match. The script simply get which guild by checking the NPC (the guild master) to see which local variable the player need to have. and return the result.

in either case OnPerception\\OnUserdefined isn't required so no need to waste CPU at all.
               
               

               
            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Starting Conditional Question
« Reply #3 on: August 01, 2011, 08:09:59 am »


               check these out - you might get some idea how thing in ga_* & gc_* scripts can work.
http://nwcitadel.for...splay.php?f=153
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Starting Conditional Question
« Reply #4 on: August 01, 2011, 04:09:06 pm »


               If the conversation is going to be the same, or only have one or two differences based on class names, then yes, it's doable, and fairly simple to do.
 You put a variable on the NPC speaking equal to the class number you want them to be checking for, and check against that in the starting conditional.
 Any words that you might need to change based on class you can set either as a custom token in the same conditional (before returning the result), or use the default class tokens Bioware provided.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Starting Conditional Question
« Reply #5 on: August 01, 2011, 05:13:57 pm »


               @Morbane:   If nwn1 had arguments that you could add to the Starting Conditional, like the scripts you linked to,  It would not be as much of a problem as it is in nwn1.
               
               

               
            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Starting Conditional Question
« Reply #6 on: August 01, 2011, 11:49:35 pm »


               

Failed.Bard wrote...

If the conversation is going to be the same, or only have one or two differences based on class names, then yes, it's doable, and fairly simple to do.
You put a variable on the NPC speaking equal to the class number you want them to be checking for, and check against that in the starting conditional.
Any words that you might need to change based on class you can set either as a custom token in the same conditional (before returning the result), or use the default class tokens Bioware provided.


Each guild conversation opens a store for said guild, I've never used the tokens so I'm lost there and haven't touched toolset or scripting in over a year now and was just getting away from dependance on the script generator then, so yeah.
               
               

               
            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Starting Conditional Question
« Reply #7 on: August 02, 2011, 09:09:05 pm »


               

Lightfoot8 wrote...

@Morbane:   If nwn1 had arguments that you could add to the Starting Conditional, like the scripts you linked to,  It would not be as much of a problem as it is in nwn1.


My bad - I come here to play when the NWN2 forum is sleeping - my apologies to the op.