Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
All right,

I was bound and determined to figure this out myself, but my python editing works best when I have a tutorial sitting in front of me (by works best I mean moderately successful)

Now its past Midnight, I'm all out of Malboros so I stuck sucking down lucky strike non-filters, three beers left in the fridge and I'm about ready to throw my hands up.

I'm trying to edit the module dialogs.py file to add new options when talking to NPCs in your party, but I'm not seeing where they fit in.  I see the dialog for the three ways in and the one for joining, but not the base "Trade, Tell me about you, go away" dialog options.

Basically what I am looking at doing is creating another dialog branch with them once they are in your party.

So it would look something like:

- I have some items I no longer need
- Tell me about yourself
- We need to seperate
- <NEW DIALOG HERE: Something along the lines of "I have need of you",or some such nonsence.>

If you choose the new dialog option it gives you another option

- I want you to act as my second
- I want you to oversee all the soldiers
- I need you to act as my quartermaster

Simple enough so far.  So I'll break a few lines and hopefully someone can help me tackle this.





Alright from here on out it is going to get complicated so try to bear with me.

I noticed that I can place triggers (or flags, or what nots to use the technical term) in the the dialogs, but I'm not sure if they are just plugged in or are followed up in another file.

I'd like to make a trigger (flag, what-ever) so that once a companion has been selected as such ["second_in_command",1] the added option is replaced with a new one.

- I'm sorry but this isn't working out(blah, blah, blah) which leads to the trigger (is it a damn trigger or flag) being reset.

["second_in_command",0]

When one of the companions is picked for one of the three positions the option to assign that position does not come up for any of the other companions (so only one companion can hold a position at a time)

When all three are assigned then the only option is to dismiss the specific three from their positions (no other companions have any fourth option).


That should be good for now if anyone can help me take a stab at it.  I'd apreciate it.  Even if it is long winded.
I've got the feeling I'm going to have to be specific with the triggers for each companion. ie.

