Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > King's Bounty > King's Bounty: Crossworlds > Mods

Mods King's Bounty: Crossworlds Mods

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2012, 11:05 AM
Fatt_Shade Fatt_Shade is offline
Approved Member
 
Join Date: Nov 2010
Location: Serbia
Posts: 837
Default

@F-kid Do you have same versions of game on both laptop and desktop pc ? If Asmo get exp on desktop in you`re RSE game, he should lvlup on laptop also because in RSE Asmo weren`t changed at all. You had to change something in his files by mistake maybe.
Try new game on laptop just for 4-5 fights to see will he get any exp, also attack low lvl troops with him (he get more exp if you kill 1-2 lvl enemy units, and more so if they are under pugmy/doom/plague spells). If he still dont get any exp my only idea is to latest patch and hope for best. Good luck
Reply With Quote
  #2  
Old 03-27-2012, 10:34 AM
Fatt_Shade Fatt_Shade is offline
Approved Member
 
Join Date: Nov 2010
Location: Serbia
Posts: 837
Default Prob with leveledup arhmage

I noticed this problem before, but now in Red sands mod it`s even more
If you use archmage and get him to higher lvl, and some bonus dmg on stats in battle during battle trance he will get 100% dmg but only from his basic 5-8, not including bonus from lvlup. If you get some archmage_staff (or 2, i tried using 3 with warrior just to check) my archmage had 3x20% bonus dmg from staff and +18% from lvl`s so in battle dmg was 9-14. When i use battle trance he should get +100% dmg from but instead 18-28, i got 14-22, so +(5-8 ) got only his basic dmg without any item/lvlup bonuses.
On other side if you use ogre and get his attack from 47 basic, to 100 with lvlup/frenzy/items and use ogre rage, he`ll get 100% bonus attack from his current, not basic attack.
My question for you ppl is, how to make archmage get same bonus as ogre, based on his actual dmg in game, not basic from archmage.txt Same prob happens if you use some +dmg item (poison dagger/whip of ishara) archmage will get dmg from those items, but in battle trance will get bonus from his basic dmg 5-8
Try checking in scripts special_attacks.lua file and compare Battle mage, and Ogre rage part of file, to figure out how to give same bonus to archmage as ogre have.
Reply With Quote
  #3  
Old 03-31-2012, 02:24 PM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Exclamation Easy Fix

@Fatt_Shade:

As it turns out, it is implemented as Percent of Base in both TL and AP so the developers intended for it to work this way, I guess.

Nonetheless, the change is easy:
  1. Search for special_battle_mage_attack in SPECIAL_ATTACKS.LUA.
  2. Look for the lines that start with Attack.act_apply_dmg... there will be too of them within this function, one for min and one for max. Note that the line goes like this: Attack.act_apply_dmgmin_spell( "magic", 0, power, 0, duration, false ), for min damage.
  3. Change both min and max like this: Attack.act_apply_dmgmin_spell( "magic", 0, 0, power, duration, false ), note how power has essentially swapped with the 0 to the right of it in the original code. Do the same thing to max and save and close and you'll get want you want.

By the way, for most functions that work on a statistic, the order is absolute percent increase, percent of base, and then percent of current. See http://translate.googleusercontent.c...LwAowdEODmh0mw as a reference for the King's Bounty LUA Attack library.

Good luck!

/C\/C\

Quote:
Originally Posted by Fatt_Shade View Post
I noticed this problem before, but now in Red sands mod it`s even more
If you use archmage and get him to higher lvl, and some bonus dmg on stats in battle during battle trance he will get 100% dmg but only from his basic 5-8, not including bonus from lvlup. If you get some archmage_staff (or 2, i tried using 3 with warrior just to check) my archmage had 3x20% bonus dmg from staff and +18% from lvl`s so in battle dmg was 9-14. When i use battle trance he should get +100% dmg from but instead 18-28, i got 14-22, so +(5-8 ) got only his basic dmg without any item/lvlup bonuses.
On other side if you use ogre and get his attack from 47 basic, to 100 with lvlup/frenzy/items and use ogre rage, he`ll get 100% bonus attack from his current, not basic attack.
My question for you ppl is, how to make archmage get same bonus as ogre, based on his actual dmg in game, not basic from archmage.txt Same prob happens if you use some +dmg item (poison dagger/whip of ishara) archmage will get dmg from those items, but in battle trance will get bonus from his basic dmg 5-8
Try checking in scripts special_attacks.lua file and compare Battle mage, and Ogre rage part of file, to figure out how to give same bonus to archmage as ogre have.
Reply With Quote
  #4  
Old 04-02-2012, 07:57 PM
Fatt_Shade Fatt_Shade is offline
Approved Member
 
Join Date: Nov 2010
Location: Serbia
Posts: 837
Default Not so easy fix

Not working
Code:
 Attack.act_apply_dmgmin_spell( "magic",  0, 0, power, duration, false)
        Attack.act_apply_dmgmax_spell( "magic", 0, 0, power, duration, false)
        Attack.act_apply_par_spell( "defense", 0, 0, -penalty, duration, false)
