![]() |
Bugfixes
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: Code:
local can_join = math.floor(hero_lead/Logic.cp_leadship(atom)) -count In unit_special_attacks.lua, line 2199: Code:
if Attack.act_is_spellattacker, "special_magic_shield") then see post #25 for details The above change is not currently included in the attached zip file Book of Evil fix (thanks saroumana) - This spell was grossly overpowered In spells_power.lua, line 1365: Code:
local bonus = math.floor(100*(creator_power + int_bonus)*int_bonus) In visa.lua, line 170: Code:
local bonus, penalty = pwr_visa_svartalfheim() In arena.lua, line 553: Code:
if kritProbRnd > kritProb then in arena.lua, starting line 880: insert the following code (in red): Code:
end in addon_arena.lua, line 1265: Code:
if (rage_shield_i < Game.Random(1, 100)) then in spells_power.lua, line 990: Code:
local rage_can_give = math.ceil(mana_can_get/convert_mod) in unit_special_attacks.lua, line 1190: Code:
effect_freeze_attack(target, dmgts+dmgts1+1, duration, 0) 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: Code:
if h > max_hazard then in unit_features_master.lua, line 1469: Code:
if not not hitbacking then in addon_pet.lua, line 192: Code:
everebody_dies = (Attack.act_damage( cell, ignore_posthitmaster )) in addon_pet.lua, line 79: Code:
Attack.done_timeshift(Attack.aseq_time(0)) in unit_features_ondamage.lua, line 307: Code:
if initsize == 1 then see post #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: Code:
Game.InvokeMsgBox("warning", "<label=sw_default>") in spells.lua, line 6100: Code:
effect_freeze_attack(cell_found, 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) |
1 Attachment(s)
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. |
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. |
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. |
Quote:
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. |
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. ;)
|
Quote:
Which skill is Distraction? Player skill or unit skill? |
oh this is nice, thx a lot
|
Quote:
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 |
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 |
Quote:
Code:
Attack.atom_spawn(act, tend, "magic_diversion", Attack.angleto(act)) 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. ;) |
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: Code:
-- *********************************************** |
Code:
Attack.act_del_spell(target,"effect_stun") I wouldn't mind a few longer than normal spell effects if they'd just queue up as I played. Hmm. |
Quote:
Code:
Attack.atom_spawn(target, pause, "effect_stun", 0, true) |
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: Code:
Attack.atom_spawn(act, tend, "magic_diversion", Attack.angleto(act)) Code:
Attack.atom_spawn(act, tend, "effect_stun", Attack.angleto(act)) |
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. |
Great Job - Don't Forget the LUA Library
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/showpos...97&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\ |
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. |
Quote:
@Loopy, both of those are documented in the bug thread along with explanations. Check it out. |
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): Code:
-- *********************************************** |
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? |
I think this post covers this problem: http://forum.1cpublishing.eu/showthread.php?t=35519
Quote:
/C\/C\ Quote:
|
Quote:
Quote:
|
Quote:
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. |
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: Code:
local tab_spell_select = { Code:
local tab_spell_select_positive = { |
Book of evil correction :
in spells_power.lua Original Quote:
Quote:
|
Nice find. Added that to the first post. Also added a fix for the Song of Svartalfheim.
|
Quote:
|
Great work. Big thnx !
|
Quote:
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? |
Quote:
I'm going to move it to the description/tooltip section. |
Try this...
Just do this:
Before: Code:
if Attack.act_human(0) then Code:
if Attack.act_human( 0 ) then /C\/C\ Quote:
|
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. |
Quote:
|
Quote:
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. |
adding fix files
so you just dump the lua files from zip into addon folder ?
|
Quote:
|
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.
|
Ok, time for someone to fact check me here, because if I'm reading this correctly, I'm very confused:
Code:
iskrit = ( kritProbRnd < kritProb ) 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? |
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 :-)
|
Quote:
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 |
Quote:
|
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? |
Quote:
|
Oh dear. Double facepalm.
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.
I'll just replace what I have in the thread now with this. |
Code:
|
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.
|
Quote:
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. |
Quote:
|
Quote:
|
In addition, none of these LUA functions appear to work:
Game.MessageBox(...) Game.InvokeMsgBox(...) Game.Log(...) Game.atom_getpar(...) Plz fix. Thank you! |
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.
|
Quote:
Code:
if receiver_human and not receiver_glot then |
Quote:
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: Code:
Blah blah < bleh bleh Code:
Blah blah >= bleh bleh 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. |
Quote:
Code:
if receiver_human and not receiver_glot then Code:
if receiver_human and not receiver_glot and (skill_power("weakness_lore", 2) > 0) then |
1 Attachment(s)
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. |
Quote:
Any hope to fix the famous battle crash using viking buffer troop? |
Code:
if receiver_human and not receiver_glot and (skill_power("weakness_lore", 2) > 0) then |
Quote:
|
Quote:
|
Quote:
|
Ok, I changed the Sense Weakness fix to Zechnophobe'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. |
edit: wrong topic, my bad.
|
Please refer bug reports to this thread. The purpose of this one is to highlight fixes that are available via scripting.
|
1 Attachment(s)
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?
|
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.
|
Quote:
|
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.
|
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 |
1 Attachment(s)
Quote:
|
Quote:
|
Quote:
|
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. |
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.
|
O well, that's a pity, no early Ice Dragon for me then hah, thanks alot for trying, and for all the other bugfixes :)
|
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. |
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 issue? It's a puzzler. |
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. |
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. :) |
Quote:
Quote:
Quote:
Quote:
|
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. |
Quote:
|
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". |
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. :( |
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! ;)) |
You might have to dig for it!
I tought the only 'documentation' they had was on the russian forums. |
Well, by "documentation", I mean the various .txt files they have for things like spells, items, etc.
|
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. |
Quote:
|
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). |
Quote:
|
@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. Those that want the fix without the modifications can apply the same fix by looking at the included medals.txt. |
Thanks, the fixes work nice and no more crashes in battles :)
|
Quote:
|
Hi Bhruic,
can you remove the fix: LAST HERO, from your subpatch? Since its fixed with the steam patch. |
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.
|
Quote:
|
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. :) |
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 .
|
Quote:
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. |
All times are GMT. The time now is 02:40 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.