PDA

View Full Version : Bugfixes


Pages : [1] 2

Bhruic
10-30-2012, 06:43 PM
Downloads offline while investigating latest patch

This thread is dedicated to those bugs that can be fixed by modifying Lua files. For those who know what they are doing, the bug fixes will be listed, but there'll also be a corresponding file to download to enjoy the fixes for the less technically inclined. To save space, changes are included in the same code box, the original first, the modified version second.

For those who are just downloading the file, I'm listing the time of file update at the end of this post, so you can check if it's changed since you last downloaded it.

Diplomacy fix - Diplomacy would only work if the enemy you were attacking had less units than your max leadership, and then could grant you more units than you should be able to take
In skills.lua, line 383:
local can_join = math.floor(hero_lead/Logic.cp_leadship(atom)) -count

local can_join = math.floor(hero_lead/Logic.cp_leadship(atom)) - hero[atom]

Archmage's Magic Shield fix - The Magic Shield reduced the target units outgoing damage rather than their incoming damage
In unit_special_attacks.lua, line 2199:
if Attack.act_is_spellattacker, "special_magic_shield") then

if Attack.act_is_spell(receiver, "special_magic_shield") then

Alfheim fix - the Alfheim edda is supposed to only cast beneficial spells on allies and harmful spells on enemies, but it was casting both types on any units
see post #25 (http://forum.1cpublishing.eu/showpost.php?p=475489&postcount=25) for details

The above change is not currently included in the attached zip file

