Question: Dialogue condition.

正在查看此主题的用户

Ivdiness

Recruit
I have a problem that is probably very easy to solve,  I hope someone can tell me how to do it, because this is (I think) the last thing that my mod needs for it's release.

What I want to do is:

Create in a dialogue a condition that checks wether the player has already spoken to that specific troop (kingdom hero) about a specific topic, so that if it has, that topic doesn't appear in the conversation.

If I have not expressed myself clearly enough, please make me now, and I will try to aclarify any misunderstanding.

I'm sory if you notice any grammatical or vocabulary mistake, I'm not from an English-speaking country.

Greetings.
 
Ivdiness 说:
I have a problem that is probably very easy to solve,  I hope someone can tell me how to do it, because this is (I think) the last thing that my mod needs for it's release.

What I want to do is:

Create in a dialogue a condition that checks wether the player has already spoken to that specific troop (kingdom hero) about a specific topic, so that if it has, that topic doesn't appear in the conversation.

If I have not expressed myself clearly enough, please make me now, and I will try to aclarify any misunderstanding.

I'm sory if you notice any grammatical or vocabulary mistake, I'm not from an English-speaking country.

Greetings.

Good question Ivdiness.

I cannot tell you explicitly how to do this, as the exact code is based upon variables (npc id#, how many topics etc) that you do not reveal.  However, I can show you in module_dialogue.py an example of a conditional conversation that you can copy and modify for your use.


插入代码块:
[anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (assign, "$pretender_told_story", 0),
     (eq, "$g_talk_troop_met", 0),
     (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
     ],
   "Do I know you?.", "pretender_intro_1", []],
  [anyone|plyr ,"pretender_intro_1", [], "My name is {playername}. At your sevice.", "pretender_intro_2", []],
  [anyone|plyr ,"pretender_intro_1", [], "I am {playername}. Perhaps you have heard of my exploits.", "pretender_intro_2", []],

  [anyone ,"pretender_intro_2", [(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
                                 (val_sub, ":rebellion_string", "fac_kingdom_1"),
                                 (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_intro"),
                                 (str_store_string, 48, ":rebellion_string"),],
   "{s48}", "pretender_intro_3", []],

If this does not help you, or it is confusing then let me know and I will help translate into logical steps for you.  I look forward to seeing your module! :smile:

Regards,

Saxondragon
 
Thank you very much for that!

I've already checked and re-checked lots of alike dialogue tuples, and a new idea came to my mind.

Is it possible to create a troop_slot?

Because:

"slot_troop_met" is a constant declared in module_constants, as "slot_troop_renown", etc.
So, if I create a new constant, for e.g. slot_troop_topic_talked, it should work, shouldn't it?
"Slot_troop_met" won't work, because it is already used by other scripts, and values are assigned to it by other scripts.

The thing is, how to correctly create a troop slot, and which value to assign it in "module_constants".

Thank you very much for your help.

I expect suggestions, and I expect I've made myself clear. If not, just ask me anything you didn't understand.

Again, I'm much sory if you have problems understanding my message.


Greetings.


EDIT: Done! It worked perfectly, just a few more changes, and my mod is ready to go.
 
后退
顶部 底部