Aller au contenu

Photo

Starting Conditional Question


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Birdman076

Birdman076
  • Members
  • 186 messages
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?

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#3
CID-78

CID-78
  • Members
  • 1 124 messages
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.

#4
Morbane

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

#5
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
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.

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
@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.

#7
Birdman076

Birdman076
  • Members
  • 186 messages

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.

#8
Morbane

Morbane
  • Members
  • 1 883 messages

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.