Book of Evil fix (thanks saroumana (http://forum.1cpublishing.eu/member.php?u=17149)) - This spell was grossly overpowered
In spells_power.lua, line 1365:
local bonus = math.floor(100*(creator_power + int_bonus)*int_bonus)

local bonus = math.floor(100*(creator_power + item_bonus)*int_bonus)

Song of Svartalfaheim fix - Was giving too much initiative
In visa.lua, line 170:
local bonus, penalty = pwr_visa_svartalfheim()

local gold, bonus, penalty = pwr_visa_svartalfheim()

Sense Weakness fix - Sense Weakness gets 1% less chance to apply than it should
In arena.lua, line 553:
if kritProbRnd > kritProb then

if kritProbRnd >= kritProb then

Spell/Rage crits fix - Criticals were not being applied to either spells or rage attacks
in arena.lua, starting line 880:
insert the following code (in red):
end
else
if iskrit then -- íà êðèòàõ
sdmg = -sdmg * krit
if receiver_human then
item_bonus_on_krit(attacker)
end
end
end
-- Óìåíèÿ Ìàðîäåðà
if attacker_human and killed>0 and 1000==10 then

Shield of Rage fix (thanks mahey (http://forum.1cpublishing.eu/member.php?u=51994)) - Granted the reverse percentage chance of removing a spell (ie, at 10%, it actually had a 90% chance of removal)
in addon_arena.lua, line 1265:
if (rage_shield_i < Game.Random(1, 100)) then

if (rage_shield_i >= Game.Random(1, 100)) then

Calm Rage fix - The spell could attempt to calm more rage than you currently possessed, resulting in loss of total rage amount
in spells_power.lua, line 990:
local rage_can_give = math.ceil(mana_can_get/convert_mod)

local rage_can_give = math.floor(mana_can_get/convert_mod)

Soothsayer Ice Storm fix - The freeze effect of Ice Storm would only (and excessively) target the center unit
in unit_special_attacks.lua, line 1190:
effect_freeze_attack(target, dmgts+dmgts1+1, duration, 0)

effect_freeze_attack(cell, dmgts+dmgts1+1, duration, 0)

Edda fix (thanks Chro (http://forum.1cpublishing.eu/member.php?u=51771)) - Edda power wasn't getting calculated properly
in visa_power_hint.lua:
Search and replace, find all instances of "skald_edda", replace with "edda_skald" (should be 9 changes made)

Fear (partial?) fix - Some units are able to use their special abilities when feared - this fix applies to Slingers and Catapults
in arena.lua, line 3700:
if h > max_hazard then
max_hazard = h
target = act
prob = k * (1 + hit_count*0.5)
end

if h > max_hazard then
if (mover.spells.spell_scare or mover.spells.effect_fear) then
if (mover.level >= act.level) then
max_hazard = h
target = act
prob = k * (1 + hit_count*0.5)
end
else
max_hazard = h
target = act
prob = k * (1 + hit_count*0.5)
end
end

Trolls Pacify fix - Pacify was not taking effect
in unit_features_master.lua, line 1469:
if not not hitbacking then

if not hitbacking then

Ice Prison/Hilda's Arrows fix - Any unit with Ice Prison on it would be destroyed and replaced with an orb if hit with Hilda's Arrows (a nice exploit to be sure ;))
in addon_pet.lua, line 192:
everebody_dies = (Attack.act_damage( cell, ignore_posthitmaster ))
if everebody_dies then

everebody_dies = (Attack.act_damage( cell, ignore_posthitmaster ))
if Attack.act_is_spell(cell, "spell_ice_prison") then
everebody_dies = false
end
if everebody_dies then

Mista's Lightning fix - If an enemy moved before you used this ability, your current unit would lose its turn, and the lightning wouldn't proc for that round
in addon_pet.lua, line 79:
Attack.done_timeshift(Attack.aseq_time(0))

--Attack.done_timeshift(Attack.aseq_time(0))

Ice Dragon death fix - Ice Dragons were causing crashes when they died
in unit_features_ondamage.lua, line 307:
if initsize == 1 then
Attack.log(dmgts, "add_blog_ice_dragon_death_1", "name"," "..blog_side_unit(0), "special", mana_count)
else
Attack.log(dmgts, "add_blog_ice_dragon_death_2", "name"," "..blog_side_unit(0), "special", mana_count)

if initsize == 1 then
Attack.log(dmgts, "add_blog_ice_dragon_death_1", "name"," "..blog_side_unit(0), "special", manaval)
else
Attack.log(dmgts, "add_blog_ice_dragon_death_2", "name"," "..blog_side_unit(0), "special", manaval)

Highterant fix - Highterants had a buggy egg-laying routine
see post #153 (http://forum.1cpublishing.eu/showpost.php?p=478597&postcount=153) for details

Various warning fixes - Main unit special abilities (such as the Skald's curse song or the Royal Griffin's Heavenly Guard) would have their warnings pop up when under AI control
in unit_special_attacks.lua
there are multiple spots where the change needs to be made, I'm giving a single example here, but you can find all of them by doing a search for Game.InvokeMsgBox("warning" and cycling through them. Most work just like this example:
Game.InvokeMsgBox("warning", "<label=sw_default>")
Attack.log_label("null")

if not Attack.is_computer_move() then
Game.InvokeMsgBox("warning", "<label=sw_default>")
Attack.log_label("null")
end

Blizzard fix - The Blizzard spell wasn't freezing units properly
in spells.lua, line 6100:
effect_freeze_attack(cell_found, t_shift, 3, nil, 1)

effect_freeze_attack(cell, t_shift, 3, nil, 1)

___
If you download the zip file, you need to extra the files in the sessions\addon subfolder off your main WotN installation.

File updated Nov 7, 3:56 pm (local time)

camelotcrusade
10-30-2012, 06:56 PM
Update: Mod updated for Patch 5.
Other notes - In Patch 2, Last Hero was replaced with Stoneskin for the Skald talent "paean." I'm happy with this decision and no longer providing a mod to change it to dragon_slayer. In Patch 3, Avenging Angel was also added to "paean." Nice.

If you want to replace Stonekin (or any other spell in the list for paean) yourself, you will need to do it once in lines 867-871 and twice in lines 945-955 for a total of 3 replacements (e.g., spell_stone_skin twice and spell_stone_skin_attack once). All of Bhuric's changes that I packaged into my last version were covered in Patch 2 (fixes for Archmage's shield and soothsayer ice storm).

Song of Alfheim and Diversion FX Mod
The attachment below includes includes the song of alfheim mod to make it only target you with beneficial buffs and enemies with curses, and the diversion animation mod which makes it look like stun instead. A readme is included, but in case you don't read it Bhuric deserves full credit for developing the code for the song of alfheim mod. :)

Your location may vary but mine is in here: C:\Program Files (x86)\Steam\steamapps\common\King's Bounty - Warriors of the North\sessions\addon.

The correct order to install these is: Start with Patched files first (e.g., clean out any LUA files in your addon folder), Install Bhruic fixes if they are available, then install my mods over top of them. Zech's language mod alters completely different files and can be installed at any time.

Finally, I will be updating my attachment whenever Bhruic issues new versions of unit_special_attacks or addon_arena, or whenever there is a new official patch.

Bhruic
10-30-2012, 08:05 PM
Well, rather than do that approach, I fixed the spell (mostly). It's actually not a bad spell, if you know you are going to finish combat soon.

Probably Dragonslayer would be better, but I'm trying to just do fixes with this, rather than outright game changes.

camelotcrusade
10-30-2012, 08:15 PM
I'm so impressed you figured that out.

Do you know how to change the visual representation for the Distraction skill? It reminds me of Fit of Energy/Rally which makes you act not stop moving. :)

If it were up to me, I'd change it to the Confusion effect (???) over their heads.

Zechnophobe
10-30-2012, 08:26 PM
Well, rather than do that approach, I fixed the spell (mostly). It's actually not a bad spell, if you know you are going to finish combat soon.

Probably Dragonslayer would be better, but I'm trying to just do fixes with this, rather than outright game changes.

Last Stand is a fine spell when manually cast. Having it randomly cast on a stack sucks horribly though.

I might break open the lua myself tonight and see if I can fix some of this stuff.

God, is it possible someone could do a fan-made update to all the freaking tool tips? I'd literally climax in excitement at that.

Bhruic
10-30-2012, 08:28 PM
Added fix for Archmage's Magic Shield spell. Amusingly the default version of it actually caused the unit it was cast on to do 50% less damage. So basically you were nerfing your own units by casting it on them. ;)

Bhruic
10-30-2012, 08:30 PM
I'm so impressed you figured that out.

Do you know how to change the visual representation for the Distraction skill? It reminds me of Fit of Energy/Rally which makes you act not stop moving. :)

If it were up to me, I'd change it to the Confusion effect (???) over their heads.

It was mainly just trial and error - I took everything out, then slowly added stuff back until it broke.

Which skill is Distraction? Player skill or unit skill?

Hagbard
10-30-2012, 08:33 PM
oh this is nice, thx a lot

Bhruic
10-30-2012, 08:34 PM
Last Stand is a fine spell when manually cast. Having it randomly cast on a stack sucks horribly though.

I might break open the lua myself tonight and see if I can fix some of this stuff.

God, is it possible someone could do a fan-made update to all the freaking tool tips? I'd literally climax in excitement at that.

True, Last Hero is a poor random spell. Ideally I'd like to see it swapped for something like Dragonslayer, but that's not really my call to make. ;)

I believe the tooltips are all just text based, so it should be possible to fix them, yes. Check the loc_ses.kfs file in sessions/addon (it's just a zip file). It contains all the .lng files, which seem to be plaintext

camelotcrusade
10-30-2012, 08:54 PM
Diversions is a mind/spirit tree skill that says you have a 10/20/30% chance to make opponents lose their turn. I've been calling it the wrong thing this whole time, I better update my threads. :)

I will also make a note of the archmage fix in the bugs thread soon. And for the record I highly approve of you making only fixes not mods with these releases. I'm still gonna mod mine to use Dragonslayer, though. :D I feel it's not too strong (highly conditional as a random buff) but still useful.

PS - more work for you Bhruic but if you colorized what code changed it would be extra awesome

Bhruic
10-30-2012, 09:22 PM
Diversions is a mind/spirit tree skill that says you have a 10/20/30% chance to make opponents lose their turn. I've been calling it the wrong thing this whole time, I better update my threads. :)

I will also make a note of the archmage fix in the bugs thread soon. And for the record I highly approve of you making only fixes not mods with these releases. I'm still gonna mod mine to use Dragonslayer, though. :D I feel it's not too strong (highly conditional as a random buff) but still useful.

PS - more work for you Bhruic but if you colorized what code changed it would be extra awesome

In addon_arena.lua:
Attack.atom_spawn(act, tend, "magic_diversion", Attack.angleto(act))
That's the line where it's displaying the animation for the diversion skill. You'll need to experiment with the available animations to see which one you want to replace it with.

Hmm, I'm not sure if the code tag supports colours, but I guess I can try it and see.

edit: If I'd looked at your first post, I'd have realized that it does. ;)

camelotcrusade
10-30-2012, 09:50 PM
That looks great, thanks for using those colors.

Okay so I hunted for the confused effect but then i realized since it only applies on the world map it might bug out if I used it in combat. So instead I found Stun, that would at least indicate "this unit isn't going to do anything this turn."

Here it is:


-- ***********************************************
-- * Stun
-- ***********************************************
function effect_stun_attack(target, pause, duration, log_message)
--local target = Attack.get_target()
if pause == nil then
pause = 1
end
if target == nil then
target = Attack.get_target()
end
if duration == nil then
duration = tonumber(Logic.obj_par("effect_stun", "duration"))
end
if (Attack.act_ally(target) or Attack.act_enemy(target)) and not Attack.act_feature(target, "boss,pawn") then
--local duration = tonumber(Attack.get_custom_param("duration"))
duration = correct_spell_duration (duration, target, true)
local inbonus = tonumber(Logic.obj_par("effect_stun", "inbonus"))
local speedbonus = tonumber(Logic.obj_par("effect_stun", "speedbonus"))
-- local speed = Attack.act_get_par(target, "speed")

-- local change_speed = speed - speedbonus

Attack.act_del_spell(target,"effect_stun")
Attack.act_apply_spell_begin( target, "effect_stun", duration, false )
Attack.act_apply_par_spell( "disreload", 10, 0, 0, duration, false)
Attack.act_apply_par_spell( "disspec", 10, 0, 0, duration, false)
Attack.act_apply_par_spell( "initiative", -inbonus, 0, 0, duration, false)
Attack.act_apply_par_spell( "speed", -speedbonus , 0, 0, duration, false)
Attack.act_apply_spell_end()
Attack.atom_spawn(target, pause, "effect_stun", 0, true)

-- log_message = -1 - íåò ëîãà, 0 - ïðèïèñûâàåì ê äàìàãó, 1 - âûâîäèì îòäåëüíîé ñòðîêîé
if log_message == nil then
log_message = 0
end
if log_message == 0 then
Attack.act_damage_addlog(target, "add_blog_stun_")
elseif log_message == 1 then
if Attack.act_size(target) > 1 then
Attack.log(pause, "add_blog_stun_2", "targets", blog_side_unit(target, 1))
else
Attack.log(pause, "add_blog_stun_1", "target", blog_side_unit(target, 1))
end
end
end

return true
end


Any idea where the visual effect is in all that? I don't want the unit to actually be stunned, just look like while they are distracted.

Zechnophobe
10-30-2012, 10:04 PM
Attack.act_del_spell(target,"effect_stun")
Attack.act_apply_spell_begin( target, "effect_stun", duration, false )
Attack.act_apply_par_spell( "disreload", 10, 0, 0, duration, false)
Attack.act_apply_par_spell( "disspec", 10, 0, 0, duration, false)
Attack.act_apply_par_spell( "initiative", -inbonus, 0, 0, duration, false)
Attack.act_apply_par_spell( "speed", -speedbonus , 0, 0, duration, false)
Attack.act_apply_spell_end()
Attack.atom_spawn(target, pause, "effect_stun", 0, true)



Not 100% sure without poking it, but the 'atom_spawn' could be an animation effect, though I'm not sure about the arguments. I'd be fairly certain though that the 'pause' variable is telling it to not let you continue to make orders while it's in effect. It just occurred to me that applying that argument to more effects would speed up combat a lot. Like, how Celestial guards (the things royal griffens spawn) remove debuffs on them without halting you from making actions.

I wouldn't mind a few longer than normal spell effects if they'd just queue up as I played. Hmm.

Bhruic
10-30-2012, 10:08 PM
Any idea where the visual effect is in all that? I don't want the unit to actually be stunned, just look like while they are distracted.


Attack.atom_spawn(target, pause, "effect_stun", 0, true)


As Zechnophobe says, that's the line. I'm not sure if you can just copy and replace it with the other line, or if you'll need to modify it at all, but you can experiment and find out.

camelotcrusade
10-30-2012, 10:37 PM
Omg you guys, it worked! I feel like a super modder now... :cool:

All I had to do was replace "magic_diversion" with "effect_stun." Worked great. No pause or anything, it just made the noise, showed the stun effect and the Skeleton lost his action points. Try it out if you want.

Manual Method

In addon_arena.lua, line 1010. Replace:


Attack.atom_spawn(act, tend, "magic_diversion", Attack.angleto(act))


with


Attack.atom_spawn(act, tend, "effect_stun", Attack.angleto(act))


Update: The attachment which replaces the "Fit of Energy/Rally" graphic with the "Stun" swirling stars effect has been consolidated into my other mods here (http://forum.1cpublishing.eu/showpost.php?p=475175&postcount=2).

Zechnophobe
10-30-2012, 11:11 PM
High five team! (not like I did anything)

This is, by the way, why being a software developer can sometimes make you feel like a freaking wizard. You mere mortals and your inability to change graphical effects? Hah! You disgust me.

MattCaspermeyer
10-31-2012, 01:26 AM
Hey, great job guys!

As a modder, it is neat to see people changing the game for the better.

Don't forget, though, about the LUA library mentioned here:

http://forum.1cpublishing.eu/showpost.php?p=462797&postcount=4

You'll need to use a translater to convert the text to English unless you understand Russion (Google seems to work okay), but you should be able to discern the input arguments from there.

Also feel free to ask me if the LUA library doesn't answer your questions since I've dabbled (and am dabbling) in the LUA library quite a bit...

/C\/C\

Loopy
10-31-2012, 03:18 AM
Warrior Maidens have two broken abilities.

Call of Valhalla seems to not work at all or only work 1 round in the past, and with multiple stacks of maidens it almost never works past the first time.

Gift of Odin seems to not work at all.

camelotcrusade
10-31-2012, 03:34 AM
Hey, great job guys!

As a modder, it is neat to see people changing the game for the better.

Don't forget, though, about the LUA library mentioned here:

http://forum.1cpublishing.eu/showpost.php?p=462797&postcount=4

You'll need to use a translater to convert the text to English unless you understand Russion (Google seems to work okay), but you should be able to discern the input arguments from there.

Also feel free to ask me if the LUA library doesn't answer your questions since I've dabbled (and am dabbling) in the LUA library quite a bit...

/C\/C\

Cool, thanks for the link!
@Loopy, both of those are documented in the bug thread along with explanations. Check it out (http://forum.1cpublishing.eu/showthread.php?t=35325).

camelotcrusade
10-31-2012, 04:30 AM
Up next - 1. Does anyone have ideas of where to even begin to fix the Crystal Collector bug? That one is really cramping my style. Yeah, I know I'm only missing out on a few points of intellect, but I know if I start spending my crystals it will be ages before I catch up.

2. I've never seen my alchemist or my engineer mix more than one bottle when using their remix ability. Here's what the code says (line 3026, unit_special_attacks.lua):


-- ***********************************************
-- Ñîçäàíèå Çåëèé/Ãðàíàò (Àëõèìèê, Èíæåíåð)
-- ***********************************************
function special_craft_attack()
local charge = 1
if Attack.act_human(0) then
if Attack.act_name(0) == "alchemist" then
if Logic.hero_lu_item_on_body("alchemist_toolkit") then
if 10 >= Game.CurLocRand(1, 100) then
charge = charge + 1
end
end
end
end

local animation = Attack.get_custom_param("animation")
Attack.act_aseq(0, animation)
local dmgts = Attack.aseq_time(0, "x")
local name = Attack.get_custom_param("craft")
local craft_name = "craft_"..name
Attack.act_enable_attack(0, craft_name, false)
Attack.act_enable_attack(0, name, true)
Attack.act_charge(0, charge, name)

local size = Attack.act_size(0)
if Attack.act_size(0)> 2 then
size = 2
end
Attack.log(0.5 + dmgts, "add_blog_chemistry_crafting_success_"..tostring(charge)..tostring(size), "name", blog_side_unit(0, 0), "special", charge)

return true
end


I can see it looks like there is a 10% chance to do better than 1 bottle. Have I just been unlucky 20+ times or might there be something wrong here?

namad
10-31-2012, 05:45 AM
1) the powerful raise ability is intentionally limited to the recent past... as a balancing factor... its still prolly op!

2) what does the witchhunter fix actually do? (I didn't know what was wrong with them before)


also... is 20intiative rune mages a bug? what should it be? is that fixable via lua? what was it in crossworlds? 20 seems like its gotta be a typo? 20 is prolly the max possible value or something?

MattCaspermeyer
10-31-2012, 07:40 AM
I think this post covers this problem: http://forum.1cpublishing.eu/showthread.php?t=35519

Up next - 1. Does anyone have ideas of where to even begin to fix the Crystal Collector bug? That one is really cramping my style. Yeah, I know I'm only missing out on a few points of intellect, but I know if I start spending my crystals it will be ages before I catch up.

The code you quote looks correct - do you mean you've tried 20 times or that you should have been successful 20 times (i.e. you've tried 200 times)? If you've tried 20 times, you should have (on average) got 2 potions twice, but there is no guarantee and so you may have just been unlucky. If you've tried 200 times, then there is definitely something wrong, although the code looks fine to me...

/C\/C\

2. I've never seen my alchemist or my engineer mix more than one bottle when using their remix ability. Here's what the code says (line 3026, unit_special_attacks.lua):


-- ***********************************************
-- Ñîçäàíèå Çåëèé/Ãðàíàò (Àëõèìèê, Èíæåíåð)
-- ***********************************************
function special_craft_attack()
local charge = 1
if Attack.act_human(0) then
if Attack.act_name(0) == "alchemist" then
if Logic.hero_lu_item_on_body("alchemist_toolkit") then
if 10 >= Game.CurLocRand(1, 100) then
charge = charge + 1
end
end
end
end

local animation = Attack.get_custom_param("animation")
Attack.act_aseq(0, animation)
local dmgts = Attack.aseq_time(0, "x")
local name = Attack.get_custom_param("craft")
local craft_name = "craft_"..name
Attack.act_enable_attack(0, craft_name, false)
Attack.act_enable_attack(0, name, true)
Attack.act_charge(0, charge, name)

local size = Attack.act_size(0)
if Attack.act_size(0)> 2 then
size = 2
end
Attack.log(0.5 + dmgts, "add_blog_chemistry_crafting_success_"..tostring(charge)..tostring(size), "name", blog_side_unit(0, 0), "special", charge)

return true
end


I can see it looks like there is a 10% chance to do better than 1 bottle. Have I just been unlucky 20+ times or might there be something wrong here?

Bhruic
10-31-2012, 07:50 AM
2) what does the witchhunter fix actually do? (I didn't know what was wrong with them before)

Their self-buff ability was limited to only giving them the Dragonslayer buff. With the fix, they are back to potentially getting any of the buffs in their repertoire.

also... is 20intiative rune mages a bug? what should it be? is that fixable via lua? what was it in crossworlds? 20 seems like its gotta be a typo? 20 is prolly the max possible value or something?

It's hard to say if it's a bug or not, but it seems unlikely to be a typo (I doubt they intended to give them 2 initiative, and even 10 would seem high).

Bhruic
10-31-2012, 07:57 AM
2. I've never seen my alchemist or my engineer mix more than one bottle when using their remix ability. Here's what the code says (line 3026, unit_special_attacks.lua):

I can see it looks like there is a 10% chance to do better than 1 bottle. Have I just been unlucky 20+ times or might there be something wrong here?

To save space I didn't quote the code, but you can go back and look... What it actually is doing is checking if you've got the item "alchemist_toolkit" equipped on your character, and if you do, then you have a 10% chance of getting a second bottle. That's the only way it lists for that to take place.

I've never used Alchemists/Engineers in WotN, so I'm not sure if they are supposed to have the option to mix more than one without an item.

Bhruic
10-31-2012, 08:46 AM
Alfheim fix - the Alfheim edda is supposed to only cast beneficial spells on allies and harmful spells on enemies, but it was casting both types on any units

addon_arena.lua

original:
local tab_spell_select = {
-- õîðîøèå çàêëû
{s = "spell_dispell", nf = "magic_immunitet,pawn,boss"},
{s = "spell_haste", nf = "magic_immunitet,pawn,boss"},
{s = "spell_bless", nf = "undead,magic_immunitet,pawn,boss"},
{s = "spell_divine_armor", nf = "undead,magic_immunitet,pawn,boss"},
{s = "spell_reaction", nf = "magic_immunitet,pawn,boss"},
{s = "spell_gifts", nf = "magic_immunitet,pawn,boss"},
-- ïëîõèå çàêëû
{s = "spell_defenseless", nf = "magic_immunitet,pawn,boss"},
{s = "spell_slow", nf = "magic_immunitet,pawn,boss"},
{s = "spell_magic_bondage", nf = "mind_immunitet,magic_immunitet,pawn,boss"},
{s = "spell_pygmy", nf = "magic_immunitet,pawn,boss"},
{s = "spell_scare", nf = "magic_immunitet,mind_immunitet,undead,pawn,boss"},
{s = "spell_weakness", nf = "undead,golem,plant,magic_immunitet,pawn,boss"},
{s = "spell_crue_fate", nf = "magic_immunitet,pawn,boss"}--[[,
{s = "spell_ram", nf = "magic_immunitet,pawn,boss,mech"}]]
}
local cast = {}
local spell_count = table.getn(tab_spell_select)
local acnt = Attack.act_count()
local total_prob = 0
for i = 1, spell_count do
local spell = (tab_spell_select[i]).s
local nfeatures = (tab_spell_select[i]).nf
local tab_spell_targets = {}
for j = 0, acnt-1 do
if not Attack.act_feature(j, nfeatures) and Attack.act_takesdmg(j) then
table.insert(tab_spell_targets, j) -- âûáîð áàçîâûõ öåëåé
end
end
if table.getn(tab_spell_targets) > 0 then -- åñòü áàçîâûå öåëè
local spell_lvl = Game.Random (1, 3) -- óðîâåíü çàêëà, êîòîðûé áóäåì þçàòü
local applicable = Attack.build_spell_attack(spell, spell_lvl).applicable
for i, t in ipairs (tab_spell_targets) do
if applicable(t) then -- çàêë ïðèìåíèì íà ýòó öåëü
local prob = 10
total_prob = total_prob + prob
table.insert(cast, {spell = spell, level = spell_lvl, target = t, prob = prob})
end
end
end
end
modified:
local tab_spell_select_positive = {
-- õîðîøèå çàêëû
{s = "spell_dispell", nf = "magic_immunitet,pawn,boss"},
{s = "spell_haste", nf = "magic_immunitet,pawn,boss"},
{s = "spell_bless", nf = "undead,magic_immunitet,pawn,boss"},
{s = "spell_divine_armor", nf = "undead,magic_immunitet,pawn,boss"},
{s = "spell_reaction", nf = "magic_immunitet,pawn,boss"},
{s = "spell_gifts", nf = "magic_immunitet,pawn,boss"}
}
local tab_spell_select_negative = {
-- ïëîõèå çàêëû
{s = "spell_defenseless", nf = "magic_immunitet,pawn,boss"},
{s = "spell_slow", nf = "magic_immunitet,pawn,boss"},
{s = "spell_magic_bondage", nf = "mind_immunitet,magic_immunitet,pawn,boss"},
{s = "spell_pygmy", nf = "magic_immunitet,pawn,boss"},
{s = "spell_scare", nf = "magic_immunitet,mind_immunitet,undead,pawn,boss"},
{s = "spell_weakness", nf = "undead,golem,plant,magic_immunitet,pawn,boss"},
{s = "spell_crue_fate", nf = "magic_immunitet,pawn,boss"}--[[,
{s = "spell_ram", nf = "magic_immunitet,pawn,boss,mech"}]]
}
local cast = {}
local acnt = Attack.act_count()
local total_prob = 0
local spell_count = table.getn(tab_spell_select_positive)
for i = 1, spell_count do
local spell = (tab_spell_select_positive[i]).s
local nfeatures = (tab_spell_select_positive[i]).nf
local tab_spell_targets = {}
for j = 0, acnt-1 do
if not Attack.act_feature(j, nfeatures) and Attack.act_takesdmg(j) and Attack.act_ally(j) then
table.insert(tab_spell_targets, j) -- âûáîð áàçîâûõ öåëåé
end
end
if table.getn(tab_spell_targets) > 0 then -- åñòü áàçîâûå öåëè
local spell_lvl = Game.Random (1, 3) -- óðîâåíü çàêëà, êîòîðûé áóäåì þçàòü
local applicable = Attack.build_spell_attack(spell, spell_lvl).applicable
for i, t in ipairs (tab_spell_targets) do
if applicable(t) then -- çàêë ïðèìåíèì íà ýòó öåëü
local prob = 10
total_prob = total_prob + prob
table.insert(cast, {spell = spell, level = spell_lvl, target = t, prob = prob})
end
end
end
end

spell_count = table.getn(tab_spell_select_negative)
for i = 1, spell_count do
local spell = (tab_spell_select_negative[i]).s
local nfeatures = (tab_spell_select_negative[i]).nf
local tab_spell_targets = {}
for j = 0, acnt-1 do
if not Attack.act_feature(j, nfeatures) and Attack.act_takesdmg(j) and Attack.act_enemy(j) then
table.insert(tab_spell_targets, j) -- âûáîð áàçîâûõ öåëåé
end
end
if table.getn(tab_spell_targets) > 0 then -- åñòü áàçîâûå öåëè
local spell_lvl = Game.Random (1, 3) -- óðîâåíü çàêëà, êîòîðûé áóäåì þçàòü
local applicable = Attack.build_spell_attack(spell, spell_lvl).applicable
for i, t in ipairs (tab_spell_targets) do
if applicable(t) then -- çàêë ïðèìåíèì íà ýòó öåëü
local prob = 10
total_prob = total_prob + prob
table.insert(cast, {spell = spell, level = spell_lvl, target = t, prob = prob})
end
end
end
end

saroumana
10-31-2012, 09:15 AM
Book of evil correction :

in spells_power.lua

Original

function pwr_evilbook(level)
if tonumber(level) == 0 or level == nil then
level = Obj.spell_level()
if level == 0 then
level = 1
end
if Obj.where() == 6 and Obj.spell_level() ~= 0 then
level = level + 1
end
else
level = tonumber(level)
end

local level = tonumber("0" .. text_dec(Logic.obj_par("spell_evilbook", "level"), level))
local kill = tonumber("0" .. text_dec(Logic.obj_par("spell_evilbook", "kill"), level))
local creator_power = 1 + tonumber(skill_power2("creator", 1)/100)
creator_power = creator_power/2
local int_bonus = 1 + tonumber(Game.Config("spell_power_config/int_power"))*HInt()/100
local item_bonus = tonumber(Logic.hero_lu_item("sp_spell_demonologist", "count")/100)
local bonus = math.floor(100*(creator_power + int_bonus)*int_bonus)

return bonus, level, kill
end

CHANGE

function pwr_evilbook(level)
if tonumber(level) == 0 or level == nil then
level = Obj.spell_level()
if level == 0 then
level = 1
end
if Obj.where() == 6 and Obj.spell_level() ~= 0 then
level = level + 1
end
else
level = tonumber(level)
end

local level = tonumber("0" .. text_dec(Logic.obj_par("spell_evilbook", "level"), level))
local kill = tonumber("0" .. text_dec(Logic.obj_par("spell_evilbook", "kill"), level))
local creator_power = 1 + tonumber(skill_power2("creator", 1)/100)
creator_power = creator_power/2
local int_bonus = 1 + tonumber(Game.Config("spell_power_config/int_power"))*HInt()/100
local item_bonus = tonumber(Logic.hero_lu_item("sp_spell_demonologist", "count")/100)
local bonus = math.floor(100*(creator_power + item_bonus)*int_bonus)

return bonus, level, kill
end

Bhruic
10-31-2012, 09:30 AM
Nice find. Added that to the first post. Also added a fix for the Song of Svartalfheim.

pavar
10-31-2012, 11:37 AM
Last Stand is a fine spell when manually cast. Having it randomly cast on a stack sucks horribly though.

I might break open the lua myself tonight and see if I can fix some of this stuff.

God, is it possible someone could do a fan-made update to all the freaking tool tips? I'd literally climax in excitement at that.

I'm working on correcting the effing grammar (and the off-mark descriptions) on spells and skills. If you are willing to list the tooltips that need updating (what it says / what it should say), I would gladly dive in on it. Thanks to you guys I am able to play the game without having it crashing to the desktop every 2 minutes and I wouldn't know where to start to correct the bugs, but this is at my level :cool:

ikbenrichard
10-31-2012, 01:19 PM
Great work. Big thnx !

camelotcrusade
10-31-2012, 03:57 PM
To save space I didn't quote the code, but you can go back and look... What it actually is doing is checking if you've got the item "alchemist_toolkit" equipped on your character, and if you do, then you have a 10% chance of getting a second bottle. That's the only way it lists for that to take place.

I've never used Alchemists/Engineers in WotN, so I'm not sure if they are supposed to have the option to mix more than one without an item.

I bet that is the problem - good find. I don't have that item so it's never creating 2 bottles. However, the description on remix clearly says "Create 1-2 charges of X." I guess they put that in as a catchall? Seems misleading if you ask me, especially since your chances of finding one specific item could be low.

Imo, it should always have that 10% chance and having the item (after all, it's a belt slot!) should give you an extra 10% chance. Either that or the description should say 1 item... but then it won't be accurate when you DO have that item. Aargh.

Thoughts?

camelotcrusade
10-31-2012, 04:08 PM
1) the powerful raise ability is intentionally limited to the recent past... as a balancing factor... its still prolly op!


I am starting to agree it's working as intended. What it should say is "Restores a maximum of X forces of the targeted troop if they receive the Call of Valhalla before they act again." That's what it really does, and I agree that's plenty good.

I'm going to move it to the description/tooltip section.

MattCaspermeyer
10-31-2012, 04:19 PM
Just do this:

Before:

if Attack.act_human(0) then
if Attack.act_name(0) == "alchemist" then
if Logic.hero_lu_item_on_body("alchemist_toolkit") then
if 10 >= Game.CurLocRand(1, 100) then
charge = charge + 1
end
end
end
end

After:

if Attack.act_human( 0 ) then
if Attack.act_name( 0 ) == "alchemist" then
local chance = 10

if Logic.hero_lu_item_on_body( "alchemist_toolkit" ) then
chance = chance + 10
end

if chance >= Game.CurLocRand( 1, 100 ) then
charge = charge + 1
end
end
end

The descriptions say 1 to 2 charges, but do not list a percent chance of that happening, the Toolkit description says +10% chance - the code above would cover both bases...

/C\/C\

I bet that is the problem - good find. I don't have that item so it's never creating 2 bottles. However, the description on remix clearly says "Create 1-2 charges of X." I guess they put that in as a catchall? Seems misleading if you ask me, especially since your chances of finding one specific item could be low.

Imo, it should always have that 10% chance and having the item (after all, it's a belt slot!) should give you an extra 10% chance. Either that or the description should say 1 item... but then it won't be accurate when you DO have that item. Aargh.

Thoughts?

camelotcrusade
10-31-2012, 04:23 PM
Thanks Matt! I'm going to mod my game and make a note of this on the bugs thread. Bhruic when you have time please add this to the summary. Also, thanks so much for tweaking Song of Alfheim. That one was complicated!

And I forget who linked me to the Crystal collector thread - I definitely know what's happening, I just think it's counter intuitive. Why on earth is there a reward for failing to learn your magic and hording up 100 crystals? Is it supposed to favor the Viking class or something? I find it a real killjoy and think it should be total collected. Mod for that would be great.

Xargon
10-31-2012, 04:30 PM
Thanks Matt! I'm going to mod my game and make a note of this on the bugs thread. Bhruic when you have time please add this to the summary. Also, thanks so much for tweaking Song of Alfheim. That one was complicated!

And I forget who linked me to the Crystal collector thread - I definitely know what's happening, I just think it's counter intuitive. Why on earth is there a reward for failing to learn your magic and hording up 100 crystals? Is it supposed to favor the Viking class or something? I find it a real killjoy and think it should be total collected. Mod for that would be great.

I agree about the crystal collector thing, it's rather annoying to hold off on all spell upgrades (though in line with the gold collector medal). But the required number of crystals should definitely higher if it is changed, a total of 100 collected crystals can be reached very early.

camelotcrusade
10-31-2012, 04:36 PM
I agree about the crystal collector thing, it's rather annoying to hold off on all spell upgrades (though in line with the gold collector medal). But the required number of crystals should definitely higher if it is changed, a total of 100 collected crystals can be reached very early.

Hmm good point. We never noticed the problem with gold collector because gold is coming out our ears.

For me it's not even about holding out on upgrades, it's holding out on learning the magic in the first place. I just don't get rewarding us for not learning our spells in the first place. It would be like having an award for not spending your runes (I know the Rune Mage does that, but imo not the same thing) or an award for never using new troops. Is that supposed to be fun?

You know the more I think about it, the more messed up this is. It should be a reward for SPENDING your cyrstals and have a higher requirement. That would reward finding them and doing something useful. Maybe that is the Mod we should make, if it's possible.

deftest
10-31-2012, 06:13 PM
so you just dump the lua files from zip into addon folder ?

camelotcrusade
10-31-2012, 06:18 PM
so you just dump the lua files from zip into addon folder ?

Yep. And if you want to tweak anything additional in or out of them, you can just edit them once they are included (like alchemist fix, dragonslayer for Last hero swap, image change on distraction, etc.)

Loopy
10-31-2012, 06:22 PM
Pretty sure Crystal Collector isn't bugged. It's crystal collector, not crystal finder. If you are spending the crystals you aren't collecting them. The medal for getting lots of gold works the same way.

Bhruic
10-31-2012, 06:52 PM
Ok, time for someone to fact check me here, because if I'm reading this correctly, I'm very confused:
iskrit = ( kritProbRnd < kritProb )
if iskrit then
if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = false
is_weakness_lore = true
end
end
end

Basically, what this is doing it checking if someone made a critical hit. kritProb is the chance of performing a critical hit, kritProbRnd is a random number from 0-99.

Now, if I'm understanding this right, if a critical hit was made (kritProbRnd is less than kritProb), it then subtracts the value from "weakness_lore", which is the Sense Weakness skill. However, let's assume that you don't have the Sense Weakness skill. Shouldn't skill_power("weakness_lore", 2) return 0? And if that's the case, then kritProb = kritProb - skill_power("weakness_lore", 2) becomes kritProb = kritProb - 0, or kritProb = kritProb. In which case the second if kritProbRnd < kritProb then is guarunteed to also be true because kritProb hasn't changed. Which means that iskrit should automatically be set false, and the game should think Sense Weakness kicked in.

Even worse, I'm sitting here and I can't remember if I've actually had the enemy perform a critical hit on me. It could be my memory letting me down, or it could be that you can't actually get a critical hit on your troops until you take the Sense Weakness skill. Unfortunately I can't set up a test case for "enemy performs a critical hit". So have I mis-analyzed the code? Can anyone without the Sense Weakness skill verify that they've taken (not given) a critical hit?

Fatt_Shade
10-31-2012, 07:34 PM
How does weakness lore work with ancient vampires ? They have 100% miss on crit, and this gives even more so basicly enemy hit your ancient vampire they evade and weakness lore override that and they get hit :-)

Razorflame
10-31-2012, 07:50 PM
Ok, time for someone to fact check me here, because if I'm reading this correctly, I'm very confused:
iskrit = ( kritProbRnd < kritProb )
if iskrit then
if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = false
is_weakness_lore = true
end
end
end

Basically, what this is doing it checking if someone made a critical hit. kritProb is the chance of performing a critical hit, kritProbRnd is a random number from 0-99.

Now, if I'm understanding this right, if a critical hit was made (kritProbRnd is less than kritProb), it then subtracts the value from "weakness_lore", which is the Sense Weakness skill. However, let's assume that you don't have the Sense Weakness skill. Shouldn't skill_power("weakness_lore", 2) return 0? And if that's the case, then kritProb = kritProb - skill_power("weakness_lore", 2) becomes kritProb = kritProb - 0, or kritProb = kritProb. In which case the second if kritProbRnd < kritProb then is guarunteed to also be true because kritProb hasn't changed. Which means that iskrit should automatically be set false, and the game should think Sense Weakness kicked in.

Even worse, I'm sitting here and I can't remember if I've actually had the enemy perform a critical hit on me. It could be my memory letting me down, or it could be that you can't actually get a critical hit on your troops until you take the Sense Weakness skill. Unfortunately I can't set up a test case for "enemy performs a critical hit". So have I mis-analyzed the code? Can anyone without the Sense Weakness skill verify that they've taken (not given) a critical hit?


ah i also was wondering that since sometimes i got a msg about sense weakness
and i was like wtf i don't have that skill tagged


i thought it maybe was a viking ability or something

but seeing this
this is just a bad write up fix plz:D

Bhruic
10-31-2012, 07:56 PM
ah i also was wondering that since sometimes i got a msg about sense weakness
and i was like wtf i don't have that skill tagged


i thought it maybe was a viking ability or something

but seeing this
this is just a bad write up fix plz:D

It's an easy fix, but I just want to verify that I'm not misreading it first.

camelotcrusade
10-31-2012, 08:17 PM
I don't think I've been critted now that you mention. And I actually think we see the sense weakness text come up when we should have been critted but we aren't.

Just last night the AI cast DOOM on my wolves (ermahgerd attack the summons?!!) and when they were hit by the enemy they were not criticaled. I did see the sense weakness appear in the text, though.

Does that help?

Bhruic
10-31-2012, 08:22 PM
I don't think I've been critted now that you mention. And I actually think we see the sense weakness text come up when we should have been critted but we aren't.

Just last night the AI cast DOOM on my wolves (ermahgerd attack the summons?!!) and when they were hit by the enemy they were not criticaled. I did see the sense weakness appear in the text, though.

Does that help?

Yup. Ha. And people were complaining about spells/rage not doing critical hits. The poor enemy wasn't getting crits for anything!

camelotcrusade
10-31-2012, 08:52 PM
Oh dear. Double facepalm (http://www.hockeydrunk.com/wp-content/uploads/2009/11/double_facepalm.jpg).

So how should we bug this one? Sense Weakness prevents critical hits from enemies? It's kind of a whopper if we are understanding this correctly.

Edit: Attempt at an entry.

Sense Weakness bug appears to prevent enemy critical hits: A look at the sense weakness code (link to thread (http://forum.1cpublishing.eu/showpost.php?p=475737&postcount=39)) reveals an error where sense weakness is effectively preventing enemies from inflicting critical hits - but only if you don't have any ranks in the skill. When they would normally inflict a crit you instead see a "sense weakness" mention in the combat log and the crit is averted. Some players are also reporting they never been hit with a crit.

I'll just replace what I have in the thread now with this.

Zechnophobe
10-31-2012, 09:30 PM
iskrit = ( kritProbRnd < kritProb )
if iskrit then
if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = true
else
iskrit = false
is_weakness_lore = true
end
end
end


Logic was just all topsy turvy. They intend to check IF IT IS STILL A CRIT, but instead of letting it be a crit, they instead cancel it. I believe the above should fix it unless I'm misremembering lua 'else' syntax.

camelotcrusade
10-31-2012, 09:39 PM
Nice, Zechnophobe. I'll link to it once it's confirmed and Bhruic adds it to the summary. Too bad getting crit isn't easy to test. You almost need to keep a save near a hero who casts doom.

Bhruic
10-31-2012, 09:57 PM
iskrit = ( kritProbRnd < kritProb )
if iskrit then
if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = true
else
iskrit = false
is_weakness_lore = true
end
end
end


Logic was just all topsy turvy. They intend to check IF IT IS STILL A CRIT, but instead of letting it be a crit, they instead cancel it. I believe the above should fix it unless I'm misremembering lua 'else' syntax.

Well, what they were trying to do is check if Sense Weakness would prevent it from being a crit. Which they did correctly. Unfortunately what they didn't do is consider the case where you didn't have Sense Weakness.

Your code does mostly fix it, but I already posted a different fix in the main post. Both do roughly the same thing but different ways. The main point is that it should be working correctly now.

Zechnophobe
10-31-2012, 10:04 PM
Well, what they were trying to do is check if Sense Weakness would prevent it from being a crit. Which they did correctly. Unfortunately what they didn't do is consider the case where you didn't have Sense Weakness.

Your code does mostly fix it, but I already posted a different fix in the main post. Both do roughly the same thing but different ways. The main point is that it should be working correctly now.

Heh, the 'correct' way to fix it is actually just make the operand be >= in that second check, which I realized after I just saw my silly solution again.

Bhruic
10-31-2012, 10:09 PM
Heh, the 'correct' way to fix it is actually just make the operand be >= in that second check, which I realized after I just saw my silly solution again.

That'd involve less steps, certainly. I think mine's slightly more elegant in that it requires less steps if you don't have Sense Weakness. Of course, I might be biased. ;)

Csimbi
10-31-2012, 10:10 PM
In addition, none of these LUA functions appear to work:
Game.MessageBox(...)
Game.InvokeMsgBox(...)
Game.Log(...)
Game.atom_getpar(...)
Plz fix.
Thank you!

Bhruic
10-31-2012, 10:15 PM
Those are certainly all source code fixes, and as we don't have access, you'll have to wait for 1C to fix those (should they choose to). Better to report those in the Bugs thread.

camelotcrusade
11-01-2012, 12:02 AM
Critical Hits/Sense Weakness fix - If your hero didn't have the Sense Weakness skill, all critical hits on your units would trigger Sense Weakness (sounds backwards, I know)
In arena.lua, line 553:
if receiver_human and not receiver_glot then

if receiver_human and not receiver_glot and (skill_power("weakness_lore", 2) > 0) then


Hi - turns out I got a save right smack in front of the guy who casts Doom, so I just tested and the bug is still happening. Then I realized the zip file has addon_arena.lua, not arena.lua, so I didn't have the fix installed. So I went into the arena.lua file to mod it myself, but I don't quite understand how to do it. At 553 (and the next few after) it says:


if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = false
is_weakness_lore = true


Where do I make the changes? Am I adding that line you show right after it?

Zechnophobe
11-01-2012, 12:02 AM
That'd involve less steps, certainly. I think mine's slightly more elegant in that it requires less steps if you don't have Sense Weakness. Of course, I might be biased. ;)

Hmm, just for the sake of discussion...

I wasn't optimizing for speed, since that is no doubt a non-issue with something like this. More just for how clarity and ease of debugging. Calling in additional functions to do your logic like that makes the code slightly weightier. And then, any edit to an external source should generally be simple so as a diff is easy to understand. Seeing:

Blah blah < bleh bleh
Turn into

Blah blah >= bleh bleh

Is pretty clear what the problem was, and the solution for it.

Er, not that any of this really matters... I've just been doing code reviews at work recently and it has me thinking about Ivory Tower code production stuff.

Zechnophobe
11-01-2012, 12:04 AM
Hi - turns out I got a save right smack in front of the guy who casts Doom, so I just tested and the bug is still happening. Then I realized the zip file has addon_arena.lua, not arena.lua, so I didn't have the fix installed. So I went into the arena.lua file to mod it myself, but I don't quite understand how to do it. At 553 (and the next few after) it says:


if receiver_human and not receiver_glot then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = false
is_weakness_lore = true


Where do I make the changes? Am I adding that line you show right after it?

He is saying change:

if receiver_human and not receiver_glot then

to

if receiver_human and not receiver_glot and (skill_power("weakness_lore", 2) > 0) then

camelotcrusade
11-01-2012, 12:12 AM
Lol, thanks. :) I'll try not to hurt myself making the change.

Edit: Aaand... it works! Wolves took the crit.

If anybody needs a crit tester save, you can use this one. Just talk to the berserker guy to fight him - he knows doom. What I have been doing is running the maiden out to grab the chest and then casting summon nature's ally in the hex in front of her. When it's the hero's turn he'll cast doom on the wolves and then his black knight will run up and smack them for a crit (or the sense weakness bug, if you don't put in the fix).

And you probably know this but the save goes in your my documents\my games\KBWoTN saves folder.

RCDOWN
11-01-2012, 01:36 AM
Well, rather than do that approach, I fixed the spell (mostly).
Tnx man, you saved the day! :)

Any hope to fix the famous battle crash using viking buffer troop?

QNk
11-01-2012, 03:27 AM
if receiver_human and not receiver_glot and (skill_power("weakness_lore", 2) > 0) then
kritProb = kritProb - skill_power("weakness_lore", 2)
if kritProbRnd < kritProb then
iskrit = true
else
is_weakness_lore = true


Doesn't the iskrit check also need to be changed to true? What it's doing right now is if a crit is registered, it checks again against a kritProb modified by sense weakness. If iskrit = false, then the game would only register a crit if the random number was LOWER than the initial but HIGHER than the modified kritProb. Or did I misunderstand how the kritProbRnd < kritProb inequality work?

Bhruic
11-01-2012, 09:12 AM
Er, not that any of this really matters... I've just been doing code reviews at work recently and it has me thinking about Ivory Tower code production stuff.

lol, I know. I was being semi-facetious. Had I thought of doing it your way first, I would have stuck with that as being the simpler approach. Still, as both ways work equally well, I'm going to stick with the approach I took and call it "better"! ;) (even if it's not)

Bhruic
11-01-2012, 09:14 AM
Tnx man, you saved the day! :)

Any hope to fix the famous battle crash using viking buffer troop?

That's the first I've heard of it. Do you have a save where I could witness it happening? Although there's a decent chance the crash is caused by the actual compiled code rather than a script, it's still worth a look.

Bhruic
11-01-2012, 10:25 AM
Doesn't the iskrit check also need to be changed to true? What it's doing right now is if a crit is registered, it checks again against a kritProb modified by sense weakness. If iskrit = false, then the game would only register a crit if the random number was LOWER than the initial but HIGHER than the modified kritProb. Or did I misunderstand how the kritProbRnd < kritProb inequality work?

iskrit is already set to true to begin with, that's the only way to enter that code block (with the "if iskrit then"). So there's no need to do anything to it unless Sense Weakness kicks in, in which case it needs to be set to false.

Bhruic
11-01-2012, 12:41 PM
Ok, I changed the Sense Weakness fix to Zechnophobe (http://forum.1cpublishing.eu/member.php?u=15977)'s solution, as it's simpler (I give up! ;))

Added a second fix for Sense Weakness (effect was being applied twice).

Added a fix for spells/rage not getting critical hits.

Bunnle
11-01-2012, 01:24 PM
edit: wrong topic, my bad.

Bhruic
11-01-2012, 01:26 PM
Please refer bug reports to this thread (http://forum.1cpublishing.eu/showthread.php?t=35325). The purpose of this one is to highlight fixes that are available via scripting.

rekiem
11-01-2012, 01:49 PM
Shield of Rekross seems to be bugged, when he should give you ice dragons, the description is all bugged and if you try to get it the game crashes. Any chances that it's just a lua error?

Bhruic
11-01-2012, 02:01 PM
That's probably a text error, but again, please report the bugs in the thread I linked previously. We want to have all the bug reports in one central location.

rekiem
11-01-2012, 02:15 PM
That's probably a text error, but again, please report the bugs in the thread I linked previously. We want to have all the bug reports in one central location.

It's definetly crashing the game when used at the state on the screenshot, but it works for other dragons, i've already got 2 greens, 1 red and 1 black from the shield

Bhruic
11-01-2012, 02:19 PM
Well, if you PM me a copy of the save right before you try and summon it, I can check and see if it's something fixable.

mahey
11-01-2012, 02:37 PM
Rage Shield is also bugged.

addon_arena.lua line 1265:
if (rage_shield_i < Game.Random(1, 100)) then
has to be if (rage_shield_i >= Game.Random(1, 100)) then

rekiem
11-01-2012, 02:38 PM
Well, if you PM me a copy of the save right before you try and summon it, I can check and see if it's something fixable.

There you go. I fail completely at lua scripting it seems, couldn't even find what file I should be checking for errors lol.

Bhruic
11-01-2012, 02:51 PM
Rage Shield is also bugged.

Good find, added to the front page.

Bhruic
11-01-2012, 02:56 PM
There you go. I fail completely at lua scripting it seems, couldn't even find what file I should be checking for errors lol.

Hmm, I opened up your game, but the dragon the shield is offering me is a red one (which works fine). Anything I should need to do to get an ice dragon?

rekiem
11-01-2012, 03:04 PM
The dragon is randomly generated like 30 seconds after you level up, as long as there's no dragon inside (you got the dragon from the shield on the previous level), i guess it differs by something else too, since it was ice dragon for me :(

EDIT: Ok the save i gave you the shield is about to change his dragon. If you open the hero screen right before the "You feel a sharp blow...." message, it'll still be the bugged shield. (you have about 2 seconds after you load lol >< sorry), I can provide an earlier save if you want.

Bhruic
11-01-2012, 03:30 PM
I managed to get to it as an ice dragon, but that's almost certainly a fix that 1C will have to do. The "use" option details in the items.txt file is just a string of hex numbers which, without knowing what they correspond to, are virtually impossible to decipher.

rekiem
11-01-2012, 03:36 PM
O well, that's a pity, no early Ice Dragon for me then hah, thanks alot for trying, and for all the other bugfixes :)

Bhruic
11-01-2012, 05:14 PM
Haha, I just spent a fruitless 30 minutes (and why I'm laughing about that I don't know! ;)). I went back to playing, and noticed that enemies were getting hit with something called "Fatal luck", which put some random curse on them. I thought, "uh oh, I must have messed something up in the code somewhere". So I went back and kept tinkering with things to figure out what I'd done wrong.

Well, long story short, it turns out I had the "Chain of Chance" on, which - apparently - hits an enemy with a curse any time they hit you with a critical hit. The description is horribly wrong, saying just that it "curses enemies, inflicting critical strikes". What it really does is curse enemies when you get hit with a critical strike. Of course I hadn't seen it yet, as the enemy never critical struck anyone thanks to the bug.

camelotcrusade
11-01-2012, 06:20 PM
Good work as always. Been updating the bug thread with the fixes. A few quick questions.

1. Can you add the alchemist/engineer fix to the main page? The description really does say they should mix 1-2 bottles and doesn't mention the toolkit, so I think it's a legit fix and not just a mod.
2. Love that you fixed spell/rage crit. What skill or ability gives you rage crit that's not working? I want to list the fix near the bug (and I don't even know if I have that bugged yet).
3. I'll add the new bug you just mentioned. Is Chain of Chance an item?
4. Got any time to wade into the necromancer/shackles (http://forum.1cpublishing.eu/showthread.php?t=35502) issue? It's a puzzler.

Bhruic
11-01-2012, 06:30 PM
1) I'm still on the fence on that one. Yes, the tooltip says 1-2, but the tooltips are frequently wrong in the game, as you well know ;). Plus, there's no indication of what the chance of a second one should be, if in fact you are supposed to get 1-2. Should it be a 50-50 split?

2) Icy Rage is the skill that increases your critical hit chance for Rage, but it should be pointed out that you always should have a chance to crit with Spells/Rage attacks. The probability seems quite low (unless they have Doom cast on them, which guaruntees a crit with anything). If I'm reading this right, the base probability is:
3 x (current mana-or-rage / maximum mana-or-rage).

