Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Docm30 said:
Can someone point me in the direction of where it decides how much gold you get after winning a battle?

Thanks.

Look for this in module_scripts:

Code:
#script_party_give_xp_and_gold:
  # INPUT:
  # param1: destroyed Party-id
  # calculates and gives player paty's share of gold and xp.
  
  ("party_give_xp_and_gold",
    [
      (store_script_param_1, ":enemy_party"), #Party_id
      
      (call_script, "script_calculate_main_party_shares"),
      (assign, ":num_player_party_shares", reg0),
            
      (assign, ":total_gain", 0),
      (party_get_num_companion_stacks, ":num_stacks",":enemy_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id,     ":stack_troop",":enemy_party",":i_stack"),
        (neg|troop_is_hero, ":stack_troop"),
        (party_stack_get_size, ":stack_size",":enemy_party",":i_stack"),
        (store_character_level, ":level", ":stack_troop"),
        (store_add, ":gain", ":level", 10),
        (val_mul, ":gain", ":gain"),
        (val_div, ":gain", 10),
        (store_mul, ":stack_gain", ":gain", ":stack_size"),
        (val_add, ":total_gain", ":stack_gain"),
      (try_end),
      
      (val_mul, ":total_gain", "$g_strength_contribution_of_player"),
      (val_div, ":total_gain", 100),

      (val_min, ":total_gain", 40000), #eliminate negative results
                  
      (assign, ":player_party_xp_gain", ":total_gain"),
      
      (store_random_in_range, ":r", 50, 100),
      (val_mul, ":player_party_xp_gain", ":r"),
      (val_div, ":player_party_xp_gain", 100),
      
      (party_add_xp, "p_main_party", ":player_party_xp_gain"),
      
      (store_mul, ":player_gold_gain", ":total_gain", player_loot_share),
      (val_min, ":player_gold_gain", 60000), #eliminate negative results
      (store_random_in_range, ":r", 50, 100),
      (val_mul, ":player_gold_gain", ":r"),
      (val_div, ":player_gold_gain", 100),
      (val_div, ":player_gold_gain", ":num_player_party_shares"),
      
      #add gold now
      (party_get_num_companion_stacks, ":num_stacks","p_main_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
        (try_begin),
          (troop_is_hero, ":stack_troop"),
          (call_script, "script_troop_add_gold", ":stack_troop", ":player_gold_gain"),
        (try_end),
      (try_end),
  ]),
 
Which values do I edit to allow a player to start a siege even if his relation with the faction is 0? Which values do I also edit to allow a player to loot and burn a village, even if his relation with the town is 0? Thx.
 
Pilgrim said:
Which values do I edit to allow a player to start a siege even if his relation with the faction is 0? Which values do I also edit to allow a player to loot and burn a village, even if his relation with the town is 0? Thx.
Search for "castle_start_siege" in module_game_menus.py and replace the 0 from the line (lt, ":reln", 0), with a 1 (or replace the "lt" with a "le", it's the same).
Search for "Loot and burn this village." and do that again for the same line.
 
Hello lads,
Could someone tell me is it possible to edit the skybox of the campaign map only?
So instead of clouds at map ends, you could have something like

ruse-023.jpg
ruse_223445.jpg

As you can see when you zoom out the map/reach the end, you can see that it's clearly in a room or something.
 
You'd need to model in the edge of the table as part of the map. Not sure if the campaign skybox is independent from the ones inside missions though. You can also try turning the compass mesh into a pseudo-skybox since it's always on-screen and rotates with the camera view, but that might up being really ugly.
 
For the table edge, I'd have to color it using any of the hardcoded materials, and replace its texture with wood right? Since I can't add another one.
 
What's wrong with this trigger:
Code:
	      (1, 0, 5, [(eq, "$g_belligerent_drunk_leaving", 0),],
       [
	   (store_random_in_range,":randomized",0,4),
	   (try_begin),
	   (eq,":randomized",1),
	   (assign, "$entry_point_destination",7),
	   (add_visitors_to_current_scene,8,"trp_alari_local",1),
	   (else_try),
	   (eq,":randomized",2),
	   (assign, "$entry_point_destination",8),
	   (add_visitors_to_current_scene,8,"trp_alari_local",1),
	   (try_end),
	 (try_for_agents, ":agent"),
      (agent_get_troop_id, ":troop_no", ":agent"),
	  (eq,":troop_no","trp_alari_local"),
	  (entry_point_get_position, pos1, "$entry_point_destination"),
      (agent_set_scripted_destination, ":agent", pos1),
	  (assign, "$g_belligerent_drunk_leaving", ":agent"),
     (try_end),
         ]),
		(1, 0, 0, 
      [
        (gt, "$g_belligerent_drunk_leaving", 0),
        (entry_point_get_position, pos0, "$entry_point_destination"),
        (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),
      ]),

The people spawn in one at a time, do not move, and do not fade out. Then randomly, a larger number of people spawn in and run to the other spawn point but do not fade out. :???:
 
How do i prevent the start quest merchant from appearing in the tavern? Bear in mind that i have two dialog trees, one of which makes the merchant disappear.
I'd look this up myself but it's spread across three files, and there isn't a common name for scripts involving the start quests so I can't search for it.
 
Somebody said:
It probably has to do with reusing $g_belligerent_drunk_leaving for more than one agent at a time.

That shouldn't apply though, because I have
(eq, "$g_belligerent_drunk_leaving", 0),
in the conditions block...
 
@Robin
Are the two global variables you are using being changed outside of these triggers? Also, are they set initially when the mission starts? (You don't want garbage values carrying over from another mission).
 
That global is also used in other scripts running in the context of a tavern fight. Your script also summons a bunch of them, but always assigns the id of the first trp_alari_local agent found as the value of the global regardless of whether it's active or faded or dead or running around.
 
I was contacted recently about measures against decompiling. As all my work has been pretty open source, i never looked into these things, though i do seem to recall a topic about it. If anybody could link me the topic or wishes to assist the person in need, that would be greatly appreciated.
 
Duh said:
I was contacted recently about measures against decompiling. As all my work has been pretty open source, i never looked into these things, though i do seem to recall a topic about it. If anybody could link me the topic or wishes to assist the person in need, that would be greatly appreciated.
Not too familiar with it but from the discussions I read there are obfuscation methods, and there's such a thing to enable in swysdk(which I use).
 
Status
Not open for further replies.
Back
Top Bottom