[Some Questions]

Users who are viewing this thread

Pumpkin Lord

Guys,

How to add new option to town menus like  'Population Health' or something like that?

I guess it is in game_menus.py but couldnt find it.

regards,
 
The menu for towns is called "town".

After a long conditions block, there are the menu options, each with their own conditions block, followed by the menu text, followed by the consequences block for if you click on that menu option.
 
Caba`drin said:
The menu for towns is called "town".

After a long conditions block, there are the menu options, each with their own conditions block, followed by the menu text, followed by the consequences block for if you click on that menu option.

I don't think it was an answer nor was clear.
 
Yes, it is possible, and yes it's under game_menus.py

Just search for "town", and keep going until you reach the menu (there will probably be some references to mnu_town), then after that long condition block, you can add your menu.

If I may though, you probably need more training before you can add population health. Things such as adding game menus is not hard, so before starting on more advanced stuff, you should probably try coding some more basic things :smile:
 
The "yes" answer to your thread titular question was implied by my post.

Your mention of module_game_menus suggested to me that you might just need a nudge in the right direction, so I tried to point you toward what you should be looking for/at within that file to figure out how to code a new menu option. The question was vague enough that it was unclear what else was required.

EDIT ninja'd by Cruger...but I posted anyway, for whatever it's worth...which may not be much to the OP.
 
Cruger said:
Yes, it is possible, and yes it's under game_menus.py

Just search for "town", and keep going until you reach the menu (there will probably be some references to mnu_town), then after that long condition block, you can add your menu.

If I may though, you probably need more training before you can add population health. Things such as adding game menus is not hard, so before starting on more advanced stuff, you should probably try coding some more basic things :smile:

I know, thanks butaway i found it, also Population Health was just an example and too hard to do it with just myself.


Thank you too, Caba- Drin, sorry for misunderstanding.

regards,
 
Where can i find the Wives, Lords, Kings family trees and relationships between them? Which of module file contains that code?
 
Belendor said:
Where can i find the Wives, Lords, Kings family trees and relationships between them? Which of module file contains that code?

These are set up in module_scripts, particular in the script called "initialize_aristocracy"
You can access this information via troop slots later in the game
slot_troop_spouse              = 30
slot_troop_father              = 31
slot_troop_mother              = 32
slot_troop_guardian            = 33 #Usually siblings are identified by a common parent.This is used for brothers if the father is not an active npc. At some point we might introduce geneologies
slot_troop_betrothed          = 34 #Obviously superseded once slot_troop_spouse is filled
 
Caba`drin said:
Belendor said:
Where can i find the Wives, Lords, Kings family trees and relationships between them? Which of module file contains that code?

These are set up in module_scripts, particular in the script called "initialize_aristocracy"
You can access this information via troop slots later in the game
slot_troop_spouse              = 30
slot_troop_father              = 31
slot_troop_mother              = 32
slot_troop_guardian            = 33 #Usually siblings are identified by a common parent.This is used for brothers if the father is not an active npc. At some point we might introduce geneologies
slot_troop_betrothed          = 34 #Obviously superseded once slot_troop_spouse is filled

Uhm i see, solved that too, i will ask my all questions here by now, you dont have to answer, but it is so important for me.

Is it possible to change the map icon's sizes?
 
dunde said:
Changing the scale on module_map_icons.py will do that.

Thanks, how can i change the Troops scale/height like the ones that are in ''Dwarves & Giants'' mod?
 
Belendor said:
how can i change the Troops scale/height like the ones that are in ''Dwarves & Giants'' mod?

Creating custom skeleton, apply it to custom race at module_skins.py, adding hitbox at \data\skeleton_bodies.xml and the most annoying process is rescaling all armors you want to use for the new races. I did once for MnB, making Nord troops taller than others, but I gave up for doing the same thing on WB.
 
dunde said:
Belendor said:
how can i change the Troops scale/height like the ones that are in ''Dwarves & Giants'' mod?

Creating custom skeleton, apply it to custom race at module_skins.py, adding hitbox at \data\skeleton_bodies.xml and the most annoying process is rescaling all armors you want to use for the new races. I did once for MnB, making Nord troops taller than others, but I gave up for doing the same thing on WB.

Thanks for this complex answer. :smile:

Here, can any of you give me the script of an invasion script like in Sword of Damocles? I couldnt find it anywhere, at least not for Warband. Except the part that you can set when invasion happens, i just want invasion to happen, not too complex.
 
module_party_templates:
Code:
  ("invaders","Invaders",icon_khergit|carries_goods(2)|pf_show_faction,0,fac_outlaws,bandit_personality,[(trp_swadian_knight,100,320),]),
       # I hate the evil swadians... :)