3) It's not really a bug, it's just a side-effect of fixing the critical hit bug. It required one of my units to take a critical hit to activate, which never happened (because of the bug). Now that it's fixed, it does happen, which took me by surprise.

4) I've read about it, but I haven't got that spell yet, so I haven't tried using in on various undead. Maybe I'll cheat and give it to myself to see what's up.

camelotcrusade
11-01-2012, 06:44 PM
Thanks very much sir. Once they release the first patch we can go about noting what's fixed and separating the mods from the bugs if some of their intentions get clarified. I am fond of the alchemist fix and the song of alfheim fix, but like you said you never know what they are doing to do (if they even change them). Or if you have time we know this is coming so you could make an optional fixes/mods section.

I added Chain of Chance to description bugs since it lies. :)

Zechnophobe
11-01-2012, 06:49 PM
1) I'm still on the fence on that one. Yes, the tooltip says 1-2, but the tooltips are frequently wrong in the game, as you well know ;). Plus, there's no indication of what the chance of a second one should be, if in fact you are supposed to get 1-2. Should it be a 50-50 split?

In KBAP it was ~33% chance of two, by my eyeballing of it. (I used Alchemists with 4 movement for a run. They were like little no-retaliation poison dealing land dragons!)



2) Icy Rage is the skill that increases your critical hit chance for Rage, but it should be pointed out that you always should have a chance to crit with Spells/Rage attacks. The probability seems quite low (unless they have Doom cast on them, which guaruntees a crit with anything). If I'm reading this right, the base probability is:
3 x (current mana-or-rage / maximum mana-or-rage).