I try it already when checked ogre`s rage skill. Maybe because mage`s dmg is melee physical, and magic on range , or ... i have on idea. Same problem is with -50% for his defense during battle trance, no matter how much defense unit have 24 basic and stone skin, and magic spring and all bonuses form items, when in trance he`ll lose only 12 (half of his basic) which is wrong i think. If right bonus is 100% on current dmg and crit% , then -50% of current defense should be OK.
Reply With Quote
  #5  
Old 04-03-2012, 04:19 AM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Thumbs down Bummer :-(

Quote:
Originally Posted by Fatt_Shade View Post
Not working
Code:
 Attack.act_apply_dmgmin_spell( "magic",  0, 0, power, duration, false)
        Attack.act_apply_dmgmax_spell( "magic", 0, 0, power, duration, false)
        Attack.act_apply_par_spell( "defense", 0, 0, -penalty, duration, false)
I try it already when checked ogre`s rage skill. Maybe because mage`s dmg is melee physical, and magic on range , or ... i have on idea. Same problem is with -50% for his defense during battle trance, no matter how much defense unit have 24 basic and stone skin, and magic spring and all bonuses form items, when in trance he`ll lose only 12 (half of his basic) which is wrong i think. If right bonus is 100% on current dmg and crit% , then -50% of current defense should be OK.
Sounds like a bug, you know, I was never really sure why they didn't just use dmg:

So change dmgmin and dmgmax to just one line:

Code:
Attack.act_apply_dmg_spell( "magic",  0, 0, power, duration, false)
See what that does. If that doesn't work, there's another way to do it - look at what I did in my TL HOMM3 Babies mod in ARENA.LUA lines 549 - 574:

Code:
  for i = 1, table.getn( resistances ) do
    local min_damage_current, min_damage_base = Attack.act_get_dmg_min( target, resistances[ i ] )
    if min_damage_base > 0 then
      local max_damage_current, max_damage_base = Attack.act_get_dmg_max( target, resistances[ i ] )
      local min_damage_inc = math.max( math.floor( math.abs( min_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k
      local max_damage_inc = math.max( math.floor( math.abs( max_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k
      local new_min_damage = min_damage_current + min_damage_inc
      local new_max_damage = max_damage_current + max_damage_inc
  
      if new_min_damage < 1 then
        new_min_damage = min_damage_current
      end

      if new_max_damage < 1 then
        new_max_damage = max_damage_current
      end

      if new_min_damage ~= min_damage_current then
        Attack.act_apply_dmgmin_spell( resistances[ i ], min_damage_inc, 0, 0, -100, false )
      end
  
      if new_max_damage ~= max_damage_current then
        Attack.act_apply_dmgmax_spell( resistances[ i ], max_damage_inc, 0, 0, -100, false )
      end
    end
  end
Let me explain this code:

Code:
  for i = 1, table.getn( resistances ) do
.
.
.
  end
The for loop just loops through all the damage types (i.e. fire, magic, etc.)

Code:
.
.
.
    local min_damage_current, min_damage_base = Attack.act_get_dmg_min( target, resistances[ i ] )
    if min_damage_base > 0 then
.
.
.
    end
Next I get the current and base damages for that damage type and if the base damage is greater than 0 then I do something if not then there is nothing to do.

Code:
.
.
.
      local max_damage_current, max_damage_base = Attack.act_get_dmg_max( target, resistances[ i ] )
      local min_damage_inc = math.max( math.floor( math.abs( min_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k
      local max_damage_inc = math.max( math.floor( math.abs( max_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k
      local new_min_damage = min_damage_current + min_damage_inc
      local new_max_damage = max_damage_current + max_damage_inc
.
.
.
If min_damage_base is > 0 then I go and do some more stuff: 1) I get the max damage current and base to go along with the mins I got earlier and 2) I compute the min and max damage increase based off the difficulty level and pick the max between the min stat increase and the computed increase. The sign_diff_k is used for decreasing stats if you play Easy level. I then compute the new min and max damage.

Code:
.
.
.
      if new_min_damage < 1 then
        new_min_damage = min_damage_current
      end

      if new_max_damage < 1 then
        new_max_damage = max_damage_current
      end
.
.
.
These next two checks are just making sure if the damage is reduced that it doesn't go below 1. I guess I should set those damages to 1 instead of current so that they are at least reduced instead of staying the same.

Code:
.
.
.
      if new_min_damage ~= min_damage_current then
        Attack.act_apply_dmgmin_spell( resistances[ i ], min_damage_inc, 0, 0, -100, false )
      end
  
      if new_max_damage ~= max_damage_current then
        Attack.act_apply_dmgmax_spell( resistances[ i ], max_damage_inc, 0, 0, -100, false )
      end
.
.
.
Lastly, If there is an actual change in the damage, then I go do something, note how I just change the absolute value of the damage. I checked the Ogre's Rage ability and that's how they did their attack. You know, I'm trying to think if I had problems like you're having and then implemented it this way instead. There certainly is a lot of trial and error when making changes like this. You probably don't need to be so thorough for the Archmage, just look in his ATOM and confirm his damage types and work with them directly, no need to cycle through like I did (but this was for all units so that's why I did it the way I did it).

Good luck!

/C\/C\

Last edited by MattCaspermeyer; 04-03-2012 at 05:48 AM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.