OSP Kit SP Duel Kit v0.5 released - duel your troops, companions, lord and kings.

Users who are viewing this thread

jik said:
I also posted the fix for that.  In my dialog, it jumps right to the duel, and will still go to the proper menu after. 
  [(modify_visitors_at_site, "scn_town_1_arena"),
    (set_visitor, 0, "trp_player"),
    (set_visitor, 1, "$g_talk_troop"),
    (set_jump_mission, "mt_arena_duel_thing_std"),
    (jump_to_scene, "scn_town_1_arena"),
(try_begin),
      (neq, "$talk_context", tc_court_talk),
      (jump_to_menu, "mnu_duel_menu"),
    (try_end),
  ]
  ],

hmm, I tried putting this concept into part of MartinF's code, but it wouldn't start the scene automatically or let me start the fight when I pressed tab.....  Can somebody explain how you modify the current Duel Kit code to automatically start the scene?  I modified the variables and stuff, but I'm not sure where exactly to put it...
 
Just to make sure, I just tried it again.  Here are the code blocks I have:
Dialog:
  [trp_npc17,"geoffrey_hostile_7", [], "Coward?!?!  I will see you there shortly, {knave/wench}...","close_window",
  [(modify_visitors_at_site, "scn_town_1_arena"),
    (set_visitor, 0, "trp_player"),
    (set_visitor, 1, "$g_talk_troop"),
    (set_jump_mission, "mt_arena_duel_thing_std"),
    (jump_to_scene, "scn_town_1_arena"),
(try_begin),
      (neq, "$talk_context", tc_court_talk),
      (jump_to_menu, "mnu_duel_menu"),
    (try_end),
  ]
  ],

game_menu (I commented out the parts I don't need, just a 1 time duel for me, but if I leave it in, I can duel him again):
("duel_menu",0,
  "{s1}",
  "none",
  [(str_clear, s2),
    (str_store_troop_name, s2, "$g_talk_troop"),
    (try_begin),
      (quest_slot_eq,"qst_mod_trouble",slot_quest_current_state,4),
      (str_store_string, s1, "@You lost your duel against ^{s2}.  He laughs at your disgrace as he walks away."),
    (else_try),
      (quest_slot_eq,"qst_mod_trouble",slot_quest_current_state,3),
      (str_store_string, s1, "@You won your duel against ^{s2}.  Shamefully he is dragged away by his friends."),
    (else_try),
      (str_store_string, s1, "@You prepare to duel ^{s2}"),
    ],
    [

#    ("start_fight",[(eq, "$g_duel_result", 0)],"Start the duel.",
#      [(try_begin),   
#        (is_between, "$g_encountered_party", towns_begin, towns_end),   
#          (party_get_slot, ":arena_scene", "$g_encountered_party", slot_town_arena), 
#      (else_try),   
#          (assign, ":closest_dist", 100000),   
#          (assign, ":closest_town", -1),   
#          (try_for_range, ":cur_town", towns_begin, towns_end),     
#              (store_distance_to_party_from_party, ":dist", ":cur_town", "p_main_party"),     
#              (lt, ":dist", ":closest_dist"),     
#              (assign, ":closest_dist", ":dist"),     
#              (assign, ":closest_town", ":cur_town"),   
#          (try_end),   
#          (party_get_slot, ":arena_scene", ":closest_town", slot_town_arena),
#      (try_end), 
#      (modify_visitors_at_site, ":arena_scene"), 
#      (reset_visitors),
#  (set_visitor, 1, "$g_talk_troop"), 
#        (try_begin),
#            (this_or_next|troop_is_mounted, "$g_talk_troop"),
#            (troop_is_guarantee_horse, "$g_talk_troop"),
#            (set_visitor, 0, "trp_player"),
#        (else_try),
#            (set_visitor, 2, "trp_player"),
#        (try_end),
#        (set_jump_mission, "mt_arena_duel_thing_std"),
#        (jump_to_scene, ":arena_scene"),
#        (change_screen_mission),
#      ]
#      ),
#    ("duel_again",[(neq, "$g_duel_result", 0)],"Duel again.",
#      [
#          (assign, "$g_duel_result", 0),
#          (jump_to_menu, "mnu_duel_menu"),
#  ]
#    ),
      ("leave",[],"Leave.",
      [(change_screen_map),
        ]
      ),
    ]
),

mission_template:
##Geoffrey 1 on 1 duel

"arena_duel_thing_std",mtf_arena_fight,-1,
"The duel begins!", 
  [   
  (56, mtef_visitor_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, []),   
  (58, mtef_visitor_source|mtef_team_2, af_override_horse, aif_start_alarmed, 1, []),
  #(56, mtef_visitor_source|mtef_team_3, af_override_horse, aif_start_alarmed, 1, []),
  ], 
  [common_inventory_not_available,
  (ti_tab_pressed, 0, 0, [(display_message, "@Geoffrey: Trying to flee, Peasant?")], []),   
  #(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),   
  #(0, 0, ti_once, [],
    #[       
      #(call_script, "script_music_set_situation_with_culture", mtf_sit_arena),     
    #]),
  (1,3, ti_once,
[(all_enemies_defeated, 1),
    (neg|main_hero_fallen, 0)
    ],
[(quest_set_slot,"qst_mod_trouble",slot_quest_current_state,3),
    (remove_troop_from_site,"trp_npc17","scn_town_mod_tavern"),
    (finish_mission),
    ]
  ),

  (2, 3, ti_once,
[(main_hero_fallen),],     
    [(quest_set_slot,"qst_mod_trouble",slot_quest_current_state,4),
    (finish_mission),
    ]
  ), 
],
),   

Like I said, this is the code I have, and it works from talking to Geoffrey in the tavern.  I will have all this in the tutorial update, but I don't think I'll make it my monday... damn text kit thing...  P!$$ing me off...
 