Now that is interesting. That sounds like it's about one tenth the intended strength, even when working correctly. Having a 3% crit chance when at max rage or mana is very minor. But I really dig the intention at least. Makes mana regen to keep yourself topped off feel a bit more important.



3) It's not really a bug, it's just a side-effect of fixing the critical hit bug. It required one of my units to take a critical hit to activate, which never happened (because of the bug). Now that it's fixed, it does happen, which took me by surprise.

Hmm, I'll have to fix the description on this one when I get to items. This was a CW item that had the same effect, and was similarly difficult to understand then!


4) I've read about it, but I haven't got that spell yet, so I haven't tried using in on various undead. Maybe I'll cheat and give it to myself to see what's up.

If I remember, I'll at least try to reproduce the bug when I get home from work.

Bhruic
11-01-2012, 06:59 PM
Well, I made a test game to check out the Magic Shackles bug, it seems like I can affect all other undead except the Necromancers, so it can't be the mind immunity. Definitely isn't a leadership problem either, as I found a stack with a single one.

Weirdly, there doesn't seem to be a txt file for units, so I can't check to see if it's going something extra set that would be blocking the spell.

camelotcrusade
11-01-2012, 07:07 PM
Well, I made a test game to check out the Magic Shackles bug, it seems like I can affect all other undead except the Necromancers, so it can't be the mind immunity. Definitely isn't a leadership problem either, as I found a stack with a single one.

Weirdly, there doesn't seem to be a txt file for units, so I can't check to see if it's going something extra set that would be blocking the spell.

Thanks. I'm going to bug it. In KBAP necromancers were a frequent target for my magic shackles. I see no reason why they aren't now, as well, especially given all the undead you slog through.

Bhruic
11-01-2012, 07:12 PM
Yeah, it certainly is one.

You know, I think the Chain of Chance thing isn't so much a bad tooltip as it's a bad comma.

"curses enemies, inflicting critical strikes" makes a lot more sense as "curses enemies inflicting critical strikes".

camelotcrusade
11-01-2012, 07:23 PM
Ooh, Zechnophobe just suggested Necros might have gotten Presence of Mind in the update. Can you check your save to see if they have it? If they do, that is what is killing our shackles. It's blocking archmages from being shackled, too.

Poor witch hunters. Can't shackle either of those. :(

Bhruic
11-01-2012, 07:28 PM
Yeah, I read that, but he said they were "undocumented". Which might be true - the Necromancer definitely doesn't have that ability listed. But I can't find where the documentation for units is, so I can't check to see if that's the case.

They really hid units well. Or I'm blind. Maybe I need to wait 2 turns to see if it wears off? (yay KB jokes! ;))

rekiem
11-01-2012, 08:12 PM
You might have to dig for it!

I tought the only 'documentation' they had was on the russian forums.

Bhruic
11-01-2012, 08:14 PM
Well, by "documentation", I mean the various .txt files they have for things like spells, items, etc.

nublets
11-02-2012, 12:31 AM
Thank you for these fixes!

I had put my game on hold until the sense weakness bug was fixed and its great to see the community able to do that and much more.

camelotcrusade
11-02-2012, 01:24 AM
1) If I'm reading this right, the base probability is:
3 x (current mana-or-rage / maximum mana-or-rage).


