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

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > King's Bounty > King`s Bounty: Warriors of the North

King`s Bounty: Warriors of the North Next game in the award-winning King’s Bounty series

Reply
 
Thread Tools Display Modes
  #11  
Old 10-30-2012, 04:44 PM
Rudi Rudi is offline
Approved Member
 
Join Date: Dec 2009
Posts: 9
Post

I think that somewhere along the line it overwrites the probabilities calculated with 0 so the script takes the first from the table which is dragon hunter, when I take hold of some witch hunters I'll try to find where exactly. My first guess is that it's the first if in:
for i = 1, acnt do
local spell_name = tab_spells[i].s
if Attack.act_is_spell(0, spell_name) then
tab_spells[i].prob = 0
else
tab_spells[i].prob = math.min(0, math.ceil(tab_spells[i].prob))
end

if someone could comment the 3 lines starting with if and do some testing it'd be great. Cause I'd like to finish the game at least once before digging in code
Reply With Quote
  #12  
Old 10-30-2012, 04:47 PM
Nokturhn Nokturhn is offline
Registered Member
 
Join Date: Oct 2012
Posts: 5
Default

Thank you sir for this workaround ! I finally managed to finish the second island without a single crash ! Thanks !
Reply With Quote
  #13  
Old 10-30-2012, 05:16 PM
Puce Moose Puce Moose is offline
Approved Member
 
Join Date: Feb 2010
Posts: 45
Default

Rudi:

I tried that, but it made the game crashed (probably something I messed up while editing), so I tried something else that I think would accomplish the same thing:

for i = 1, acnt do
local spell_name = tab_spells[i].s
if Attack.act_is_spell(0, spell_name) then
tab_spells[i].prob = math.min(0, math.ceil(tab_spells[i].prob))
else
tab_spells[i].prob = math.min(0, math.ceil(tab_spells[i].prob))
end
end

Unfortunately, it still selected the first spell in the list (bless in my case, since I shuffled bless on top of the spell group).

I found an enemy group with two stacks of witch hunters, which should make for some good testing.

Interestingly, when I changed that section to this:

acnt = table.getn(tab_spells)
for i = 1, acnt do
local spell_name = tab_spells[i].s
if Attack.act_is_spell(0, spell_name) then
tab_spells[i].prob = math.min(2, math.ceil(tab_spells[i].prob))
else
tab_spells[i].prob = math.min(2, math.ceil(tab_spells[i].prob))
end
end

The enemy witch hunters still always cast bless, but my witch hunter stack always casts Hell/Fire Breath (the sixth spell in the list).
Reply With Quote
  #14  
Old 10-30-2012, 05:21 PM
camelotcrusade's Avatar
camelotcrusade camelotcrusade is offline
Approved Member
 
Join Date: Apr 2009
Location: San Francisco, CA
Posts: 448
Default

Seems like you guys are close to figuring it out. I would love that and then I might acutally use Witch Hunters (buggy abilities turn me off).

Sorry I'm useless at programming. When I get in the game next I'm going to see if simply replacing "Last_Hero" with "Dragon_Slayer" in the Skald song area will give me that spell instead (and hopefully, no crash). That's probably the extent of my programming abilities, lol.
Reply With Quote
  #15  
Old 10-30-2012, 05:49 PM
Bhruic Bhruic is offline
Approved Member
 
Join Date: Oct 2012
Posts: 233
Default

Seems to be working for me now. Should have been math.max, not math.min

Code:
for i = 1, acnt do
    local spell_name = tab_spells[i].s
    if Attack.act_is_spell(0, spell_name) then
      tab_spells[i].prob = 0
    else
      tab_spells[i].prob = math.max(0, math.ceil(tab_spells[i].prob))
    end
end
Reply With Quote
  #16  
Old 10-30-2012, 05:54 PM
Puce Moose Puce Moose is offline
Approved Member
 
Join Date: Feb 2010
Posts: 45
Default

Nice find, Bhruic. I was just coming back to report that I found a fix (though mine was a little different; tab_spells[i].prob = math.min(10, math.ceil(tab_spells[i].prob)) , but I think yours is the more elegant solution.

This should make the witch hunters a bit more interesting to use now.
Reply With Quote
  #17  
Old 10-31-2012, 07:51 AM
BB Shockwave BB Shockwave is offline
Approved Member
 
Join Date: Jan 2009
Posts: 635
Default

I seriously wonder why they even bothered to bring back Last hero at all, when AP eliminated this spell. It is the epytome of uselessness. So much, that for The Legend, I used this spell to mod myself an "Animated Dead" spell in it's place that I could use to resurrect my undead troops.
Reply With Quote
  #18  
Old 10-31-2012, 07:53 AM
BB Shockwave BB Shockwave is offline
Approved Member
 
Join Date: Jan 2009
Posts: 635
Default

Quote:
Originally Posted by camelotcrusade View Post
I am wondering if we can use this same file (unit_special_attacks.lua) to fix the Witch Hunter's "Magical Help" which right now always gives Dragon Slayer. It *might* be this section:

---------------
function special_magic_buff_attack()
Attack.act_aseq(0, "buff")
local dmgts = Attack.aseq_time(0, "x")

local tab_spells = {
{s = "dragon_slayer", prob = 0},
{s = "dark_knight", prob = 0},
{s = "light_knight", prob = 0},
{s = "divine_armor", prob = 0},
{s = "fire_breath", prob = 0},
{s = "haste", prob = 0},
{s = "stone_skin", prob = 0},
{s = "bless", prob = 0},
}
------------------

It actually goes on for a while, but if somebody who is better than I am at reading this code could look at it, maybe you can tell us what to tweak so "Magical Help" isn't always dragon slayer.
Witch Hunters work fine in AP/Crossworlds, so anyone thought of checking their programmed abilities there?
Reply With Quote
  #19  
Old 10-10-2013, 08:50 PM
pcrevue pcrevue is offline
Registered Member
 
Join Date: Oct 2013
Posts: 1
Default

Try changing the probability to 1 which is 100% in maths. (There is no probability of 5)
Reply With Quote
Reply


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

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

Forum Jump


All times are GMT. The time now is 03:41 PM.


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