Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
I assume there's no way to assign different materials to the "same" terrain type, like desert and desert_forest, right?
 
Might be worth a try creating a material called map_desert_forest or whatever, it might not work but I remember seeing a unique forest terrain in Thorgrim's. All the map materials are in CommonRes/Materials.brf if you want to look; there is no unique desert forest material that I can see.
 
Okay, I'm gonna seem out of place here since I'm no modder, but could anyone direct me towards how to change the amount of time village looting takes? I'm presuming that the value (10hrs or whatever) is determined by a number somewhere that (ideally) I could dig up in the .txt files and tweak a little. Thanks.
 
SomeHairyGuy 说:
Okay, I'm gonna seem out of place here since I'm no modder, but could anyone direct me towards how to change the amount of time village looting takes? I'm presuming that the value (10hrs or whatever) is determined by a number somewhere that (ideally) I could dig up in the .txt files and tweak a little. Thanks.

Menus.txt. I believe this is the section, with that 3 being what you want to alter. Might be wrong though, play around with it maybe.

mno_village_loot  0  Plunder_the_village,_then_raze_it.  11 1 3 936748722493063420 144115188075856213 1 501 3 144115188075856213 34 648518346341351424 2133 2 144115188075856240 144115188075856213 4 0 2204 2 1224979098644774912 144115188075856213 2190 3 1224979098644774913 144115188075856287 1224979098644774912 30 2 1224979098644774913 0 1 3 936748722493063451 648518346341351424 144115188075856213 3 0 1030 3 3 5 1 2040 0  .  mno_village_raid_leave  0  Leave_this_village_alone.  1 2040 0  .

The code notes say that "(3 hours will be extended by the trigger)".  Don't know how that will interact with your alterations.

Edit: Thanks for the link Antonis, looks useful.
 
Okay, thanks very much for the quick replies guys.

BTW, I just started playing Fires of War last night Antonis, and it's neat. Nice job!
 
Glad you like it. And kraggrim, my pleasure. I also use most of those as ideas to tinker with the module files.  :smile:
Subitai has done a great job, picking after TheMageLord in an excellent work.
 
Hmm... no joy with changing that 3 to a 1, villages still take the same amount of time to loot by the look of things. At least this prompted me to try using the Module System thingbob, which is all new to me. I'll see what changing the '5, 1' after the 3 does.

Also, do you comment things out with ';' or '#'?

EDIT: copying the relevant 'Take hostile action' section from a different mod's menu.txt didn't seem to help, but had some amusing results, such as repeated driving away of 12-or-so cattle when the 'loot and burn' option is picked.

EDIT 2: FFFFFfff--- yass! I think I've done it!  :party:

I went into scripts.txt and looked around for an isolated '10', '11' or '12' (I think it's meant to take 10-ish hours to loot a village); I found under 'process village raids' the following...

process_village_raids -1
146 6 3 1224979098644774912 648518346341351515 648518346341351625 4 0 1073741857 3 1224979098644774912 648518346341351530 648518346341351537 1073741857 3 1224979098644774912 648518346341351563 648518346341351565 1073741855 2 1224979098644774912 648518346341351589 33 3 1224979098644774912 648518346341351599 648518346341351601 2133 2 1224979098644774913 1297036692682702872 2133 2 1224979098644774914 1297036692682702873 2133 2 1224979098644774915 1297036692682702874 5 0 33 3 1224979098644774912 648518346341351605 648518346341351625 2133 2 1224979098644774913 1297036692682702865 2133 2 1224979098644774914 1297036692682702870 2133 2 1224979098644774915 1297036692682702871 5 0 2133 2 1224979098644774913 1297036692682702863 2133 2 1224979098644774914 1297036692682702866 2133 2 1224979098644774915 1297036692682702867 3 0 521 3 1224979098644774916 1224979098644774912 36 4 0 541 3 1224979098644774912 35 0 2106 2 1224979098644774916 5 2111 2 1224979098644774916 0 501 3 1224979098644774912 36 1224979098644774916 4 0 2147483678 2 1224979098644774916 50 4 0 1681 2 1224979098644774917 1224979098644774912 2147483679 2 1224979098644774917 1224979098644774913 1676 2 1224979098644774912 1224979098644774913 3 0 561 3 1224979098644774912 38 1 501 3 1224979098644774912 38 0 1679 1 1224979098644774912 3 0 5 0 541 3 1224979098644774912 35 1 2133 2 1224979098644774918 1 521 3 1224979098644774919 1224979098644774912 34 4 0 30 2 1224979098644774919 0 132 1 1224979098644774919 3221225503 2 1224979098644774919 648518346341351424 31 2 144115188075856283 0 2281 3 1224979098644774920 1224979098644774912 1224979098644774919 2147483678 2 1224979098644774920 4 2133 2 1224979098644774918 0 3 0 4 0 31 2 1224979098644774918 1 1 3 936748722493063420 1224979098644774912 0 501 3 1224979098644774912 38 0 1679 1 1224979098644774912 5 0 2133 2 1224979098644774921 11 521 3 1224979098644774922 1224979098644774912 34 4 0 1685 3 1224979098644774923 1224979098644774922 1369094286720630806 2105 2 1224979098644774921 1224979098644774923 3 0 4 0 541 3 1224979098644774912 132 1 2107 2 1224979098644774921 2 2108 2 1224979098644774921 3 3 0 2105 2 1224979098644774916 1224979098644774921 501 3 1224979098644774912 36 1224979098644774916 4 0 30 2 1224979098644774916 50 541 3 1224979098644774912 38 0 1678 2 1224979098644774912 1008806316530991157 1678 2 1224979098644774912 1008806316530991158 1676 2 1224979098644774912 1224979098644774914 501 3 1224979098644774912 38 1 3 0 4 0 32 2 1224979098644774916 100 2342 2 1 1224979098644774912 1652 3 1224979098644774924 1224979098644774922 0 30 2 1224979098644774924 0 2330 2 2 1224979098644774922 1105 1 1585267068834414747 4 0 521 3 1224979098644774925 1224979098644774912 7 33 3 1224979098644774925 360287970189639879 360287970189640027 1 4 936748722493063669 1224979098644774924 1224979098644774925 -1 2105 2 144115188075856989 -1 3 0 520 3 1224979098644774926 1224979098644774924 11 521 2 1224979098644774927 1224979098644774912 2122 3 1224979098644774928 1224979098644774927 60 2105 2 1224979098644774926 1224979098644774928 500 3 1224979098644774924 11 1224979098644774926 4 0 33 3 1224979098644774925 360287970189639879 360287970189640027 520 3 1224979098644774929 1224979098644774925 11 2106 2 1224979098644774929 1224979098644774928 2111 2 1224979098644774929 0 500 3 1224979098644774925 11 1224979098644774929 3 0 1 3 936748722493063420 1224979098644774912 2 501 3 1224979098644774912 47 0 501 3 1224979098644774912 48 0 501 3 1224979098644774912 36 0 501 3 1224979098644774912 37 0 4 0 2204 2 1224979098644774930 1224979098644774912 1073742365 3 1224979098644774912 7 360287970189639680 31 2 1224979098644774930 432345564227567630 1 4 936748722493063460 864691128455135422 1224979098644774912 1224979098644774924 3 0 1 6 936748722493063643 1 1224979098644774924 1224979098644774912 -1 -1 2204 2 1224979098644774931 1224979098644774922 1 4 936748722493063666 1224979098644774931 1224979098644774930 5 3 0 3 0 5 0 541 3 1224979098644774912 35 2 521 3 1224979098644774932 1224979098644774912 37 2105 2 1224979098644774932 1 501 3 1224979098644774912 37 1224979098644774932 4 0 30 2 1224979098644774932 10 541 3 1224979098644774912 38 1 1679 1 1224979098644774912 1678 2 1224979098644774912 1008806316530991159 501 3 1224979098644774912 38 2 3 0 4 0 32 2 1224979098644774932 50 541 3 1224979098644774912 38 2 1679 1 1224979098644774912 501 3 1224979098644774912 38 3 1676 2 1224979098644774912 1224979098644774915 3 0 4 0 32 2 1224979098644774932 100 1 3 936748722493063420 1224979098644774912 0 501 3 1224979098644774912 37 0 1679 1 1224979098644774912 501 3 1224979098644774912 38 0 1676 2 1224979098644774912 1224979098644774913 3 0 3 0 3 0

...and changed that '11' to 22, and then 44. When tested, village looting sped up dramatically and did indeed seem to be 2x/4x faster (respectively). I don't know why the time amount gets shorter as you increase the number - maybe its a divider or something, I dunno. This is kinda over my head.
 
SomeHairyGuy 说:
I don't know why the time amount gets shorter as you increase the number - maybe its a divider or something, I dunno. This is kinda over my head.
Which module are you trying to tweak? Native or a mod? If you have the modules is much easier as you can read the code, no need to try to divine the meaning of the magic numbers  :wink:
 
I want to add a new troop in taverns just like minstrels and travellers. Is it possible? If it is, How can i do that?
 
kalarhan 说:
Which module are you trying to tweak? Native or a mod? If you have the modules is much easier as you can read the code, no need to try to divine the meaning of the magic numbers  :wink:

Heh, sorry I forgot to mention that. I tested it on Fires of War and then on Viking Conquest; both times there was that isolated ' 11 ' (spaces included) under the process_village_raids -1 section, line 96 if you're just opening the .txt file.

In the mod sys thingy, in VC, the magic 11 is on line 21519, with the following little section:

----------

(assign, ":raid_progress_increase", 11),

---------

Hope that helps  :grin:
 
litdum 说:
I want to add a new troop in taverns just like minstrels and travellers. Is it possible? If it is, How can i do that?

simply create your new troop in module_troops ...
then go to module_game_menus , search for ("town_tavern",[

and add a new entry,something like :

            (try_begin),
                ...
              ---your conditions here---
                ...

              (set_visitor, ":cur_entry", "trp_your_new_troop"),
              (val_add, ":cur_entry", 1),
            (try_end),

or better  by using a slot like it's done with ransom brokers, travelers or book sellers ...



 
fladin 说:
litdum 说:
I want to add a new troop in taverns just like minstrels and travellers. Is it possible? If it is, How can i do that?

simply create your new troop in module_troops ...
then go to module_game_menus , search for ("town_tavern",[

and add a new entry,something like :

            (try_begin),
                ...
              ---your conditions here---
                ...

              (set_visitor, ":cur_entry", "trp_your_new_troop"),
              (val_add, ":cur_entry", 1),
            (try_end),

or better  by using a slot like it's done with ransom brokers, travelers or book sellers ...

Actually i ve tried something to do that, here the codes i ve added:
to module_troops:
插入代码块:
      ["tavern_woman_1","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_2","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_3","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_4","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_5","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_6","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_7","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_8","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_9","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
       ["tavern_woman_10","tavern_woman","tavern_woman",tf_female|tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
to module_game_menus:
插入代码块:
           (try_begin),
               (party_get_slot, ":tavern_woman", "$current_town", slot_center_tavern_woman),
               (gt, ":tavern_woman", 0),
               (set_visitor, ":cur_entry", ":tavern_woman"),
               (val_add, ":cur_entry", 1),
             (try_end),
to module_simple_triggers:
插入代码块:
     #NPC changes end
     [b](call_script, "script_tavern_woman"),[/b]
     (call_script, "script_update_ransom_brokers"),
     (call_script, "script_update_tavern_travellers"),
     (call_script, "script_update_tavern_minstrels"),
     (call_script, "script_update_booksellers")
to module scripts:
插入代码块:
      (call_script, "script_update_tavern_travellers"),
      (call_script, "script_update_tavern_minstrels"),
      (call_script, "script_update_booksellers"),
      [b](call_script, "script_tavern_woman")[/b],
and
插入代码块:
("tavern_woman",
    [(try_for_range, ":town_no", towns_begin, towns_end),
       (party_set_slot, ":town_no", slot_center_tavern_woman, 0),
     (try_end),

     (try_for_range, ":troop_no", tavern_womans_begin, tavern_womans_end),
       (store_random_in_range, ":town_no", towns_begin, towns_end),
       (party_set_slot, ":town_no", slot_center_tavern_woman, ":troop_no"),
     
     ]),
to module_constans:
插入代码块:
slot_center_tavern_woman            = 251
tavern_womans_begin = "trp_tavern_woman_1"
tavern_womans_end   = "trp_tavern_woman_10"

But after t added these codes. There have been in taverns random troops like guild master, lady tamar... instead of tavern woman that I've added.
 
one (try_end), is missing here :

(try_for_range, ":troop_no", tavern_womans_begin, tavern_womans_end),
      (store_random_in_range, ":town_no", towns_begin, towns_end),
      (party_set_slot, ":town_no", slot_center_tavern_woman, ":troop_no"),
(try_end),
 
Is there anyway I can make a script to check when a player has been killed. Say I want to make it so if a player gets a kill it increases his shoot speed etc?
 
Fraser 说:
Is there anyway I can make a script to check when a player has been killed. Say I want to make it so if a player gets a kill it increases his shoot speed etc?

check mission templates triggers
 
Why does this code not work?
插入代码块:
#Random event	  
      (3, 3, 3, 
      [
		(neg|conversation_screen_is_active),
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
	          (display_message, "@debug: trigger fired"),
	  (try_begin),
		(eq, "$townsman_burst_in", 0),	
        (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
        (gt, ":tavern_traveler", 0),
		#(store_random_in_range, ":random_chance_of_burst_in", 0, 3),
		#(eq, ":random_chance_of_burst_in", 1), #random chance disabled for now
		(assign, "$townsman_burst_in", 1),	
        (display_message, "@debug: in 9 seconds the theivery victim will appear"),
	  (else_try),	
	          (display_message, "@debug: global townsman_burst_in not 0"),
		(eq, "$townsman_burst_in", 1),
	          (display_message, "@debug: townsman_should burst_in"),
		#	  (entry_point_get_position, pos1, 0), #tried this, didn't work
		#(add_visitors_to_current_scene, pos1, "trp_townsman_whos_money_was_stolen", 1),
		(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1),
		(assign, "$townsman_burst_in", 2),	
	  (try_end),
      ]),	
	  (1, 0, 0, 
      [
		(neg|conversation_screen_is_active),
		(eq, "$townsman_burst_in", 2),	
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (eq, ":troop_no", ":tavern_traveler"), 
          (agent_get_position, pos50, ":agent_no"),
        (try_end),
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (eq, ":troop_no", "trp_townsman_whos_money_was_stolen"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (gt, ":tavern_traveler", 0),
          (agent_set_scripted_destination, ":agent_no", pos50),
          (agent_get_position, pos1, ":agent_no"),
          (get_distance_between_positions, ":dist", pos50, pos1),
          (le, ":dist", 200),       
          (start_mission_conversation, ":troop_no"),
        (try_end),
      ]),	 

It does everything correctly until it says "debug: townsman should burst in" and at that point no townsman bursts in, and nothing else happens other than the trigger repeatedly saying the variable isn't 0. This leads me to believe add_visitors_to_current_scene is an unsuitable operation, but I cannot think of a better one. It is inside of the tavern if that matters.
 
The Dark Robin 说:
Why does this code not work?

Make sure your slot 0 is actualy a spawn point for npcs (you need to check the mission template) and if that is corrected, add this:

插入代码块:
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"), 
(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1),

if that fails you should post the mission_template code so we can see the slots.

插入代码块:
  (
    "arena_melee_fight",mtf_arena_fight,-1,
    "You enter a melee fight in the arena.",
    [
      (0,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
      (1,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword, itm_arena_tunic_red]),

and so on...
 
Still no luck.

插入代码块:
	("town_default",0,-1,
	 "Default town visit",[
		(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise), #player spawn
		(0,mtef_visitor_source,af_override_horse,0,1,[]), #random event spawn
		(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(8,mtef_scene_source,af_override_horse,0,1,[]),
		(9,mtef_scene_source,af_override_horse,0,1,[]),
		(10,mtef_scene_source,af_override_horse,0,1,[]),
		(11,mtef_scene_source,af_override_horse,0,1,[]),
		(12,mtef_scene_source,af_override_horse,0,1,[]),
		(13,mtef_scene_source,0,0,1,[]),
		(14,mtef_scene_source,0,0,1,[]),
		(15,mtef_scene_source,0,0,1,[]),
		(16,mtef_visitor_source,af_override_horse,0,1,[]),
		(17,mtef_visitor_source,af_override_horse,0,1,[]),
		(18,mtef_visitor_source,af_override_horse,0,1,[]),
		(19,mtef_visitor_source,af_override_horse,0,1,[]),
		(20,mtef_visitor_source,af_override_horse,0,1,[]),
		(21,mtef_visitor_source,af_override_horse,0,1,[]),
		(22,mtef_visitor_source,af_override_horse,0,1,[]),
		(23,mtef_visitor_source,af_override_horse,0,1,[]),
		(24,mtef_visitor_source,af_override_horse,0,1,[]),
		(25,mtef_visitor_source,af_override_horse,0,1,[]),
		(26,mtef_visitor_source,af_override_horse,0,1,[]),
		(27,mtef_visitor_source,af_override_horse,0,1,[]),
		(28,mtef_visitor_source,af_override_horse,0,1,[]),
		(29,mtef_visitor_source,af_override_horse,0,1,[]),
		(30,mtef_visitor_source,af_override_horse,0,1,[]),
		(31,mtef_visitor_source,af_override_horse,0,1,[]),
		
		#tavern OSP begin
		(1,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#32
		(2,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#33
		(3,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#34
		(4,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#35
		(5,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#36
		(6,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#37
		(7,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#38
		(8,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#39
		(10,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#40
	 ],[
		dedal_tavern_animations,
      (1, 0, ti_once, [], 
      [
        (store_current_scene, ":cur_scene"),
        (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
        (try_begin),
          (eq, "$sneaked_into_town", 1),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
        (else_try),
          (eq, "$talk_context", tc_tavern_talk),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
        (else_try),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town),
        (try_end),
      ]),
	  		  	        
      (ti_before_mission_start, 0, 0, [], 
      [
        (call_script, "script_change_banners_and_chest"),
        (call_script, "script_initialize_tavern_variables"),
	  ]),

      (ti_inventory_key_pressed, 0, 0, 
      [
        (set_trigger_result,1)
      ], []),
      
      #tavern - belligerent drunk leaving/fading out
      (1, 0, 0, 
      [
        (gt, "$g_belligerent_drunk_leaving", 0),
        (entry_point_get_position, pos0, 0),
        (agent_get_position, pos1, "$g_belligerent_drunk_leaving"),
        (get_distance_between_positions, ":dist", pos0, pos1),
        (le, ":dist", 150),
      ],
      [
        (agent_fade_out, "$g_belligerent_drunk_leaving"),
        (assign, "$g_belligerent_drunk_leaving", 0),
      ]),
      
      (ti_tab_pressed, 0, 0, 
      [
        (try_begin),
          (eq, "$g_main_attacker_agent", 0),
          (set_trigger_result, 1),
        (try_end),  
      ], []),

	  #tavern brawl triggers - drunk
      (2, 0, 0, 
      [
	    (neg|conversation_screen_is_active),

		(eq, "$talk_context", tc_tavern_talk),
		
		(neg|troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),		
		(troop_slot_eq, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),		
		(eq, "$drunks_dont_pick_fights", 0),		
	  ], 
	  [	  
	    (try_begin),
	      (eq, "$g_start_belligerent_drunk_fight", 0),
	      (assign, "$g_start_belligerent_drunk_fight", 1),
	      
	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_belligerent_drunk"),
	        (assign, "$g_belligerent_drunk", ":cur_agent"),
	      (try_end),
	    (else_try),
	      (eq, "$g_start_belligerent_drunk_fight", 1),	 
	           
	      (agent_is_active, "$g_belligerent_drunk"),
	      (agent_is_alive, "$g_belligerent_drunk"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_belligerent_drunk"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),
	      
 		  (call_script, "script_activate_tavern_attackers"),
  		  (start_mission_conversation, "trp_belligerent_drunk"),
  		  (assign, "$g_start_belligerent_drunk_fight", 2),
	    (try_end),  
	  ]),
	  	  
	  #tavern brawl triggers - assassin
      (2, 0, 0, [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),		
	  ], 
	  [
	    (try_begin),
	      (eq, "$g_start_hired_assassin_fight", 0),
	      (assign, "$g_start_hired_assassin_fight", 1),
	      
	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_hired_assassin"),
	        (assign, "$g_hired_assassin", ":cur_agent"),
	      (try_end),	      
	    (else_try),  
	      (eq, "$g_start_hired_assassin_fight", 1),

	      (agent_is_active, "$g_hired_assassin"),
	      (agent_is_alive, "$g_hired_assassin"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_hired_assassin"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),

		  (call_script, "script_activate_tavern_attackers"),
		  (assign, "$g_start_hired_assassin_fight", 2),
		(try_end),  
	  ]),
	  	  
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
				
		(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
		(agent_is_wounded, "$g_main_attacker_agent"),
		(try_begin),
		(neq, "$belligerent_drunk_will_ask_to_join", 3),
		(agent_is_wounded, "$g_main_attacker_agent"),
		#(display_message, "@he was wounded."),
		(store_random_in_range, ":belligerent_drunk_want_to_join", 0, 2),
		(eq, ":belligerent_drunk_want_to_join", 1),
		#(display_message, "@random works"),
		#(ge, "$player_honor", 0),
		#(display_message, "@honor enough he will join."),
		(assign, "$belligerent_drunk_will_ask_to_join", 1),
		(try_end),
      ],
      [
        (mission_enable_talk),
      
		(try_for_agents, ":agent"),
		  (agent_is_alive, ":agent"),
		  (agent_get_position, pos4, ":agent"),
		  (agent_set_scripted_destination, ":agent", pos4),
		(try_end),
		
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$townsman_burst_in", 3),
		(store_normalized_team_count, ":count1", 1),
		(store_normalized_team_count, ":count2", 2),
		(this_or_next|lt, ":count1", 1),
		(lt, ":count2", 1),
      ],
      [
        (mission_enable_talk),
		(finish_party_battle_mode),
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),

	  
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
		(main_hero_fallen),		
      ],
      [
	  (jump_to_menu, "mnu_lost_tavern_duel"),
	  (finish_mission,0)
	  
	  ]),	  
	  
	  
	  #No shooting in the tavern
      (1, 0, 0, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
		
		(get_player_agent_no, ":player_agent"),
		(agent_is_alive, ":player_agent"),
		
		(agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
		(is_between, ":wielded_item", "itm_darts", "itm_torch"),
		(neq, ":wielded_item", "itm_javelin_melee"),
		(neq, ":wielded_item", "itm_throwing_spear_melee"),
		(neq, ":wielded_item", "itm_jarid_melee"),
		(neq, ":wielded_item", "itm_light_throwing_axes_melee"),
		(neq, ":wielded_item", "itm_throwing_axes_melee"),
		(neq, ":wielded_item", "itm_heavy_throwing_axes_melee"),
      ], 
      [
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		##diplomacy start+
		#Turn of this !@#$%ing obnoxious and totally illogical restriction provided:
		(try_begin),
			#1) there is an actual fight
			(gt, "$g_main_attacker_agent", 0),
			(agent_is_alive, "$g_main_attacker_agent"),
			(neg|agent_is_wounded, "$g_main_attacker_agent"),
			#2) the player is the lord of this town, a mercenary captain in the kingdom's employ, or ruler of this kingdom
			(store_faction_of_party , ":center_faction", "$g_encountered_party"),
			(this_or_next|eq, ":center_faction", "$players_kingdom"),
				(eq, ":center_faction", "fac_player_supporters_faction"),
		(else_try),
		#Else, original behavior:
			(start_mission_conversation, ":tavernkeeper"),
		(try_end),
		##diplomacy stop+
	  ]),
	  	  	  
	  #Check for weapon in hand of attacker, also, everyone gets out of the way
      (1, 0, 0, 
      [
		(gt, "$g_main_attacker_agent", 0),	
      ],
      [
        (agent_get_wielded_item, ":wielded_item", "$g_main_attacker_agent", 0),
        (val_max, "$g_attacker_drawn_weapon", ":wielded_item"),               
        
        (call_script, "script_neutral_behavior_in_fight"),
      ]),	  
#Random event	  
      (3, 3, 3, 
      [
		(neg|conversation_screen_is_active),
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
	          (display_message, "@debug: trigger fired"),
	  (try_begin),
		(eq, "$townsman_burst_in", 0),	
        (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
        (gt, ":tavern_traveler", 0),
		#(store_random_in_range, ":random_chance_of_burst_in", 0, 3),
		#(eq, ":random_chance_of_burst_in", 1), #random chance disabled for now
		(assign, "$townsman_burst_in", 1),	
        (display_message, "@debug: in 9 seconds the theivery victim will appear"),
	  (else_try),	
	          (display_message, "@debug: global townsman_burst_in not 0"),
		(eq, "$townsman_burst_in", 1),
	          (display_message, "@debug: townsman_should burst_in"),
		#	  (entry_point_get_position, pos1, 0), #tried this, didn't work
		#(add_visitors_to_current_scene, pos1, "trp_townsman_whos_money_was_stolen", 1),
		(store_current_scene, ":cur_scene"),
        (modify_visitors_at_site, ":cur_scene"), #suggested by kalarhan
                 #(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1, 0) 
		(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1),
		(assign, "$townsman_burst_in", 2),	
	  (try_end),
      ]),	
	  (1, 0, 0, 
      [
		(neg|conversation_screen_is_active),
		(eq, "$townsman_burst_in", 2),	
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (eq, ":troop_no", ":tavern_traveler"), 
          (agent_get_position, pos50, ":agent_no"),
        (try_end),
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (eq, ":troop_no", "trp_townsman_whos_money_was_stolen"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (gt, ":tavern_traveler", 0),
          (agent_set_scripted_destination, ":agent_no", pos50),
          (agent_get_position, pos1, ":agent_no"),
          (get_distance_between_positions, ":dist", pos50, pos1),
          (le, ":dist", 200),       
          (start_mission_conversation, ":troop_no"),
        (try_end),
      ]),	  	
    ] + bodyguard_triggers,
  ),
 
状态
不接受进一步回复。
后退
顶部 底部