Any idea how crit bonus skills are applied now that crits are working? I think it was +3/5/7% (maybe, I'd have to check again) and I wonder if they multiplicative or additive. If they aren't additive then you really don't get much out of them... especially if you don't start with enough mana to begin with.

Bhruic
11-02-2012, 01:30 AM
They are additive.

I should also point out that unlike regular crits, the crit increase isn't a static 1.5, but is 1.3 + 0.4 x (previous formula from above).

camelotcrusade
11-02-2012, 01:32 AM
They are additive.

I should also point out that unlike regular crits, the crit increase isn't a static 1.5, but is 1.3 + 0.4 x (previous formula from above).

Ohhh. So thats not your chance to crit, that's your critical damage? I think I'm confused. What's your chance to crit, then? :confused:

Csimbi
11-02-2012, 04:43 AM
@Bhruic
There's no version number on the zip file in the first post.
Is that the latest (as of today)?
Maybe you could add the date to the filename in the future.
Thanks!

Just reported this bug (you might want to consider adding this, too):
"Guardian" award - While the hint appearing above this award says that this award gives resistance to all types of damage, it actually does not give any resistance to 'glacial' and 'astral' damage.
It was fixed in my extended awards mod (http://forum.1cpublishing.eu/showthread.php?p=476429). Those that want the fix without the modifications can apply the same fix by looking at the included medals.txt.

xtrm
11-02-2012, 08:22 AM
Thanks, the fixes work nice and no more crashes in battles :)

Bhruic
11-02-2012, 10:04 AM
Ohhh. So thats not your chance to crit, that's your critical damage? I think I'm confused. What's your chance to crit, then? :confused:

It's used for both things, your chance to crit as well as how much extra damage you crit for.

ikbenrichard
11-02-2012, 11:30 AM
Hi Bhruic,

can you remove the fix: LAST HERO, from your subpatch? Since its fixed with the steam patch.

Bhruic
11-02-2012, 12:10 PM
There are lots of bugs officially fixed in the latest patch, I'm going to need to go through each fix individually to see if it still applies. That'll take a bit of time.

ikbenrichard
11-02-2012, 02:08 PM
There are lots of bugs officially fixed in the latest patch, I'm going to need to go through each fix individually to see if it still applies. That'll take a bit of time.

I understand, I (we) greatly appreciate your efforts !!

camelotcrusade
11-02-2012, 03:20 PM
Let me know if you need help.

Question: What do we need to do if we all the fixes to date installed? Clear the addon folder and start fresh? Otherwise, won't it read our files before the patched files?

I know I am going to want to put some of our stuff back in, too, especially where I like some of our fixes better. :)

Netami
11-02-2012, 03:23 PM
I'll probably regret asking this as it's gonna sound very noobish ... but where exactly are the .lua files o_O In my sessions/addon folder there are only like 2 files + another folder called locations .

Bhruic
11-02-2012, 03:29 PM
Let me know if you need help.

Question: What do we need to do if we all the fixes to date installed? Clear the addon folder and start fresh? Otherwise, won't it read our files before the patched files?

I know I am going to want to put some of our stuff back in, too, especially where I like some of our fixes better. :)

Well, the main slow down is that Steam is blocked here at work, so I can't check out the patch until I get home.

I'd recommend completely deleting all of the .lua files right now, so it's not reading them instead of the new ones. Once I get a chance to check out the new patch, I can see which things are still broken and re-implement them with the new files.

Bhruic
11-02-2012, 03:31 PM
I'll probably regret asking this as it's gonna sound very noobish ... but where exactly are the .lua files o_O In my sessions/addon folder there are only like 2 files + another folder called locations .

The .lua files are in the ses.kfs file. You can extract them using something like 7zip.

Netami
11-02-2012, 03:33 PM
Uhm so is it enough if I just move the .lua files you gave to that folder ? or do I need to like unpack the file u said and then pack it again? kinda confused about it ;s

camelotcrusade
11-02-2012, 03:35 PM
Well, the main slow down is that Steam is blocked here at work, so I can't check out the patch until I get home.

I'd recommend completely deleting all of the .lua files right now, so it's not reading them instead of the new ones. Once I get a chance to check out the new patch, I can see which things are still broken and re-implement them with the new files.

No rest for the weary... thanks a bunch. I think about half of our fixes will still be needed (Skald crash is still happening, no word in diplomacy yet and I saw very few unit-specific fixes).

Do you mind adding the alfheim fix to a different zip in a mod section? I am sure I'm not the only one who likes this version better... in fact, it's the most fun I've had playing a skald. I also had another idea for overhauling the bard songs, here (http://forum.1cpublishing.eu/showthread.php?t=35622), for the sunny day when all we have to worry about are mods we want.

Bhruic
11-02-2012, 03:40 PM
Uhm so is it enough if I just move the .lua files you gave to that folder ? or do I need to like unpack the file u said and then pack it again? kinda confused about it ;s

Oh, sorry. Ok, if you want to use the bugfixes that you downloaded from this thread, all you need to do is extract them into that folder. You only need to get them from the .kfs file if you want to modify them yourself.

Right now I'd recommend not using the bugfixes from this thread, however, until they've been updated with the latest patch. There may be some conflicts.

Netami
11-02-2012, 03:57 PM
Hmm well doesnt seem like moving the files into the folder works o_O Well dont really know how to check ... was looking at the Sense Weakness skill it was giving more than 7% crit chance before but I dont notice any difference in the crit % of my troops =/

also I dont know if it was mentioned before but the spell Heat Focus seems to be crashing the game for me whenever I try to cast it =/

One more thing I gotta ask ... the fixes they work on loaded games right ? Not only on new games ? oO

camelotcrusade
11-02-2012, 09:32 PM
Hmm well doesnt seem like moving the files into the folder works o_O Well dont really know how to check ... was looking at the Sense Weakness skill it was giving more than 7% crit chance before but I dont notice any difference in the crit % of my troops =/

also I dont know if it was mentioned before but the spell Heat Focus seems to be crashing the game for me whenever I try to cast it =/

One more thing I gotta ask ... the fixes they work on loaded games right ? Not only on new games ? oO

We need some time to pull out the updated game files and go through to see how they implemented their fixes on items we've been fixing ourselves. Then we'll upload a new package.

All of our fixes would apply immediately - they aren't to game files which are stored in a save but rather applied to files the game loads when you start it up. I'm not an expert, but I think what happens is it looks in that addon folder and uses the files we put in there instead of what's buried in the game files. The good part about that is you can always remove or modify those without hurting the integrity of the base game.

camelotcrusade
11-02-2012, 09:35 PM
For those who can't open the game right now but want to start playing with the updated game files from wherever they are... I'm rather heartbroken about the Maidens having their Call of Valhalla freshly bugged if you want a target. :)

Edit - removing attachment. Some players are using it and causing themselves problems. It wasn't for using, it was for modding purposes only. :)

Bhruic
11-02-2012, 09:41 PM
That would be me. Thanks. ;)

I'm going to be re-doing the first post to try and ensure it accurately reflects the latest patch, so if a fix isn't there, it hopefully was "officially" fixed.

Bhruic
11-02-2012, 10:28 PM
Alright, updated the first post. There were a surprising number of bugs still present.

Right now I just need confirmation on whether Last Hero is still crashing the game, and what changes were made to the Song of Alfheim. And then I can start in on the new bugs. :rolleyes:

camelotcrusade
11-02-2012, 10:42 PM
Several people have said the Skald crash is still in the game. RE song of alfheim I am not sure yet... I believe only the description was updated as it was apparently WAI. Bah. :)

Also, I recommend keeping a previous version around in case you need to reference old code that actually worked before they "fixed" it. :)

Bhruic
11-02-2012, 10:56 PM
Well, some of the reports seemed to be from people who hadn't updated yet. I'll give it a bit to get some clarification.

Hard to believe that Alfheim was actually intended to cast random bad spells on your units and good spells on the enemy. Why would you ever use it under those circumstances?

camelotcrusade
11-02-2012, 10:59 PM
Well, some of the reports seemed to be from people who hadn't updated yet. I'll give it a bit to get some clarification.

Hard to believe that Alfheim was actually intended to cast random bad spells on your units and good spells on the enemy. Why would you ever use it under those circumstances?

Oh, I get it. It's a "chaos fairy" who wreaks havoc. The thing is, flavor and utility are at the opposite end of the scale here. I think at least after three ranks in Edda it should never hit your own guys. But since that would be a waste of runes as it currently stands, I'm happy to mod it to just do that with one rank. So glad you made the code available.

RE skald I am staying far away from that poision and putting my dragonslayer mod right back in. :D

oas
11-03-2012, 01:24 AM
For those who can't open the game right now but want to start playing with the updated game files from wherever they are... I'm rather heartbroken about the Maidens having their Call of Valhalla freshly bugged if you want a target. :)

Is that part of the new patch?
Or do I still have to install it?

How do install the patch through steam (it's my first time using it)

Sorry my english isn't that great

camelotcrusade
11-03-2012, 03:48 AM
Is that part of the new patch?
Or do I still have to install it?

How do install the patch through steam (it's my first time using it)

Sorry my english isn't that great

No need to do anything for the patch, steam updates are automatic. The fixes in this thread are for issues they haven't addressed. If you don't mind waiting for a future patch, you'll be fine. If you do, instructions for installing these fixes are on the first page.

redfuryau
11-03-2012, 12:38 PM
For those who can't open the game right now but want to start playing with the updated game files from wherever they are... I'm rather heartbroken about the Maidens having their Call of Valhalla freshly bugged if you want a target. :)

Just wondering out of interset how they are bugged? I used them very briefly in the tutorial and resurrected a couple of lost units with no problems, but that certainly wasn't an extensive test.

oas
11-03-2012, 02:23 PM
camelotcrusade, youre ses.kfs file should replace the one on the folder?

What fixes does it contain? The same fixes as Bruhic (i already put those in the folder)?
Will it conflict?

Sorry for being a pain ^^

camelotcrusade
11-03-2012, 05:11 PM
@Oas, sorry to confuse you. That .ses is just most of the moddable game files after the official patch, nothing modded or fixed by the community. I posted it because some people wanted to start working on fixes and mods and they didn't have it nearby. If you want to use community fixes they are on page 1. I suppose if you didn't have the steam version you could use it for a partial patch, though. I haven't seen a manual patch yet.

@redfuryau well they work for me too! But I haven't restarted so I thought that was it. Maybe they aren't bugged after all. I'll ask a definitive question about it so we can get more reports.

Chro
11-03-2012, 06:13 PM
The Skald skill Edda does not currently give the 10%/20% bonus when you put extra points in it.

This can easily be fixed by going into the visa_power_hint.lua file and replacing every instance of "skald_edda" with "edda_skald".

On a side note, if anyone else thinks 10-20% is too piddly to put points in, you can change the values (to something like 20-50%) by modifying the percentages under edda_skald in the skills.txt file. Just be aware that this will also increase the song penalties as well, unless you're like me and you go back to the visa_power_hint.lua file and change all the penalty and resp formulas to use (2-edda_bonus) instead of edda_bonus. This will make the skill reduce the penalties while increasing the bonuses, making this skill actually worth putting points in.

camelotcrusade
11-03-2012, 07:14 PM
The Skald skill Edda does not currently give the 10%/20% bonus when you put extra points in it.

This can easily be fixed by going into the visa_power_hint.lua file and replacing every instance of "skald_edda" with "edda_skald".

On a side note, if anyone else thinks 10-20% is too piddly to put points in, you can change the values (to something like 20-50%) by modifying the percentages under edda_skald in the skills.txt file. Just be aware that this will also increase the song penalties as well, unless you're like me and you go back to the visa_power_hint.lua file and change all the penalty and resp formulas to use (2-edda_bonus) instead of edda_bonus. This will make the skill reduce the penalties while increasing the bonuses, making this skill actually worth putting points in.

Are you sure? Unless this is happening after the patch, it was working before. Maybe they switched around the name of the skill for some reason? When I tested it (pre-patch) the intiative song went from 18% to 19 or 20%, I forget exactly which, but it was very minor. I haven't restarted so I can't confirm yet if this is happening... but I can try it later and see what happens since I have Edda and runes to burn.

camelotcrusade
11-03-2012, 11:27 PM
@Chro - good catch man, just tested it and yep, they screw it up in the patch. I'll add to the bug thread and thanks for the fix.

Bhruic
11-03-2012, 11:50 PM
Added fix for the Calm Rage spell

namad
11-04-2012, 09:18 AM
if i was effected by the calm rage bug and lost max rage should i just start over? or is there anyway to fix it?

Bhruic
11-04-2012, 11:11 AM
You'll need to reload an earlier save if you can. If not, your only remaining option would be using something like the in-game console command or Cheat Engine.

midoss
11-04-2012, 11:30 AM
After i downloaded the calm rage fix warrior maiden resurrection doesn't work so i used the old unit_special_attacks.lua and it worked

also thank you for you effort great job.

Edit: The same fix that wasn't working now works sorry about that.

keko4321
11-04-2012, 01:31 PM
Bhruic Thank you so much .
it's always great to have people like you around

Bhruic
11-04-2012, 01:31 PM
Added fix for Soothsayer's Ice Storm ability.

pavar
11-04-2012, 04:32 PM
Bhruic, I think that with the last update you used an older version of your addon_arena. The Alfheim edda has reverted to its old pre-fix buggy self. I modified it based on your post #25 and it works fine again. Might want to also check if something else is un-fixed, though so far I haven't noticed something.

Bhruic
11-04-2012, 04:47 PM
I didn't add the Alfheim fix to the post-patch version. They changed the description for the edda to make it clear that it's supposed to be completely random, rather than only casting beneficial spells on your troops and harmful on the enemy.

pavar
11-04-2012, 04:55 PM
I didn't add the Alfheim fix to the post-patch version. They changed the description for the edda to make it clear that it's supposed to be completely random, rather than only casting beneficial spells on your troops and harmful on the enemy.
:) Ok, guess I missed the steam patch :eek:

camelotcrusade
11-04-2012, 05:34 PM
After i downloaded the calm rage fix warrior maiden resurrection doesn't work so i used the old unit_special_attacks.lua and it worked

also thank you for you effort great job.

I'd really like to know what breaks the maiden resurrection... I haven't seen it broken yet in my game, but I sure don't want it breaking on me any time soon.

@Bhuric, if you want to do any comparisons, the version I'm using is attached. It's been fiddled with, but I can vouch for the maiden resurrection working if you can find a buggy one to compare it to.

Bhruic
11-04-2012, 05:47 PM
My suspicion is that people tried to use older versions with newer versions. If you tried to use the old version of the .lua file with the patched version of the game it wouldn't function properly. If you tried to use the newer .lua file with the unpatched game it also wouldn't function properly.

So far I haven't seen anyone verifiably claim that the new version of the .lua file with the latest patch doesn't work.

Bhruic
11-04-2012, 08:09 PM
Added Chro's Edda fix.

camelotcrusade
11-05-2012, 01:00 AM
Added fix for Soothsayer's Ice Storm ability.

I still haven't seen this freeze anything outside of the first cell and I've been using it on big groups (sometimes there is a mob in every hex).

I modified line 1190 but noticed the same thing in line 1177. Does that have to change too, or is that designating special rules for the target cell vs. others?

Bhruic
11-05-2012, 01:05 AM
There's only a 15% chance of freezing guys in surrounding squares, so you won't see it that often. I did verify that it worked locally. Still, you should have seen it happen within a few fights.

The one at line 1177 is supposed to be "target", as it's the 30% chance for the guy at the center of the spell.

edit: Just double-checked and I hit 3 guys, center was skel archers, 2 skel warriors on either side, one of the skel warriors got frozen.

