Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Help with dialog updates

Page: 1 of 1
 Darth_Andrez
09-28-2008, 2:17 PM
#1
I need help with updating a dialog for my new recruitment mod.

what i need to do is make my dialog update because of an event
Example; you walk up to a man and start the dialog he says "hello im harry"
and you go away from him and when you come back and start the dialog again he will now say "hello again"

it something i have never seen a tutorial on so any help would be greatly apreacieciated(i cant spell)

Thanks, :xp:Nanu12
 ForeverNight
09-28-2008, 2:40 PM
#2
This is where conditional scripts come into play.

I don't have one on me right now, but you would create a conditional script that, let's say it checks for an item that you get through the first dialog and can't get rid of. Then, if you have that item, the game would then play the dialog that fires when you have that item...

Does that make any sense? I'm kinda out of it today...
 Inyri
09-28-2008, 2:41 PM
#3
This kind of thing is done with scripts and variables, typically. I'm going to slaughter the explanation of this, so bear with me.

When you make a dialogue you typically have branches. On each branch and each reply you have two slots for scripts -- an action script (the script performs an action when the dialogue branch comes up) and a conditional script (the script determines whether or not the dialogue will appear based on one or more conditions).

To make a particular dialogue branch not appear you will need to have a conditional script on that branch (for instance you can set the script only to appear if a variable you set is '1'). Somewhere you will need to have an action script that will set that variable to 1.

You can also use this method to make sure a branch doesn't fire. If you have a conditional script on branch 1 that says it will only fire if the variable is 0, you can have an action script at the end of that dialogue that changes the variable to 1. This way the first branch won't fire, but the second branch will.

So now that I've confused you feel free to ask questions. :)
 Darth_Andrez
09-28-2008, 3:04 PM
#4
This kind of thing is done with scripts and variables, typically. I'm going to slaughter the explanation of this, so bear with me.

When you make a dialogue you typically have branches. On each branch and each reply you have two slots for scripts -- an action script (the script performs an action when the dialogue branch comes up) and a conditional script (the script determines whether or not the dialogue will appear based on one or more conditions).

To make a particular dialogue branch not appear you will need to have a conditional script on that branch (for instance you can set the script only to appear if a variable you set is '1'). Somewhere you will need to have an action script that will set that variable to 1.

You can also use this method to make sure a branch doesn't fire. If you have a conditional script on branch 1 that says it will only fire if the variable is 0, you can have an action script at the end of that dialogue that changes the variable to 1. This way the first branch won't fire, but the second branch will.

So now that I've confused you feel free to ask questions. :)
Thanks, Its still a bit confusing how would i go about making the script that changes its varialble,im totally useless when it comes to advanced scripting if you could make it for me i would be very greatfull all i want is a sort of tenplate if you no what i mean?
 ChAiNz.2da
09-28-2008, 3:11 PM
#5
Thanks, Its still a bit confusing how would i go about making the script that changes its varialble,im totally useless when it comes to advanced scripting if you could make it for me i would be very greatfull all i want is a sort of tenplate if you no what i mean?

K1 or TSL?

TSL's new options make conditionals a snap (depending on what you need) since the dialogues have the ability to look for parameters. Literally, one script can be used for a host of different options and TSL includes alot of pre-made conditional/parameter scripts.. K1, not so much :(

Just in case.. because of TSL's new functionality.. it's often best to use tk102's DLGEditor (http://www.starwarsknights.com/tools.php#de) (I use it no matter what game).
 Inyri
09-28-2008, 3:11 PM
#6
I'm pretty useless with advanced scripting too, although this would probably be considered a basic script. I think some of the tutorials should help you formulate such a script. In fact there are probably some variable scripts in Holowan Labs somewhere if you run a quick forum search.
 Darth_Andrez
09-28-2008, 3:13 PM
#7
ok thanks guys ill have a look in tuts but its for K1
 Inyri
09-28-2008, 3:16 PM
#8
If you need to see some of these scripts in action you're free to look at the dialogue and script files from my recruitment mod. I used the technique extensively.
 ChAiNz.2da
09-28-2008, 3:17 PM
#9
ok thanks guys ill have a look in tuts but its for K1

Pavlos' tutorial I believe sets an example for a 'talked to' type setting. Might want to check it out :)

http://www.lucasforums.com/showthread.php?t=180845)
 Inyri
09-28-2008, 3:20 PM
#10
Oh that's right, I forgot that there are a couple of default game scripts you can use if you don't want to make your own. I believe they're k_con_talkedto and k_act_talktrue. Based on what I told you before I'm sure you can figure out which goes where. :)

Chainz, can you confirm those scripts for me? Been a while since I've used them.
 Darth_Andrez
09-28-2008, 3:24 PM
#11
scrap that
 ChAiNz.2da
09-28-2008, 3:25 PM
#12
Chainz, can you confirm those scripts for me? Been a while since I've used them.

Now… we’re going to attach some global scripts. These are standard game resources. We’re using them to check if the player has spoken to the NPC beforehand. If your dialogue if for KotOR then type “k_act_talktrue” in the “Script that fires when spoken” field on your first speaker node and then type “k_con_talkedto” in the “Script that determines availability” field. In TSL the principle is the same. Set conditional #1 to “c_talkedto” and set the script #1 field to “a_talktrue.” Any scripts that you ever place in these fields should not have the extension attached.

Absolutely correct :D
 Darth_Andrez
09-28-2008, 3:25 PM
#13
OH sorry scrap this post
 ChAiNz.2da
09-28-2008, 3:27 PM
#14
OH sorry scrap this post

Not a problem.. we're here to help :D
Take a look at that tutorial though..Pavlos did a wonderful job on it :)
 Darth_Andrez
09-29-2008, 4:35 PM
#15
ok kool

hey guys i have decided to make the mod under added content because it will also add a new side quest thanks for help guys ill keep you updated


EDIT:
Hey guys so i think ive got to grips with it now

correct me if im wrong but if put a script like equipt item in script that fires when spoken
does that mean that if you put it in the script that determinds availability the dialog branch will only be available if the script has fired?
 ForeverNight
09-29-2008, 4:49 PM
#16
Basically, yes.

If you write a conditional script that checks if you have an item, and if fires and returns true, than you will access that dialog branch. If it fires and returns false, then you won't.

If the NPC is giving the lines, and the script fires and sees that you don't have the item, then it will go down to the next line of dialog and check what it says to do. If there's no script, then it will just fire the dialog and stop the search for more dialog.
 Darth_Andrez
09-29-2008, 4:55 PM
#17
ok thats quite helpful so how do i rite conditional scripts
?
Page: 1 of 1