Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Character -> Statistics -> Export Character.
Then in the mod Character -> Statistics -> Import Character

you keep the stats and the money.
 
What's the conditions block for making sure someone is in a town. (Like a lord).

I think there's also a problem in the conditions block here:

Code:
  [anyone,"lord_hire_troops",[(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
                             (store_mul, ":vassal_potential", "$g_talk_troop_relation", 5),
                             (val_add, ":vassal_potential", ":renown"),
                             (ge, ":vassal_potential", 100),
							 (party_get_slot, ":noble_troop", "$g_encountered_party", slot_center_noble_troop_type),
							 (party_get_slot, ":noble_amount", "$g_encountered_party", slot_center_noble_troop_amount),
							 (gt, ":noble_amount", 0),
							 (assign,":noble_troop",reg3),
							 (call_script, "script_game_get_join_cost", ":noble_troop"),
							 (assign, ":join_cost", reg0),
							 (store_mul, reg5, ":noble_amount", reg0),
							 (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
							 (val_min, ":noble_amount", ":free_capacity"),
							 (store_troop_gold, ":cur_gold", "trp_player"),
							 (try_begin),
							   (gt, ":join_cost", 0),
							   (val_div, ":cur_gold", ":join_cost"),
							   (val_min, ":noble_amount", ":cur_gold"),
							 (try_end),
							 (assign, "$temp", ":noble_amount"),],
  "I will be glad to help you. I have several {reg3? who will join you for {reg5} denars.","lord_hire_troops_2",[]],

I'm not sure but I defined slot_center_noble_troop_type and amount in module_costants. And updated scripts and simple triggers. Unsure what they actually do but tried to copy the mercenary hire model as much as I could.
 
Hi, I don't know the reason but I have an error like this;
fffffm0.jpg

Happens when I try to add sceneprops. But it is fraking annoying. I can't add at least three same props. I've recovered my system. But still the same error. Is anyone know what I have to do. Thanks...
 
Is there a way/how do you make heroes (such as marnid and borcha) killable?  I want to make a bunch more heroes but have the current ones able to die like anyone else, rather than be invincible.
 
Garnier said:
Is there a way/how do you make heroes (such as marnid and borcha) killable?  I want to make a bunch more heroes but have the current ones able to die like anyone else, rather than be invincible.

in module_troops.py remove the tag 'tf_hero' and it kicks them down to being regular troops; but if you do this, you'll have to tweak some conversation scipts that limit a conversation to heros (change the hero requirement to a range operation).

or you could add the tag 'tf_allways_fall_dead' but if injured so much as a fraction, they die...

or you could put in one of the death scripts floating around and edit it to include heros.

three choices. bonus. maw
 
Hey guys, is there an operation to change inter-faction relations mid game?

The idea being that by completeing a quest you make on faction like another faction more.

Also is there a way to force factions to be permanately at peace or at war with each other both via the module system and via an operation?

Cheers in advance!
 
demize2010 said:
Hey guys, is there an operation to change inter-faction relations mid game?

The idea being that by completeing a quest you make on faction like another faction more.

Also is there a way to force factions to be permanately at peace or at war with each other both via the module system and via an operation?

Cheers in advance!

Hey,

Yes you can change faction relations easily using a couple of scripts.
And to lock two factions at war/peace you can negate some things in the script that makes them go to war or peace and simply declare at game start that you want them to be at war or peace.

To set a relation between two kingdoms use the set_relation operation. Example:
Code:
(set_relation, ":kingdom_a", ":kingdom_b", "10")

To make two kingdoms go to war with eachother use call the script script_diplomacy_start_war_between_kingdoms. Example:

Code:
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2"),

To make two kingdoms be permanently at war with eachother, add something like this to the "randomly_start_war_peace" script.

Code:
           (assign, ":jumpout", 0),
           (try_begin),
               (this_or_next|eq, "fac_your_first_kd", ":cur_kingdom"),
               (eq, "fac_your_second_kingdom", ":cur_kingdom"),
               (this_or_next|eq, "fac_your_first_kingdom", ":cur_kingdom_2"),
               (eq, "fac_your_second_kingdom", ":cur_kingdom_2"),
               (assign, ":jumpout", 1),
           (try_end),
           (eq, ":jumpout", 0),

Add it just before this line:
Code:
           (call_script, "script_diplomacy_start_peace_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2"),


That will make it stop them from randomly going to peace with eachother.

An easier solution, tho abit of a hax job imho is to make the two go to war every time two kingdoms go to peace.(the system will still give a message telling you they are at peace unless you negate that tho).

Did this anwser your problem or do you have further questions?

Zait
 
Cheers Zaitenko  :grin:

I've decided to take a different approach to the mod for the time being... but I'll hang onto your code :grin: will be really useful once I switchback to sandbox mode :grin:

I did have another question...

Basicly I'm trying to setup a scripted battle. I'm trying to use the custom battle as a template (as it requires no party encounter) but no matter what I do, I can't get the players party into the fight!


Edit: Found out how to use the mission template file properly... *noob*
 
So, I have a little problem:

Code:
  (
    "stormhaven_upper_levels",0,-1,
    "stormhaven temp",
    [(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
     (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,[])
     ],
    [ (ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
      (ti_tab_pressed, 0, 0, [(eq, "$may_use_leave",1),(set_trigger_result,1)], []),

      (1, 0, ti_once, [], [
          (store_current_scene, "$current_area"),
          (scene_set_slot, "$current_area", slot_level, "$c"),
        ]),

      (ti_before_mission_start, 0, ti_once, [], [(assign, "$may_use_leave", 0)]),

      (.1, 0, 0, [],
        [(get_player_agent_no, "$agent_no_player"),
            (agent_get_position, pos5, "$agent_no_player"),
            (entry_point_get_position, pos51, 51),
            (get_distance_between_positions, "$distance_jump_to_menu_go_up", pos5, pos51),
            (entry_point_get_position, pos52, 52),
            (get_distance_between_positions, "$distance_jump_to_menu_go_down", pos5, pos52),

       (.1, 3, -1, [(lt, "$distance_jump_to_menu_go_up", 400)],

        [(assign, "$may_use_leave",1)]),

        (.1, 3, -1, [(lt, "$distance_jump_to_menu_go_down", 400)],[(assign, "$go",1),(assign, "$may_use_leave",1)]),

        ]),
      ],
  ),

Here is one of the mission templates that seem to cause an error:



What utter nonsense...

I have no idea where the script screws up...
 
Aenarion said:
    "stormhaven_upper_levels",0,-1,
    "stormhaven temp",
    [(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
     (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,[])
     ],
    [ (ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
      (ti_tab_pressed, 0, 0, [(eq, "$may_use_leave",1),(set_trigger_result,1)], []),

      (1, 0, ti_once, [], [
          (store_current_scene, "$current_area"),
          (scene_set_slot, "$current_area", slot_level, "$c"),
        ]),

      (ti_before_mission_start, 0, ti_once, [], [(assign, "$may_use_leave", 0)]),

      (.1, 0, 0, [],
        [(get_player_agent_no, "$agent_no_player"),
            (agent_get_position, pos5, "$agent_no_player"),
            (entry_point_get_position, pos51, 51),
            (get_distance_between_positions, "$distance_jump_to_menu_go_up", pos5, pos51),
            (entry_point_get_position, pos52, 52),
            (get_distance_between_positions, "$distance_jump_to_menu_go_down", pos5, pos52),

       (.1, 3, -1, [(lt, "$distance_jump_to_menu_go_up", 400)],

        [(assign, "$may_use_leave",1)]),

        (.1, 3, -1, [(lt, "$distance_jump_to_menu_go_down", 400)],[(assign, "$go",1),(assign, "$may_use_leave",1)]),

        ]),
      ],
  ),

The compiler's telling you anything but nonsense. In fact, it's telling you exactly what the problem is -- it requires an integer where you've decided to put a full stop right after the opening bracket. It's not a human, it can't just fill in the blanks when you give it bad input. Now try it again with 0.1 instead and see how it compiles.

Mechanically,
Winter
 
Why doesn't this work like I want it to?  Instead of going to the exchange members screen, it goes to battle.
Code:
[anyone,"start", [(eq,"$talk_context",tc_party_encounter),
                    (eq, "$character_race", 1),
                    (eq,"$g_encountered_party_template","pt_roaming_undead"),
                    ],
   "...", "roaming_undead_party_encounter_force_join",[]],
  [anyone|plyr, "roaming_undead_party_encounter_force_join", [], "Follow me!", "close_window",[(change_screen_exchange_members,0),]],

 
Winter said:
Aenarion said:
Some code...

The compiler's telling you anything but nonsense. In fact, it's telling you exactly what the problem is -- it requires an integer where you've decided to put a full stop right after the opening bracket. It's not a human, it can't just fill in the blanks when you give it bad input. Now try it again with 0.1 instead and see how it compiles.

Mechanically,
Winter

Nope, using a .1 instead of 0.1 never made an impact on how things worked out in my previous experiments, neither do they now. Thanks for trying, however.
 
Winter's on the right track, I think he slipped with the fix. 0.1 is not an integer. Go with either 0 or 1.
 
So I'm really confused...

I want to jump from a dialog consequence into a menu but I'm getting no where fast!

here is my code, trying to jump on the 2ND line...

Code:
[trp_papa_bandits,"start", [], "Are you ready to go?", "leave_for_village",[]],
[trp_papa_bandits|plyr,"leave_for_village", [], "Yes", "close_window",[(jump_to_menu,"mnu_doomed_village_tavern")]],
[trp_papa_bandits|plyr,"leave_for_village", [], "No", "close_window",[]],

*EDIT* this code results in the dialog just closing with no other result.
 
fisheye said:
Winter's on the right track, I think he slipped with the fix. 0.1 is not an integer. Go with either 0 or 1.

No slips on my part, the single decimal point with full stop is used in Native all over.


Aenarion said:
Nope, using a .1 instead of 0.1 never made an impact on how things worked out in my previous experiments, neither do they now. Thanks for trying, however.

Then obviously it's not the only error you've got in your code. Probably 'cause you've used negatives in your triggers for some reason I don't comprehend.

Clearly,
Winter
 
I have no idea what the minus mark before a number is supposed to do. It has not made any impact (yet, anyhow) to the trigger.

What I am trying to make is:

When near certain points, the player can leave an area. If the player is near a point designed to let him/her continue to the next level, then a new option is added to the regular menu that pops up whenever entering a town.

However, the module system must really hate me for not working properly with such a simple change...
 
so ok I am trying to edit those dammed AI tatics because they suck so much, I am nearly finishing.
I want to know the variable for the player amount of archers and cavalry, I want to make the AI hold a line if he either has many ranged troops or the player has very few enemy troops.
so what is the variable/constant for the player troops? for the ai is:
:ai_perc_cavalry
:ai_perc_archers
EDIT: I found scroling a little down:
  ("team_get_class_percentages",
    [
      (assign, ":num_infantry", 0),
      (assign, ":num_archers", 0),
      (assign, ":num_cavalry", 0),
      (assign, ":num_total", 0),
      (store_script_param_1, ":team_no"),
      (try_for_agents,":cur_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_is_human, ":cur_agent"),
        (agent_get_team, ":agent_team", ":cur_agent"),
        (eq, ":agent_team", ":team_no"),
       
        (val_add, ":num_total", 1),
        (agent_get_class, ":agent_class", ":cur_agent"),
        (try_begin),
          (eq, ":agent_class", grc_infantry),
          (val_add,  ":num_infantry", 1),
        (else_try),
          (eq, ":agent_class", grc_archers),
          (val_add,  ":num_archers", 1),
        (else_try),
          (eq, ":agent_class", grc_cavalry),
          (val_add,  ":num_cavalry", 1),
        (try_end),
      (try_end),
      (try_begin),
        (eq,  ":num_total", 0),
        (assign,  ":num_total", 1),
      (try_end),
      (store_mul, ":perc_infantry",":num_infantry",100),
      (val_div, ":perc_infantry",":num_total"),
      (store_mul, ":perc_archers",":num_archers",100),
      (val_div, ":perc_archers",":num_total"),
      (store_mul, ":perc_cavalry",":num_cavalry",100),
      (val_div, ":perc_cavalry",":num_total"),
      (assign, reg0, ":perc_infantry"),
      (assign, reg1, ":perc_archers"),
      (assign, reg2, ":perc_cavalry"),
Thanks everybody for don't helping since I found the answer 5 minutes later  :mrgreen:
 
A pretty basic question.. but how do I add the name of my mod to the menu screen?

For Example:

Mount and Blade: Peasants v 1.0

or

Mount and Blade
                The Legions Mod

 
Status
Not open for further replies.
Back
Top Bottom