camelotcrusade
11-05-2012, 01:12 AM
There's only a 15% chance of freezing guys in surrounding squares, so you won't see it that often. I did verify that it worked locally. Still, you should have seen it happen within a few fights.

The one at line 1177 is supposed to be "target", as it's the 30% chance for the guy at the center of the spell.

edit: Just double-checked and I hit 3 guys, center was skel archers, 2 skel warriors on either side, one of the skel warriors got frozen.

Okay, thanks! I thought it was 30% for everyone so that probably explains it. Really appreciate you double checking. :)

hardy87
11-05-2012, 04:18 PM
Here, my fix for Warrior Maiden Call of Valhalla :)

open file unit_special_attacks.lua in ses.kfs, and search "Valhalla". Then replace this

function special_valhalla_call_calccells()
local level = Attack.get_custom_param("level")
if level == nil or level == "" then
level = 4
else
level = tonumber(level)
end

local ccnt = Attack.cell_count()
for i = 0, ccnt-1 do
local cell = Attack.cell_get(i)
if Attack.act_ally(cell) then
if (Attack.act_level(cell) <= level) then
if Attack.act_applicable(cell) then
if (Attack.cell_dist(0, cell) >= 1) then
local size_last2 = Attack.val_restore(cell, "size_last2")
if size_last2 == nil or size_last2 == "" then
size_last2 = Attack.act_initsize(cell)
else
size_last2 = tonumber(size_last2)
end
if ( size_last2 > Attack.act_size(cell) ) then
Attack.marktarget(cell)
end
end
end
end
end
end

return true
end

function special_valhalla_call_attack()
local target = Attack.get_target()
if target ~= nil then
Attack.aseq_rotate(0, target, "special")
local dmgts = Attack.aseq_time(0, "x")

local power, power_max = text_range_dec(Attack.get_custom_param("count"))
power = power*Attack.act_size(0)
local act = Attack.get_caa(target)
local count0 = Attack.val_restore(act, "size_last2")
if count0 == nil or count0 == "" then
count0 = Attack.act_initsize(act)
else
count0 = tonumber(count0)
end
local count1 = Attack.act_size(act)
local rephits = math.min( power, (count0 - count1) )*Attack.act_get_par(act, "health")
Attack.cell_resurrect(act, rephits)
Attack.atom_spawn(act, dmgts, "magic_wing", Attack.angleto(act))

local count2 = Attack.act_size(target)
Attack.log_label("respawn_")
Attack.act_damage_addlog(target, "res_")
Attack.log_special(count2-count1)
end

return true
end

or you can use my edited file :) Call of Valhalla ability will work :)

ps: sorry for my bad english !

Bhruic
11-05-2012, 04:26 PM
The Call of Valhalla does work, you are using an older version of the game. Update to the latest Steam patch.

hardy87
11-05-2012, 04:29 PM
I used the file uploaded on the first page. So it doesn't work :(

Bhruic
11-05-2012, 04:33 PM
If you haven't got the latest Steam patch - which you don't - you should not be using the file from the first page. It includes the updates from the patch, which are what are causing your problems. You need to let Steam update the game for you, then apply the file.

hardy87
11-05-2012, 04:39 PM
Oh, I see it. Thanks !

Bhruic
11-05-2012, 06:27 PM
Added at least partial fix for Fear. Let me know if you run across other units that are able to use their special abilities on units they shouldn't while feared.

Zechnophobe
11-05-2012, 11:04 PM
Here, my fix for Warrior Maiden Call of Valhalla :)

open file unit_special_attacks.lua in ses.kfs, and search "Valhalla". Then replace this



or you can use my edited file :) Call of Valhalla ability will work :)

ps: sorry for my bad english !

Bad English is no problem, but use the "CODE" tag instead of quotes so it doesn't eat your code formatting. Seeing line after line of unindented 'end' made me throw up a little bit in my mouth ;P.

Bhruic
11-05-2012, 11:25 PM
Added fix for Troll's Pacify ability.

camelotcrusade
11-05-2012, 11:34 PM
Added fix for Troll's Pacify ability.

Trolls everywhere thank you, including the ones on the forum. :rolleyes:

Bhruic
11-06-2012, 01:52 AM
Added fix for the Ice Prison + Hilda's Arrows bug.

Bhruic
11-06-2012, 04:49 PM
Added fix for Mista's Lightning.

oas
11-06-2012, 06:47 PM
The medals are capped at lvl 3?

I installed the mod to fix the bug for awards "mod_wn131_eng_csimbi_extended_awards" now I can reach lvl 4. If i delete the file (I don't want to go past lvl 3 if that is the limit) would cause any problem?

Bhruic
11-06-2012, 07:32 PM
Added fix for Ice Dragon deaths.

gunnyhighway
11-06-2012, 08:24 PM
I installed this since then I get random crashes anyone else got this issue?

I read somewhere that it might be caused by Skalds but I am not sure if they meant the Skald class or the skald units. I just started playing a skald after finishing up with soothsayer so maybe its skald?

Bhruic
11-06-2012, 08:28 PM
The Skalds used to cause a crash with the Last Hero spell, but that has been fixed in the official patch. The game is a bit unstable, however, and numerous people have reported random crashes. The "random" part making it quite difficult to troubleshoot.

bacchus1974
11-07-2012, 08:20 AM
to install this update i just do decompressed these files in my folder

\steam\SteamApps\common\King's Bounty - Warriors of the North\sessions\addon

please help me

Xargon
11-07-2012, 08:38 AM
to install this update i just do decompressed these files in my folder

\steam\SteamApps\common\King's Bounty - Warriors of the North\sessions\addon

You followed the instructions outlined in the first post, congratulations. Everything should be working


please help me

That might be possible if you actually state what your problem is.

Bhruic
11-07-2012, 05:00 PM
This is (hopefully) a fix for the Highterant egg-laying issue. As it's a rather large piece of code (I wrote a specific AI routine to handle it - go me! ;)), I'm placing the code here rather than in the first post. Also, I'm not including pre- and post-code changes, everything in red text was added by me. The aim of this routine is to try and find the square that is farthest away from any enemy (and within movement range) and lay the egg there - presumably with the best chance of survival.

In arena.lua, line 2718:

local maxc, maxtarget
if mover.name == "highterrant" then
local maxdist = 0
for i = 0, ecells.n do
local c = ecells[i]
if c == nil then -- проверяем также клетку, где мы стоим - вдруг идти никуда и не нужно - и здесь хорошо
c = mover
c.distance = 0
end
if c.distance < mover.ap then
local near_enemy = false
for dir = 0, 5 do
local c2 = Attack.cell_adjacent(c, dir)
if Attack.act_enemy(c2) then
near_enemy = true
break
end
end
if not near_enemy then
local dist = 0
for k = 0, ecells.n do
local c2 = ecells[k]
if c2 == nil then -- проверяем также клетку где стоим, т.к. с нее можем уйти
c2 = mover
end
if Attack.cell_dist(c, c2) == 1 then
local mindist = 1e8
for j, act in ipairs(actors) do
if Attack.act_enemy(act) then
dist = Attack.cell_dist(c2, act)
if dist < mindist then
mindist = dist
end
end
end
if mindist > maxdist then
maxdist = mindist
maxc = c
maxtarget = c2
end
end
end
end
end
end
else
if offence and not mover.thrower and (mover.par('dismove') == 0) and (mover.ap > 1) then -- при наступательной тактике не-стрелки способные перемещаться бегут к вражеским лучникам
-- здесь могут оказаться : demon, dryad, highterrant, thorn_warrior
local mindist = 1e8
local nneed_corpse = true
if mover.name == "thorn" or mover.name == "thorn_warrior" then -- тернии призывают на гексы с трупами
nneed_corpse = false
end
for i = 0, ecells.n do
local c = ecells[i]
if c == nil then -- проверяем также клетку, где мы стоим - вдруг идти никуда и не нужно - и здесь хорошо
c = mover
c.distance = 0
end
if c.distance < mover.ap then
local dist = 0
for j, act in ipairs(actors) do
if Attack.act_enemy(act) then
if act.thrower then
dist = dist + Attack.cell_dist(c, act)*0.5
else
dist = dist + Attack.cell_dist(c, act)
end
end
end
if dist < mindist then
for j = 0, ecells.n do
local c2 = ecells[j]
if c2 == nil then -- проверяем также клетку где стоим, т.к. с нее можем уйти
c2 = mover
end
if Attack.cell_dist(c, c2) == 1 then
if nneed_corpse or Attack.cell_has_ally_corpse(c2) or Attack.cell_has_enemy_corpse(c2) then
mindist = dist
maxc = c
break
end
end
end
end
end
end
if maxc ~= nil then
local mindist2 = 1e8
for i = 0, ecells.n do
local c2 = ecells[i]
if c2 == nil then -- проверяем также клетку где стоим, т.к. с нее можем уйти
c2 = mover
end
if Attack.cell_dist(maxc, c2) == 1 then
if nneed_corpse or Attack.cell_has_ally_corpse(c2) or Attack.cell_has_enemy_corpse(c2) then
local dist2 = 0
for j, act in ipairs(enemies) do -- как далеко до врагов
if act.thrower then
dist2 = dist2 + Attack.cell_dist(c2, act)*0.5
else
dist2 = dist2 + Attack.cell_dist(c2, act)
end
end
if dist2 < mindist2 then
mindist2 = dist2
maxtarget = c2
end
end
end
end
end
end
if maxc == nil then
-- здесь гарантированно окажутся : chosha, demonologist, druid, ingeneer, kingthorn, thorn
local mindist2 = 1e8
for i = 1, atk.cells.n do
local c2 = atk.cells[i]
local dist2 = 0
for j, act in ipairs(enemies) do -- как далеко до врагов
if act.thrower then
dist2 = dist2 + Attack.cell_dist(c2, act)*0.5
else
dist2 = dist2 + Attack.cell_dist(c2, act)
end
end
if dist2 < mindist2 then
mindist2 = dist2
maxtarget = c2
end
end
end
end

Bhruic
11-07-2012, 07:19 PM
Added fixes for warning popups occurring under AI control (yours or the enemies).

camelotcrusade
11-07-2012, 07:34 PM
Added fixes for warning popups occurring under AI control (yours or the enemies).

That's neat. Would it for example fix the popup on the skald trying to use an ability with no target?

Bhruic
11-07-2012, 07:35 PM
Yup, and same with the Royal Griffins summoning (or more precisely not being able to summon) the Heavenly Guard.

camelotcrusade
11-07-2012, 07:39 PM
Okay, nice, I will update that part of the bug thread once I'm done editing my own file.

n00b question - sometimes that line is commented out. That means it's not actually doing the popup so I don't need to put in the code to block it, right?

Bhruic
11-07-2012, 07:40 PM
If it's commented out, no, you don't have to bother with it (it's not being used anyway).

Bhruic
11-07-2012, 07:59 PM
Added fix for the Blizzard spell.

camelotcrusade
11-07-2012, 09:30 PM
Cool, I will add the bug - and the fix - to the thread. I am not sure if fireball and/or fire rain are supposed to inflict burning, but if they do they might be worth a look. I don't have them yet so I can't read the descriptions.

Bhruic
11-07-2012, 09:33 PM
I've used both spells, and they do inflict burning properly.

Sertorius
11-07-2012, 11:30 PM
Hello,

When I downloaded a new(er) version of the zip file (dated Nov 7 on the 1st post) and pasted the luas into /sessions/addons, I found that all the replaced .lua files had the non-altered code... in other words, none of the changes had been applied to the code in the .lua files of the Nov 7 .zip file. I just reverted to an older .zip file I had, but I was wondering if this was intentional or not (so that people could apply various fixes individually...it is a bit tedious).

Netami
11-07-2012, 11:50 PM
Can someone tell me which line is responsible for Rune Mages initiative ? It's changed from 20 to 2 and I don't really care what was intended I'm used to Rune Mages always going first and it pretty much ruins my game now...

namad
11-08-2012, 12:09 AM
Can someone tell me which line is responsible for Rune Mages initiative ? It's changed from 20 to 2 and I don't really care what was intended I'm used to Rune Mages always going first and it pretty much ruins my game now...

pretty sure that change is just from the steam patch, isn't it?

Bhruic
11-08-2012, 12:14 AM
Hello,

When I downloaded a new(er) version of the zip file (dated Nov 7 on the 1st post) and pasted the luas into /sessions/addons, I found that all the replaced .lua files had the non-altered code... in other words, none of the changes had been applied to the code in the .lua files of the Nov 7 .zip file. I just reverted to an older .zip file I had, but I was wondering if this was intentional or not (so that people could apply various fixes individually...it is a bit tedious).

Not sure what happened, but I checked the file, and they are all modified. I've got no idea what you ran into.

Xargon
11-08-2012, 09:00 AM
Can someone tell me which line is responsible for Rune Mages initiative ? It's changed from 20 to 2 and I don't really care what was intended I'm used to Rune Mages always going first and it pretty much ruins my game now...

If you really don't want to use the patch: it's in the runemage.atom file (not in the addon archive, but in the corresponding one in the data folder, I believe).

Netami
11-08-2012, 09:13 AM
Yeah its with the steam patch and I wanna use it but I want to revert the Rune Mage ini change or atleast make it 10... nearly whole game ive been using rune mages saved up might runes got high crit and now they go last ? thats really bullshit >_> Anyway cant find the file you mentioned do I have to unpack some other file there ? and after i make the change what will i have to do pack it back again ? oO

Xargon
11-08-2012, 09:52 AM
Same procedure as with these bugfixes: there is some archive (ses.kfs or whatever they are called, don't remember if the name is the same as the one in the addon folder), you just extract the file (into the same folder) and change it and the game will use the altered file.

Netami
11-08-2012, 10:26 AM
Awesome mate found it and fixed it now I can play on :D Big thanks

trubble
11-08-2012, 07:53 PM
Hi there, I can see that the issue of Ice Dragons causing the game to crash when they die has been noted but I do not understand what I am supposed to do to fix it. I don't know anything about modding or coding, I just play. I have the most up to date version on Steam, what else do I need to do?

Are these fixes just for coders or is there a solution for general members of public too?

shlayferg
11-08-2012, 09:42 PM
Light Knight Spell should apply to all units at level 3 according to its description but it still applies to only one unit.

I tried to read the code for it in spells.lua but I am not a programmer and couldn't find out how to change that. Could you please help me?

I guess the same happens to Dark Knight Spell but I don't have it.

Zechnophobe
11-08-2012, 09:49 PM
Hi there, I can see that the issue of Ice Dragons causing the game to crash when they die has been noted but I do not understand what I am supposed to do to fix it. I don't know anything about modding or coding, I just play. I have the most up to date version on Steam, what else do I need to do?

Are these fixes just for coders or is there a solution for general members of public too?

These are for the general public! Just get the files as directed, and extract them (with winzip, winrar, or whatever) to the folder he mentions in the first post.

DennisBergkamp
11-08-2012, 10:08 PM
Yes, which should be something like:

C:\Program Files (x86)\Steam\steamapps\common\King's Bounty - Warriors of the North\sessions\addon

Is it not necessary to replace them within the ses.kfs file also? Or can the LUA files just be placed into the sessions\addon directory next to the kfs files?

For instance, if I wanted Royal Griffins to give paladins a morale bonus, could I simply edit the morale.txt file and place it within the directory? Or does it have to be repackaged into ses.kfs?

Thanks!

Bhruic
11-08-2012, 10:17 PM
Or can the LUA files just be placed into the sessions\addon directory next to the kfs files?

Yes, that's the way to do it.

For instance, if I wanted Royal Griffins to give paladins a morale bonus, could I simply edit the morale.txt file and place it within the directory?

Again, yes, that's the best way to handle it.

DennisBergkamp
11-08-2012, 10:38 PM
Great, thanks for the quick replies :)

Zechnophobe
11-08-2012, 10:46 PM
I actually think using .kfs archives in the mod folder is a bit cleaner, since it puts each mod in a separate file.

To do that with Bhruic's fixes, simply rename his zip, and change the .zip extension to .kfs. And then place it in addon/mods. You will have to create the mods folder.

trubble
11-08-2012, 10:49 PM
These are for the general public! Just get the files as directed, and extract them (with winzip, winrar, or whatever) to the folder he mentions in the first post.

Okay, I see. I can now kill Ice dragons with impunity. Thank you. :)

Why does 1C make it so we have to fix the game ourselves, wouldn't it be easier to fix it for everyone through Steam update? Probably a silly question.

camelotcrusade
11-09-2012, 02:11 AM
Light Knight Spell should apply to all units at level 3 according to its description but it still applies to only one unit.

I tried to read the code for it in spells.lua but I am not a programmer and couldn't find out how to change that. Could you please help me?

I guess the same happens to Dark Knight Spell but I don't have it.

This one is noted in the bugs list but unfortunately we don't have a fix for it yet.

@trubble they aren't asking us to make any bug fixes or track bugs, we're just doing it so we can help problems get recorded and the fixes are made so we can enjoy the game while we wait for official patches.

Zechnophobe
11-09-2012, 06:58 AM
Hey there, Bhruic. I discovered the solution to Jarl's not displaying their attack log correctly.

Change:
Attack.log(dmgts+dmgts1, "add_blog_fear_2", "target", blog_side_unit(cell, 0))

To:
Attack.log(dmgts+dmgts1, "add_blog_fear_2", "targets", blog_side_unit(cell, 0))

in unit_special_attacks.lua. It's setting the wrong tag, which is then incorrectly named in the language file. I believe the correct fix here is to use the right tag name, since it should be the plural 'targets' here. Notice the comparison with the wolf howl that uses the same attack log messages?

peprik
11-09-2012, 05:22 PM
Hey Bhruic,
why did you hide the file?
(btw. great work otherwise!)

Bhruic
11-09-2012, 05:52 PM
http://forum.1cpublishing.eu/showpost.php?p=479349&postcount=61

Numbereleventeen
11-09-2012, 11:14 PM
I actually think using .kfs archives in the mod folder is a bit cleaner, since it puts each mod in a separate file.

To do that with Bhruic's fixes, simply rename his zip, and change the .zip extension to .kfs. And then place it in addon/mods. You will have to create the mods folder.

Seems like mods work if you just put them in the addons folder too.. As thats where I put yours and it worked fine. Didn't know about this sub folder options since there was no installation instructions in ur mod (maybe make a readme?).

Oji
11-10-2012, 08:03 AM
After 2nd patch - do i have to delete lua files from community fix from sessions/addon folder?

Amasalan
11-10-2012, 08:12 AM
After 2nd patch - do i have to delete lua files from community fix from sessions/addon folder?

yes

mnorbieu
11-10-2012, 01:23 PM
where is the zip file?

wulf77
11-10-2012, 01:30 PM
i am also cant finde archive file for download

Bhruic
11-10-2012, 05:16 PM
As I stated in the first post, there's a new Steam patch out that fixes the majority of bugs that were in my fixes. When I've got some time, I'll check to see if there are any outstanding ones that haven't been fixed, but in the meantime, use the official Steam patch.

mnorbieu
11-10-2012, 07:01 PM
only problem , steam is not patching to my client , and if i correct i must start new game for using new patch... this is why will be nice this file

Bhruic
11-10-2012, 07:11 PM
You do not have to start a new game with the Steam patch. Some bugs will not be fixed if you don't start a new game, but they wouldn't be fixed by my bugfixes either.

mnorbieu
11-11-2012, 03:59 AM
hmm. ok. my client verison is 6246, it is latest ?

commanderz
11-11-2012, 04:51 AM
where is the bugfix file?......cant find in the first page?

Amasalan
11-11-2012, 10:51 AM
where is the bugfix file?......cant find in the first page?

As I stated in the first post, there's a new Steam patch out that fixes the majority of bugs that were in my fixes. When I've got some time, I'll check to see if there are any outstanding ones that haven't been fixed, but in the meantime, use the official Steam patch.
:)

