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

Users who are viewing this thread

Hello,

I added a few tweaks to my version of your duel kit.  Thanks for writing it.

First if you win, you gain renown and relationship with person, unless they are lord then you lose relation with them (they hate losing)

Here's the code:

  #goes after:
  #add 1 to the slot for amount of duels the player won against this troop if it is a tf_hero

  # add renown.  If lord lose relationship, else gain it.
  (call_script,"script_change_troop_renown", "trp_player", 1),
  (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  (try_begin), # lords actually hate it if you beat them.
      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  (try_end),

Second addition is a report you can add to the reports menu:

# ####################################################################################################
# GSC, Oct 3, 2009
# MartinF's dueling lords code.
# Report of wins and losses.
####################################################################################################
  ("dueling_report",0,
  "{s1}",
  "none",
  [(str_clear, s2),(assign, reg3, 0),(assign, reg4, 0),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
          (call_script, "script_troop_get_player_dueling_wins", ":troop_no"),
          (assign, ":wins", reg0),
          (call_script, "script_troop_get_player_dueling_losses", ":troop_no"),
          (assign, ":losses", reg0),
      (str_store_troop_name, s3, ":troop_no"),
  (assign, reg1, ":wins"),
  (store_add, reg3, ":wins"),
  (assign, reg2, ":losses"),
  (store_add, reg4, ":losses"),
  (str_store_string, s2, "@{s2}^{s3}: Wins {reg1} Losses {reg2}"),
(try_end),
(str_store_string, s2, "@{s2}^ \n\n Totals: Wins {reg3} Losses {reg4}"),
(str_store_string, s1, "@Your dueling results with the Kingdom Lords are:^{s2}"),
        ],
    [
      ("continue",[],"Continue...",
      [(jump_to_menu, "mnu_reports"),
        ]
      ),
    ]
  ),
# end dueling lords code
# ####################################################################################################
 
were should i implement this and how?
############################### Duel Mod Start  ##############################


("duel_menu",0,
  "{s1}{s2}",
  "none",
  [
(str_clear, s2),  (str_clear, s3), (str_clear, s5), (str_clear, s6), (str_clear, s7),
  (troop_get_slot, ":duel_wins", "$g_talk_troop", slot_troop_duel_won),
  (assign, reg(6), ":duel_wins"),
  (troop_get_slot, ":duel_losses", "$g_talk_troop", slot_troop_duel_lost),
  (assign, reg(7), ":duel_losses"),
  (store_add, ":duel_total", ":duel_wins", ":duel_losses"),
  (assign, reg(5), ":duel_total"),
  (str_store_troop_name, s3, "$g_talk_troop"),
(try_begin),
(eq, "$g_duel_result", -1),
(str_store_string, s1, "@You lost your duel against ^^{s3}"),
(else_try),
(eq, "$g_duel_result", 1),
(str_store_string, s1, "@You won your duel against ^^{s3}"),
(else_try),
(str_store_string, s1, "@You prepare to duel ^^{s3}"),
(try_end),
    (try_begin),
(troop_is_hero, "$g_talk_troop"),
(str_store_string, s2, "@^^^^You have fought {s3} {reg5} times. ^^You've won {reg6} times. ^^You've lost {reg7} times"),
(else_try),
(str_store_string, s2, "@^^^^Dueling with your own troops will not count towards your dueling statistics."),
(try_end),

    ],
 
  [
      ("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, "$g_duel_vis_point_opp", "$g_talk_troop"),
    (set_visitor, "$g_duel_vis_point_plyr", "trp_player"),

        (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),
        ]
      ),
      ]
),


############################### Duel Mod End  ##############################
 
Check the first post of the thread. It tells where to put everything.

That portion goes in the game_menus.py file. You do a search for a certain line and put it after that.

mfbreg
 
i agree with tansvanio...i can't implement well that portion too...

the build_module log tell me this error:

Code:
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
Error: Unable to find object:mt_arena_duel_thing_std
ERROR: Illegal Identifier:mt_arena_duel_thing_std
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: array_party_num
WARNING: Global variable never used: talk_array_no

______________________________

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

don't look at those two warnings in the end...
 
mfberg said:
Check the first post of the thread. It tells where to put everything.

That portion goes in the game_menus.py file. You do a search for a certain line and put it after that.

mfbreg
It tells me to search for "Simple_encounter"
there are 4 Simple encounters!

cant u plz send me the script and its area surroundind in your file, so i can just copy and put there?
 
tansvanio said:
mfberg said:
Check the first post of the thread. It tells where to put everything.

That portion goes in the game_menus.py file. You do a search for a certain line and put it after that.

mfbreg
It tells me to search for "Simple_encounter"
there are 4 Simple encounters!

cant u plz send me the script and its area surroundind in your file, so i can just copy and put there?

uhm...i've put those strings above the first one and it gives me that error...maybe is above the others... :???:
 
I've managed to solve mine and tansvanio's problem...


the problem is that the module_game_menus code have to be added ABOVE the part that MartinF told...

and the mission_template can be put at the end of the file... :smile:
 
can anyone help me? i did what MartinF instruct me to do, but its still doesn't work,

does it even work in v1.1132?


Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_global_variables.py", line 6, in <module>
    from module_dialogs import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
dialogs.py", line 1561, in <module>
    (is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
NameError: name 'kingdom_heroes_begin' is not defined
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 4, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 6, in <module>
    from module_dialogs import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
dialogs.py", line 1561, in <module>
    (is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
NameError: name 'kingdom_heroes_begin' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\process
_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Users\vinus\Desktop\New folder (2)\system\Module_system 1.132\module_
game_menus.py", line 3722, in <module>
    [anyone|plyr,"member_question_2", [], "I would like to challenge you to a fr
iendly duel.", "duel_accept",[]],
NameError: name 'anyone' is not defined
Exporting postfx_params...

______________________________

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

thats the error i got :cry: :sad:
 
hello, first of all I want to thanks MartinF and the other users that worked on this kit  :grin:

I've implemented the code in the first post, and it works well

but I would like to know if there is an up-to-date version of this kit


thanks
 
Back
Top Bottom