There are a few reasons this won't work for everyone.

First off, it sets the visitors to 0 and 1, which is fine if you just want to do a straight duel, but with all the options I have, that's not going to work. If you wanted to do that, you'd have to move the whole setup code back from the game_menu to the dialog and use variables for the visitor numbers like so:

Code:
(set_visitor, "$g_duel_vis_point_opp", "$g_talk_troop"),
(set_visitor, "$g_duel_vis_point_plyr", "trp_player"),

Secondly I think the neq thing, whatever that does, doesn't work with all npc's. When I tried this, it just dumped me back into the town menu of the town whose lord I challenged rather than showing the game menu at all.

Thirdly, it won't show the game menu before the duel, which you may or may not mind.

Anyway between this and some pointers Jinnai gave me I think I might be able to improve on the way it currently works, so I'll look at it again today and post an update if I figure it out.

[edit]
Ok, it was pretty easy to figure out once Jinnai pointed me in the right direction. It does involve changing another mission template, so it's not as 'clean' as the v0.5 code but that's life :smile:

In the last dialog of the duel dialog to this (blue is new):
[anyone|plyr, "duel_start", [], "That sound great. I'll meet you down there.", "close_window", [(assign, reg(0), "$g_talk_troop"),(jump_to_menu, "mnu_duel_menu"), (assign, "$g_duel_menu_show", 1),]],

Then in mission_templates.py, go to "visit_town_castle" and in the triggers section, add a new trigger like this (blue is new):

    (ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
      (ti_tab_pressed, 0, 0, [(set_trigger_result,1)], []),
      (0, 0, ti_once, [], [
        #(set_fog_distance, 150, 0xFF736252)
        (try_begin),
          (eq, "$talk_context", tc_court_talk),
#          (call_script, "script_music_set_situation_with_culture", mtf_sit_lords_hall),
        (else_try),
          (call_script, "script_music_set_situation_with_culture", 0), #prison
        (try_end),
        ]),

(0,0,0.5, [(eq, "$g_duel_menu_show",1)],
(jump_to_menu, "mnu_duel_menu"),
(assign, "$g_duel_menu_show", 0),
(finish_mission),
]),

    ],
  ),

This trigger just checks for the value of that global variable the whole time you're in a castle scene and then when it gets set to 1 in the dialog, it dumps you into the duel menu without interfering with the setup.

Of course if you're using different scenes where you can meet people you can duel, you'll have to add the trigger to those templates as well.

I'm not putting it into the release code yet, I'll put it in v0.6 along with some additional options but you can fix your own mod for right now.
 
Well that just confused me A LOT!
You just added so many things and you keep on adding more and more lol :smile:
so where do i add that part and which parts do i add?
 
I will be putting up a new version either later today or tomorrow, Misho, so if you're confused atm, just wait for that. I will explain exactly where to put what and why :smile:
 
Actually, despite the game-breakyness of it, it would be cool if this could be implemented as a way to solve larger battles or sieges... you duel their leader/champion under some set conditions (pre-determined equipment/no horses/whatever). You'd have to make a persuasion check or something in order to get them to agree, or the other side would have to propose the to duel.
 
i get an error
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 6, in <module>
    from module_dialogs import *
  File "C:\Documents and Settings\kristoffer\Desktop\ModuleSystem\module_dialogs
.py", line 12476
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
    ^
IndentationError: unexpected indent
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
Traceback (most recent call last):
  File "process_dialogs.py", line 6, in <module>
    from module_dialogs import *
  File "C:\Documents and Settings\kristoffer\Desktop\ModuleSystem\module_dialogs
.py", line 12476
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
    ^
IndentationError: unexpected indent
Checking global variable usages...

______________________________

Script processing has ended.
Press any key to exit. . .

then when i start the game the loading screen freeze.
 
which reminds me I really need to put the updated version online soon, hehe.

So much to do, so little time :wink:
 
It would also be neat if you could challenge them for specific pieces of equipment(like if they spawn with a unique weapon, challenge them for it), and if you lose, you lose one randomly equipped weapon, also if you decide to challenge the leader of an army to a duel as they attack you, you should also be able to get a bit of honor for it. Knights of old used to challenge each other to honorable single combat all the time. Just some thoughts on it.
 
this makes me think of that movie troy, we could pit our two best warriors against eachother to solve conflicts, the enemy would only actually accept the challenge if you had the clear advantage in numbers.
 
So, have you updated the online version yet?

By the way, to exit the menu automatically, why don't you just add a (change_screen_return) or something?
 
I know MartinF is away for a few months, so I don't think this code has been updated in a while.  I have it interested in my mod and it works well, but I haven't tried to make any improvements or changes so the duel's actually mean something in the game, etc.
 
well, actually, there is a good bit of these open source kits and other stuff.  The problem is they all get get either in the script exchange thread or are bumped off the first few pages of the forge.  I talked to the admins a while ago about allowing us to move these to the documentation board but nothing ever happened with that concept.  Maybe I'll try and make a list at least, since that script exchange has some really good stuff too.
 
I've got a compelation of quite of few of these kits/scripts/etc.  starting back with the first shield bash script.  I can post the word doc file on the repository if any one wants them...  It's 97 pages, so quite a lot to read through...
 
hmm, well that probably won't hurt, but I think a separate documentation\script forum would be the best way to go, or at least a list that is updated.  I just feel bad since there are so many awesome scripts out there, but I doubt many people (at least newer members) know about them or can easily find them when they search.  Maybe I'll try and make a list and then people can tell me what I'm missing...
 
This forum is lucky to have someone in a major project take time to do a lookup link thread like that...  You're a giver Hockie, and one of the most giving...
 
Back
Top Bottom