bacchus1974
11-11-2012, 12:30 PM
can you give me the version on the patch of steam please

my verions is 1.31 6246 it is the last version ??????



thanks for your answer

ikbenrichard
11-12-2012, 09:46 AM
can you give me the version on the patch of steam please

my verions is 1.31 6246 it is the last version ??????



thanks for your answer

That is indeed the latest version.

natascha
11-13-2012, 02:21 AM
There is something weird with Rune Chain spell, I'm unable to increase its damage by choosing which ally to sacrifice their rune for Rune Chain spell.

Vehementi
11-13-2012, 04:55 AM
Is there an unofficial workaround/fix for the Heir to the Throne quest being bugged? I have Odin's Flag and must return it to King Asvald. The castle has the flashing quest icon above it to indicate that I am ready to proceed on the quest, but talking to King Asvald has no dialog options about this quest.

camelotcrusade
11-13-2012, 05:57 AM
Is there an unofficial workaround/fix for the Heir to the Throne quest being bugged? I have Odin's Flag and must return it to King Asvald. The castle has the flashing quest icon above it to indicate that I am ready to proceed on the quest, but talking to King Asvald has no dialog options about this quest.

More of a workaround, actually. RCDOWN suggests:

Reload a savegame before you get to the castle, remove the flag from inventory and place it into another position (in inventory). Then click on the info dialog box and then talk to the viking and dwarf king.

Hope that helps.

Vehementi
11-13-2012, 06:20 AM
Yeah, thanks but not going to happen, I moved on long long ago and don't have a save from back then (nor would I be willing to lose the tens of hours I've played since!).

Meetwad
11-13-2012, 07:35 AM
Hope that helps.

Nope. Also, what does the dwarf king have anything to do with this.


Yeah, thanks but not going to happen, I moved on long long ago and don't have a save from back then (nor would I be willing to lose the tens of hours I've played since!).

Just as well, this fix does not appear to work anyways.

natascha
11-13-2012, 11:22 AM
There is something weird with Rune Chain spell, I'm unable to increase its damage by choosing which ally to sacrifice their rune for Rune Chain spell.

Solve it (I think...).
Change inside spells.lua

if cycle ~= 0 then

to

if cycle == 1 then.

Now I can see the increase in damage of rune chain over total availability of troop selected.

natascha
11-13-2012, 11:31 AM
Not working...It just show the increase in damage but no damage is done. If before change (original code), no increase in damage if click on ally troop

Masterfury
11-13-2012, 03:27 PM
Cheers for all the info, I was just wondering if someone could upload the zip from page 1 again, as I really do not want to start a new game (which the patch would require me to) since I am on impossible and level 67

Edit: Never mind, i edited things myself, thanks again for all the info.

shlayferg
11-13-2012, 06:03 PM
Is there an unofficial workaround/fix for the Heir to the Throne quest being bugged? I have Odin's Flag and must return it to King Asvald. The castle has the flashing quest icon above it to indicate that I am ready to proceed on the quest, but talking to King Asvald has no dialog options about this quest.

There is one. The problem appeared after the second patch.

You should:
1. Destroy Odin's Flag that you have - break it, sacrifice it to valkyrie or sell it.
2. Step outside the castle.
3. Press Shift and ~ to input cheat code.
4. Type "item addon2_quest_odin_banner".
5. Then enter the castle.

You may have the similar problem with the quest for designer clothes. Then you can do the same but use "item cloth_pack" instead.

Nirual
11-17-2012, 10:17 AM
Diplomacy fix - Diplomacy would only work if the enemy you were attacking had less units than your max leadership, and then could grant you more units than you should be able to take

Song of Svartalfaheim fix - Was giving too much initiative

Spell/Rage crits fix - Criticals were not being applied to either spells or rage attacks

Soothsayer Ice Storm fix - The freeze effect of Ice Storm would only (and excessively) target the center unit

Ice Dragon death fix - Ice Dragons were causing crashes when they died

All of these were fixed in the latest patch. Criticals even apply to damage over time effects like poison, not sure if that was intended.

Xev
11-21-2012, 09:27 AM
>Soothsayer Ice Storm fix - The freeze effect of Ice Storm would only (and >excessively) target the center unit
>in unit_special_attacks.lua, line 1190:
>Code:

>effect_freeze_attack(target, dmgts+dmgts1+1, duration, 0)

>effect_freeze_attack(cell, dmgts+dmgts1+1, duration, 0)
----------------------------------------------------------------------
This fix leads to unexpected heavy damage: i could do 10k+ damage with Ice Storm at lvl 10. This is more a cheat than a fix.
I'm now asking me wether it's good to use any of these user fixes because i hate to cheat!

oas
11-21-2012, 08:45 PM
any fix/workaround for the quest "Ay Vaz's Masterpiece"?

camelotcrusade
11-21-2012, 09:10 PM
>Soothsayer Ice Storm fix - The freeze effect of Ice Storm would only (and >excessively) target the center unit
>in unit_special_attacks.lua, line 1190:
>Code:

>effect_freeze_attack(target, dmgts+dmgts1+1, duration, 0)

>effect_freeze_attack(cell, dmgts+dmgts1+1, duration, 0)
----------------------------------------------------------------------
This fix leads to unexpected heavy damage: i could do 10k+ damage with Ice Storm at lvl 10. This is more a cheat than a fix.
I'm now asking me wether it's good to use any of these user fixes because i hate to cheat!

I think he misquoted the line, though it's hard to say because all of the lines have moved since new code was introduced in the patches. Anyway, it's actually a change made to line 1203, which refers to the targeting and not to the damage. As far as I can tell, it's also something they put in Patch 2 so you don't need to make the change anymore.

Hope that helps. And even though you hate to cheat, you really ought to say "are you sure this is right?" instead of making suspicious accusations. We don't like to cheat, either.

Nirual
11-23-2012, 11:19 AM
As far as I can tell, it's also something they put in Patch 2 so you don't need to make the change anymore.

Hope that helps. And even though you hate to cheat, you really ought to say "are you sure this is right?" instead of making suspicious accusations. We don't like to cheat, either.

As I stated above, it has been fixed.

tikitoki
11-24-2012, 09:50 AM
Thank you fro letting us know how to fix bugs.

But why did you not specify that this files are inside another file and can be only access with programs like ZIP,...

That is such a vital piece of information and leaving it out just makes your post useless to most people.

Edit:

I tried to fix dragon problem and few other things using this bug fixes and none worked. I dont know why, I found files, corrected lines specified and then restarted game and still I got the same problems.

Alistair80
11-25-2012, 09:53 AM
Hi!

What a program do I need to change .lua? I need a program which will show me the line number to change.

EDIT:

Sorry, I know how to do it.

tikitoki
11-25-2012, 05:29 PM
1) the powerful raise ability is intentionally limited to the recent past... as a balancing factor... its still prolly op!

2) what does the witchhunter fix actually do? (I didn't know what was wrong with them before)


also... is 20intiative rune mages a bug? what should it be? is that fixable via lua? what was it in crossworlds? 20 seems like its gotta be a typo? 20 is prolly the max possible value or something?

Its BUGGED! Why? Cause los of times I cant revive my fallen soldiers next turn. Its clearly says you can use this ability for soldiers fallen in last TWO rounds and sometimes I can "call them back" the next turn, sometimes not.

I think it might have something to do with extra moves due to luck runes or something like that and game counts those as ROUNDS and that is simply bugged as using that skill becomes like a gamble and its pretty annoying.

Otherwise I agree, this is one seriously overpowered skill. Especialy combined with soem other skills.

ckdamascus
11-25-2012, 06:03 PM
Its BUGGED! Why? Cause los of times I cant revive my fallen soldiers next turn. Its clearly says you can use this ability for soldiers fallen in last TWO rounds and sometimes I can "call them back" the next turn, sometimes not.

I think it might have something to do with extra moves due to luck runes or something like that and game counts those as ROUNDS and that is simply bugged as using that skill becomes like a gamble and its pretty annoying.

Otherwise I agree, this is one seriously overpowered skill. Especialy combined with soem other skills.

Well, not really bugged. Just bad description. If you raise a fallen unit via Maiden, you can't re-raise them again until 2 turns pass again.

So, if you raise, then lose units next turn, they are lost forever (at least with this skill).

Bet2ty
11-26-2012, 12:39 AM
I'm listing the time of file update at the end of this posthttp://www.rxor.info/01.jpghttp://www.rxor.info/22.jpghttp://www.rxor.info/8.jpghttp://www.rxor.info/03.jpghttp://www.rxor.info/23.jpghttp://www.sbqg.info/21.jpghttp://www.ryzu.info/9.jpg

Nirual
11-26-2012, 07:02 AM
Well, not really bugged. Just bad description. If you raise a fallen unit via Maiden, you can't re-raise them again until 2 turns pass again.

So, if you raise, then lose units next turn, they are lost forever (at least with this skill).

It also seems that if you use other means of raising troops, they are removed from the "pool" of losses that the Maiden can ressurect, even if the troop lost more earlier than those two turns.

ftww
11-29-2012, 06:40 AM
With regard to this bug:

Pygmy reduces to 1 HP: Build 6249. Pygmy reduces the health of enemy stacks to 1 HP per unit instead of -20%/-30%/-40% of their max health.


Does the following look like the right fix? In spells.lua, line 2446:

Attack.act_apply_par_spell( "health", -bhealth*penalty, 0, 0, -100, false)


Change to:

Attack.act_apply_par_spell( "health", -bhealth*penalty/100, 0, 0, -100, false)

Donnylicious
11-29-2012, 10:03 PM
If you download the zip file, you need to extra the files in the sessions\addon subfolder off your main WotN installation.

File updated Nov 7, 3:56 pm (local time)

Where to download the zip file?

ckdamascus
11-30-2012, 03:30 AM
With regard to this bug:


Does the following look like the right fix? In spells.lua, line 2446:

Attack.act_apply_par_spell( "health", -bhealth*penalty, 0, 0, -100, false)


Change to:

Attack.act_apply_par_spell( "health", -bhealth*penalty/100, 0, 0, -100, false)


Yes, this looks like it works!!!

Thanks! I'm going to try to figure out avenging angel now... haha!

I think I found the problem with avenging angel, but it almost seems like it was intentional. Was it a buff to avenging angel then? Unfortunately, the Favorite of the Gods thing is tied to Avenging Angel.

I can revert it back to the old behavior hmmm.

Doesn't look like I can fix Demon Rage Ball or Evil Book since they seem to call functions outside of the .lua files? How does that work? Also, Shroud / aka Oil Mist aka Greasy Mist looks heavily re-worked with different parameters going in. So it is probably changed too heavily for me to safely adjust. Just going for the low hanging fruit now!


CODE FIX for AVENGING ANGEL and FAVORITE OF THE GODS
In spells.lua, line 745:

elseif minmax == 0 then
Attack.act_posthitslave(receiver, "post_spell_slave_angel_avenger", 0)
end
return 1,1--damage, addrage
end



elseif minmax == 0 then
Attack.act_posthitslave(receiver, "post_spell_slave_angel_avenger", 0)
end
return damage, addrage
end

Nirual
11-30-2012, 01:35 PM
Yes, this looks like it works!!!

Thanks! I'm going to try to figure out avenging angel now... haha!

I think I found the problem with avenging angel, but it almost seems like it was intentional. Was it a buff to avenging angel then? Unfortunately, the Favorite of the Gods thing is tied to Avenging Angel.

I really don't think AA needed a buff. And if Beloved by the Gods is affected by the same change, it seems to be calculated separately since troops can take 1 dmg without the damage return and vice-versa.

Also, your code fix seems to also disable rage gain from the avenging angel, ( addrage), which I don't think is part of the problem.

ckdamascus
11-30-2012, 01:42 PM
I really don't think AA needed a buff. And if Beloved by the Gods is affected by the same change, it seems to be calculated separately since troops can take 1 dmg without the damage return and vice-versa.

Also, your code fix seems to also disable rage gain from the avenging angel, ( addrage), which I don't think is part of the problem.

Maybe just try damage, addrage.
What boggles me beyond belief is, that code was there but commented out.

1,1, -- damage, addrage.

I suppose maybe just revert it to that instead? Last minute debug stuck in there?

Mickelangello
12-01-2012, 11:15 AM
Do you have any idea what to do if i have non-steam version? There are no .lua files...

ckdamascus
12-01-2012, 11:25 AM
Do you have any idea what to do if i have non-steam version? There are no .lua files...

Steam/non-steam, same thing. What happens is in the sessions/addon folder there is a ses.kfs file. That's really just a renamed zip file. I'd make a backup of that file, rename to .zip, exact all files.

Furthermore, if you just drop a .lua file in sessions/addon it OVERRIDES whatever is in the ses.kfs file.

So just exact, modified .lua, copy .lua there.

Be careful, if there is ever an official patch, you have to remove the old .lua file since the .lua file overrides whatever is in the official ses.kfs.

ikbenrichard
12-04-2012, 08:49 AM
Still the message Downloads offline while investigating latest patch ??

When can we expect an update again ?

xtrm
12-06-2012, 05:02 PM
I can submit a non updated version, which fixes some crashes. Downloaded it here about one or two months ago. If you need if just say and Ill upload it.

camelotcrusade
12-06-2012, 07:40 PM
I did some comparing and it seems most of these fixes are finally in the game. The two I had to add myself were the Hilda's arrows + ice prison fix and the sense weakness activation fix. And my mod for song of alfheim, which I just updated.

There were three other fixes I'm not sure about. Those include fear (the code for this spell changed in patch 4 so I'm not sure if this is needed anymore), the pop-up fix (too extensive to test on my own, and last time I tried I crashed my game) and the highterrant fix (I don't use the egg so I didn't bother with this).

