Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   King`s Bounty: Warriors of the North (http://forum.fulqrumpublishing.com/forumdisplay.php?f=206)
-   -   Bugfixes (http://forum.fulqrumpublishing.com/showthread.php?t=35494)

Bhruic 10-30-2012 09:22 PM

Quote:

Originally Posted by camelotcrusade (Post 475256)
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:
Code:

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:

Code:

-- ***********************************************
-- * 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

Code:

    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

Quote:

Originally Posted by camelotcrusade (Post 475295)
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.

Code:

    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:

Code:

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

Code:

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.

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

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\

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

Quote:

Originally Posted by MattCaspermeyer (Post 475384)
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\

Cool, thanks for the link!
@Loopy, both of those are documented in the bug thread along with explanations. Check it out.

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):

Code:

-- ***********************************************
-- Ñîçäàíèå Çåëèé/Ãðàíàò (Àëõèìèê, Èíæåíåð)
-- ***********************************************
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?


All times are GMT. The time now is 04:11 AM.

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