module_triggers:
Code:
(8765,0,ti_once,[],[
     (set_spawn_radius, 4),
     (try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
           (spawn_around_party, "p_town_1", "pt_invaders"),
           (val_add, ":i", 1), # i++, so no "unused local var" message
     (try_end),

This will make 250 Invader parties spawn after a year passes. Change the "ti_once" to 0 if you want it every year. :wink:
 
Lumos said:
module_party_templates:
Code:
  ("invaders","Invaders",icon_khergit|carries_goods(2)|pf_show_faction,0,fac_outlaws,bandit_personality,[(trp_swadian_knight,100,320),]),
       # I hate the evil swadians... :)
module_triggers:
Code:
(8765,0,ti_once,[],[
     (set_spawn_radius, 4),
     (try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
           (spawn_around_party, "p_town_1", "pt_invaders"),
           (val_add, ":i", 1), # i++, so no "unused local var" message
     (try_end),

This will make 250 Invader parties spawn after a year passes. Change the "ti_once" to 0 if you want it every year. :wink:

Thanks but sorry i am new to codding, where should i copy this code? To end to middle etc..?

regards,
 
You can add the codes just before the last ] for both py files.
Btw, you can change ":i" to ":unused" or reg1 and you can safely delete
  (val_add, ":i", 1), # i++, so no "unused local var" message

Btw 250 parties, each consists 100-300 swadian knights? It will be the end of Calradia. :smile:
 
dunde said:
You can add the codes just before the last ] for both py files.
Btw, you can change ":i" to ":unused" or reg1 and you can safely delete
  (val_add, ":i", 1), # i++, so no "unused local var" message

Btw 250 parties, each consists 100-300 swadian knights? It will be the end of Calradia. :smile:

Haha dont worry i will decrease the number and edit it with something else, thanks for your valuable answers.

Next, as i saw so far noone has made a Hair Pack like new hair styles, how can i make new one?

Second, i want to make a sword artifact but not for to be used at Battlefields, it will be used for adding stats like Books, how? ( I want that sword give +1 Power Strike)
 
Make it a book with a sword mesh (for starters) - you know, in the items file.
["book_weapon_mastery", "On the Art of Fighting with Swords", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none],
["book_engineering","Method of Mechanical Theorems", [("book_open",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],

# Belendor's Power Sword here
["power_sword","Belendor's Power Sword", [("bastard_sword_a",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],
Basically this is a bad attempt at making what you said. Changing the bolded part changes the mesh, and changing the blue part changes the type of item. Maybe "book" isn't good. You can make it whatever you want, but since you don't want to use the sword...

And then in module_scripts find "game_get_item_extra_text" and in it:
Code:
      (else_try),
        (is_between, ":item_no", reference_books_begin, reference_books_end),
        (try_begin),
          (eq, ":extra_text_id", 0),
          (try_begin),
            (eq, ":item_no", "itm_book_wound_treatment_reference"),
            (str_store_string, s1, "@wound treament"),
          (else_try),
            (eq, ":item_no", "itm_book_training_reference"),
            (str_store_string, s1, "@trainer"),
          (else_try),
            (eq, ":item_no", "itm_book_surgery_reference"),
            (str_store_string, s1, "@surgery"),
#-################# Belendor's Power Sword - here but only if it's a book type
          (else_try),
            (eq, ":item_no", "itm_power_sword"),
            (str_store_string, s1, "@power strike"),
#-################# Power sword end
          (try_end),
          (set_result_string, "@+1 to {s1} while in inventory"),
          (set_trigger_result, 0xFFEEDD),
        (try_end),
This will make your sword show the "+1 to power strike while in inventory" writing.

And finally, search for "game_get_skill_modifier_for_troop", and in it modify this:
Code:
    (else_try),
      (eq, ":skill_no", "skl_trainer"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_surgery"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
#-################# Belendor's Power Sword
    (else_try),
      (eq, ":skill_no", "skl_power_strike"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_power_sword"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1), # this dictates how much your item will boost.
#-################# Power sword end
    (try_end),
 
Lumos said:
Make it a book with a sword mesh (for starters) - you know, in the items file.
["book_weapon_mastery", "On the Art of Fighting with Swords", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none],
["book_engineering","Method of Mechanical Theorems", [("book_open",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],

# Belendor's Power Sword here
["power_sword","Belendor's Power Sword", [("bastard_sword_a",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],
Basically this is a bad attempt at making what you said. Changing the bolded part changes the mesh, and changing the blue part changes the type of item. Maybe "book" isn't good. You can make it whatever you want, but since you don't want to use the sword...

And then in module_scripts find "game_get_item_extra_text" and in it:
Code:
      (else_try),
        (is_between, ":item_no", reference_books_begin, reference_books_end),
        (try_begin),
          (eq, ":extra_text_id", 0),
          (try_begin),
            (eq, ":item_no", "itm_book_wound_treatment_reference"),
            (str_store_string, s1, "@wound treament"),
          (else_try),
            (eq, ":item_no", "itm_book_training_reference"),
            (str_store_string, s1, "@trainer"),
          (else_try),
            (eq, ":item_no", "itm_book_surgery_reference"),
            (str_store_string, s1, "@surgery"),
#-################# Belendor's Power Sword - here but only if it's a book type
          (else_try),
            (eq, ":item_no", "itm_power_sword"),
            (str_store_string, s1, "@power strike"),
#-################# Power sword end
          (try_end),
          (set_result_string, "@+1 to {s1} while in inventory"),
          (set_trigger_result, 0xFFEEDD),
        (try_end),
This will make your sword show the "+1 to power strike while in inventory" writing.

And finally, search for "game_get_skill_modifier_for_troop", and in it modify this:
Code:
    (else_try),
      (eq, ":skill_no", "skl_trainer"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_surgery"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
#-################# Belendor's Power Sword
    (else_try),
      (eq, ":skill_no", "skl_power_strike"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_power_sword"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1), # this dictates how much your item will boost.
#-################# Power sword end
    (try_end),

Okay, thank you both, how about Hair Styles?
 
Back
Top Bottom