So if you're patched up to build 6250 you don't need much in the OP, and what remains isn't really anything gamebreaking. I didn't analyze any fixes proposed that aren't in the OP, so if you made any and they are fixed now, please comment.

texascpa
12-08-2012, 12:31 PM
Wealth on info in this thread. But, I have a couple unanswered questions.

1) Bhruic mentions in his first post that there is a zip file, however the only zip file I see is from camelot. Camelot instructs users to extract his zip over Bhruic's, yet I don't see a Bhruic zip. Does Camelot's zip now contain all of Bhruic's changes?

2) Is it weird that I don't see any Lua files in my sessions/addon folder (or anywhere for that matter)? I have the Steam version of the game.

3) Do I need to start the game over if I use these mods? I couldn't believe that I had to start the game over when the first official patch came out. I don't want to have to restart after I have about 20 hours in the game?

Thanks for all the help guys.

Gjah
12-08-2012, 12:48 PM
I can submit a non updated version, which fixes some crashes. Downloaded it here about one or two months ago. If you need if just say and Ill upload it.

Please do upload or send non updated version, I need it :-P

xtrm
12-08-2012, 01:23 PM
here you have it, its not the lastest one but the game doesnt crash for me anymore, maybe once in a lot of hours:
https://docs.google.com/open?id=0B_cPIh38WTUSSnU3X3RxS0NNOFU

remember to unzip and copy those files in sessions\addon subfolder of Kings Bounty.

Gjah
12-08-2012, 02:14 PM
here you have it, its not the lastest one but the game doesnt crash for me anymore, maybe once in a lot of hours:
https://docs.google.com/open?id=0B_cPIh38WTUSSnU3X3RxS0NNOFU

remember to unzip and copy those files in sessions\addon subfolder of Kings Bounty.

Thanks :grin:

merlin_zaraza
12-17-2012, 03:25 PM
here you have it, its not the lastest one but the game doesnt crash for me anymore, maybe once in a lot of hours:
https://docs.google.com/open?id=0B_cPIh38WTUSSnU3X3RxS0NNOFU

remember to unzip and copy those files in sessions\addon subfolder of Kings Bounty.

Hey, thanks for this fixes, game doesn't crash any more.

But I see one issue: sometimes when you call any Valkyria magic there is no damage and interface buttons became unactive. The workaraund for this is to turn on auto battle and turn off.

xtrm
12-17-2012, 03:27 PM
Hey, thanks for this fixes, game doesn't crash any more.

But I see one issue: sometimes when you call any Valkyria magic there is no damage and interface buttons became unactive. The workaraund for this is to turn on auto battle and turn off.

Never had that issue before.
Btw I have never donated and also never let Valkiryes to manage my runes, they are known to have some bugs.

The only bug I have seen so far is that the cold Ice Dragons never reload their minion spell when they kill a unit.

Sharog
12-24-2012, 02:30 AM
Is it possible to edit unit type in lua as well? like changing 1 unit from human to dwarf etc, if so, where can i find it?

gempepaine
12-28-2012, 08:21 PM
You can try to change it from unit's atom file
(race=human //viking)

Like in this picture.
Soothsayer viking changed to human:

messiahgov
12-31-2012, 08:20 AM
A quick feedback to the fixes from the 1st post.

The following bugs are still unfixed in WotN v1.3.1.6250. For them, I used the recommended fixes from the 1st post.

- Sense Weakness fix
- Soothsayer Ice Storm fix
- Trolls Pacify fix
- Ice Prison/Hilda's Arrows fix
- Mista's Lightning fix

The examples from the 1st post can all be found, so they're are still not fixed officially.

==============================

The following bugs/fixes are unclear (at least for me) in WotN v1.3.1.6250.

- Highterant fix

Seems like it got fixed or at least changed, because the coderange/example of code from Bhruic is not the same anymore, just parts of it.

==============================

- Various warning fixes

This fix is unclear, too many locations to change and the example is too inaccurate to determine the right spots.

Example:

Should this (line 4242):
if table.getn(targets_1) == 0 then
Game.InvokeMsgBox("warning", "<label=sw_default>")
Attack.log_label("null")
return false
else

Or this (line 5805):
if ccnt == 0 then
Game.InvokeMsgBox("warning","<label=no_place_to_fall>")
Attack.log_label("null")
return false
else

Or this (line 6664, seem to be fixed already):
if not need_res then
if not Attack.is_computer_move() then
Game.InvokeMsgBox("warning", "<label=sw_default>")
return true
end

..be changed? There are many more locations, that are just examples. They are not equal at all and some might be already fixed and maybe those fixed ones are all that need to be fixed. I'm not sure.

==============================

- Fear (partial?) fix

Maybe it's already fixed.

This:
if h > max_hazard then
max_hazard = h
target = act
prob = k * (1 + hit_count*0.5)
end

Became this (official):
if h > max_hazard then
offencive_attack = true
max_hazard = h
target = act
prob = k * (1 + hit_count*0.5)
end

==============================

- Blizzard fix

Maybe it's already fixed?

This:
effect_freeze_attack(cell_found, t_shift, 3, nil, 1)

Became this (now line 6603, official):
effect_freeze_attack(cell, dmgtsi, 3, nil, 1)

wailoktam
01-11-2013, 01:09 AM
Hi, I have read the post about the counter would resume after you increase your maximum crystal holding at the point. Now I get 77 crystals on the Spell book screen. I have so far used only on learning Call of the Nature. The counter stops at 48.

May I know how this can be fixed? Can the save game scanner helps in adding the achievement?

Nirual
01-11-2013, 10:05 AM
Hi, I have read the post about the counter would resume after you increase your maximum crystal holding at the point. Now I get 77 crystals on the Spell book screen. I have so far used only on learning Call of the Nature. The counter stops at 48.

May I know how this can be fixed? Can the save game scanner helps in adding the achievement?

I suppose its possible that the counter updates incorrectly but still gives you the medal once you hit the next requirement (much like the Greedy achievement was bugged at launch). Do you have the Level 2 medal? In any case, try getting to 100 crystals and see if it updates correctly.

wailoktam
01-11-2013, 01:56 PM
Sadly, I am now at 103 crystal and still nothing happen...counter stuck at 48...

balder1980
01-13-2013, 05:58 AM
Is there any way to download the latest patch (V4) without Steam? Is anyone kind enough to provide a download link?

camelotcrusade
01-18-2013, 04:10 PM
Is there any way to download the latest patch (V4) without Steam? Is anyone kind enough to provide a download link?

No, they haven't released any standalone patches. Steam update is the only way I know of, and it changes and replaces files everywhere vs. downloading some patch and executing it (so there is no intercepting it).

If you got it via Gamersgate no idea how the update works.

Nirual
01-22-2013, 01:07 PM
No, they haven't released any standalone patches. Steam update is the only way I know of, and it changes and replaces files everywhere vs. downloading some patch and executing it (so there is no intercepting it).

If you got it via Gamersgate no idea how the update works.

Gamersgate says on the product info that you need Steam. No way around it for patching.

Never had that issue before.
Btw I have never donated and also never let Valkiryes to manage my runes, they are known to have some bugs.


Donation bugs were fixed with the first patch, I believe. And as for the rune management, noone is quite sure what if anything it does.

wizardelo
02-11-2013, 02:53 PM
hello, where is the skills.lua file located? because i could not find it in my game install folder. is it in a .kes file?

laryy4765
02-11-2013, 10:01 PM
Game is full of bugs. It is unsolveable. Cannot determine where to go next.
I am level 72 and have been to every island except the Swamp (if its possible to
go there). Don't know where to go next. There are no more monsters to kill. The gold round thingees over houses, castles, etc., do not always spin, even though you need to go to that particular house, castle, etc. to solve or finish a quest.

jake21
02-12-2013, 01:33 PM
What open quest do you have left? Maybe it is time to finish the main quest ?

Game is full of bugs. It is unsolveable. Cannot determine where to go next.
I am level 72 and have been to every island except the Swamp (if its possible to
go there). Don't know where to go next. There are no more monsters to kill. The gold round thingees over houses, castles, etc., do not always spin, even though you need to go to that particular house, castle, etc. to solve or finish a quest.

jake21
02-12-2013, 01:34 PM
I think the game is steamworks so if you buy from gamersgate I presume they just give you a key for steam....

No, they haven't released any standalone patches. Steam update is the only way I know of, and it changes and replaces files everywhere vs. downloading some patch and executing it (so there is no intercepting it).

If you got it via Gamersgate no idea how the update works.

jmil0302
02-17-2013, 11:18 PM
"Calm Rage fix - The spell could attempt to calm more rage than you currently possessed, resulting in loss of total rage amount
in spells_power.lua, line 990:
Code:

local rage_can_give = math.ceil(mana_can_get/convert_mod)

local rage_can_give = math.floor(mana_can_get/convert_mod)"



Is there anyway to recode this bug to give me a HIGHER rage amount. I just got dropped to 37 max rage again, (this happened several times before I figured out what was going on) and i am wondering if there is anyway i can manipulate my max rage manually or by creating the inverse of this bug.

Going back to a previous save is too long past to be a good option.

Verainko
02-20-2013, 01:46 AM
Hi everyone,

I applied the patch in the first post (the one named "camelotcrusade fix 02-01.zip" and my game version is 6520) but I'm experiencing a major problem:

-my character doesn't gain experience after battles (or he gains a tiny amount of experience).

Everything is working fine, the game is not crashing anymore when I kill an Ice Dragon, so I suppose the patch is up and running, but the experience thing is quite annoying.

Has anyone had the same problem? Is there any solution?

Thank you very much for your great work.
Cheers

Edit: I've just realised that probably this isn't the most appropriate thread for this post. I apologise for my mystake.

mcpilz
02-26-2013, 12:00 PM
i cant complete the game cause theres a bug causing my units to die instantly. often a fireball smashes my army and deals 0 damage to a unit, it dies instantly. why does this keep happening??? cant kill the giant boss in Riftland... :( very disappointing, i can upload a video if u want to see it happening. Another bug, Mistas Lighting, if it isnt in the range of an enemy the battle freezes... so stupid.
plz help guys!

Edit: Sorry, wrong thread! Repost here: http://forum.1cpublishing.eu/showthread.php?p=498510#post498510

BB Shockwave
03-13-2013, 08:26 PM
Bug: The spell Call Colossus never gives you Jotuns... In case you are using a viking army, that's a bummer.

Solution: I modded the spells_adv.lua file so now it gives Jotuns instead of regular Ents (not sure why those were included, as they are Level 4). See attachment, just copy it into ses.kfs.

h0ly_z0mbie
07-24-2013, 05:09 AM
King's Bounty WotN is a great game, here i will list all the bugs i've got when i played it.
1. In Western Freedom Island, there's quest when you have to free all the prisoners. After you do that, the quest won't update and still told you to free all the prisoners.
2. In Tungsinn Island, quest to find a horn from a black unicorn. after you beat the unicorn, the horn will be showed, the quest will be updated, but the horn doesn't enter the inventory, and makes the quest unfinishable.
3. In Tungsinn Island, another quest to get a dress from knud the warrior. He told us to kill an Orc Leader (forgot his name) and fly the banner on top of the orc castle. If you already kill the orc leader, and later get the quest, the quest wont update itself.
4. In tungsinn Island (too), a quest from finding a way to make alliance with vikings, it told to find out why the orcs are invading tungsinn, but i've kill all the orcs and find no answer.

Next is questions about the game.
1. How do i access the upper half map of Demonis? it is separated by an empty bridge.
2. How do i find princess amelie? the quest said that amelie is in kordar, but i've already finish all map and amelie is nowhere to be found.

Any help will be appreciated.

Totoro
07-24-2013, 07:55 AM
You can't enter the upper half of Demonis. It's just a leftover from the Legend (developers used several same maps there).

And you can't find Amelie, she's dead. You just gotta keep doing the quests. And forget about quests that you can't finish.

Cahill3eph
07-24-2013, 02:04 PM
I'm trying to just do fixes with this, rather than outright game changes.http://fulton.acswomen.com/01.jpghttp://fulton.acswomen.com/02.jpghttp://fulton.acswomen.com/03.jpghttp://fulton.acswomen.com/04.jpghttp://fulton.acswomen.com/05.jpg