Renown Calculations Question

正在查看此主题的用户

Iceciro

Recruit
I'm working on something here, and I'm having a little trouble (its not clear to me just what the system is doing!)

What precisely is this bit of code, and the "convert_to_fixed_point" bit in particular, doing to the 2500 that would be the minimum?  Even if it converts the 2500 to 25 it should result in 5 renown being the minimum per battle, but that clearly isn't the case.  It's part of # script_calculate_renown_value in Module_Scripts

插入代码块:
    
      (val_min, "$battle_renown_value", 2500),
      (convert_to_fixed_point, "$battle_renown_value"),
      (store_sqrt, "$battle_renown_value", "$battle_renown_value"),
      (convert_from_fixed_point, "$battle_renown_value"),
      (assign, reg8, "$battle_renown_value"),
      (display_message, "@Renown value for this battle is {reg8}.",0xFFFFFFFF),

I'm trying to edge the Renown calculations to be more based on the str of the enemy you fight, rather than the difference in power (thus allowing players to still earn renown at a decent rate without forcing them to lead companion armies against small groups of looters to 'farm' it.) but before I make any changes to the existing code I need to know precisely what it's doing!
 
It (val_min) is taking the smaller of two values. Therefore, the maximum renown value before square rooting (store_sqrt) is 2500, giving you a max of 50 renown per battle.
 
Ahhhh. I knew it was taking the minimum of something, but the logic got screwed up in my head. That makes much more sense now!
 
Necroposting my own topic makes me a bad person probably - but given that this is the Mod Dev forums and the question is related to the renown calculations again, I figured it might be easier to keep it consolidated in case anyone ever goes looking for similar information.

插入代码块:
      
      (call_script, "script_party_calculate_strength", "p_main_party", 0),
      (assign, ":main_party_strength", reg0),
      (call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
      (assign, ":enemy_strength", reg0),
      (call_script, "script_party_calculate_strength", "p_collective_friends", 0),
      (assign, ":friends_strength", reg0),


p_collective_friends within the calculation - does that pull the additional allies brought into the combat, or is it the allies plus the player's party?  I'm trying to break this all down again, after my week at work, haha.
 
This is were p_collective_friends is filled.
插入代码块:
  # script_collect_friendly_parties
  # Fills the party p_collective_friends with the members of parties attached to main_party and ally_party_no
  ("collect_friendly_parties",
    [
      (party_collect_attachments_to_party, "p_main_party", "p_collective_friends"),
      (try_begin),
        (gt, "$g_ally_party", 0),
        (party_collect_attachments_to_party, "$g_ally_party", "p_temp_party"),
        (assign, "$g_move_heroes", 1),
        (call_script, "script_party_add_party", "p_collective_friends", "p_temp_party"),
      (try_end),
  ]),
 
后退
顶部 底部