["$borcha_second_in_command",1] or ["$borcha_second_in_command",0]
["$borcha_troop_trainer",1] or ["$borcha_troop_trainer",0]
["$borcha_supply_sergeant",1] or ["$borcha_supply_sergeant',0]

and the same with all other companions along with a generic

["supply_sergeant_assigned",1] and so forth to keep the option from popping up in the wrong place.

There is a purpose to all this madness, and I'd like to be all secretive and tell everyone to wait until I've got it all put together, but I have a feeling I'll be back soon to ask for help and guidance with all the rest of it as well soon enough.

I have read Winter's excellent tutorial on dialog, but I still have a few problems.  1. I can't find the right line to edit and 2. It's a basic tutorial and I'm a moron and skipped basic and went to complicated.

Thanks for the help,

-cheers.

Alright I think I found the right spot and added these lines:

#################################
  # start addition to member talk #
  #################################
  [anyone|plyr,"member_talk", [], "I have need of your services my friend.", "member_assignment", []],
  [anyone,"member_assignment", [] "Yes {Sir/Madamn}", []]
  [anyone|plyr,"member_assignment", [] "I want you to act as my second.", "second_in_command", []],
  [anyone,"second_in_command", [] "Aye {Sir/Madamn}, I won't fail you.", "member_talk", []].
  [anyone|plyr,"member_assignment", [] "I want you to head up all troop training.", "troop_trainer", []],
  [anyone, "troop_trainer", [] "As you wish {Sir/Madamn}, I'll whip them into shape.", "member_talk", []],
  [anyone|plyr,"member_assignment", [] "I need you to take over quartermaster duties.", "quartermaster", []],
  [anyone,"quartermaster", [] "Not a very glamorous job my {lord/lady}, but I'll do my best.", "member_talk", []],
  ###############################
  # end addition to member talk #
  ###############################
  [anyone|plyr,"member_talk", [], "Nothing. Let us keep riding.", "close_window",[]],

....and it doesn't work.

But it doesn't crash the game either which I guess is a plus.
 
check_engine said:
#################################
  # start addition to member talk #
  #################################
  [anyone|plyr,"member_talk", [], "I have need of your services my friend.", "member_assignment", []],
  [anyone,"member_assignment", [] "Yes {Sir/Madamn}", []]
  [anyone|plyr,"member_assignment", [] "I want you to act as my second.", "second_in_command", []],
  [anyone,"second_in_command", [] "Aye {Sir/Madamn}, I won't fail you.", "member_talk", []].
  [anyone|plyr,"member_assignment", [] "I want you to head up all troop training.", "troop_trainer", []],
  [anyone, "troop_trainer", [] "As you wish {Sir/Madamn}, I'll whip them into shape.", "member_talk", []],
  [anyone|plyr,"member_assignment", [] "I need you to take over quartermaster duties.", "quartermaster", []],
  [anyone,"quartermaster", [] "Not a very glamorous job my {lord/lady}, but I'll do my best.", "member_talk", []],
  ###############################
  # end addition to member talk #
  ###############################
  [anyone|plyr,"member_talk", [], "Nothing. Let us keep riding.", "close_window",[]],

If you've read my tutorial, you should be able to see what's wrong with the parts I highlighted.

There'll be a much more comprehensive guide for dialogue when I get to that part of the documentation.

Firmamentally,
Winter
 
Sorry Winter I should have edited the above post,

Right before I called it a night I made the following changes:

[anyone,"do_member_view_char", [], "Anything else?", "member_talk",[]],
  #################################
  # start addition to member talk #
  #################################
  [anyone|plyr,"member_talk", [], "I have need of your services my friend.", "member_assignment_1", []],
  [anyone,"member_assignment_1", [] "Yes {Sir/Madamn}", "member_assignment_2", []]
  [anyone|plyr,"member_assignment_2", [] "I want you to act as my second.", "second_in_command", []],
  [anyone,"second_in_command", [] "Aye {Sir/Madamn}, I won't fail you.", "member_talk", []].
  [anyone|plyr,"member_assignment_2", [] "I want you to head up all troop training.", "troop_trainer", []],
  [anyone, "troop_trainer", [] "As you wish {Sir/Madamn}, I'll whip them into shape.", "member_talk", []],
  [anyone|plyr,"member_assignment_2", [] "I need you to take over quartermaster duties.", "quartermaster", []],
  [anyone,"quartermaster", [] "Not a very glamorous job my {lord/lady}, but I'll do my best.", "member_talk", []],
  ###############################
  # end addition to member talk #
  ###############################
  [anyone|plyr,"member_talk", [], "Nothing. Let us keep riding.", "close_window",[]],

My line of thought on this so you can maybe fill me in on where I'm screwing up is:

"I have need of your services my friend" should be added to the member talk between the options

"We need to seperate for a while" and "Nothing let us keep riding"

(Here is where the first problem comes in -it doesn't show up (I tried restarting a game as well)

Selecting "I have need of your services..." leads to member_assignment_1 where whoever you are talking to responds.
clicking on the screen moves to member_member_assignment_2 where you have the three options:

Second in command
Troop Trainer
Quartermaster

Selecting any of them should currently move to the correct NPC companion response.

At least that's the way I see it working.  As for the flags I haven't even attempted that yet, I'd like to get this up and running first.

Alright, update:  When running python to compile the changes I get this error message:

Never mind the error message, I added in all the damn commas and switched the stupid period to a comma as well.

Now it works,

Thanks for your help Winter, I appreciate it.

Now for the second part...

I imagine I'll be back in a few hours.

... Or a little quicker, a couple of questions here.

I've gotten them to be removed from the dialog options using this code:

[anyone,"do_member_view_char", [], "Anything else?", "member_talk",[]],
  #################################
  # start addition to member talk #
  #################################
  [anyone|plyr,"member_talk", [], "I have need of your services my friend.", "member_assignment_1", []],
  [anyone,"member_assignment_1", [], "Yes {Sir/Madamn}", "member_assignment_2", []],
  [anyone|plyr,"member_assignment_2", [(eq,"$executive_officer",0)], "I want you to act as my second.", "second_in_command", []],
  [anyone,"second_in_command", [], "Aye {Sir/Madamn}, I won't fail you.", "member_talk", [(assign,"$executive_officer",1)]],
  [anyone|plyr,"member_assignment_2", [(eq,"$guard_captain",0)], "I want you to head up all troop training.", "troop_trainer", []],
  [anyone,"troop_trainer", [], "As you wish {Sir/Madamn}, I'll whip them into shape.", "member_talk", [(assign,"$guard_captain",1)]],
  [anyone|plyr,"member_assignment_2", [(eq,"$supply_sergeant",0)], "I need you to take over quartermaster duties.", "quartermaster", []],
  [anyone,"quartermaster", [], "Not a very glamorous job my {lord/lady}, but I'll do my best.", "member_talk", [(assign,"$supply_sergeant",1)]],
  [anyone|plyr,"member_assignment_2", [], "Never mind.", "member_talk", []],
  ###############################
  # end addition to member talk #
  ###############################
  [anyone|plyr,"member_talk", [], "Nothing. Let us keep riding.", "close_window",[]],

First:
I had to use trial and error to get it to compile right because some of the examples I looked at used [(xxx)] and some used [[xxx]] what is the difference in using [ or (.  So in the future I know which to use for what I'm trying to do.

Second:
I want to be able to assign a certain NPC to have extra dialog options if they are set for one of those three positions.  Is there a variable I can use that the computer will flag only a certain NPC. say
[(assign,"executive_officer",1),(assign,"$namedNPC_executive_officer",1)] ** where as the NPC you talked to is flagged as namedNPC **so that only the assigned exec would get added dialog.  This one is a tougher nut for me to crack, as I can't find any examples of anything like this in the dialog file.

Thanks in advance for your help.
 
how can I chang the music in a mod...the old musics are realy getting old, and I have some Realy good ones that I want to put in.

I put them in the sounds folder like it said, but  Idont know how to get them to play insted of the old ones. :???:

Thanks
band.gif
 
Put your music in the M&B\music folder.

Then edit M&B\Data\music.txt.

The first line is the total number of mp3s.

Each line then has the filename of the mp3, and a number 1,2, or 3.

1: play in towns and peaceful places
2: play in combat
3: play in both
 
to the above: you need to export the object files from the mod specific brf files in the resource folder


A question of my own: I keep getting this exit tab that  is activateable on a building I created and I want to get rid of it but I don't know what is causeing it. Here is a screen shot below (circled in black is what I want to get rid of) :


 
I think exit pops up if you go out of the xy boundaries stated in module_scenes.py. Expand the boundaries and see what happens? They can be negative, e.g. (-1000,-1000),(1000,1000)

Also, they could also be described in the sco file. If so, try renaming the sco file and see if it recurs.

 
I tried expanding the bounderies but no go...Is it possible that objects over a certain size are recognized in a wierd way in M&B ( you can't see this in the screenshot but its a very tall tower...)
 
Simple way to check, just shift your entire mesh downwards (i.e. re-zero at a higher position), then try again.

This will totally mess up your skybox if it's an exterior scene, but it should still work fine if it's an interior scene.

EDIT: hang on, it looks like your screenshot is at ground level. it shouldn't affect like that.

Could you post a screenshot of the mesh in your editing program so we can see the 0,0,0 plane? You're sure that the entire mesh is within the boundary? HAve you tried removing the .sco?
 
The "Exit" thing is caused by having "Exit" in the scene tuple. Remove "exit" and just make a passage-based exit (or one with the new placeable Exit boundaries), and the message will disappear.

Wakefully,
Winter
 
Run into a spot of bother with Python. When trying to build the edited module, I get the following error message with dialogues.py:

Traceback (most recent call last):
    File "process_dialogs.py", line 121, in ?
        compile_sentece_tokens(dialogs)
    File "process_dialogs.py", line 66, in compile_sentece_tokens
        output_token = sentence[opt_token_pos]
IndexError: list index out of range


The code that has an error in it is something to do with Ymira:

All Ymira's code:

[trp_ymira,"start", [[eq,"$ymira_introduced",0]], "Please, {sir/madam}, you must help me! They are going to kill me if you don't!", "ymira_introduce_1",
  [[assign,"$ymira_introduced",1]]],
  [trp_ymira|plyr,"ymira_introduce_1", [], "Easy now. No one can harm you as long as I am here.", "ymira_introduce_2a",[]],
  [trp_ymira,"ymira_introduce_2a", [], "Oh, is that true? God bless you, {sir/madam}...", "ymira_introduce_2a_1",[]],
  [trp_ymira|plyr,"ymira_introduce_2a_1", [], "Now calm down and tell me who's after you.", "ymira_introduce_2a_2",[]],
  [trp_ymira,"ymira_introduce_2a_2", [], "I don't know... bad men... please let me come with you...", "ymira_introduce_2a_3",[]],
  [trp_ymira|plyr,"ymira_introduce_2a_3", [], "What? You want to join my party?", "ymira_introduce_8",[]],
  [trp_ymira,"ymira_introduce_8", [], "Please, let me come with you, {sir/madam}.\
I will look after your horses, I will wash your clothes... I work very hard... and I eat very little...\
Please, You must let me come with you...", "ymira_ask_join",[]],
  [trp_ymira|plyr,"ymira_ask_join", [], "All right...", "ymira_ask_join_1",[]],
  [trp_ymira,"ymira_ask_join_1", [], "Oh, thank you...", "ymira_ask_join_2",[]],
  [trp_ymira|plyr,"ymira_ask_join_2", [[hero_can_join]], "What is your name?", "ymira_ask_join_3",[]],
  [trp_ymira,"ymira_ask_join_3", [], "Ymira.", "ymira_ask_join_4",[]],
  [trp_ymira|plyr,"ymira_ask_join_4", [], "Well, Ymira, you can come with me for now.\
I will decide what to do with you later.", "ymira_ask_join_5",[]],
  [ymira,"ymira_ask_join_5", [], "Oh, God bless you. Thank you, thank you very much.\
I will work very hard for you. I promise.", "close_window"],
  [[assign,"ymira_joined_party",1],
    [troop_join,"trp_ymira"],
    [remove_troop_from_site,"trp_ymira"],
    [troop_join,ymira,1]],

  [trp_ymira|plyr,"ymira_ask_join_2", [[neg|hero_can_join]], "But unfortunately.\
My party is full at the moment. I can't take anyone else with me. Wait here, I will think of something.", "ymira_join_decline",[]],

  [trp_ymira|plyr,"ymira_ask_join", [], "No way. This is no life for a girl like you.", "ymira_join_decline",[]],
  [trp_ymira,"ymira_join_decline", [], "Oh no, please don't leave me here...", "close_window",
  []],


  [trp_ymira|plyr,"ymira_introduce_1", [], "Go find some soldiers to protect you. I don't have time for this.", "ymira_introduce_2b",[]],
  [trp_ymira,"ymira_introduce_2b", [], "But it is the soldiers that are going to kill me.", "ymira_introduce_2b_1",[]],
  [trp_ymira|plyr,"ymira_introduce_2b_1", [], "I wouldn't want to cross with any soldiers. Get lost now.", "ymira_join_decline",[]],
  [trp_ymira|plyr,"ymira_introduce_2b_1", [], "You are running from soldiers? In that case...", "ymira_introduce_8",[]],

  [trp_ymira,"start", [[eq,"$ymira_joined_party",0]], "Please... please let me come with you.", "ymira_ask_join",
  []],

  [trp_ymira,"party_encounter", [], "Do you want me to rejoin you?", "member_wilderness_talk",[]],
  [trp_ymira,"start", [[neg|main_party_has_troop,"trp_ymira"]], "Do you want me to rejoin you?", "member_inn_talk",[]],
  [trp_ymira,"member_separate_inn", [], "I don't know what you will do without me, but you are the boss. I'll wait for you at the Four Ways Inn.", "close_window",
  [[store_conversation_troop,reg(0)],[remove_member_from_party,reg(0)],[add_troop_to_site, reg(0), "scn_four_ways_inn", ymira_inn_entry]]],



I have placed Ymira at the Four Ways Inn, to clarify things a bit. Also, I'm partway through correcting the conversation, so any mistakes I just haven't got round to yet.

Edit - just spotted some mistakes - the first bold one should be trp_ymira (not my fault, that one)
The second should be "trp_ymira" instead of just ymira (that was my fault).
The italic ,1 shouldn't have been there.

Now it gives a completely different error message - see the top of the post for the edit.

The new Ymira code is this:


[trp_ymira,"start", [[eq,"$ymira_introduced",0]], "Please, {sir/madam}, you must help me! They are going to kill me if you don't!", "ymira_introduce_1",
  [[assign,"$ymira_introduced",1]]],
  [trp_ymira|plyr,"ymira_introduce_1", [], "Easy now. No one can harm you as long as I am here.", "ymira_introduce_2a",[]],
  [trp_ymira,"ymira_introduce_2a", [], "Oh, is that true? God bless you, {sir/madam}...", "ymira_introduce_2a_1",[]],
  [trp_ymira|plyr,"ymira_introduce_2a_1", [], "Now calm down and tell me who's after you.", "ymira_introduce_2a_2",[]],
  [trp_ymira,"ymira_introduce_2a_2", [], "I don't know... bad men... please let me come with you...", "ymira_introduce_2a_3",[]],
  [trp_ymira|plyr,"ymira_introduce_2a_3", [], "What? You want to join my party?", "ymira_introduce_8",[]],
  [trp_ymira,"ymira_introduce_8", [], "Please, let me come with you, {sir/madam}.\
I will look after your horses, I will wash your clothes... I work very hard... and I eat very little...\
Please, You must let me come with you...", "ymira_ask_join",[]],
  [trp_ymira|plyr,"ymira_ask_join", [], "All right...", "ymira_ask_join_1",[]],
  [trp_ymira,"ymira_ask_join_1", [], "Oh, thank you...", "ymira_ask_join_2",[]],
  [trp_ymira|plyr,"ymira_ask_join_2", [[hero_can_join]], "What is your name?", "ymira_ask_join_3",[]],
  [trp_ymira,"ymira_ask_join_3", [], "Ymira.", "ymira_ask_join_4",[]],
  [trp_ymira|plyr,"ymira_ask_join_4", [], "Well, Ymira, you can come with me for now.\
I will decide what to do with you later.", "ymira_ask_join_5",[]],
  [trp_ymira,"ymira_ask_join_5", [], "Oh, God bless you. Thank you, thank you very much.\
I will work very hard for you. I promise.", "close_window"],
  [[assign,"ymira_joined_party",1],
    [troop_join,"trp_ymira"],
    [remove_troop_from_site,"trp_ymira"],
    [troop_join,"trp_ymira"]],

  [trp_ymira|plyr,"ymira_ask_join_2", [[neg|hero_can_join]], "But unfortunately.\
My party is full at the moment. I can't take anyone else with me. Wait here, I will think of something.", "ymira_join_decline",[]],

  [trp_ymira|plyr,"ymira_ask_join", [], "No way. This is no life for a girl like you.", "ymira_join_decline",[]],
  [trp_ymira,"ymira_join_decline", [], "Oh no, please don't leave me here...", "close_window",
  []],


  [trp_ymira|plyr,"ymira_introduce_1", [], "Go find some soldiers to protect you. I don't have time for this.", "ymira_introduce_2b",[]],
  [trp_ymira,"ymira_introduce_2b", [], "But it is the soldiers that are going to kill me.", "ymira_introduce_2b_1",[]],
  [trp_ymira|plyr,"ymira_introduce_2b_1", [], "I wouldn't want to cross with any soldiers. Get lost now.", "ymira_join_decline",[]],
  [trp_ymira|plyr,"ymira_introduce_2b_1", [], "You are running from soldiers? In that case...", "ymira_introduce_8",[]],

  [trp_ymira,"start", [[eq,"$ymira_joined_party",0]], "Please... please let me come with you.", "ymira_ask_join",
  []],

  [trp_ymira,"party_encounter", [], "Do you want me to rejoin you?", "member_wilderness_talk",[]],
  [trp_ymira,"start", [[neg|main_party_has_troop,"trp_ymira"]], "Do you want me to rejoin you?", "member_inn_talk",[]],
  [trp_ymira,"member_separate_inn", [], "I don't know what you will do without me, but you are the boss. I'll wait for you at the Four Ways Inn.", "close_window",
  [[store_conversation_troop,reg(0)],[remove_member_from_party,reg(0)],[add_troop_to_site, reg(0), "scn_four_ways_inn", ymira_inn_entry]]],
 
all of the dialogue states that are not "start", you need to replace "trp_ymira" with "anyone" and "trp_ymira|plyr" with "anyone|plyr". That could fix it, but i'm not sure. You should probably do it anyway.
 
All your problems are contained in this chunk of code:

  [ymira,"ymira_ask_join_5", [], "Oh, God bless you. Thank you, thank you very much.\
I will work very hard for you. I promise.", "close_window"],
  [[assign,"ymira_joined_party",1],
    [troop_join,"trp_ymira"],
    [remove_troop_from_site,"trp_ymira"],
    [troop_join,ymira,1]],

There's a great number of things wrong with this block, which I hope you can identify on your own.

Dynastically,
Winter
 
Yoshiboy said:
all of the dialogue states that are not "start", you need to replace "trp_ymira" with "anyone" and "trp_ymira|plyr" with "anyone|plyr". That could fix it, but i'm not sure. You should probably do it anyway.
Made no difference. Why would I need to anyway? Looking at the Borcha conversations, it's trp_borcha and trp_borcha|plyr, and that works, so why would Ymira's conversation be any different?

@Winter: I updated with what was wrong with that.
"[ymira,"ymira_ask_join_5", []" should be "[trp_ymira,"ymira_ask_join_5", [],"
"[troop_join,ymira,1]]" should be "[troop_join,"trp_ymira"]]"

If I've missed anything, please tell me. I am very inexperienced at Python so I've probably missed the biggest mistake.
 
Leprechaun said:
@Winter: I updated with what was wrong with that.
"[ymira,"ymira_ask_join_5", []" should be "[trp_ymira,"ymira_ask_join_5", [],"
"[troop_join,ymira,1]]" should be "[troop_join,"trp_ymira"]]"

If I've missed anything, please tell me. I am very inexperienced at Python so I've probably missed the biggest mistake.

Okay, I'll list them all for everyone's benefit, including the ones you just mentioned.

  [ymira,"ymira_ask_join_5", [], "Oh, God bless you. Thank you, thank you very much.\
I will work very hard for you. I promise.", "close_window"],
   [[assign,"ymira_joined_party",1],
    [troop_join,"trp_ymira"],
    [remove_troop_from_site,"trp_ymira"],
    [troop_join,ymira,1]],

1 ) Dialogue partner field: missing trp_ prefix. Should be trp_ymira.
2 ) Ending dialog-state field: "close_window"],? That bracket does not go there.
3 ) Consequences block: missing $ in variable [assign,"ymira_joined_party",1],. Should be [assign,"$ymira_joined_party",1],
4 ) Consequences block: Duplicate troop_join operation; the second, unnecessary troop_join also has various problems with it.
5 ) Closing brackets: There are only two closing brackets where there should be three. This is where the misplaced bracket from 2 should go.

Tutorially,
Winter
 
Now you say them, they really are damn obvious, and I should have spotted them, even simply by comparing the code to other bits of dialogue.

Thanks.
 
Winter said:
The "Exit" thing is caused by having "Exit" in the scene tuple. Remove "exit" and just make a passage-based exit (or one with the new placeable Exit boundaries), and the message will disappear.

Wakefully,
Winter

Thanks that worked like a charm. The exit thing is barely necessary anyway since I'm guessing most people just tab out of scenes. That will teach me to be more carefull when I copy and paste code without fully knowing what all of it does! :lol:
 
Status
Not open for further replies.
Back
Top Bottom